query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
init method used for putting layout infront of user
public void init() { //it will set spacing between and around the buttons and the box pane = new FlowPane(); pane.setPadding(new Insets(10, 10, 10, 10)); pane.setHgap(20); pane.setVgap(20); // create label, and buttons myLabel = new Label("Please enter the amount : "); myTextField = new TextField(); Commission = new Button ("_Compute Sales Commission"); Amount = new Button ("_Compute Sales Amount"); //focus here for shortcut key yourButton = new Button ("E_xit"); pane.getChildren().add(myLabel); pane.getChildren().add(myTextField); pane.getChildren().add(Commission); pane.getChildren().add(Amount); pane.getChildren().add(yourButton); Commission.setOnAction(this); Amount.setOnAction(this); yourButton.setOnAction(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setupLayout() {\n // left empty for subclass to override\n }", "public Layout() {\n super(\"Chitrashala\");\n initComponents();\n }", "private void init() {\n setLayout(new BorderLayout());\n setBackground(ProgramPresets.COLOR_BACKGROUND);\n add(getTitlePanel(), BorderLayout.NORTH);\n add(getTextPanel(), BorderLayout.CENTER);\n add(getLinkPanel(), BorderLayout.SOUTH);\n }", "public void init() {\n setLayout(new BorderLayout());\n }", "private void initProcess(){\n this.getScPanelFriends().getViewport().setOpaque(false);\n this.getScPanelTopics().getViewport().setOpaque(false);\n this.getCenterPanel().setSize(0,0);\n this.getEastPanel().setSize(1700,800);\n //Administrador inhabilitado por defecto hasta implementación\n this.getBtnAdmin().setEnabled(false);\n this.getMenuOption().setLocationRelativeTo(this);\n }", "private void initializeLayout(){\n String title = mStrInfo;\n String subtitle = mClientItem.clientName;\n mHomeToolbar.setGymRatToolbarTitle(title, subtitle);\n\n //initialize maids\n initializeMaid();\n\n //initialize bottom navigation\n initializeBottomNavigation();\n }", "private void init() {\n refreshLayout = new TurbolinksSwipeRefreshLayout(getContext(), null);\n addView(refreshLayout, 0);\n }", "public Layout() {\n }", "private void init() {\n\t\tcontentPane=getContentPane();\n\t\ttopPanel= new JPanel();\n\t\tcontentPane.setLayout(new BorderLayout());\n\t\tlabel = new JLabel(\"Username\");\n\t\ttextfield = new JTextField(\"Type Username\", 15);\n\t\ttextfield.addActionListener(aListener);\n\t\tconnectButton = new JButton(\"Connect to Server\");\n\t\tconnectButton.addActionListener(aListener);\n\t\ttopPanel.setLayout(new FlowLayout());\n\t\tlabel.setVerticalAlignment(FlowLayout.LEFT);\n\t\ttopPanel.add(label);\n\t\ttopPanel.add(textfield);\n\t\ttopPanel.add(connectButton);\n\t\tsetSize(600, 600);\n\t\tcontentPane.add(topPanel, BorderLayout.NORTH);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tthis.addWindowListener(framListener);\n\t}", "@Override\n public void init() // set up GUI\n {\n setLayout(new FlowLayout());\n\n customerView = new CustomerView(); // initialize customerView\n \n add(customerView); // add customerView to the GUI\n }", "private void initUI() {\r\n\t\tthis.verticalLayout = new XdevVerticalLayout();\r\n\t\tthis.verticalLayout2 = new XdevVerticalLayout();\r\n\t\r\n\t\tthis.setSpacing(false);\r\n\t\tthis.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout.setSpacing(false);\r\n\t\tthis.verticalLayout.setMargin(new MarginInfo(false));\r\n\t\tthis.verticalLayout2.setMargin(new MarginInfo(false));\r\n\t\r\n\t\tthis.verticalLayout2.setSizeFull();\r\n\t\tthis.verticalLayout.addComponent(this.verticalLayout2);\r\n\t\tthis.verticalLayout.setComponentAlignment(this.verticalLayout2, Alignment.MIDDLE_CENTER);\r\n\t\tthis.verticalLayout.setExpandRatio(this.verticalLayout2, 20.0F);\r\n\t\tthis.verticalLayout.setSizeFull();\r\n\t\tthis.addComponent(this.verticalLayout);\r\n\t\tthis.setComponentAlignment(this.verticalLayout, Alignment.MIDDLE_CENTER);\r\n\t\tthis.setExpandRatio(this.verticalLayout, 10.0F);\r\n\t\tthis.setSizeFull();\r\n\t\r\n\t\tthis.addContextClickListener(event -> this.this_contextClick(event));\r\n\t}", "private void init() {\n\n\t\tthis.setResizable(false);\n\t\tthis.setSize(575, 155);\n\t\tthis.setLocationRelativeTo(null);\n\t\tthis.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\n\n\t\tJPanel panNom = addPannelName();\n\t\tJPanel panPass = addPannelPassword();\n\t\tJPanel panTopic = addPannelTopic();\n\n\t\tJPanel content = new JPanel();\n\t\tcontent.add(panNom);\n\t\tcontent.add(panPass);\n\t\tcontent.add(panTopic);\n\n\t\tJPanel control = new JPanel();\n\n\t\tJButton okButton = addOKButtonTopic();\n\t\tJButton cancelButton = addCancelButton();\n\n\t\tcontrol.add(okButton);\n\t\tcontrol.add(cancelButton);\n\n\t\tthis.getContentPane().add(content, BorderLayout.NORTH);\n\t\tthis.getContentPane().add(control, BorderLayout.SOUTH);\n\t}", "public void init()\n {\n buildUI(getContentPane());\n }", "public MainScreen(User user) {\n\t\tsuper();\n\t\tthis.user = user;\n\t\tthis.contentPane = getContentPane();\n\t\tpopulateUtilities();\n\t\tinitGUI(user);\n\t}", "private void init(){\r\n\t\tsetLayout(new FlowLayout());\r\n\t\tsetPreferredSize(new Dimension(40,40));\r\n\t\tsetVisible(true);\r\n\t}", "private void init() {\n\t\tback=(ImageView)this.findViewById(R.id.back);\n\t\taddUser=(ImageView)this.findViewById(R.id.adduser);\n\t\tgrid=(GridView)this.findViewById(R.id.gridview);\n\t}", "private void init() {\n setBackground(LIGHT_GRAY);\n Box layout = new Box(BoxLayout.Y_AXIS);\n\n jump = createButton(\"Jump\", null);\n exit = createButton(\"Exit!\", null);\n fly = createButton(\"Fly\", null);\n Jfloat = createButton(\"Float\", null);\n layout.add(Box.createRigidArea(new Dimension(0, 150)));\n layout.add(jump);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(Jfloat);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(fly);\n layout.add(Box.createRigidArea(new Dimension(0, 25)));\n layout.add(exit);\n add(layout);\n }", "private void initUI() {\n }", "private void initialize() {\n\t\tthis.setBounds(100, 100, 950, 740);\n\t\tthis.setLayout(null);\n\n\t\n\t}", "private void initBaseLayout()\n {\n add(viewPaneWrapper, BorderLayout.CENTER);\n \n currentLayoutView = VIEW_PANE;\n currentSearchView = SEARCH_PANE_VIEW;\n showMainView(VIEW_PANE);\n showSearchView(currentSearchView);\n }", "private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\t}", "private void init() {\n\t\n\t\tthis.setSize(DEFAULT_W, DEFAULT_H);\n\t\tthis.setLocation(DEFAULT_X, DEFAULT_X);\n\t\tthis.setTitle(DEFAULT_TITLE);\n\n\t}", "public mainLayoutController() {\n\t }", "private void Myinits() {\n \n \n \n setLocationRelativeTo(this);\n }", "private void setLayout() {\n\t\ttxtNickname.setId(\"txtNickname\");\n\t\ttxtPort.setId(\"txtPort\");\n\t\ttxtAdress.setId(\"txtAdress\");\n\t\tlblNickTaken.setId(\"lblNickTaken\");\n\n\t\tgrid.setPrefSize(516, 200);\n\t\tbtnLogin.setDisable(true);\n\t\ttxtNickname.setPrefSize(200, 25);\n\t\tlblNickTaken.setPrefSize(250, 10);\n\t\tlblNickTaken.setText(null);\n\t\tlblNickTaken.setTextFill(Color.RED);\n\t\tlblNick.setPrefSize(120, 50);\n\t\ttxtAdress.setText(\"localhost\");\n\t\ttxtPort.setText(\"4455\");\n\t\tlblCardDesign.setPrefSize(175, 25);\n\t\tcomboBoxCardDesign.getSelectionModel().select(0);\n\t\tbtnLogin.setGraphic(imvStart);\n\t}", "public void createInitialLayout(IPageLayout layout) {\n \n\t}", "private void init() {\n\t\tcreateSubjectField();\n\t\tcreateTextField();\n\t\tcreateButton();\n\t\tsetupSubjectPanel();\n\t\tsetupToDoPanel();\n\n\t\tsetBorder(BorderFactory.createTitledBorder(\"To Do List\"));\n\t\tsetLayout(new BorderLayout());\n\t\tadd(pnlSubject, BorderLayout.NORTH);\n\t\tadd(scroll, BorderLayout.CENTER);\n\t\tadd(pnlButton, BorderLayout.SOUTH);\n\t}", "@Override\n public void createInitialLayout(IPageLayout layout) {\n defineActions(layout);\n defineLayout(layout);\n }", "private void initGUI(User user) {\n\t\ttry {\n\t\t\tthis.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t\t\tthis.setTitle(\"Warehouse Application\");\n\t\t\tthis.setIconImage(new ImageIcon(getClass().getClassLoader().getResource(ApplicationConstants.WAREHOUSE_LOGO)).getImage());\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setFocusTraversalKeysEnabled(false);\n\t\t\tthis.setLocation(new java.awt.Point(100, 100));\n\t\t\t{\n\t\t\t\tChangeScreen.setBlankScreen(user);\n\t\t\t}\n\t\t\t{\n\t\t\t\tmnuMain = new WarehouseMenuBar(user, this);\n\t\t\t\tsetJMenuBar(mnuMain);\n\t\t\t}\n\t\t\tpack();\n\t\t\tthis.setSize(809, 577);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public MainUI() {\r\n initComponents();\r\n this.setLocationRelativeTo(null);\r\n /**/\r\n }", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "private void initialize() {\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\tthis.setBounds(new Rectangle(0, 0, 393, 177));\r\n\t\tthis.add(getBasePanel(), BorderLayout.CENTER);\r\n\r\n\t}", "private void init() {\n mainll = new LinearLayout(getContext());\n mainll.setId(View.generateViewId());\n mainll.setLayoutParams(new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT));\n mainll.setOrientation(LinearLayout.VERTICAL);\n\n map = new HashMap<>();\n\n RelativeLayout mainrl = new RelativeLayout(getContext());\n RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,\n ActionBar.LayoutParams.WRAP_CONTENT);\n\n params.addRule(RelativeLayout.BELOW, mainll.getId());\n\n save = new Button(getContext());\n\n save.setLayoutParams(params);\n save.setText(\"save\");\n\n mainrl.addView(mainll);\n mainrl.addView(save);\n addView(mainrl);\n }", "private void initialize() {\r\n\t\tthis.setBounds(new Rectangle(0, 0, 670, 576));\r\n\t\tthis.setResizable(false);\r\n\t\tthis.setTitle(\"数据入库 \");\r\n\t\tthis.setLocationRelativeTo(getOwner());\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "private void setLayoutElements() {\n // AuthenticatedUser is async thread.\n // It is getting the details for the\n // authenticated user and use them\n // to set UI elements below.\n AuthenticatedUser getAccount = new AuthenticatedUser(\n this, profilePictureProgressBar, profilePicture, firstName, lastName, email\n );\n\n // Starting the thread.\n getAccount.execute();\n }", "private void init() {\n super.setPersistent(false);\n super.setDialogLayoutResource(R.layout.login_edit);\n }", "@Override\n public void init() {\n super.init();\n\n setTheme(\"xtreemfs\");\n\n initLayout();\n initTable();\n initFileDetails();\n initButtons();\n initFilteringControls();\n initUploadState();\n }", "private void initView() {\n\n }", "protected abstract void initView();", "public SetupScreen() \r\n { \r\n _userLabel = new LabelField(Ipoki._resources.getString(LBL_USER), DrawStyle.ELLIPSIS);\r\n add(_userLabel);\r\n _userEdit = new EditField(\"\", Ipoki._user, 20, Field.EDITABLE);\r\n add(_userEdit);\r\n _passLabel = new LabelField(Ipoki._resources.getString(LBL_PASSWORD), DrawStyle.ELLIPSIS);\r\n add(_passLabel);\r\n _passEdit = new PasswordEditField(\"\", Ipoki._pass, 20, Field.EDITABLE);\r\n add(_passEdit);\r\n _freqLabel = new LabelField(Ipoki._resources.getString(LBL_FREQ), DrawStyle.ELLIPSIS);\r\n add(_freqLabel);\r\n _freqEdit = new EditField(\"\", String.valueOf(Ipoki._freq), 20, Field.EDITABLE | EditField.FILTER_INTEGER);\r\n add(_freqEdit);\r\n }", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "public void InitLayout() {\n SetBackground(R.drawable.can_dfqc_ac_bg);\n this.mTvA = AddText(121, 173, 203, 25);\n this.mTvP = AddText(121, 212, KeyDef.RKEY_RADIO_6S, 25);\n this.mTvMode = AddText(121, Can.CAN_FLAT_RZC, 203, 25);\n this.mTvC = AddText(121, 295, 139, 25);\n this.mTvWind = AddText(121, KeyDef.RKEY_AVIN, 53, 25);\n initValue();\n }", "private void initUI()\r\n\t{\r\n\t\tthis.label = new Label();\r\n\t\t\r\n\t\tthis.label.setText(\"This view is also saveable\");\r\n\t\t\r\n\t\tthis.label.setSizeUndefined();\r\n\t\tthis.add(this.label);\r\n\t\tthis.setSizeFull();\r\n\t}", "private void initial() {\n\t\tsetTitleTxt(getString(R.string.choose_game));\n\t\tLinearLayout contentView = (LinearLayout) findViewById(R.id.contentView);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\n\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tview = View.inflate(this, R.layout.user_choose_game, null);\n\t\tcontentView.addView(view, params);\n\t\tgameGrid = (GridView) view.findViewById(R.id.game_list);\n\t\tgameContent = (LinearLayout) view.findViewById(R.id.game_list_info);\n\t\tview.setVisibility(View.GONE);\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "public void initUI() {\n\t\tadd(board);\r\n\t\t//Set if frame is resizable by user\r\n\t\tsetResizable(false);\r\n\t\t//call pack method to fit the \r\n\t\t//preferred size and layout of subcomponents\r\n\t\t//***important head might not work correctly with collision of bottom and right borders\r\n\t\tpack();\r\n\t\t//set title for frame\r\n\t\tsetTitle(\"Snake\");\r\n\t\t//set location on screen(null centers it)\r\n\t\tsetLocationRelativeTo(null);\r\n\t\t//set default for close button of frame\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void init(IUserAccount user) {\n\n String mainMenuTitle = languageRB.getString(\"mainMenuTitle\");\n\n menuFrame = new JFrame();\n menuFrame.setTitle(mainMenuTitle);\n menuFrame.setSize(350,9*50);\n menuFrame.setLocationRelativeTo(null);\n menuFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n menuFrame.setResizable(true);\n uiNavigator.initBgColour(menuFrame);\n\n JLabel headerLabel = new JLabel(mainMenuTitle, JLabel.CENTER);\n\n String welcomeLabelText = languageRB.getString(\"welcomeLabelText\")+\", \"+user.getUserId()+\"!\";\n JLabel welcomeLabel = new JLabel(welcomeLabelText, JLabel.CENTER);\n\n JPanel mainPanel = new JPanel();\n mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));\n\n JPanel optionPanel = new JPanel();\n optionPanel.setLayout(new GridLayout(9,1));\n\n optionPanel.add(headerLabel);\n optionPanel.add(welcomeLabel);\n\n initMenuOptions(user, optionPanel);\n\n mainPanel.add(optionPanel);\n menuFrame.add(mainPanel);\n }", "public void initKnowledgePointPopupLayout() {\n knowledgePointPopup = new FrontGateKnowledgePointPopup(this.getContext());\n knowledgePointPopup.showPopupWindow();\n }", "public testLayout() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void InitView() {\n\t\tmLinearLayout = new LinearLayout(getContext());\n\t\t//mLinearLayout.setBackgroundResource(MusicApplication.getInstance().getBgResource());\n\t\t\n\t\t//Modify by LiYongNam 2012.9.19_start\n\t\tMusicUtil.setBackgroundOfView ( mLinearLayout, getContext() );\t\t\t\t\n\t\t//Modify by LiYongNam 2012.9.19_end\n\t\t\n\t\tmLinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tmLinearLayout.setPadding(1, 1, 1, Util.dipTopx(getContext(), 60));\n\t\t// 导航条\n\t\taddTitleBar(-1, \"编辑列表\", R.drawable.check_off, R.drawable.title_bar);\n\n\t\tmControlBar = new ControlBar(getContext());\n\t\tmControlBar.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,\n\t\t\t\tUtil.dipTopx(getContext(), 60)));\n\n//\t\taddControlButton(\"全选\", CONTROL1, 0);\n\t\taddControlButton(\"播放\", CONTROL2, 1);\n\t\taddControlButton(\"加入\", CONTROL3, 2);\n\t\taddControlButton(\"删除\", CONTROL4, 3);\n\n\t}", "private void initialiseUI()\n { \n // The actual data go in this component.\n String defaultRootElement = \"icr:regionSetData\";\n JPanel contentPanel = initialiseContentPanel(defaultRootElement);\n pane = new JScrollPane(contentPanel);\n \n panelLayout = new GroupLayout(this);\n\t\tthis.setLayout(panelLayout);\n\t\tthis.setBackground(DAOConstants.BG_COLOUR);\n\n\t\tpanelLayout.setAutoCreateContainerGaps(true);\n\n panelLayout.setHorizontalGroup(\n\t\t\tpanelLayout.createParallelGroup()\n\t\t\t.addComponent(pane, 10, 520, 540)\n );\n\n panelLayout.setVerticalGroup(\n\t\t\tpanelLayout.createSequentialGroup()\n .addComponent(pane, 10, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)\n );\n }", "private void init() {\r\n\r\n createGUI();\r\n\r\n setSize(new Dimension(600, 600));\r\n setTitle(\"Grid - Regular Grid Renderer\");\r\n }", "private void initUI() {\r\n\t\t//Äußeres Panel\r\n\t\tContainer pane = getContentPane();\r\n\t\tGroupLayout gl = new GroupLayout(pane);\r\n\t\tpane.setLayout(gl);\r\n\t\t//Abstende von den Containern und dem äußeren Rand\r\n\t\tgl.setAutoCreateContainerGaps(true);\r\n\t\tgl.setAutoCreateGaps(true);\r\n\t\t//TextFeld für die Ausgabe\r\n\t\tJTextField output = view.getTextField();\r\n\t\t//Die jeweiligen Panels für die jeweiigen Buttons\r\n\t\tJPanel brackets = view.getBracketPanel();\r\n\t\tJPanel remove = view.getTop2Panel();\r\n\t\tJPanel numbers = view.getNumbersPanel();\r\n\t\tJPanel last = view.getBottomPanel();\r\n\t\t//Anordnung der jeweiligen Panels durch den Layout Manager\r\n\t\tgl.setHorizontalGroup(gl.createParallelGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tgl.setVerticalGroup(gl.createSequentialGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tpack();\r\n\t\tsetTitle(\"Basic - Taschenrechner\");\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t}", "public ClientMainView() {\n initComponents();\n setLocationRelativeTo(null);\n }", "private void init() {\r\n\t\tthis.setBackground(Color.decode(\"#c5dfed\"));\r\n\r\n\t\tthis.initPanelButtons();\r\n\r\n\t\tUtilityClass.addBorder(this, 20, 20, 20, 20);\r\n\t\t\r\n\t\tthis.title.setFont(ConstantView.FONT_TITLE_CRUD);\r\n\t\tthis.title.setHorizontalAlignment(JLabel.CENTER);\r\n\t\tthis.add(title, BorderLayout.NORTH);\r\n\t\t\r\n\t\tthis.add(panelButtons, BorderLayout.SOUTH);\r\n\t\tthis.jPanelFormClient.setOpaque(false);\r\n\t\tthis.add(jPanelFormClient, BorderLayout.CENTER);\r\n\t}", "public UserInterface() {\n \t setTitle(\"The Cancer Specialist - Diagnostic Application\");\n initComponents();\n }", "private void initUI() {\n\t\tfileInputPanel.setLayout(new GridBagLayout());\n\n\t\tGridBagConstraints gridBagConstraints = new GridBagConstraints();\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\t\tgridBagConstraints.anchor = GridBagConstraints.NORTH;\n\t\tgridBagConstraints.gridwidth = 2;\n\n\t\tJLabel title = new JLabel(\"Welcome to ANNie\");\n\t\ttitle.setFont(new Font(\"Serif\", Font.BOLD, 36));\n\n\t\tfileInputPanel.add(title, gridBagConstraints);\n\n\t\tgridBagConstraints.gridwidth = 1;\n\t\tgridBagConstraints.insets = new Insets(10, 5, 10, 5);\n\n\t\tfileInputPanel.setBorder(BorderFactory.createLineBorder(Color.black));\n\n\t\tcreateFileDropdownArea(gridBagConstraints);\n\t\tcreateLabelSelectArea(gridBagConstraints);\n\t\tcreateButtons(gridBagConstraints);\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "public BridgingUI() {\n initComponents();\n initUserActions();\n }", "protected void init() {\n super.init();\n prefetchCount.setPreferredSize(new Dimension(100,25));\n useTx.setPreferredSize(new Dimension(100,25));\n\n mainPanel.add(receiveTimeout);\n mainPanel.add(prefetchCount);\n mainPanel.add(purgeQueue);\n mainPanel.add(autoAck);\n mainPanel.add(readResponse);\n mainPanel.add(useTx);\n }", "private void initView() {\n\n LayoutInflater inflater = getLayoutInflater();\n final int screenWidth = MyUtils.getScreenMetrics(this).widthPixels;\n final int screenHeight = MyUtils.getScreenMetrics(this).heightPixels;\n for (int i = 0; i < 3; i++) {\n ViewGroup layout = (ViewGroup) inflater.inflate(\n R.layout.content_layout, myHorizontal, false);\n layout.getLayoutParams().width = screenWidth;\n TextView textView = (TextView) layout.findViewById(R.id.title);\n textView.setText(\"page \" + (i + 1));\n layout.setBackgroundColor(Color.rgb(255 / (i + 1), 255 / (i + 1), 0));\n createList(layout);\n myHorizontal.addView(layout);\n }\n }", "protected void initUI() {\n\r\n\t\t((Button) findViewById(R.id.project_site_start_wifiscan_button)).setOnClickListener(this);\r\n\r\n\t\t// ((Button) findViewById(R.id.project_site_calculate_ap_positions_button)).setOnClickListener(this);\r\n\r\n\t\t// ((Button) findViewById(R.id.project_site_add_known_ap)).setOnClickListener(this);\r\n\r\n\t\t((Button) findViewById(R.id.project_site_step_detect)).setOnClickListener(this);\r\n\t\t\r\n\t\t((ToggleButton) findViewById(R.id.project_site_toggle_autorotate)).setOnClickListener(this);\r\n\r\n\t\tmultiTouchView = ((MultiTouchView) findViewById(R.id.project_site_resultview));\r\n\t\tmultiTouchView.setRearrangable(false);\r\n\r\n\t\tmultiTouchView.addDrawable(map);\r\n\r\n\t\tif (site.getTitle().equals(ProjectSite.UNTITLED)) {\r\n\t\t\tshowDialog(DIALOG_TITLE);\r\n\t\t} else {\r\n\t\t\tif (freshSite) {\r\n\t\t\t\t// start configuration dialog\r\n\t\t\t\tshowDialog(DIALOG_FRESH_SITE);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public IView() {\n initComponents();\n setLocationRelativeTo(null); //Center form on screen\n }", "private void initGui()\n {\n setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.WHITE));\n\n setLayout(new GridBagLayout());\n\n GridBagConstraints gbc = new GridBagConstraints();\n\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.anchor = GridBagConstraints.WEST;\n\n this.add(lblHint, gbc);\n }", "private void setupLayout()\n\t{\n\t\tbaseLayout.putConstraint(SpringLayout.NORTH, queryButton, 70, SpringLayout.NORTH, this);\n\t\tbaseLayout.putConstraint(SpringLayout.WEST, queryButton, 49, SpringLayout.WEST, this);\n\t}", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "private void initialize() {\r\n\t\t// set specific properties and add inner components.\r\n\t\tthis.setBorder(BorderFactory.createEtchedBorder());\r\n\t\tthis.setSize(300, 400);\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\taddComponents();\r\n\t}", "protected abstract void iniciarLayout();", "void initLayout() {\n\t\t/* Randomize the number of rows and columns */\n\t\tNUM = Helper.randomizeNumRowsCols();\n\n\t\t/* Remove all the children of the gridContainer. It will be added again */\n\t\tpiecesGrid.removeAllViews();\n\t\t\n\t\t/* Dynamically calculate the screen positions and sizes of the individual pieces\n\t * Store the starting (x,y) of all the pieces in pieceViewLocations */\n\t\tpieceViewLocations = InitDisplay.initialize(getScreenDimensions(), getRootLayoutPadding());\n\t\t\n\t\t/* Create an array of ImageViews to store the individual piece images */\n\t\tcreatePieceViews();\n\t\t\n\t\t/* Add listeners to the ImageViews that were created above */\n\t\taddImageViewListeners();\n\t}", "public void initLayouts() {\n\t\tJPanel p_header = (JPanel) getComponentByName(\"p_header\");\n\t\tJPanel p_container = (JPanel) getComponentByName(\"p_container\");\n\t\tJPanel p_tree = (JPanel) getComponentByName(\"p_tree\");\n\t\tJPanel p_commands = (JPanel) getComponentByName(\"p_commands\");\n\t\tJPanel p_execute = (JPanel) getComponentByName(\"p_execute\");\n\t\tJPanel p_buttons = (JPanel) getComponentByName(\"p_buttons\");\n\t\tJPanel p_view = (JPanel) getComponentByName(\"p_view\");\n\t\tJPanel p_info = (JPanel) getComponentByName(\"p_info\");\n\t\tJPanel p_chooseFile = (JPanel) getComponentByName(\"p_chooseFile\");\n\t\tJButton bt_apply = (JButton) getComponentByName(\"bt_apply\");\n\t\tJButton bt_revert = (JButton) getComponentByName(\"bt_revert\");\n\t\tJTextArea ta_header = (JTextArea) getComponentByName(\"ta_header\");\n\t\tJLabel lb_icon = (JLabel) getComponentByName(\"lb_icon\");\n\t\tJLabel lb_name = (JLabel) getComponentByName(\"lb_name\");\n\t\tJTextField tf_name = (JTextField) getComponentByName(\"tf_name\");\n\n\t\tBorder etched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);\n\n\t\tp_header.setBorder(etched);\n\t\tp_container.setBorder(etched);\n\t\tp_commands.setBorder(etched);\n\t\t// p_execute.setBorder(etched);\n\t\t// p_view.setBorder(etched);\n\t\t// p_buttons.setBorder(etched);\n\n\t\tp_buttons.setLayout(new FlowLayout(FlowLayout.LEFT, 25, 2));\n\t\tp_chooseFile.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 1));\n\t\tp_view.setLayout(new BorderLayout(0, 0));\n\t\tp_info.setLayout(null);\n\n\t\t// GroupLayout for main JFrame\n\t\t// If you want to change this, use something like netbeans or read more\n\t\t// into group layouts\n\t\tGroupLayout groupLayout = new GroupLayout(getContentPane());\n\t\tgroupLayout\n\t\t\t\t.setHorizontalGroup(groupLayout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\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\tAlignment.LEADING)\n\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\tgroupLayout\n\t\t\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\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_commands,\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\t225,\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.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\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\tgroupLayout\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.LEADING)\n\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\tp_execute,\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\t957,\n\t\t\t\t\t\t\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\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\tp_container,\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\t957,\n\t\t\t\t\t\t\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.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_header,\n\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\t1188,\n\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.addContainerGap()));\n\t\tgroupLayout\n\t\t\t\t.setVerticalGroup(groupLayout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addComponent(p_header,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, 57,\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.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\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\tAlignment.LEADING)\n\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\tp_commands,\n\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\t603,\n\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.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\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\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_container,\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\t549,\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.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\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\tp_execute,\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\t48,\n\t\t\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.addContainerGap()));\n\n\t\tGroupLayout gl_p_container = new GroupLayout(p_container);\n\t\tgl_p_container\n\t\t\t\t.setHorizontalGroup(gl_p_container\n\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\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\tAlignment.LEADING)\n\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\tp_view,\n\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\t955,\n\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.addGroup(\n\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\tgl_p_container\n\t\t\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\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbt_apply)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\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\tbt_revert))\n\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\tgl_p_container\n\t\t\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\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlb_name)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\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\ttf_name,\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\t893,\n\t\t\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.addContainerGap()));\n\t\tgl_p_container\n\t\t\t\t.setVerticalGroup(gl_p_container\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\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\tAlignment.BASELINE)\n\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\ttf_name,\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\t\tGroupLayout.DEFAULT_SIZE,\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.addComponent(lb_name))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addComponent(p_view,\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\t\t466, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\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\tAlignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(bt_revert)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(bt_apply))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap(\n\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\tShort.MAX_VALUE)));\n\t\tp_container.setLayout(gl_p_container);\n\n\t\t// GroupLayout for p_header\n\n\t\tGroupLayout gl_p_header = new GroupLayout(p_header);\n\t\tgl_p_header.setHorizontalGroup(gl_p_header.createParallelGroup(\n\t\t\t\tAlignment.LEADING).addGroup(\n\t\t\t\tAlignment.TRAILING,\n\t\t\t\tgl_p_header\n\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(ta_header, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t1069, Short.MAX_VALUE).addGap(18)\n\t\t\t\t\t\t.addComponent(lb_icon).addGap(4)));\n\t\tgl_p_header\n\t\t\t\t.setVerticalGroup(gl_p_header\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_header\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGap(6)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_header\n\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\tAlignment.BASELINE)\n\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\tta_header,\n\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\t44,\n\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.addComponent(lb_icon))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\t\tp_header.setLayout(gl_p_header);\n\n\t\tGroupLayout gl_p_commands = new GroupLayout(p_commands);\n\t\tgl_p_commands\n\t\t\t\t.setHorizontalGroup(gl_p_commands\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_commands\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_commands\n\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\tAlignment.LEADING)\n\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\tp_tree,\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\t\t211,\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.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_buttons,\n\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\tGroupLayout.DEFAULT_SIZE,\n\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.addContainerGap()));\n\t\tgl_p_commands.setVerticalGroup(gl_p_commands.createParallelGroup(\n\t\t\t\tAlignment.LEADING).addGroup(\n\t\t\t\tgl_p_commands\n\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(p_buttons, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.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(p_tree, GroupLayout.DEFAULT_SIZE, 558,\n\t\t\t\t\t\t\t\tShort.MAX_VALUE).addContainerGap()));\n\t\tp_commands.setLayout(gl_p_commands);\n\n\t\tgetContentPane().setLayout(groupLayout);\n\t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "private void initComponents() {\r\n\r\n setLayout(new java.awt.BorderLayout());\r\n }", "private void initialize() {\n\t\tthis.setLayout(new BorderLayout());\n\t\tthis.setSize(300,200);\n\t\tthis.add(getJPanel(), java.awt.BorderLayout.CENTER);\n\t\tthis.add(getJPanel1(), java.awt.BorderLayout.SOUTH);\n\t}", "private void setLayout() {\n\tHorizontalLayout main = new HorizontalLayout();\n\tmain.setMargin(true);\n\tmain.setSpacing(true);\n\n\t// vertically divide the right area\n\tVerticalLayout left = new VerticalLayout();\n\tleft.setSpacing(true);\n\tmain.addComponent(left);\n\n\tleft.addComponent(openProdManager);\n\topenProdManager.addListener(new Button.ClickListener() {\n\t public void buttonClick(ClickEvent event) {\n\t\tCustomerWindow productManagerWin = new CustomerWindow(CollectorManagerApplication.this);\n\t\tproductManagerWin.addListener(new Window.CloseListener() {\n\t\t public void windowClose(CloseEvent e) {\n\t\t\topenProdManager.setEnabled(true);\n\t\t }\n\t\t});\n\n\t\tCollectorManagerApplication.this.getMainWindow().addWindow(productManagerWin);\n\t\topenProdManager.setEnabled(false);\n\t }\n\t});\n\n\t\n\tsetMainWindow(new Window(\"Sistema de Cobranzas\", main));\n\n }", "private void initViews() {\n user_name = (LinearLayout)findViewById(R.id.user_name);\n user_photo = (LinearLayout)findViewById(R.id.user_photo);\n user_sex = (LinearLayout)findViewById(R.id.user_sex);\n user_notes = (LinearLayout)findViewById(R.id.user_notes);\n name = (TextView)findViewById(R.id.name);\n sex = (TextView)findViewById(R.id.sex);\n notes = (TextView)findViewById(R.id.notes);\n email = (TextView)findViewById(R.id.email);\n photo = (ImageView)findViewById(R.id.photo);\n }", "@Override\n\tprotected void init() {\n\t\tsuper.init();\n\t\tisAnchorPointForPosition = true;\n\t\tsetContentSize(Screen.GAME_W, Screen.GAME_H);\n\t\tsetAnchor(Graphics.HCENTER | Graphics.VCENTER);\n\t}", "public void setupUI() {\r\n\t\t\r\n\t\tvPanel = new VerticalPanel();\r\n\t\thPanel = new HorizontalPanel();\r\n\t\t\r\n\t\titemName = new Label();\r\n\t\titemName.addStyleName(Styles.page_title);\r\n\t\titemDesc = new Label();\r\n\t\titemDesc.addStyleName(Styles.quest_desc);\r\n\t\titemType = new Label();\r\n\t\titemType.addStyleName(Styles.quest_lvl);\r\n\t\t\r\n\t\tVerticalPanel img = new VerticalPanel();\r\n\t\timg.add(new Image(imgDir));\r\n\t\t\r\n\t\tvPanel.add(itemName);\r\n\t\tvPanel.add(itemDesc);\r\n\t\tvPanel.add(img);\r\n\t\tvPanel.add(hPanel);\r\n\t\t\r\n\t\tVerticalPanel mainPanel = new VerticalPanel();\r\n\t\tmainPanel.setWidth(\"100%\");\r\n\t\tvPanel.addStyleName(NAME);\r\n\t\t\r\n\t\tmainPanel.add(vPanel);\r\n \tinitWidget(mainPanel);\r\n }", "private void initUI() {\n // deal with toolbar\n setSupportActionBar(activityToolbar);\n if(getSupportActionBar() != null) {\n getSupportActionBar().setTitle(\"\");\n } else {\n Timber.w(\"Action bar is null? Strange behavior might occur\");\n }\n\n // deal with nav drawer\n drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n drawerLayout.addDrawerListener(drawerListener);\n\n }", "private void setupLayout()\n {\n Container contentPane;\n\n setSize(300, 300); \n\n contentPane = getContentPane();\n\n // Layout this PINPadWindow\n }", "@Override\n\tpublic void initUi() {\n\t\tlayoutShowContact = currentView.findViewById(R.id.contact_layout_show);\n\t\tlayoutShowContact.setOnClickListener(clickListener);\n\t\tsetTitle(R.string.contact);\n\t}", "private void initUi() {\n mToolbsr = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(mToolbsr);\n\n fab = (FloatingActionButton) findViewById(R.id.fab);\n mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);\n mNavigationView = (NavigationView) findViewById(R.id.nav_view);\n\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n viewPager = (ViewPager) findViewById(R.id.viewpager);\n }", "private void initialize() {\n this.setLayout(new CardLayout());\n this.setName(this.extension.getMessages().getString(\"spiderajax.options.title\"));\n \t if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {\n \t \tthis.setSize(391, 320);\n \t }\n this.add(getPanelProxy(), getPanelProxy().getName()); \n \t}", "private void initLayoutComponents()\n {\n viewPaneWrapper = new JPanel(new CardLayout());\n viewPane = new JTabbedPane();\n crawlPane = new JPanel(new BorderLayout());\n transitionPane = new JPanel();\n searchPane = new BGRenderer(Color.WHITE, WINDOW_WIDTH, WINDOW_HEIGHT);\n resultsPane = new BGRenderer(Color.WHITE, WINDOW_WIDTH, WINDOW_HEIGHT);\n }", "public void initView(){}", "public MainView() {\r\n\t\tinitialize();\r\n\t}", "private void init(){\n this.setOrientation(LinearLayout.VERTICAL);\n input=new EditText(theContext);\n seperator=new LinearLayout(theContext);\n seperator.setOrientation(HORIZONTAL);\n input.setMaxLines(1);\n input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\n input.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n strengthText = new TextView(theContext);\n strengthText.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n strengthText.setText(\"This password is\");\n str = new TextView(theContext);\n str.setText(\" too short\");\n str.setTextColor(Color.GRAY);\n seperator.addView(strengthText);\n seperator.addView(str);\n progressBar = new ProgressBar(theContext,null,android.R.attr.progressBarStyleHorizontal);\n progressBar.setScaleY(3);\n progressBar.setMax(5);\n progressBar.setProgress(0);\n progressBar.getProgressDrawable().setColorFilter(Color.GRAY, PorterDuff.Mode.SRC_IN);\n this.addView(input);\n if(hasBar) {\n this.addView(progressBar);\n }\n if(hasStrTxt) {\n this.addView(seperator);\n }\n input.addTextChangedListener(inputWatcher);\n\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "private void initViews() {\n\n\t}", "private void initialize() {\n this.setLayout(new BorderLayout());\n this.setSize(300, 200);\n this.setPreferredSize(new java.awt.Dimension(450, 116));\n this.add(getListPanel(), java.awt.BorderLayout.CENTER);\n this.add(getButtonPanel(), java.awt.BorderLayout.SOUTH);\n }", "public void init() {\n\t\tsetSize(500,300);\n\t}", "protected abstract void initViews();", "public abstract void initView();", "@Override\n public void initView() {\n }", "private void initView(){\n\t\tinitSize();\n\t\tinitText();\n\t\tinitBackground();\n\t\tthis.setOnClickListener(this);\n\t\tthis.setOnLongClickListener(this);\n\t}" ]
[ "0.71433604", "0.7136074", "0.69810086", "0.698063", "0.6938443", "0.69255275", "0.6902422", "0.6895282", "0.684899", "0.68345493", "0.6813554", "0.6796008", "0.6790464", "0.6782859", "0.6745546", "0.6736593", "0.67279655", "0.6713504", "0.6708972", "0.66940135", "0.6691055", "0.6687896", "0.6680226", "0.6677185", "0.6644456", "0.6638921", "0.6627331", "0.6620665", "0.6618482", "0.66175985", "0.659141", "0.659141", "0.65901107", "0.6559709", "0.6559071", "0.6549725", "0.65462935", "0.6545262", "0.65315443", "0.65296006", "0.65278715", "0.6521971", "0.65148413", "0.65148413", "0.65101093", "0.6505721", "0.6503844", "0.6500466", "0.6500466", "0.6497973", "0.64942133", "0.64904433", "0.64904344", "0.64748037", "0.6471936", "0.6471508", "0.64588964", "0.6458213", "0.6456646", "0.6454671", "0.64497083", "0.64462245", "0.6443371", "0.6440669", "0.6439508", "0.64371943", "0.643156", "0.6425117", "0.64221156", "0.64184237", "0.64066994", "0.63993907", "0.6398587", "0.6398016", "0.6395662", "0.6394563", "0.6390892", "0.6390892", "0.6382426", "0.63823444", "0.6376463", "0.6367569", "0.63625115", "0.6360202", "0.6358995", "0.63587594", "0.6351335", "0.6347771", "0.6342589", "0.63413435", "0.6336235", "0.63343817", "0.6333475", "0.6333022", "0.6328885", "0.63278437", "0.6325919", "0.63206863", "0.6320199", "0.631845", "0.6315299" ]
0.0
-1
Create a scene and place it in the stage
@Override // Override the start method in the Application class /** * Start method for layout building */ public void start(Stage primaryStage) { Scene scene = new Scene(pane, 370, 200); primaryStage.setTitle("Sales Conversion"); // Set the stage title primaryStage.setScene(scene); // Place the scene in the stage primaryStage.show(); // Display the stage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createScene();", "private void createScene() {\r\n imageView.setFitWidth(400);\r\n imageView.setFitHeight(300);\r\n\r\n Scene scene = new Scene(rootScene(), 700, 600);\r\n\r\n primaryStage.setTitle(TITLE);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n }", "void createScene(){\n\t\tmainScene = new Scene(mainPane);\r\n\t\t\r\n\t\t//If keyEvent is not focussed on a node on the scene, you can attach\r\n\t\t//a keyEvent to a scene to be consumed by the screen itself.\r\n\t\tCloser closer = new Closer();\r\n\t\tmainScene.setOnKeyPressed(closer);\r\n\t}", "public void Scene() {\n Scene scene = new Scene(this.root);\n this.stage.setScene(scene);\n this.stage.show();\n }", "@Override\n public void start (Stage stage) throws IOException {\n init.start(stage);\n myScene = view.makeScene(50,50);\n stage.setScene(myScene);\n stage.show();\n }", "public void setupScene() {\n\t\tplayScene = new Scene(new Group());\n\t\tupdateScene(playScene);\n\t\twindow.setScene(playScene);\n\t\twindow.show();\n\t}", "@Override\n\tpublic void createScene()\n\t\n\t{\n\t loading = new Sprite (0,0,resourceManager.loadingRegion,vbo); // тупо ставим спрайт с картинкой\n\t\tattachChild(loading);\n\t}", "public Scene createScene() {\n root = new Group();\n key = new Group();\n Scene scene = new Scene(root, 500, 500, Color.WHITE);\n addRootNode();\n setupKey();\n getAlreadyConnectedPeers();\n return scene;\n }", "protected void buildScene() {\n Geometry cube1 = buildCube(ColorRGBA.Red);\n cube1.setLocalTranslation(-1f, 0f, 0f);\n Geometry cube2 = buildCube(ColorRGBA.Green);\n cube2.setLocalTranslation(0f, 0f, 0f);\n Geometry cube3 = buildCube(ColorRGBA.Blue);\n cube3.setLocalTranslation(1f, 0f, 0f);\n\n Geometry cube4 = buildCube(ColorRGBA.randomColor());\n cube4.setLocalTranslation(-0.5f, 1f, 0f);\n Geometry cube5 = buildCube(ColorRGBA.randomColor());\n cube5.setLocalTranslation(0.5f, 1f, 0f);\n\n rootNode.attachChild(cube1);\n rootNode.attachChild(cube2);\n rootNode.attachChild(cube3);\n rootNode.attachChild(cube4);\n rootNode.attachChild(cube5);\n }", "public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }", "void createStage(Stage stage){\n\t\tstage.setHeight(background.getHeight()+25);//displays full image (1)\r\n\t\tstage.setWidth(background.getWidth());\r\n\t\tshowBackground.setFitWidth(stage.getWidth());\r\n\t\tshowBackground.setFitHeight(stage.getHeight()-23);//displays full image (1)\r\n\t\r\n\t\tstage.setAlwaysOnTop(true);\r\n\t\tstage.setResizable(false);\r\n\t\t\r\n\t\t//launches first window in center of screen. \r\n\t\tstage.centerOnScreen();\r\n\t\tstage.setScene(mainScene);\r\n\t\tstage.setTitle(\"Don't Play Games in Class\");\r\n\t\t//supposed to prevent window from being moved\r\n\t\t\r\n\t\t//removes minimize, maximize and close buttons\r\n\t\t//unused because replacing the \r\n\t\t//stage.initStyle(StageStyle.UNDECORATED);\r\n\t\t\r\n\t\t//removes minimize and maximize button\r\n\t\tstage.initStyle(StageStyle.UTILITY);\r\n\t\t\r\n\t\t//replaces the closed window in the center of the screen.\r\n\t\tRespawn launch = new Respawn();\r\n\t\tstage.setOnCloseRequest(launch);\r\n\t}", "private void setStage() {\n\t\tstage = new Stage();\n\t\tstage.setScene(myScene);\n\t\tstage.setTitle(title);\n\t\tstage.show();\n\t\tstage.setResizable(false);\n//\t\tstage.setOnCloseRequest(e -> {\n//\t\t\te.consume();\n//\t\t});\n\t}", "private void buildScene() {\n for (int i = 0; i < Layer.LAYERCOUNT.ordinal(); i++) {\n SceneNode layer = new SceneNode();\n sceneLayers[i] = layer;\n\n sceneGraph.attachChild(layer);\n }\n\n // Prepare the tiled background\n Texture texture = textures.getTexture(Textures.DESERT);\n IntRect textureRect = new IntRect(worldBounds);\n texture.setRepeated(true);\n\n // Add the background sprite to the scene\n SpriteNode backgroundSprite = new SpriteNode(texture, textureRect);\n backgroundSprite.setPosition(worldBounds.left, worldBounds.top);\n sceneLayers[Layer.BACKGROUND.ordinal()].attachChild(backgroundSprite);\n\n // Add player's aircraft\n playerAircraft = new Aircraft(Aircraft.Type.EAGLE, textures);\n playerAircraft.setPosition(spawnPosition);\n playerAircraft.setVelocity(40.f, scrollSpeed);\n sceneLayers[Layer.AIR.ordinal()].attachChild(playerAircraft);\n\n // Add two escorting aircrafts, placed relatively to the main plane\n Aircraft leftEscort = new Aircraft(Aircraft.Type.RAPTOR, textures);\n leftEscort.setPosition(-80.f, 50.f);\n playerAircraft.attachChild(leftEscort);\n\n Aircraft rightEscort = new Aircraft(Aircraft.Type.RAPTOR, textures);\n rightEscort.setPosition(80.f, 50.f);\n playerAircraft.attachChild(rightEscort);\n }", "private void createScene() \n {\n PlatformImpl.startup(\n new Runnable() {\n public void run() { \n Group root = new Group(); \n Scene scene = new Scene(root, 80, 20); \n SizeView sizeview = createSizeView(scene);\n root.getChildren().add(sizeview);\n jfxPanel.setScene(scene); \n } \n }); \n }", "@Override\n protected void initScene() {\n setupCamera(0xff888888);\n\n /*\n * Create a Cube and display next to the cube\n * */\n setupCube();\n\n\n /*\n * Create a Sphere and place it initially 4 meters next to the cube\n * */\n setupSphere();\n\n\n /*\n * Create a Plane and place it initially 2 meters next to the cube\n * */\n setupPlane();\n setupImage();\n setupText();\n\n }", "@Override\r\n\tpublic void createScene() {\n\t\tthis.setBackground(new Background(255, 255, 255));\r\n\t\tsLogo = new Sprite(BaseActivity.WIDTH / 2, BaseActivity.HEIGHT / 2, logoRegion.getWidth() * 1.23f, logoRegion.getHeight() * 1.23f, logoRegion, engine.getVertexBufferObjectManager());\r\n\t\tthis.attachChild(sLogo);\r\n\t\tSystem.out.println(\"stufff\");\r\n\t\t\r\n\t\tengine.registerUpdateHandler(new TimerHandler(0.2f, new ITimerCallback() \r\n\t {\r\n\t public void onTimePassed(final TimerHandler pTimerHandler) \r\n\t {\r\n\t System.out.println(\"stuff1\");\r\n\t engine.unregisterUpdateHandler(pTimerHandler);\r\n\t PlayScene play = new PlayScene(engine, activity, camera);\r\n\t play.createScene();\r\n\t engine.setScene(play);\r\n\t Resources.getInstance().music.setLooping(true);\r\n\t \t\tResources.getInstance().music.play();\r\n\t play.start();\r\n\t }\r\n\t }));\r\n\t}", "private void initStage() {\n stage = new Stage();\n stage.setTitle(\"Attentions\");\n stage.setScene(new Scene(root));\n stage.sizeToScene();\n }", "public Scene createScene() {\n\t\tmyRoot = new AnchorPane();\n\t\tmyTabs = new TabPane();\n\t\tButton newTab = new Button(CREATE_NEW_TAB);\n\t\tnewTab.setOnAction(event -> createNewTab());\n\t\t\n\t\tTabMainScreen mainScreen = new TabMainScreen(myResources.getString(WORKSPACE) + (myTabs.getTabs().size()));\n\t\tTabHelp help1 = new TabHelp(myResources.getString(BASIC_COMMANDS), HELP_TAB_TEXT1);\n\t\tTabHelp help2 = new TabHelp(myResources.getString(EXTENDED_COMMANDS), HELP_TAB_TEXT2);\n\t\t\n\t\tmyTabs.getTabs().addAll(mainScreen.getTab(myStage), help1.getTab(), help2.getTab());\n\t\t\n\t\tAnchorPane.setTopAnchor(myTabs, TABS_OFFSET);\n\t\tAnchorPane.setTopAnchor(newTab, NEWTAB_OFFSET);\n\t\t\n\t\tmyRoot.getChildren().addAll(myTabs, newTab);\n\t\n\t\tmyScene = new Scene(myRoot, windowHeight, windowWidth, Color.WHITE);\n\t\treturn myScene;\n\t}", "@Override\r\n public void start(Stage primaryStage) throws Exception{\n primaryStage.setTitle(\"Color switch\");\r\n Gameplay obj1 = new Gameplay();\r\n obj1.mainmenu(primaryStage);\r\n// pane.getChildren().add(new Polygon(10,20,30,10,20,30));\r\n\r\n }", "public void buildInitialScene() {\n\t\t\n\t\t//Creation image background\n\t\tfinal String BACKGROUND_PATH = \"src/assets/img/temp_background.png\";\n\t\tthis.background = new GameImage(BACKGROUND_PATH);\n\n\t\t//Creation image Game Over\n\t\tfinal String GAME_OVER_PATH = \"src/assets/img/erro.png\";\n\t\tthis.errorScene = new Sprite(GAME_OVER_PATH);\n\n\t\t//Game over sprite center position\n\t\tthis.errorScene.x = spos.calculatePosition(WindowConstants.WIDTH, 2, this.errorScene, 2);\n\t\tthis.errorScene.y = spos.calculatePosition(WindowConstants.HEIGHT, 2, this.errorScene, 2);\n\t}", "@Override\n\tpublic Scene onLoadScene() {\n\t\tmEngine.registerUpdateHandler(new FPSLogger());\n\t\tScene scene=new Scene();\n\t\tAutoParallaxBackground autoParallaxBackground=new AutoParallaxBackground(0, 0, 0, 5);\n\t\tautoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 0, mTextureRegion)));\n\t\tscene.setBackground(autoParallaxBackground);\n\t\t//Position of the Sprite in the region\n\t\tAnimatedSprite banana=new AnimatedSprite(200,200,bananaRegion);\n\t\tbanana.animate(100);\n\t\tscene.attachChild(banana);\n\t\treturn scene;\n\t}", "private void createFXScene() {\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"toolBarFXML.fxml\"));\n Scene scene = new Scene(root, Color.LIGHTGREY);\n fxPanel.setScene(scene);\n } catch (IOException e) {\n Exceptions.printStackTrace(e);\n }\n\n }", "public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}", "public Scene() {}", "@Override\n public void start( Stage primaryStage ) throws Exception {\n primaryStage.setTitle(\"Battleship\");\n primaryStage.setScene(createScene());\n primaryStage.show();\n }", "public void moveScene(Parent root) {\n Stage stage = new Stage();\n stage.setScene(new Scene(root));\n stage.show();\n }", "public Scene scene() {\n AnchorPane anchorPane = new AnchorPane();\n\n Pane track = raceTrack.trackpainting();\n\n AnchorPane.setTopAnchor(track, 40.0);\n AnchorPane.setLeftAnchor(track, 40.0);\n\n determineStartingLocation(carOne, carTwo, carThree);\n\n carPosition(carOne);\n carPosition(carTwo);\n carPosition(carThree);\n\n AnchorPane.setTopAnchor(btnStartRace, 480.0);\n AnchorPane.setLeftAnchor(btnStartRace, 740.0);\n\n AnchorPane.setTopAnchor(btnEndRace, 480.0);\n AnchorPane.setLeftAnchor(btnEndRace, 730.0);\n\n AnchorPane.setTopAnchor(txtWarning, 600.0);\n AnchorPane.setLeftAnchor(txtWarning, 610.0);\n\n anchorPane.setBackground(\n new Background(new BackgroundFill(Color.rgb(0, 132, 0),\n CornerRadii.EMPTY, Insets.EMPTY)));\n\n anchorPane.getChildren().addAll(track, carOne, carTwo, carThree, btnStartRace, btnEndRace, txtWarning);\n\n Scene scene = new Scene(anchorPane, 1580, 1030);\n return scene;\n }", "private void showCreateNewPlayer(){\n try{\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(Game.class.getResource(\"view/CreateNewPlayer.fxml\"));\n AnchorPane janela = (AnchorPane) loader.load();\n \n Stage createNewPlayerStage = new Stage();\n createNewPlayerStage.setTitle(\"Create new player\");\n createNewPlayerStage.initModality(Modality.WINDOW_MODAL);\n createNewPlayerStage.initOwner(primaryStage);\n Scene scene = new Scene(janela);\n createNewPlayerStage.setScene(scene);\n \n CreateNewPlayerController controller = loader.getController();\n controller.setGame(this);\n controller.setCreateNewPlayerStage(createNewPlayerStage); \n \n createNewPlayerStage.showAndWait();\n }catch(IOException e){\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}", "@Override\n public void start(Stage stage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"Lesson3.fxml\"));\n \n \n // Create Scene with background Color\n Scene scene = new Scene(root, 700, 350, Color.LIGHTYELLOW);\n \n // set scene on stage with title\n stage.setTitle(\"Lesson 3 FXML\");\n stage.setScene(scene);\n stage.show();\n }", "public void createMainStage(){\n mainStage = new Stage();\n BorderPane mainPageBp = new BorderPane();\n \n String headerTextMain = \"Main menu\";\n setBorderPaneTop(mainPageBp, headerTextMain, mainStage);\n setBorderPaneCenterMain(mainPageBp);\n setBorderPaneBottomMain(mainPageBp);\n \n Scene sceneMain = new Scene(mainPageBp,Constants.SCENEWIDTH, Constants.SCENEHEIGHT);\n sceneMain.getStylesheets().add(\"/styles/aitBank.css\");// add connection to stylesheet per scene\n mainStage.setTitle(bankName);\n mainStage.setScene(sceneMain);\n }", "@Override\r\n\tpublic void start(Stage stage) {\n\r\n scenes.put(SceneName.MAIN, new MainView(stage).getScene());\r\n scenes.put(SceneName.SCENE1, new ViewOne(stage).getScene());\r\n/*\t\tscenes.put(SceneName.SCENE2, new ViewTwo(stage).getScene());\r\n\t\tscenes.put(SceneName.SCENE3, new ViewThree(stage).getScene());\r\n*/\r\n\r\n\t\t// Start with the main scene\r\n\t\tstage.setScene(scenes.get(SceneName.MAIN));\r\n\t\tstage.setTitle(\"Multi-Scene Demo\");\r\n\t\tstage.show();\r\n\t}", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"Scene.fxml\"));\n primaryStage.setTitle(\"Project 3\");\n primaryStage.setScene(new Scene(root, 600, 600));\n primaryStage.show();\n }", "public void createChequeStage(){\n chequeStage = new Stage();\n BorderPane chequePageBp = new BorderPane();\n \n String headerTextMain = \"Cheque Account\";\n setBorderPaneTop(chequePageBp, headerTextMain, chequeStage);\n setBorderPaneCenterCheque(chequePageBp);\n setBorderPaneBottomCheque(chequePageBp, chequeStage);\n \n Scene sceneCheque = new Scene(chequePageBp,Constants.SCENEWIDTH, Constants.SCENEHEIGHT);\n sceneCheque.getStylesheets().add(\"/styles/aitBank.css\");// add connection to stylesheet per scene\n chequeStage.setTitle(bankName);\n chequeStage.setScene(sceneCheque);\n }", "public WorldScene makeScene() {\r\n WorldScene scene = this.getEmptyScene();\r\n //make the image to draw \\/ \\/\r\n WorldImage cell = new EmptyImage();\r\n\r\n if (this.allCellsFlooded()) {\r\n cell = this.drawWin();\r\n }\r\n else if (this.currTurn >= this.maxTurn) {\r\n cell = this.drawLose();\r\n }\r\n else {\r\n cell = this.drawBoard();\r\n }\r\n\r\n //place the image on the scene \\/ \\/\r\n scene.placeImageXY(cell, 100, 200);\r\n\r\n return scene;\r\n }", "@FXML\n private void startGame(){\n AnchorPane anchorPane = new AnchorPane();\n Scene gameScene = new Scene(anchorPane, 800, 600);\n Stage gameStage = new Stage();\n GameView gameView = new GameView(anchorPane, gameScene, gameStage);\n gameView.gameStart();\n }", "public void start(Stage stage) {\n stage.setScene(\n //create scene with root and size 250 x 100\n new Scene(\n //add circle to a new Group named root\n new Group(\n //create circle of radius = 30 at x=40, y=40\n new Circle(40, 40, 30)\n ), 250, 100)\n );\n stage.setTitle(\"My JavaFX Application\"); //set the stage\n stage.show();\t\t\t\t\t\t\t\t //made stage visible\n }", "@Override\n public void show() {\n stage = new Stage(new FitViewport(game.SCREEN_WIDTH, game.SCREEN_HEIGHT), batch);\n Gdx.input.setInputProcessor(stage);\n\n background = game.getAssetManager().get(\"startscreen.png\");\n bgViewPort = new StretchViewport(game.SCREEN_WIDTH, game.SCREEN_HEIGHT);\n\n fonts = new Fonts();\n fonts.createSmallestFont();\n fonts.createSmallFont();\n fonts.createMediumFont();\n fonts.createLargeFont();\n fonts.createTitleFont();\n\n createButtons();\n }", "public void start_game() throws IOException, JAXBException {\n savetoxml();\n logger.trace(\"starting the game now...\");\n primarystage.setResizable(false);\n primarystage.setScene(game_scene);\n primarystage.show();\n\n }", "@Override\n\tpublic void create() {\n\t\tAssets.load();\n\t\t\n\t\t//creo pantallas y cargo por defecto menuPrincipal\n\t\tscreenJuego = new JuegoScreen(this);\n\t\tmenuPrincipal = new MenuPrincipal(this);\n\t\tsetScreen(menuPrincipal);\n\t}", "public gameScene_Model(Stage primaryStage){\n this.primaryStage = primaryStage;\n background = new MyStage();\n this.scene = new Scene(background,600,800);\n animal = new Animal(\"file:src/FroggerApp/Images_File/froggerUp.png\");\n }", "public static void create(){\n\t\tstage = new Stage(new StretchViewport(1680, 1050)); \n\t\tCamera camera = stage.getCamera();\n\t\tcamera.update();\n\n\t\t//Instantiate the Managers\n\t\tGdx.input.setInputProcessor(getStage());\t\n\t\tstage.getActors().clear();\n\t\t\n\t\tmapManager = new Game_Map_Manager();\n\t\tmapManager.create(getStage());\n\t\t\n\t\tGame_CardHand cardHand = new Game_CardHand();\n\t\tcardHand.create(getStage());\n\n\t\tGameScreenUI actorManager = new GameScreenUI();\n\t\tactorManager.create(getStage());\n\n\t\tTrainDepotUI trainDepot = new TrainDepotUI();\n\t\ttrainDepot.create(getStage());\n\n\t\tGoalMenu goalScreenManager = new GoalMenu();\n\t\tgoalScreenManager.create(getStage());\n\t\t\n\t\tPlayerGoals ticketManager = new PlayerGoals();\n\t\tticketManager.create(getStage());\t\n\t\t\n\t\tGame_StartingSequence startgameManager = new Game_StartingSequence(replayMode);\n\t\tstartgameManager.create(getStage());\n\t\t\n\t\tGame_Shop shop = new Game_Shop();\n\t\tshop.create(getStage());\n\t\t\n\t\tGame_PauseMenu pauseMenu= new Game_PauseMenu();\n\t\tpauseMenu.create(getStage());\n\t\t\n\t\tWarningMessage warningMessage = new WarningMessage();\n\t\twarningMessage.create(getStage());\n\t\t\n\t\tif (replayMode){\n\t\t\tReplayModeUI replayUI = new ReplayModeUI();\n\t\t\treplayUI.create(getStage());\n\t\t\t\n\t\t\tif (Game_StartingSequence.inProgress){\n\t\t\t\tWorldMap replayMap = WorldMap.getInstance();\n\t\t\t\tGame_StartingSequence.player1 = false;\n\t\t\t\t\n\t\t\t\tStation p1station = replayMap.stationsList.get(0);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player1\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp1station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tStation p2station = replayMap.stationsList.get(1);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player2\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp2station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcreateCoreGame(p1station, p2station);\n\t\t\t\tGame_StartingSequence.startGame();\n\t\t\t\tGameScreenUI.refreshResources();\n\t\t\t\tGame_StartingSequence.inProgress = false;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void start(Stage primaryStage) {\n\n // Creates the scene and displays it to the main window\n Scene withDrawPaneSetup = new Scene(withDrawPaneSetup(primaryStage), 1024, 768);\n primaryStage.setScene(withDrawPaneSetup);\n }", "public void start(Stage stage) {\n game = new Game();\n\n Scene gameScene = new Scene(game.getVisual().getRoot(), MainGUI.WIDTH, MainGUI.HEIGHT);\n gameScene.setOnKeyPressed(new PressHandler());\n gameScene.setOnKeyReleased(new ReleaseHandler());\n\n createMenu(stage, gameScene);\n Scene menuScene = new Scene(root, MainGUI.WIDTH, MainGUI.HEIGHT);\n stage.setScene(menuScene);\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 }", "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 }", "@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}", "private void setTheScene()\n {\n board.setLocalRotation(Quaternion.IDENTITY);\n board.rotate(-FastMath.HALF_PI, -FastMath.HALF_PI, 0);\n board.setLocalTranslation(0, 0, -3);\n\n cam.setLocation(new Vector3f(0, 0, 10));\n cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);\n }", "@Override\n\tpublic void create() {\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t\n\t\t//Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\t\n\t\t//initialize controller and renderer\n\t\tworldController = new WorldController();\n\t\tworldRenderer= new WorldRenderer(worldController);\n\t\t\n\t\t//The world is not paused on start\n\t\tpaused = false;\n\t}", "@Override\n\tpublic Scene giveScene() {\n\t\tLabel SignIn=new Label(\"SIGN IN\");\n\t\tLabel UserName=new Label(\"Username\");\n\t\tLabel Password=new Label(\"Password\");\n\t\tTextField Username=new TextField();\n\t\tTextField PassWord=new TextField();\n\t\tButton SubmitButton=new Button(\"SUBMIT\");\n\t\tButton BackButton=new Button(\"BACK\");\n\t\tBackButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tmyGame.setPrimaryStage(myGame.GetLoginPageScene());\n\t\t\t}\n\t\t});\t\n\t\tSignIn.setId(\"SignInLabel\");\n\t\tUserName.setId(\"UserLabel\");\n\t\tPassword.setId(\"PasswordLabel\");\n\t\tUsername.setId(\"UserText\");\n\t\tPassWord.setId(\"PasswordText\");\n\t\tSubmitButton.setId(\"SubmitButton\");\n\t\tBackButton.setId(\"BackButton\");\n\t\tVBox SignInPageVb=new VBox(50,SignIn,UserName,Username,Password,PassWord,BackButton,SubmitButton);\n\t\tSignInPageVb.setTranslateY(100);\n\t\tSignInPageVb.setAlignment(Pos.TOP_CENTER);\n\t\tStackPane MainPageStackpane=new StackPane(SignInPageVb);\n\t\tMainPageStackpane.getStylesheets().add(getClass().getResource(\"SignInPage.css\").toString());\n\t\tmyScene= new Scene(MainPageStackpane,500,1000);\n\t\tmyScene.setFill(Color.BLACK);\n\t\tSubmitButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tPlayer newPLayer = myGame.getMyDataBase().login(Username.getText(), PassWord.getText());\n\t\t\t\t//System.out.println(newPLayer);\n\t\t\t\tif (newPLayer != null) {\n\t\t\t\t\tmyGame.setCurrentPlayer(newPLayer);\n\t\t\t\t\tmyGame.setPrimaryStage(myGame.GetMainPageScene());\n\t\t\t\t}else {\n\t\t\t\t\tif(NoPlayer==null) {\n\t\t\t\t\t\tNoPlayer=new Label(\"Invalid User/Password\");\n\t\t\t\t\t\tSignInPageVb.getChildren().add(NoPlayer);\n\t\t\t\t\t}//System.out.println(\"katta\");\n\t\t\t\t//myGame.setPrimaryStage(myGame.GetGamePlayScene());\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\n\t\treturn myScene;\n\t}", "public void mainMenu() {\n Game.stage.setScene(mainMenuScene);\n Game.stage.show();\n }", "protected Scene buildScene() throws FileNotFoundException, NoSuchObjectException {\n SplitPane split = new SplitPane();\n Scene myGameScene = new Scene(split, 800, 600);\n split.setDividerPositions(0.35f, 0.6f);\n attachStyle(myGameScene, \"GameView\");\n\n Pane leftPane = getPane(myGameResourceBundle.getString(\"LeftPaneCss\"));\n buildLeftSplitPane(leftPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n Pane rightPane = getPane(myGameResourceBundle.getString(\"RightPaneCss\"));\n Entity player = getPlayerEntity();\n background = new ImageView(new Image(new FileInputStream(levelInfoParser.getBackgroundImage())));\n cameraView = new CameraView(player, myGameScene.heightProperty(), myGameScene.widthProperty());\n buildRightSplitPane(rightPane);\n cameraView.bindBackgroundImage(background);\n ImageView playerDisplay = cameraView.createPlayerDisplay(player);\n setUpGameOver(player);\n rightPane.getChildren().add(playerDisplay);\n split.getItems().addAll(leftPane, rightPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n myGameScene.setOnKeyPressed(e -> handleKeyPressed(e));\n cameraView.handleCamera(rightPane, playerDisplay,background);\n myGameScene.setOnKeyReleased(e->handleKeyReleased(e));\n rightPane.requestFocus();\n rightPane.setFocusTraversable(true);\n return myGameScene;\n }", "public void openGamePane() {\n\t\tParent root;\n\t\ttry {\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(GAMEPANELOCATION));\n\t\t\tloader.setController(this);\n\t\t\troot = loader.load();\n\t\t\tScene scene = new Scene(root);\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.show();\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tgamePane.setBackground(new Background(new BackgroundFill(new Color(195/256.0,222/256.0,250/256.0,1),CornerRadii.EMPTY, Insets.EMPTY)));\n\t\tgameObjects=new HashMap<Integer,GameObjectVisualComponent>();\n\t\tpodium=new ArrayList<Text>();\n\t\tpodium.add(new Text(gamePane.getWidth()-100,15,\"TOP\"));\n\t\tgamePane.getChildren().add(podium.get(0));\n\t}", "@Override\n public void start(Stage stage) throws IOException {\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(MainScreen.class.getResource(\"MainScreen.fxml\"));\n\n\n Parent root = fxmlLoader.load();\n MainScreen mainScreen = fxmlLoader.getController();\n Scene scene = new Scene(root);\n\n stage.setTitle(\"Inventory Management System\");\n stage.setScene(scene);\n stage.show();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "@Override\r\n\tpublic void create() {\n\t\tbatch = new SpriteBatch();\r\n\t\tcamera = new OrthographicCamera();\r\n\t\tassets = new AssetManager();\r\n\t\t\r\n\t\tcamera.setToOrtho(false,WIDTH,HEIGHT);\r\n\t\t\r\n\t\tTexture.setAssetManager(assets);\r\n\t\tTexture.setEnforcePotImages(false);\r\n\t\t\r\n\t\tsetScreen(new SplashScreen(this));\r\n\t}", "public static Scene scene2() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene2\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initAmbient(new Vec(0.4))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game).\r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// Add lighting condition:\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.7));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "public void start(Stage myStage) { \n \n System.out.println(\"Inside the start() method.\"); \n \n // Give the stage a title. \n myStage.setTitle(\"JavaFX Skeleton.\"); \n \n // Create a root node. In this case, a flow layout \n // is used, but several alternatives exist. \n FlowPane rootNode = new FlowPane(); \n \n // Create a scene. \n Scene myScene = new Scene(rootNode, 300, 200); \n \n // Set the scene on the stage. \n myStage.setScene(myScene); \n \n // Show the stage and its scene. \n myStage.show(); \n }", "@Override\n public void start(Stage stage){\n // set the stage\n this.stage = stage;\n\n // set the scenes\n mainScene();\n inputScene();\n\n // set the stage attributes\n stage.setTitle(\"Maze solver\");\n stage.setWidth(VisualMaze.DISPLAY_WIDTH);\n stage.setHeight(VisualMaze.DISPLAY_HEIGHT + 200);\n stage.setScene(main);\n\n // display the app\n stage.show();\n }", "public WorldScene makeScene() {\n WorldScene scene = new WorldScene(this.width * GamePiece.GAMEPIECE_SIZE,\n this.height * GamePiece.GAMEPIECE_SIZE);\n WorldImage row = new EmptyImage();\n for (int i = 0; i < this.width; i++) {\n WorldImage column = new EmptyImage();\n for (int j = 0; j < this.height; j++) {\n column = new AboveImage(column, this.board.get(i).get(j)\n .drawPiece(this.board.get(powerRow).get(powerCol), this.radius));\n }\n row = new BesideImage(row, column);\n }\n scene.placeImageXY(row, (this.width * GamePiece.GAMEPIECE_SIZE) / 2,\n (this.height * GamePiece.GAMEPIECE_SIZE) / 2);\n return scene;\n }", "public void initScenes()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n m_pInScene.setPosition(new CCPoint(-(s.width - 0.5f), 0));\n }", "@Override\r\n public void start(Stage stage){\n Text msg = new Text(\"Hola JavaFX\");\r\n \r\n //toplevel node\r\n VBox root = new VBox();\r\n \r\n //add the child node to VBox root node\r\n root.getChildren().add(msg);\r\n \r\n //Create a scene\r\n Scene scene = new Scene(root, 300, 50);\r\n \r\n //set the scene to the stage\r\n stage.setScene(scene);\r\n \r\n //set a title for the stage\r\n stage.setTitle(\"Hola Aplicación JavaFX\");\r\n \r\n //show the stage\r\n stage.show();\r\n }", "@Override\n public final void start(final Stage primaryStage) {\n Scene scene = new Scene(getPane(), PANE_WIDTH, PANE_HEIGHT);\n primaryStage.setTitle(\"Tic-Tak-Toe\"); // Set the stage title.\n primaryStage.setScene(scene); // Place the scene in the stage.\n primaryStage.show(); // Display the stage.\n }", "@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tStackPane pane = new StackPane();\n\t\tScene scene = new Scene(pane);\n\t\tfirstLevel();\n\t\tpane.getChildren().add(mRoot);\n\t\tstage.setScene(scene);\n\t\t\n\t\t\n\t}", "public void start() {\n BorderPane borderPane = new BorderPane();\n VBox centerPane = new VBox();\n\n borderPane.setTop(lobbyMenu());\n\n String TITLE = \"Connect 4\";\n Text title = new Text(TITLE);\n title.setFont(Font.font(\"Arial\", FontWeight.BOLD, 30));\n centerPane.getChildren().add(title);\n centerPane.getChildren().add(lobbyButtons());\n centerPane.setAlignment(Pos.CENTER);\n\n borderPane.setCenter(centerPane);\n\n Scene scene = new Scene(borderPane, 520, 360);\n\n stage.setTitle(TITLE);\n stage.setScene(scene);\n }", "private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }", "@Override\n public void create() {\n tex = new Texture(Gdx.files.internal(\"data/scene.png\"));\n\n //important since we aren't using some uniforms and attributes that SpriteBatch expects\n ShaderProgram.pedantic = false;\n\n //print it out for clarity\n System.out.println(\"Vertex Shader:\\n-------------\\n\\n\" + VERT);\n System.out.println(\"\\n\");\n System.out.println(\"Fragment Shader:\\n-------------\\n\\n\" + FRAG);\n\n shader = new ShaderProgram(VERT, FRAG);\n if (!shader.isCompiled()) {\n System.err.println(shader.getLog());\n System.exit(0);\n }\n if (shader.getLog().length() != 0)\n System.out.println(shader.getLog());\n\n\n batch = new SpriteBatch(1000, shader);\n batch.setShader(shader);\n\n cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n cam.setToOrtho(false);\n }", "private Scene createScene() {\r\n\t\tGroup root = new Group();\r\n\t\tScene scene = new Scene(root, this.getWidth(), this.getHeight());\r\n\t\tthis.textfield = new TextField();\r\n\t\ttextfield.setPromptText(this.placeholder);\r\n\t\ttextfield.setPrefWidth(this.getWidth());\r\n\t\ttextfield.setPrefHeight(this.getHeight());\r\n\t\ttextfield.setMinSize(TextField.USE_PREF_SIZE, TextField.USE_PREF_SIZE);\r\n\t\tthis.fixNavigation(textfield);\r\n\t\tthis.node = textfield;\r\n\t\troot.getChildren().add(textfield);\r\n\t\treturn scene;\r\n\t}", "private void init(){\n stage = new Stage();\n inventory = Warrior.getInventory();\n\n Skin skin = new Skin(Gdx.files.internal(\"assets/skins/uiskin.json\"));\n\n dragAndDrop = new DragAndDrop();\n dragAndDrop.setDragActorPosition(-25,25); //offset of dragable item\n\n lootWindow = createView(skin);\n\n stage.addActor(lootWindow); // add window to stage\n }", "public void backToStartScene(ActionEvent event) throws IOException {\r\n Parent startView = FXMLLoader.load(Main.class.getResource(\"fxml/StartScene.fxml\"));\r\n Scene startViewScene = new Scene(startView);\r\n\r\n // This line gets the Stage information (no Stage is passed in)\r\n Stage window = (Stage) ((Node)event.getSource()).getScene().getWindow();\r\n\r\n window.setScene(startViewScene);\r\n window.show();\r\n }", "public void start(Stage primaryStage2) throws FileNotFoundException, NoSuchObjectException {\n primaryStage = primaryStage2;\n myGameOverView = new GameOverView(language, primaryStage);\n primaryStage2.setScene(buildScene());\n }", "@Override\n public void start(Stage primaryStage) throws Exception {\n\n // set up window.\n primaryStage.setWidth(600);\n primaryStage.setHeight(400);\n primaryStage.setResizable(false);\n\n // set up scenes.\n FXMLLoader mainMenuLoader = new FXMLLoader(getClass().getResource(\"FXML/mainMenuLayout.fxml\"));\n Scene mainMenuScene = new Scene(mainMenuLoader.load());\n FXMLLoader gameLoader = new FXMLLoader(getClass().getResource(\"FXML/gameLayout.fxml\"));\n Scene gameScene = new Scene(gameLoader.load());\n\n // set the main menu to load into the game.\n MainMenuController mainMenuController = (MainMenuController) mainMenuLoader.getController();\n mainMenuController.setGameScene(gameScene);\n\n primaryStage.setScene(mainMenuScene);\n\n primaryStage.show();\n\n }", "protected void displayInitialScene() {\n stageManager.switchScene(FxmlView.SPLASH, StageStyle.UNDECORATED);\n }", "public void create () \n\t{ \n\t\t// Set Libgdx log level to DEBUG\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t// Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\tpaused = false;\n\t\t// Load preferences for audio settings and start playing music\n\t\tGamePreferences.instance.load();\n\t\tAudioManager.instance.play(Assets.instance.music.song01);\n\t\t// Start game at menu screen\n\t\tsetScreen(new MenuScreen(this));\n\t\t\n\t}", "@Override\n public void create() {\n\n batch = new SpriteBatch();\n manager = new AssetManager();\n\n manager.load(\"audio/main_theme.mp3\", Music.class);\n // manager.load(\"String sonido\", Sound.class);\n manager.load(\"sprites/dragon.pack\", TextureAtlas.class);\n manager.load(\"sprites/vanyr.pack\", TextureAtlas.class);\n manager.finishLoading();\n\n setScreen(new PlayScreen(this));\n\n }", "private void createNameSubScene() {\n\t\tnameSubScene = new ViewSubScene();\n\t\tthis.mainPane.getChildren().add(nameSubScene);\n\t\tInfoLabel enterName = new InfoLabel(\"ENTER YOU NAME\");\n\t\tenterName.setLayoutX(20);\n\t\tenterName.setLayoutY(40);\n\t\t\n\t\tinputName = new TextField();\n\t\tinputName.setLayoutX(120);\n\t\tinputName.setLayoutY(150);\n\t\t\n\t\tnameSubScene.getPane().getChildren().add(enterName);\n\t\tnameSubScene.getPane().getChildren().add(inputName);\n\t\tnameSubScene.getPane().getChildren().add(createLinkButton());\n\t}", "@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tSideMenu sidemenu = new SideMenu(canvas);\n\t\tgridpane.add(sidemenu, 0, 0);\n\t\tgridpane.add(canvas, 1, 0);\n\t\t\n\t\tScene scene = new Scene(gridpane);\n\t\t\n\t\tstage.setScene(scene);\n\t\tstage.sizeToScene();\n\t\t\n\t\tstage.setTitle(\"Make your own Dot Drawing - By Joeri\");\n\t\tstage.show();\n\t\t\n\t\tstage.setMinWidth(stage.getWidth());\n\t\tstage.setMinHeight(stage.getHeight());\n\t}", "public void start(Stage stage) {\n Layout layout = new Layout();\n Scene scene = new Scene(layout, 400, 400); \n stage.setScene(scene);\n layout.bindToScene(scene);\n new AppController(layout);\n stage.show();\n showInstructions();\n }", "protected Scene createView() {\n\t\treturn null;\n\t}", "@Override\n\tpublic void create() {\n\t\tGdx.gl20.glClearColor(1, 1, 1, 1);\n\n\t\t// instancia batch, asset manager e ambiente 3D\n\t\tmodelBatch = new ModelBatch();\n\t\tassets = new AssetManager();\n\t\tambiente = new Environment();\n\t\tambiente.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));\n\t\tambiente.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));\n\n\t\t// configura a câmera\n\t\tfloat razaoAspecto = ((float) Gdx.graphics.getWidth()) / Gdx.graphics.getHeight();\n\t\tcamera = new PerspectiveCamera(67, 480f * razaoAspecto, 480f);\n\t\tcamera.position.set(1f, 1.75f, 3f);\n\t\tcamera.lookAt(0, 0.35f, 0);\n\t\tcamera.near = 1f;\n\t\tcamera.far = 300f;\n\t\tcamera.update();\n\t\tcameraController = new CameraInputController(camera);\n\t\tGdx.input.setInputProcessor(cameraController);\n\n\t\t// solicita carregamento dos 2 modelos 3D da cena\n\t\tassets.load(\"caldeirao.obj\", Model.class);\n\t\tassets.load(\"caldeirao-jogos.obj\", Model.class);\n\t\tassets.load(\"caldeirao-love.obj\", Model.class);\n\t\tassets.load(\"fogueira.obj\", Model.class);\n\n\t\t// instancia e configura 2 tipos de renderizadores de partículas:\n\t\t// 1. Billboards (para fogo)\n\t\t// 2. PointSprites (para bolhas)\n\t\tBillboardParticleBatch billboardBatch = new BillboardParticleBatch(ParticleShader.AlignMode.Screen, true, 500);\n\t\tPointSpriteParticleBatch pointSpriteBatch = new PointSpriteParticleBatch();\n\t\tsistemaParticulas = new ParticleSystem();\n\t\tbillboardBatch.setCamera(camera);\n\t\tpointSpriteBatch.setCamera(camera);\n\t\tsistemaParticulas.add(billboardBatch);\n\t\tsistemaParticulas.add(pointSpriteBatch);\n\n\t\t// solicita o carregamento dos efeitos de partículas\n\t\tParticleEffectLoader.ParticleEffectLoadParameter loadParam = new ParticleEffectLoader.ParticleEffectLoadParameter(\n\t\t\t\tsistemaParticulas.getBatches());\n\t\tassets.load(\"fogo.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"fogo-jogos.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"fogo-love.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas-jogos.pfx\", ParticleEffect.class, loadParam);\n\t\tassets.load(\"bolhas-love.pfx\", ParticleEffect.class, loadParam);\n\n\t\t// solicita carregamento da música\n\t\tmusica = Gdx.audio.newMusic(Gdx.files.internal(\"zelda-potion-shop.mp3\"));\n\n\t\taindaEstaCarregando = true;\n\t}", "@Override\n public void start(Stage primaryStage)\n throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {\n makeMainGrid();\n Scene myHomeScene = new Scene(myMainGrid, WINDOW_WIDTH, WINDOW_HEIGHT);\n primaryStage.setScene(myHomeScene);\n primaryStage.show();\n }", "public static void create() {\r\n render();\r\n }", "@Override\n\tpublic void create() {\n\t\tthis.batch = new SpriteBatch();\n\t\t\n//\t\tgame.batch.begin();\n// player.draw(game.batch);\n// \n// game.batch.end();\n\t\t\n\t\tmanager = new AssetManager();\n\t\tmanager.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));\n\t\tmanager.load(\"data/level1.tmx\", TiledMap.class);\n\t\tmanager.load(\"data/background.png\", Texture.class);\n//\t\tmanager.load(\"level1.tsx\", TiledMapTileSet.class);\n\t\tmanager.finishLoading();\n\t\tscreen = new GameScreen(this);\n\t\tsetScreen(screen);\n\t\t\n\t}", "@Override\n public void start(Stage primaryStage) {\n primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {\n @Override\n public void handle(WindowEvent t) {\n Platform.exit();\n System.exit(0);\n }\n });\n\n // Set up the Stage.\n Group root = new Group();\n Scene scene = new Scene(root, SCENE_WIDTH, SCENE_HEIGHT);\n\n this.spriteList = new ArrayList<Sprite>();\n\n Sprite sprite = new hoffmanm2();\n sprite.setName(\"Geralt\");\n sprite.setSize(76, 77);\n sprite.setPosition(74, 51);\n sprite.setVelocity(10, 7);\n root.getChildren().add(sprite);\n this.spriteList.add(sprite);\n\n // Show the UI.\n primaryStage.setScene(scene);\n primaryStage.show();\n\n // Set up the timer to run the animation. Note that there are\n // more standard ways to run an animation with JavaFX, but this one\n // is extremely explicit, and easiest to understand and control at first.\n this.setUpAnimationTimer();\n }", "@Override\r\n public void start(Stage primaryStage) {\n VFlow flow = FlowFactory.newFlow();\r\n\r\n // make it visible\r\n flow.setVisible(true);\r\n\r\n // create two nodes:\r\n // one leaf node and one subflow which is returned by createNodes\r\n createFlow(flow, 3, 6);\r\n\r\n // show the main stage/window\r\n showFlow(flow, primaryStage, \"VWorkflows Tutorial 05: View 1\");\r\n }", "public void newGame () throws IOException {\n\t\tMenuController.setTheme(selectedTheme);\n\t\tScene tableViewScene = FXMLLoader.load(Main.class.getResource(\"/views/menu.fxml\"));\n\t\tStage stage = (Stage)gameScene.getWindow();\n\t\tstage.setScene(tableViewScene);\n\t\t// Views dosen't update on Linux when you don't set size, until you move the view.\n\t\t// To fix that we need to update the view somehow. This was the solution...\n\t\tstage.setX(stage.getX());\n\t\tstage.show();\n\t}", "private void setupStage(Scene scene) {\n SystemTray.create(primaryStage, shutDownHandler);\n\n primaryStage.setOnCloseRequest(event -> {\n event.consume();\n stop();\n });\n\n\n // configure the primary stage\n primaryStage.setTitle(bisqEnvironment.getRequiredProperty(AppOptionKeys.APP_NAME_KEY));\n primaryStage.setScene(scene);\n primaryStage.setMinWidth(1020);\n primaryStage.setMinHeight(620);\n\n // on windows the title icon is also used as task bar icon in a larger size\n // on Linux no title icon is supported but also a large task bar icon is derived from that title icon\n String iconPath;\n if (Utilities.isOSX())\n iconPath = ImageUtil.isRetina() ? \"/images/[email protected]\" : \"/images/window_icon.png\";\n else if (Utilities.isWindows())\n iconPath = \"/images/task_bar_icon_windows.png\";\n else\n iconPath = \"/images/task_bar_icon_linux.png\";\n\n primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath)));\n\n // make the UI visible\n primaryStage.show();\n }", "@Override\r\n public void start(Stage primaryStage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"ui/main.fxml\")); //FXMLLoader.load(Utilities.getResourceURL(\"ui/main.fxml\"));\r\n primaryStage.setTitle(\"Custom Groovy Game Engine\");\r\n primaryStage.setScene(new Scene(root, 960, 480));\r\n primaryStage.show();\r\n }", "@Override\n\tpublic void create() {\n\t\tassetManager = new AssetManager();\n\t\tassetManager.load(ROLIT_BOARD_MODEL, Model.class);\n\t\tassetManager.load(ROLIT_BALL_MODEL, Model.class);\n\t\t\n\t\t//construct the lighting\n\t\tenvironment = new Environment();\n\t\tenvironment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));\n\t\tenvironment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));\n\t\t\n\t\tmodelBatch = new ModelBatch();\n\t\t\n\t\tcam = new PerspectiveCamera(67f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n\t\t\n\t\tGdx.input.setInputProcessor(new InputHandler());\n\t}", "public void createNewGame(Stage menuStage) {\n\t\t\n\t\tthis.menuStage = menuStage;\n\t\tthis.menuStage.hide();\n\t\tview = new GameView(inputs[1]);\n\t\ttry {\n\t\tview.show();\n\t\tgame = new Game(getNames(), inputs[0]);\n\t\tturned = false;\n\t\tview.initialisePlayerViews(nameList);\n\t\tcreateKeyListeners();\n\t\tcreateGameLoop();\n\t\t}catch (IndexOutOfBoundsException ex){\n\t\t\tthrow new GameException(\"User cancelled game\");\n\t\t}\n\t}", "@Override\n\tpublic void create () {\n\t\t//IntrigueGraphicalDebugger.enable();\n\t\tIntrigueGraphicSys = new IntrigueGraphicSystem();\n\t\tIntrigueTotalPhysicsSys = new IntrigueTotalPhysicsSystem();\n\t\t\n\t\tfinal int team1 = 1;\n\t\tfinal int team2 = 2;\n\t\t\n\t\tstage = new Stage();\n\t\ttable = new Table();\n\t\ttable.bottom();\n\t\ttable.left();\n\t\ttable.setFillParent(true);\n\t\t\n\t\tLabelStyle textStyle;\n\t\tBitmapFont font = new BitmapFont();\n\t\t\n\n\t\ttextStyle = new LabelStyle();\n\t\ttextStyle.font = font;\n\n\t\ttext = new Label(\"Intrigue\",textStyle);\n\t\tLabel text2 = new Label(\"@author: Matt\", textStyle);\n\t\tLabel text3 = new Label(\"OPERATION 1\", textStyle);\n\t\t\n\t\ttext.setFontScale(1f,1f);\n\t\ttable.add(text);\n\t\ttable.row();\n\t\ttable.add(text2);\n\t\ttable.row();\n\t\ttable.add(text3);\n\t\tstage.addActor(table);\n\n\t\ttable.setDebug(true);\n\t\tString path_to_char = \"3Dmodels/Soldier/ArmyPilot/ArmyPilot.g3dj\";\n //String path_to_road = \"3Dmodels/Road/roadV2.g3db\";\n\t\t//String path_to_rink = \"3Dmodels/Rink/Rink2.g3dj\";\n\t\tString path_to_snow_terrain = \"3Dmodels/Snow Terrain/st5.g3dj\";\n\t\tString path_to_crosshair = \"2Dart/Crosshairs/rifle_cross.png\";\n\t\n\t\tMatrix4 trans = new Matrix4();\n\t\tMatrix4 iceTrans = new Matrix4();\n\t\tMatrix4 iceTrans2 = new Matrix4();\n\t\tMatrix4 iceTrans3 = new Matrix4();\n\t\tMatrix4 iceTrans4 = new Matrix4();\n\t\tMatrix4 trans2 = new Matrix4();\n\t\tMatrix4 trans3 = new Matrix4();\n\t\n\t\ttrans.translate(-3000,6000,-500);\n\t\t//Vector3 halfExtents = new Vector3(30f,90f,25f);\n\t\tbtCapsuleShape person_shape = new btCapsuleShape(30f, 90f);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(player_guid)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char).IntrigueControllerComponent(1)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans)\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.DecalComponent()\n\t\t\t\t\t.ThirdPersonCameraComponent()\n .CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent()\n\t\t\t\t\t.Fireable(path_to_crosshair)\n\t\t\t\t\t.TargetingAI(team1)\n\t\t\t\t\t//.CharacterSoundComponent(\"SoundEffects/Character/walking/step-spur.mp3\", \"SoundEffects/guns/M4A1.mp3\")\n\t\t\t\t\t.Build());\n\t\tJson json_test = new Json(); \n\t\tEntity d = mamaDukes.get(player_guid);\n\t\t//System.out.println(json_test.prettyPrint(d));\n\t\t\n\t\t\n\t\tmamaDukes.get(player_guid).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\", iceTrans, Entity.class));\n\t\t\t\t/*\n\t\t\t\tnew DrifterObject.DrifterObjectBuilder(1)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(1)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans)\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\n\t\t\t\t\t\t\t\"3DParticles/blizzard.pfx\",new Vector3(1000,1000, -2500), \n\t\t\t\t\t\t\tnew Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build())\n\t\t\t\t\t.Build());*/\n\t\ttrans2.translate(-1000,1000,1500);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(2)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans2)\n\t\t\t\t\t.ParticleComponent(\"Blood\", \"3DParticles/Character/Blood.pfx\", \n\t\t\t\t\t\t\tnew Vector3(), new Vector3(1f,1f,1f))\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent()\n\t\t\t\t\t.Fireable()\n\t\t\t\t\t.ShootingSoldierAI()\n\t\t\t\t\t.TargetingAI(team2)\n\t\t\t\t\t.Build());\n\t\t\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody()\n\t\t\t\t\t.getRigidBody()\n\t\t\t\t\t.setAngularFactor(new Vector3(0,0,0));\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody()\n\t\t\t\t\t.getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\t\t\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setUserIndex(2);\n\t\t\n\t\ttrans3.translate(-1000, 1000, 2000);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(3)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans3)\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent().Fireable()\n\t\t\t\t\t.ShootingSoldierAI().TargetingAI(team2)\n\t\t\t\t\t.Build());\n\t\t\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setAngularFactor(new Vector3(0,0,0));\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody().setUserIndex(3);\n\t\t\n\t\tVector3 rpos = new Vector3();\n\t\t\n\t\tmamaDukes.get(1).getModelComponent().getModel()\n\t\t\t\t\t.transform.getTranslation(rpos);\n\t\t\n\t\ticeTrans2.translate(0, 0, 6185.332f);\n\t\t\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"SoundEffects/stages/snow stage/wind1.mp3\",\n\t\t\t\t\"3DParticles/blizzard.pfx\", iceTrans2, Entity.class));\n\t\t\n\t\t\t\t\t/*new DrifterObject.DrifterObjectBuilder(4)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(4)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans2)\n\t\t\t\t\t.IntrigueLevelComponent(\"SoundEffects/stages/snow stage/wind1.mp3\")\n\t\t\t\t\t.Build())\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\"3DParticles/blizzard.pfx\",\n\t\t\t\t\t\t\tnew Vector3(0, 0, 6185.332f),\n\t\t\t\t\t\t\tnew Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build());*/\n\t\t\n\t\tmamaDukes.get(4).getModelComponent().getModel().transform.translate(new Vector3(0, 0, 6185.332f)); //btStaticMeshShapes do not update their motionStates. The model Translation must be set manually in these cases.\n\t\ticeTrans3.translate(-6149.6568f, 0, 6185.332f);\n\t\t\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\" , iceTrans3, Entity.class));\n\t\t/**\n\t\t * btStaticMeshShapes do not update their motionStates. The model Translation must be set manually in these cases.\n\t\t */\n\t\tmamaDukes.get(5).getModelComponent().getModel().transform.translate(new Vector3(-6149.6568f, 0, 6185.332f)); \n\t\t\n\t\ticeTrans4.translate(-6149.6568f, 0, 0);\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\" , iceTrans4, Entity.class));\n\t\t\t\t\t/**new DrifterObject.DrifterObjectBuilder(6)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(6)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans4)\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\"3DParticles/blizzard.pfx\",\n\t\t\t\t\t\t\tnew Vector3(-6149.6568f, 0, 0), new Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build())\n\t\t\t\t\t.Build());*/\n\t\tmamaDukes.get(6).getModelComponent().getModel().transform.translate(new Vector3(-6149.6568f, 0, 0)); \n\t\t\n\t}", "@Override\n public void start(Stage primaryStage) {\n\n pStage = primaryStage;\n\n try {\n\n\n Parent root = FXMLLoader.load(getClass().getResource(\"/GUI.fxml\"));\n\n Scene scene = new Scene(root, 600, 400);\n\n primaryStage.setTitle(\"Shopper 5000 Ultimate\");\n\n primaryStage.setResizable(false);\n primaryStage.setScene(scene);\n primaryStage.show();\n\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "public WorldScene makeScene() {\n WorldScene w = new WorldScene(width * scale, height * scale);\n for (Vertex v : vertices) {\n Color color = generateColor(v);\n w.placeImageXY(new RectangleImage(scale, scale, OutlineMode.SOLID, color),\n (v.x * scale) + (scale * 1 / 2), (v.y * scale) + (scale * 1 / 2));\n }\n for (Edge e : walls) {\n if (e.to.x == e.from.x) {\n w.placeImageXY(\n new RectangleImage(scale, scale / 10, OutlineMode.SOLID, Color.black),\n (e.to.x * scale) + (scale * 1 / 2),\n ((e.to.y + e.from.y) * scale / 2) + (scale * 1 / 2));\n }\n else {\n w.placeImageXY(\n new RectangleImage(scale / 10, scale, OutlineMode.SOLID, Color.black),\n ((e.to.x + e.from.x) * scale / 2) + (scale * 1 / 2),\n (e.to.y * scale) + (scale * 1 / 2));\n }\n }\n return w;\n }", "public Render(Scene scene1) {\n scene = scene1;\n }", "public void setScene(Scene scene){\n this.scene = scene;\n }", "@Override\n\tpublic void start(Stage stage) throws Exception {\n\t\tStackPane root = new StackPane();\n\t\t\n\t\t// Create drop shadow effect\n\t\tDropShadow dropShadow = new DropShadow();\n\t\tdropShadow.setColor(Color.GRAY);\n\t\tdropShadow.setOffsetY(3.0);\n\t\t\n\t\t// Create a rectangle element\n\t\tRectangle rectangle = new Rectangle(400, 200, Color.AQUA);\n\t\trectangle.setArcHeight(30);\n\t\trectangle.setArcWidth(80);\n\t\trectangle.setEffect(dropShadow);\n\t\t\n\t\t// Create a text that will display on top of the rectangle shape\n\t\tText text = new Text(\"Hello StackPane\");\n\t\ttext.setFill(Color.DARKSLATEGRAY); \n\t\ttext.setFont(Font.font(null, FontWeight.BOLD, 32));\n\t\ttext.setEffect(dropShadow);\n\t\t\n\t\t// Fade the text in and out\n\t\tFadeTransition fade = new FadeTransition(Duration.seconds(1.5), text);\n\t\tfade.setFromValue(1.0);\n\t\tfade.setToValue(0.0);\n\t\tfade.setCycleCount(Animation.INDEFINITE);\n\t\tfade.setAutoReverse(true);\n\t\tfade.play();\n\t\t\n\t\t// Set the Rectangle and Text on the root element of the StackPane\n\t\troot.getChildren().setAll(rectangle, text);\n\t\t\n\t\t// Create scene and set the scene on the stage\n\t\tScene scene = new Scene(root, 600, 300, Color.LIGHTBLUE);\n\t\tstage.setTitle(\"Hello StackPane\");\n\t\tstage.setScene(scene);\n\t\tstage.show();\n\t\t\n\t}", "@Override\n\tpublic void start(Stage primaryStage) throws IOException {\n\t\t// Create the root of the graph scene. It is mainly used in the updateScene() method.\n\t\troot = new Group();\n\n\t\t// Create a simulation with N elements\n\t\tsimulation = new Simulation();\n\n\t\t// Configure and start periodic scene update: after PERIOD_MS ms, updateScene() is called.\n\t\ttimeline = new Timeline(new KeyFrame(PERIOD_MS, ae -> {\n\t\t\tupdateScene();\n\t\t})); // \"->\" is a Java 8 specific construction\n\t\ttimeline.setCycleCount(Animation.INDEFINITE);\n\t\ttimeline.play();\n\n\n\t\t/** Allows the window to be dragged by the mouse */\n\t root.setOnMousePressed(new EventHandler<MouseEvent>() {\n\t \t@Override\n\t public void handle(MouseEvent event) {\n\t xOffset = primaryStage.getX() - event.getScreenX();\n\t yOffset = primaryStage.getY() - event.getScreenY();\n\t }\n\t });\t \n\t root.setOnMouseDragged(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n \tprimaryStage.setX(event.getScreenX() + xOffset);\n\t primaryStage.setY(event.getScreenY() + yOffset);\n\t }\n\t });\n\t \n\t \n\t /** Adds the stylesheet for visual effect */\n\t root.getStylesheets().add(\"/stylesheet.css\");\n\t root.getStyleClass().add(\"rootPane\");\n\t \n\t /** Adds icon */\n\t primaryStage.getIcons().add(new Image(\"/icon.png\"));\n\t \n\t Scene scene = new Scene(root, Simulation.SPACE_SIZE, Simulation.SPACE_SIZE, Simulation.BACKGROUND); \n\t primaryStage.setScene(scene);\n \tprimaryStage.setTitle(\"Gabriel's Land\");\n \tprimaryStage.setResizable(false);\n\t primaryStage.getScene().setCursor(Cursor.HAND);\n\t primaryStage.show();\n\n\t}", "@Override\n public void start (Stage primaryStage) {\n Group root = new Group();\n Scene scene = new Scene(root, AppConstants.STAGE_WIDTH, AppConstants.STAGE_HEIGHT);\n ModulePopulator = new ModuleCreationHelper(root, scene, primaryStage);\n view = new View();\n scene.setFill(AppConstants.BACKGROUND_COLOR);\n // scene.getStylesheets().add(getClass().getResource(\"application.css\").toExternalForm());\n view.init(root, ModulePopulator);\n ModulePopulator.setView(view);\n ModulePopulator.createMainPageModules();\n view.initRunner(root, ModulePopulator);\n primaryStage.setTitle(\"SLogo!\");\n primaryStage.setScene(scene);\n primaryStage.show();\n\n System.out.println(\"App Has Started!\");\n }", "@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/sample.fxml\"));\n Parent root = loader.load();\n primaryStage.setTitle(\"Tower Defence\");\n s = new Scene(root, 600, 480);\n primaryStage.setScene(s);\n primaryStage.show();\n MyController appController = (MyController)loader.getController();\n appController.createArena(); \t\t\n\t}", "public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}" ]
[ "0.80696446", "0.77696556", "0.75066", "0.736118", "0.726805", "0.7251021", "0.72194093", "0.7204146", "0.7191934", "0.71739984", "0.7107698", "0.7089209", "0.7066574", "0.7027453", "0.68476474", "0.68449825", "0.6837185", "0.68245083", "0.67731845", "0.6771425", "0.67550725", "0.6742788", "0.6735683", "0.6729327", "0.67239916", "0.6702062", "0.6691331", "0.6681684", "0.66777706", "0.66249", "0.6619856", "0.65991753", "0.65949136", "0.65940416", "0.65753406", "0.65730935", "0.6565038", "0.6557063", "0.65516675", "0.65387356", "0.65050125", "0.64905125", "0.6489252", "0.64886093", "0.6476293", "0.64562666", "0.6445134", "0.64337784", "0.6416379", "0.6415783", "0.6415237", "0.6414745", "0.63944894", "0.6368897", "0.63677734", "0.6367065", "0.63494104", "0.6346965", "0.6344042", "0.63391024", "0.6337922", "0.63345057", "0.6333019", "0.6332413", "0.6330685", "0.6327938", "0.63224906", "0.6322468", "0.6318958", "0.63088864", "0.6308777", "0.6306094", "0.62997365", "0.6288616", "0.6287481", "0.6270812", "0.6250679", "0.6245223", "0.6234735", "0.621871", "0.6210006", "0.6204663", "0.6197495", "0.6192586", "0.6185134", "0.61840475", "0.6183231", "0.61811674", "0.6180869", "0.6180277", "0.61798304", "0.6179067", "0.61774635", "0.616931", "0.6168968", "0.61661077", "0.6164504", "0.6161943", "0.61595374", "0.6158615" ]
0.6276325
75
The main method is only needed for the IDE with limited JavaFX support. Not needed for running from the command line.
public static void main(String[] args) { launch(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main( String[] args) {\n\t\t// this method start the javaFX application.\n\t\t// some IDEs are capable of starting JavaFX without this method.\n\t\tlaunch( args);\n\t}", "public static void main(String[] args){\r\n //Launch the JavaFX app\r\n Application.launch(args);\r\n }", "public static void main(String[] args) {\n // This is how a javafx class is run.\n // This will cause the start method to run.\n // You don't need to change main.\n launch(args);\n }", "public static void main(String[] args) {\n JFXPanel fxPanel = new JFXPanel();\n new Main().start();\n }", "public static void main(String[] args){\n try {\n //wait to initialize toolkit\n final CountDownLatch latch = new CountDownLatch(1);\n SwingUtilities.invokeLater(() -> {\n new JFXPanel(); // initializes JavaFX environment\n latch.countDown();\n });\n latch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n Consumer consumer = new Consumer();\n }", "public static void main(String[] args)\n {\n EventQueue.invokeLater(() ->\n {\n try\n {\n App app = new App();\n app.frame.setVisible(true);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n });\n }", "@Override\r\n public void start(Stage primaryStage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"ui/main.fxml\")); //FXMLLoader.load(Utilities.getResourceURL(\"ui/main.fxml\"));\r\n primaryStage.setTitle(\"Custom Groovy Game Engine\");\r\n primaryStage.setScene(new Scene(root, 960, 480));\r\n primaryStage.show();\r\n }", "@Override\n public void start(Stage primaryStage) {\n /*\n A JavaFX app defines the user interface container by means of \n a stage and a scene\n \n The JavaFX stage class is the top-level JavaFX container\n \n The JavaFX scene class is the container for all content\n \n */\n Button btn = new Button();\n btn.setText(\"Say 'Hello World'\");\n btn.setOnAction(new EventHandler<ActionEvent>() {\n \n @Override\n public void handle(ActionEvent event) {\n System.out.println(\"Hello World!\");\n }\n });\n /*\n In JavaFX, the content of the scene is represented as a hierarchial\n scene graph of nodes.\n \n In this example, the root node is a StackPane object, which is a \n resizable layout node.\n \n This means that the root node's size tracks the scene's size and \n changes when the stage s resized by the user.\n \n */\n StackPane root = new StackPane();\n root.getChildren().add(btn);\n \n //The root node contains a child node, a button control the text,\n // plus an event handler to print a message when the button is pressed\n \n \n Scene scene = new Scene(root, 300, 250);\n \n // Create a scene for a specific root node with a specific size\n \n primaryStage.setTitle(\"Hello World!\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "public static void main(String[] args) {\n // Start App\n EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() { new App(); }\n });\n }", "public static void main(String[] args) throws Exception {\n Path selfPath = Paths.get(TestBrowser.class.getProtectionDomain().getCodeSource().getLocation().toURI());\n ModuleFinder finder = ModuleFinder.of(\n Paths.get(System.getProperty(\"javafx.sdk.path\")),\n selfPath\n );\n\n // Load the application as a named module and invoke it\n ModuleLayer parent = ModuleLayer.boot();\n Configuration cf = parent.configuration().resolve(finder, ModuleFinder.of(), Set.of(\"ReproduceOpenjfxCrash2\"));\n ClassLoader scl = ClassLoader.getSystemClassLoader();\n ModuleLayer layer = parent.defineModulesWithOneLoader(cf, scl);\n Class appClass = layer.findLoader(\"ReproduceOpenjfxCrash2\").loadClass(\"javafx.application.Application\");\n Class testClass = layer.findLoader(\"ReproduceOpenjfxCrash2\").loadClass(\"eu.doppel_helix.dev.jdk.reproducecrash.TestBrowserImpl\");\n Method launchMethod = appClass.getMethod(\"launch\", Class.class, String[].class);\n launchMethod.invoke(null, new Object[]{testClass, args});\n }", "public void start(Stage mainStage) {\n\t\t\n\t}", "public static void main() {\n \n }", "void printWithJavaFX() {\n }", "@Override\n public void start(Stage primaryStage) throws Exception {\n Parent root = FXMLLoader.load(getClass().getResource(\"sample.fxml\"));\n addExitOnEsc(primaryStage);\n primaryStage.setTitle(\"Hello World\");\n primaryStage.setScene(new Scene(root, 300, 275));\n primaryStage.show();\n\n }", "@Override\n public void start(Stage primaryStage) throws Exception {\n String filePath = null;\n\n // 2,3: export statements\n Boolean exportBits = false;\n Boolean exportPNGs = false;\n\n // check command line args\n if(commandLineArgs.length > 0) {\n if(commandLineArgs[0].equals(\"-h\") || commandLineArgs[0].equals(\"--help\")) {\n syntaxMessage();\n System.exit(0);\n }\n\n File f = new File(commandLineArgs[0]);\n\n if (f.exists() && !f.isDirectory()) {\n filePath = commandLineArgs[0];\n } else {\n System.out.println(\"File '\" + commandLineArgs[0] + \"' does not exist.\");\n System.out.println(\"Use -h | --help to show the command line help.\");\n System.exit(1);\n }\n\n for(int i = 1; i < commandLineArgs.length; i++) {\n if(commandLineArgs[i].equals(\"-eb\") || commandLineArgs[i].equals(\"--export-bits\")) {\n exportBits = true;\n }\n else if(commandLineArgs[i].equals(\"-epngs\") || commandLineArgs[i].equals(\"--export-pngs\")) {\n exportPNGs = true;\n } else {\n System.out.println(\"Unknown command line argument '\" + commandLineArgs[i] + \"'.\");\n System.out.println(\"Use -h | --help to show the command line help.\");\n System.exit(1);\n }\n }\n }\n\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"view/mainWindow.fxml\"));\n Parent root = fxmlLoader.load();\n\n Model model = new Model();\n Preferences userPreferences = Preferences.userNodeForPackage(this.getClass());\n\n Controller controller = fxmlLoader.getController();\n controller.initModelViewController(model);\n controller.setStage(primaryStage);\n\n int stageWidth = userPreferences.getInt(\"stageWidth\", 2*ConfiguratorTab.CANVAS_PADDING+2*ConfiguratorTab.PE_DRAW_SIZE+3*ConfiguratorTab.INTER_PE_DISTANCE+10);\n int stageHeight = userPreferences.getInt(\"stageHeight\", 2*ConfiguratorTab.CANVAS_PADDING+2*ConfiguratorTab.PE_DRAW_SIZE+2*ConfiguratorTab.INTER_PE_DISTANCE+110);\n\n primaryStage.setTitle(\"CRC Configurator\");\n primaryStage.getIcons().add(new Image(\"icon/icon_512x512.png\"));\n\n primaryStage.setWidth(stageWidth);\n primaryStage.setHeight(stageHeight);\n primaryStage.setScene(new Scene(root, stageWidth, stageHeight));\n\n primaryStage.setOnCloseRequest(event -> {\n // save stage width and height\n userPreferences.putInt(\"stageWidth\", (int) primaryStage.getWidth());\n userPreferences.putInt(\"stageHeight\", (int) primaryStage.getHeight());\n // quit application\n controller.quitApplication();\n });\n\n if(!exportBits && !exportPNGs) {\n primaryStage.show();\n }\n\n // open file from file path given from the command line\n if(filePath != null) {\n File crcDescriptionFile = new File(filePath);\n controller.openCrcDescriptionFile(crcDescriptionFile);\n\n if(exportBits) {\n ExportBitsText exportBitsText = new ExportBitsText();\n System.out.println(exportBitsText.getText(model.getCrc(), false, Configuration.ConfigurationType.NONE, 0));\n }\n\n if(exportPNGs) {\n List<Tab> tabs = controller.getTabPane().getTabs();\n\n for(Tab tab : tabs) {\n ConfiguratorTab configuratorTab = (ConfiguratorTab) tab;\n controller.getTabPane().getSelectionModel().select(configuratorTab);\n configuratorTab.update();\n\n String pngFileName = new String(crcDescriptionFile.getName().replace(\".json\", \"\") + \"_\" + configuratorTab.getText().toLowerCase().replace(' ', '_') + \".png\");\n\n File pngFile = new File(pngFileName);\n\n Canvas canvas = configuratorTab.getCanvas();\n try {\n WritableImage writableImage = new WritableImage((int) canvas.getWidth(), (int) canvas.getHeight());\n canvas.snapshot(null, writableImage);\n RenderedImage renderedImage = SwingFXUtils.fromFXImage(writableImage, null);\n ImageIO.write(renderedImage, \"png\", pngFile);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }\n\n if(exportBits || exportPNGs) {\n System.exit(0);\n }\n }\n }", "public void start(Stage primaryStage)\n {\n \tint wid = 520;\n int hei = 200;\n Text hello = new Text(50, 50, \"Hello, JavaFX!\");\n Text question = new Text(120, 80, \"How's it going?\");\n Text question2 = new Text(120, 160, \"Are you getting any ideas?\");\n \n Line simpleLine = new Line(0, 0, 520, 200);\n \n Circle simpleCircle = new Circle(260,100,20);\n Rectangle simpleRectangle = new Rectangle(200,100,20,30);\n Ellipse e = new Ellipse(200, 30, 10,20);\n \n Group root = new Group(e,simpleRectangle, hello, question, question2, simpleLine, simpleCircle); \n Scene scene = new Scene(root, 520, 200, Color.ANTIQUEWHITE);\n \n primaryStage.setTitle(\"A JavaFX Program\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "public void start(Stage mainStage) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n configureStyle();\n EventQueue.invokeLater(() -> {\n MainFrame frame = new MainFrame(new Document());\n frame.setVisible(true);\n });\n }", "@Override\n public void start(Stage primaryStage) {\n\n // The Stage is where we place GUI stuff, such as a GridPane (see later).\n // I'll look more at this after Easter, but please read the\n // following comments\n stage = primaryStage;\n\n // In this version of the app we will drive\n // the app using a command line menu.\n // YOU ARE REQUIRED TO IMPLEMENT THIS METHOD\n runMenu();\n\n // This is how we can handle a window close event. I will talk\n // about the strange syntax later (lambdas), but essentially it's a Java 8\n // was of providing a callback function: when someone clicks the\n // close window icon then this bit of code is run, passing in the event\n // object that represents the click event.\n primaryStage.setOnCloseRequest((event) -> {\n // Prevent window from closing. We only want quitting via\n // the command line menu.\n event.consume();\n\n System.out.println(\"Please quit the application via the menu\");\n });\n }", "public static void main(String[] args){\n\n EventQueue.invokeLater(() -> {\n GUI gui = new GUI();\n gui.setVisible(true);\n });\n }", "public static void main(String[] args) {\r\n\t\tSwingUtilities.invokeLater(() -> {\r\n\t\t\tnew JVDraw().setVisible(true);\r\n\t\t});\r\n\t}", "@Override\n public void start(Stage primaryStage) throws Exception {\n BorderPane root = new BorderPane();\n\n // setup canvas\n canvas = new Canvas(700, 700);\n canvas.setOnMouseClicked(this::handleCanvasClick);\n root.setCenter(canvas);\n\n // setup button bar\n HBox buttonBar = new HBox();\n\n Button pointsButton = new Button(\"Generate points\");\n pointsButton.setOnAction(this::generatePoints);\n\n Button voronoiButton = new Button(\"Generate Voronoi\");\n voronoiButton.setOnAction(this::generateVoronoi);\n\n Button relaxButton = new Button(\"Relax sites\");\n relaxButton.setOnAction(this::relaxSites);\n\n buttonBar.getChildren().addAll(pointsButton, voronoiButton, relaxButton);\n\n root.setBottom(buttonBar);\n\n // show\n Scene scene = new Scene(root);\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "public static void main(String[] args) throws Exception{\n Window window = new Window();\n window.createWindow();\n }", "@Override\n public void start(Stage primaryStage) throws Exception {\n window = primaryStage;\n Parent root = FXMLLoader.load(getClass().getResource(\"UserInterface.fxml\"));\n primaryStage.setTitle(\"Calculator\");\n primaryStage.setOnCloseRequest(e -> Main.closeMe());\n primaryStage.setResizable(false);\n\n primaryStage.setScene(new Scene(root, 600, 300));\n primaryStage.show();\n }", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getClassLoader().getResource(\"Main.fxml\"));\n primaryStage.setTitle(\"Faulkner Kiosk\");\n primaryStage.setScene(new Scene(root, 600, 400));\n primaryStage.show();\n\n }", "@Override\r\n public void start(Stage primaryStage) {\r\n \r\n \r\n // StackPane root = new StackPane(); \r\n Scene scene = new Scene(root, 900, 900); //set up a window with these propotions\r\n \r\n primaryStage.setTitle(\"Keep it Clean simulator\"); //window title\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n \r\n setLayout();\r\n \r\n drawUI.Draw(dataInput, tileMin, tileMax);\r\n }", "@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\t\n\t\t//StackPane stackPane = new StackPane();\n\t\t//Button button = new Button(\"Przycisk\");\n\t\t//stackPane.getChildren().add(button);\n\t\t//Scene scene = new Scene(stackPane,400,400);\n\t\t//primaryStage.setScene(scene);\n\t\t\n\t\t\n\t\t//Stack Pane from FXML file\n\t\t//****************************************//\n\t\tFXMLLoader fxmlLoader = new FXMLLoader();\n\t\tfxmlLoader.setLocation(this.getClass().getResource(\"/fxml/MainStackPane.fxml\"));\n\t\tStackPane stackPane = fxmlLoader.load();\n\t\tScene scene = new Scene(stackPane);\n\t\tprimaryStage.setScene(scene);\n\t\t\n\t\tprimaryStage.setTitle(\"First JavaFx app\");\n\t\tprimaryStage.show();\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n EventQueue.invokeLater(() -> {\n gui myGui = new gui();\n myGui.setVisible(true);\n });\n\n }", "public static void main(String[] args) {\r\n\t launch(args); \r\n \r\n}", "public static void main(String[] args) {\r\n\t\tSwingUtilities.invokeLater(() -> { \r\n\t\t\tnew JNotepadApp().setVisible(true);\r\n\t\t});\r\n\t}", "public static void main(String[] args) {\n javax.swing.SwingUtilities.invokeLater(() -> createAndShowMainWindow());\n }", "public static void main(String args[]) {\n\tON_MAC_OS_X = System.getProperty(\"os.name\").toLowerCase().startsWith(\"mac os x\");\n\tfloat osVersion = Float.parseFloat(System.getProperty(\"os.version\").substring(0, 4));\n\tfloat javaVersion = Float.parseFloat(System.getProperty(\"java.version\").substring(0,3));\n\tTIGER14_OR_LATER = ON_MAC_OS_X && (osVersion >= 10.4f) && (javaVersion >= 1.4f);\n\t\n\t// Turn off CocoaComponent compatibility in the code to save time on stage\n\tSystem.setProperty(\"com.apple.eawt.CocoaComponent.CompatibilityMode\", \"false\");\n\t\n new CWCocoaComponent().setVisible(true);\n }", "@Override\n public void start(Stage primaryStage) throws Exception{\n Parent root = FXMLLoader.load(getClass().getResource(\"Scene.fxml\"));\n primaryStage.setTitle(\"Project 3\");\n primaryStage.setScene(new Scene(root, 600, 600));\n primaryStage.show();\n }", "public static void main(String[] args) {\n EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n GUI window = new GUI();\n window.frame.setVisible(true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n }", "public static void main(String[] args) {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tDemo gui = new Demo();\n\t\t\t\tgui.setVisible(true);\n\t\t\t}\n\t\t});\n\t}", "public static void main(String[] args) {\n\n Application.launch(args);\n }", "public static void main(String[] args) {\n // Create the system.\n Application.launch( args );\n }", "@Override\n public void start(Stage primaryStage) {\n AnchorPane root = new PowerOffWindow(null);\n \n Scene scene = new Scene(root);\n \n primaryStage.setTitle(\"JSonFX\");\n primaryStage.setResizable(false);\n primaryStage.setScene(scene);\n primaryStage.getIcons().add(new Image(getClass().getResource(\"/res/JsonFX.png\").toString()));\n primaryStage.show();\n }", "public static void main(String[] args) {\r\n\t\tEventQueue.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tLeapFlieUI window = new LeapFlieUI();\r\n\t\t\t\t\twindow.frame.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(() -> {\n\t\t\tTreci jvdraw = new Treci();\n\t\t\tDimension d = jvdraw.getSize();\n\t\t\td.setSize(600, 400);\n\t\t\tjvdraw.setSize(d);\n\t\t\tjvdraw.setVisible(true);\n\t\t\t\n\t\t});\n\t}", "@Override\r\n public void start(Stage primaryStage) {\n }", "public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tnew TaskPaneExample1();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void start(Stage primaryStage) throws Exception {\n console(\"start...\");\n\n Parent root = FXMLLoader.load(getClass().getResource(\"AutoGraderApp.fxml\"));\n\n primaryStage.setTitle(appName);\n primaryStage.setScene(new Scene(root, MIN_STAGE_WIDTH, MIN_STAGE_HEIGHT));\n primaryStage.setMinWidth(MIN_STAGE_WIDTH);\n primaryStage.setMinHeight(MIN_STAGE_HEIGHT);\n\n primaryStage.show();\n }", "public static void main(String[] args){\n\t\t\n\t\ttry{\n\t\t\t//Socket attempts to connect to the same computer, localhost, using the port number 4500\n\t\t\tclient = new Socket(\"localhost\", 4500);\n\t\t\t\n\t\t\t//A PrintWriter is connected to the OutputStream of the client Socket. \n\t\t\t//The boolean determines whether it should auto-flush or not.\n\t\t\tout = new PrintWriter(client.getOutputStream(),true);\n\t\t\t\n\t\t\t//The BufferedReader creates a Buffer for the InputStreamReader, which in turn\n\t\t\t//reads from the InputStream of the client Socket. \n\t\t\tin = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\t\n\t\t\t//The ObjectInputStream is able to read objects from the Socket\n\t\t\tobjIn = new ObjectInputStream(client.getInputStream());\n\t\t\t\n\n\t\t}catch(FileNotFoundException fnfe){\n\t\t\tfnfe.printStackTrace();\n\t\t\t\n\t\t}catch(ConnectException ce) {\n\t\t\tSystem.out.println(\"Could not connect to the server. Please ensure that the server is active before starting the game.\");\n\t\t\tSystem.exit(1);\n\t\t\t\n\t\t}catch(IOException ioe){\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\t\n\t\t//JavaFX requires that this method is called, with args as a parameter, in order to start creating windows\n\t\tlaunch(args);\n\t}", "@Override\n public void start(Stage primaryStage) throws IOException {\n Main.primaryStage = primaryStage;\n Main.primaryStage.setTitle(\"American Travel Bucketlist\");\n\n //Call the extension of the FXMLLoader for the MainView.\n showMainView();\n }", "public static void main(String[] args) {\n //launch it\n launch();\n }", "public static void main(String[] args) {\n Application.launch(args);\n }", "void start(Stage primaryStage);", "public static void main(String[] args) {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tprinc frame = new princ();\n\t\t\t\t\tframe.setVisible(true);\n\t\t\t\t\tframe.setTitle(\"Storyteller\");\n\t\t\t\t\t//la ventana no se puede redimensionar\n\t\t\t\t\tframe.setResizable(false);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//falta hacer que la ventana aparezca en el centrode la pantalla\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args); // Not needed for running from the command line\n\t}", "public static void main(final String... args) {\n\n Application.launch();\n }", "public static void main(String[] args) {\n SettVisualizer.startApplication();\r\n }", "public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(() -> {\n\t\t\tnew JNotepadPP().setVisible(true);\n\t\t});\n\t}", "public static void main(String args[]) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tnew AppStarter();\n\t\t\t}\n\t\t});\t\n\t}", "private JFXHelper() {}", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String[] args) {\n launch(args); \n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Windows\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new Main().setVisible(true);\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public static void main(String[] args) {\n launch(args);\r\n \r\n }", "public static void main(String[] args) {\n showWindow();\r\n\t}", "private static void initAndShowGUI() {\n JFrame frame = new JFrame(\"Swing and JavaFX\");\n final JFXPanel fxPanel = new JFXPanel();\n frame.add(fxPanel);\n frame.setSize(250, 350);\n frame.setVisible(true);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n initFX(fxPanel);\n }\n });\n }", "public static void main(String[] args) {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tMain frame = new Main();\n\t\t\t\t\tframe.setVisible(true);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static void main (String[] args) {\n launch(args);\n }", "public static void main(String[] args){\n // Creates an instance of our program\n Main gui = new Main();\n // Lets the computer know to start it in the event thread\n SwingUtilities.invokeLater(gui);\n }", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\n\t}", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n GraphicsDevice gd = ge.getDefaultScreenDevice();\n\n //If translucent windows aren't supported, exit.\n if (!gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT)) {\n System.err.println(\"Per-pixel translucency is not supported\");\n System.exit(ERR_STATUS_TRANSPARENCY);\n }\n\n SynthLookAndFeel ginjLookAndFeel = new GinjSynthLookAndFeel();\n try {\n ginjLookAndFeel.load(Ginj.class.getResourceAsStream(LAF_XML), Ginj.class);\n UIManager.setLookAndFeel(ginjLookAndFeel);\n// UIManager.setLookAndFeel(EaSynthLookAndFeel.class.getName());\n// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n }\n catch (Exception e) {\n System.err.println(\"Error loading Ginj look and feel\");\n e.printStackTrace();\n System.exit(ERR_STATUS_LAF);\n }\n\n Prefs.load();\n\n // Creating a JFileChooser can take time if you have network drives. So start loading one now, in a separate thread...\n // TODO check if this is really effective...\n futureFileChooser = new FutureTask<>(JFileChooser::new);\n ExecutorService executor = Executors.newSingleThreadExecutor();\n executor.execute(futureFileChooser);\n\n javax.swing.SwingUtilities.invokeLater(() -> {\n starWindow = new StarWindow();\n starWindow.setVisible(true);});\n\n }", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\t}", "public static void main(String[] args) {\n\t\tApplication.launch(args);\n\t}", "public static void main(String[] args) {\n\t\tJFrame frame = new JFrame();\n\t\tframe.getContentPane().add(new BookAddMethodSelectionPanel());\n\t\tframe.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t}", "public static void main(String[] args)\n {\n launch(args);\n }", "@Override\r\n public void start(Stage primaryStage){\n primaryStage = new Stage();\r\n mainStage = primaryStage;\r\n primaryStage.setTitle(\"Excel Editor\");\r\n primaryStage.setWidth(750);\r\n primaryStage.setHeight(650);\r\n primaryStage.setMaxWidth(1000);\r\n primaryStage.setMaxHeight(1000);\r\n primaryStage.setResizable(true);\r\n primaryStage.setOnCloseRequest(event -> {\r\n // Create local Buttons for the quitPage\r\n Button yesButton = new Button(\"Yes\");\r\n Button noButton = new Button(\"No\");\r\n // Customize Buttons\r\n yesButton.setMaxWidth(Double.MAX_VALUE);\r\n noButton.setMaxWidth(Double.MAX_VALUE);\r\n yesButton.setAlignment(Pos.CENTER);\r\n noButton.setAlignment(Pos.CENTER);\r\n\r\n TA_AlertPage.alert(\"Quit?\", \"Are you sure you'd like to quit?\", null, yesButton,\r\n noButton);\r\n // Consume the even if the user selects no, otherwise the program will terminate\r\n event.consume();\r\n });\r\n\r\n\r\n // Make BorderPane\r\n makeBorderPane();\r\n\r\n\r\n mainScene= new Scene(borderPane);\r\n primaryStage.setScene(mainScene);\r\n primaryStage.show();\r\n }", "public static void main(String[] args) \r\n\t {\r\n\t\tApplication.launch(args);\r\n\t }", "public static void main(String[] args) {\n launch(args);\n\n }", "public static void main(String[] args) {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tStartingFrame window = new StartingFrame();\n\t\t\t\t\twindow.frame.setVisible(true);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static void main(String args[]) throws IOException {\n GUI app = new GUI();\n }", "@Override\n\tpublic void start(Stage primaryStage) throws IOException\n\t{\n\n\t\tParent root = FXMLLoader.load(getClass().getResource(\"TestDataGeneratorGUI.fxml\"));\n\t\tScene scene = new Scene(root, 1280, 720);\n\t\t\n\t\tprimaryStage.setTitle(\"Test Data Generator & Exporter\");\n\t\tprimaryStage.setScene(scene);\n\t\tprimaryStage.show();\n\t}", "public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n createAndShowGui();\n }\n\n });\n \n }", "public static void main() {\n }", "public void start(Stage mainStage) throws IOException { \r\n\r\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tApplication.launch(args);\r\n\t}", "public static void main(String[] args)\r\n {\r\n SwingUtilities.invokeLater(() -> createAndShowGUI());\r\n }", "public static void main(String[] args) {\n\t\tshow();\r\n\t}", "public static void main(String args[])\r\n\t{\r\n\t\tToolStarter.startSwingTool(EV3SDCard.class, args);\r\n\t}", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args)\n {\n launch(args);\n }", "public static void main(String[] args) {\n\t\tinput(new JFrame());\n\t\t\n\t}", "public static void main (String []args){\n }", "public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n new KidoloEditor().setVisible(true);\n\n }\n });\n }", "public static void main(String[] args)\r\n {\r\n launch(args);\r\n }", "@Override\n public void handle(ActionEvent event) {\n System.out.println(\"Hello JavaFX\");\n }", "public static void main (String[] args) {\n SimpleWorkspaceApplication applcn = new SimpleWorkspaceApplication (args);\n applcn.getCurrentFrame().setVisible (true);\n }", "public static void main(String[] args){\n // Creates an instance of our program\n Main gui = new Main();\n // Lets the computer know to start it in the event thread\n SwingUtilities.invokeLater(gui);\n }", "public static void main(String[] args) {\n\n invokeLater(new Runnable() {\n public void run() {\n initialize();\n new MainFrame();\n }\n });\n }", "public static void main(String[] args) {\r\n launch(args);\r\n }" ]
[ "0.7855074", "0.7652527", "0.73391855", "0.73037434", "0.725813", "0.71054196", "0.69409", "0.6918405", "0.6912379", "0.67712665", "0.67472214", "0.6733873", "0.6731505", "0.6705223", "0.6699508", "0.66788906", "0.6674266", "0.6663539", "0.66617364", "0.6653239", "0.66315854", "0.6605809", "0.65567714", "0.6539728", "0.65336794", "0.65307605", "0.65246224", "0.6498698", "0.6478943", "0.6475269", "0.64674264", "0.64666706", "0.64625216", "0.6459761", "0.6456212", "0.6447363", "0.64439714", "0.64426553", "0.64412457", "0.64330125", "0.64303845", "0.64288497", "0.6425716", "0.6425556", "0.6418082", "0.64115494", "0.64037985", "0.63964885", "0.6394588", "0.6391496", "0.63874954", "0.6386007", "0.63845205", "0.63678676", "0.63677454", "0.6362149", "0.6362149", "0.6362149", "0.6362149", "0.6362149", "0.6358177", "0.6356023", "0.6348511", "0.6341217", "0.63373387", "0.6336499", "0.6333137", "0.6330562", "0.632431", "0.632431", "0.632431", "0.63242185", "0.6323154", "0.6323154", "0.632088", "0.6318885", "0.6317214", "0.63110554", "0.6303092", "0.63006055", "0.6300411", "0.6294316", "0.6287529", "0.62866133", "0.62836456", "0.6282112", "0.62819475", "0.6280617", "0.6278667", "0.6278398", "0.6278398", "0.6278398", "0.6271431", "0.6271245", "0.6268633", "0.6265369", "0.6264239", "0.6261553", "0.6259326", "0.6258751", "0.6258298" ]
0.0
-1
/ if statement will show error if the input is not a number.
@Override public void handle(ActionEvent e) { if (!Commission.getText().matches("[0-9]*")) { Alert alert = new Alert(AlertType.ERROR); alert.setTitle("Error Dialog"); alert.setHeaderText("Oops! Number Expected!"); alert.showAndWait(); } /* this statements will show the output according to the user. */ Commission = (Button) e.getSource(); commission = Double.parseDouble((myTextField.getText())); // if statements for counting sales commission if (commission > 0 && commission < 5001) { countC = ((commission * 8) / 100); } else if (commission <= 10001) { countC = (((commission - 5000) * 10) / 100) + ((5000 * 8) / 100); } else { countC = ((5000 * 8) / 100) + ((5000 * 10) / 100) + (((commission - 10000) * 12) / 100); } // if statements for counting sales amount Amount = (Button) e.getSource(); amount = Double.parseDouble((myTextField.getText())); if (amount > 0 && amount < 401) { countA = ((amount * 8) / 100); } else if (amount < 901) { countA = (((amount - 400) * 10) / 100) + ((400 * 8) / 100); } else { countA = ((400 * 8) / 100) + ((500 * 10) / 100) + (((amount - 900) * 12) / 100); } // if statements for exit if (yourButton == e.getSource()) System.exit(0); //Platform.exit(); // if statement for showing message if (Commission == e.getSource()) { Alert alert = new Alert(AlertType.INFORMATION); alert.setTitle("Message"); alert.setHeaderText("The answer is:"); alert.setContentText("the Sales Amount of " + String.valueOf(countC) + "\nis needed to make a Sales Commission of " + String.valueOf(countA) + "."); alert.showAndWait(); } else if (Amount == e.getSource()) { Alert alertA = new Alert(AlertType.INFORMATION); alertA.setTitle("Message"); alertA.setHeaderText("The answer is:"); alertA.setContentText("The Sales Commission is " + String.valueOf(countC) + ".\nFor the Sales Amount of " + String.valueOf(countA) + "."); alertA.showAndWait(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isNumber(String number){\n\t\ttry{\r\n\t\t\tFloat.parseFloat(number);\r\n\t\t}catch(Exception e){\r\n\t\t\treturn false;// if the user input is not number it throws flase\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void validateData(String input) {\n String[] inputStringArray = input.split(\" \");\n\n for (String s : inputStringArray) {\n try {\n Integer.parseInt(s);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\n \"Looks like your input - \" + s + \", is not a number. Try again\");\n }\n }\n }", "public boolean checkNumber() {\n\t\treturn true;\n\t}", "public static void notValidNumberErr(){\n printLine();\n System.out.println(\" Oops! Please enter a valid task number\");\n printLine();\n }", "public void checkInput(TextField number) {\r\n\t\ttry {\r\n\t\t\tlong num = Long.parseLong(number.getText());\r\n\t\t\tif (num < 0) \t\t\t\t\t// ako je negativan broj, pretvorit cemo ga u pozitivan\r\n\t\t\t\tnum = Math.abs(num);\r\n\t\t\tif (isValid(num)) \r\n\t\t\t\tscene2();\r\n\t\t}\r\n\t\tcatch (Exception e) {\t\t\t\t// hvatanje greske\r\n\t\t\talert(\"Wrong input, try again!\");\r\n\t\t}\r\n\t}", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "private boolean isInt(TextField input){\r\n input.setStyle(\"-fx-border-color: green; -fx-border-radius: 15;-fx-background-radius: 20;\");\r\n try {\r\n int number = Integer.parseInt(input.getText());\r\n System.out.println(\"Input is\" + number );\r\n return true;\r\n } catch (Exception e) {\r\n input.setStyle(\"-fx-border-color: red;\");\r\n input.setText(null);\r\n input.setPromptText(\"Only digits/numbers must be filled\");\r\n return false;\r\n }\r\n }", "void showAlertForInvalidNumber();", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "protected boolean isNumberValid(@NotNull ConversationContext context, @NotNull Number input) {\n/* 30 */ return true;\n/* */ }", "private static boolean isNumber( char i ) {\n\t\tif ( Character.isDigit(i) ) return true; \n\t\tthrow new IllegalArgumentException(\"The weight of the route should be a number, now it's '\"+ i +\"'\");\n\t}", "private static double checkInput(String input) {\n\t\tdouble parsedValue = 0;\n\t\ttry {\n\t\t\tparsedValue = Double.parseDouble(input);\n\t\t} catch (NumberFormatException parseFailed) {\n\t\t\tSystem.out.println(\"'\" + input + \"' se ne može protumačiti kao broj.\");\n\t\t\treturn ERROR;\n\t\t}\n\n\t\tif (parsedValue > 0) {\n\t\t\treturn parsedValue;\n\t\t} else if (parsedValue < 0) {\n\t\t\tSystem.out.println(\"Unijeli ste negativnu vrijednost.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Ne postoji pravokutnik sa stranicom duljine nula.\");\n\t\t}\n\t\treturn ERROR;\n\t}", "public static int checkInput() {\r\n\t\tint num = 0;\r\n\t\tboolean error = true; // check for error\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\t// input has to be an integer and not negative number\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0)\r\n\t\t\t\t\tthrow new InputMismatchException();\r\n\t\t\t\terror = false;\r\n\r\n\t\t\t} catch (InputMismatchException e) {\r\n\r\n\t\t\t\tSystem.out.print(\"Wrong input, try again...: \");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\t// loop continue while there is an error\r\n\t\t} while (error);\r\n\r\n\t\treturn num;\r\n\t}", "public boolean isNum() \n\t{ \n\t try \n\t { \n\t int d = Integer.parseInt(numeric); \n\t } \n\t catch(NumberFormatException nfe) \n\t { \n\t return false; \n\t } \n\t return true; \n\t}", "private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }", "private boolean isValidNumber(String quantity) {\n\t\ttry{\n\t\t\tint value=Integer.parseInt(quantity);\n\t\t\treturn value>0? true: false;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }", "private static int validateInput() {\n Scanner genericInt = new Scanner(System.in);\n int number = 0;\n if (genericInt.hasNextInt()) {\n number = genericInt.nextInt();\n return number;\n }\n else {\n validateInput();\n }\n return number;\n }", "private boolean checkForNumber(String field) {\n\n\t\tPattern p = Pattern.compile(\"[0-9].\");\n\t\tMatcher m = p.matcher(field);\n\n\t\treturn (m.find()) ? true : false;\n\t}", "public abstract boolean isNumeric();", "private boolean isValid(String input){\n return input.length() == 10 && input.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n //check its digits\n }", "boolean isInt(TextField input);", "public static int checkInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t\tif(i<0) {\r\n\t\t\t\t\tSystem.out.println(\"Enter a positive number\");\r\n\t\t\t\t\tis_Nb = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}", "private boolean isNumber(final String number) {\n try {\n Integer.parseInt(number);\n return true;\n } catch (Exception e) {\n LOGGER.error(\"Not a number \" + number, e);\n return false;\n }\n }", "private boolean validNum (int num) {\n if (num >= 0) return true;\n else return false;\n }", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private static boolean isBadInput(String s) {\n\t\tString[] split = s.split(\"\\\\s+\");\n\t\tif (split.length != 3) {\n\t\t\tSystem.err.printf(\"Unknow length: %d\\n\", split.length);\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tInteger.parseInt(split[0]);\n\t\t\tInteger.parseInt(split[2]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tSystem.err.printf(\"Input numbers only.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (split[1].length() != 1) {\n\t\t\tSystem.err.printf(\"Operator should be one character.\\n\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public int lecturaNumero()\n {\n boolean error = false; \n int numero = 0;\n System.out.print(\">\");\n try {\n numero = lectura.nextInt();\n\n } catch (InputMismatchException ime){\n error = true; \n lectura.next();\n }\n if (!error){\n return numero; \n }else{\n return -1;\n }\n }", "@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}", "public static void validateInput(Scanner in) {\n\t\twhile (!in.hasNextInt()) {\n\t\t\tSystem.out.println(\"That's not an integer!\");\n\t\t\tin.next();\n\t\t\tSystem.out.print(\"Please try again: \");\n\t\t}\n\t}", "public boolean validateInput(double input){\n\t\tif(input >= -1 && input <= 1)\n\t\t return true;\n\t\treturn false;\t\n\t}", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNumeric(String userInput) {\n return Pattern.matches(Constants.ID_VALIDATION, userInput);\n }", "public boolean isInteger() {\n try {\n Integer.parseInt(txt.getText());\n return true;\n } catch (Exception e) {\n return error(\"El valor debe ser un numero entero!\");\n }\n }", "public boolean hasNumber(){\n return (alg.hasNumber(input.getText().toString()));\n }", "public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "public boolean checkNum(String n,JTextField t,int len) \n\t{\n\t\tboolean number=true;\t\t//We are assuming that name will be a String \n\t\tboolean result=false;\n\t\ttry \n\t\t{\n\t\t\tDouble num=Double.parseDouble(n); //if s contains sting then it will not be parse and it will throw exception\t\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\t\tnumber=false;\t\t}\n\t\t\n\t\tif(number==true) // true\n\t\t{\n\t\t\t//it is a number\n\t\t\tif(n.length()==len)\n\t\t\t{\tresult=true;\t}\n\t\t\telse\n\t\t\t{\tresult=false;\t}\n\t\t}\n\t\telse if(number==false) //it is a String\n\t\t{\tresult=false;\t}\n\t\treturn result;\n}", "public boolean isNumber(String input) {\r\n\t\tif (input == null || input.isEmpty())\r\n\t\t\treturn false;\r\n\t\tif (input.charAt(0) == '-')\r\n\t\t\treturn false;\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tif (Character.isDigit(input.charAt(i)) == false)\r\n\t\t\t\treturn false;\r\n\t\t\tif (Integer.parseInt(input) < 1 || Integer.parseInt(input) > 7)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static int getNumberAnswer(){\r\n\t\tint answer=0;\r\n\t\tBoolean isNumber = false ;\r\n\t\tdo {\r\n\t\t\ttry{\r\n\t\t\t\tanswer = Integer.parseInt(input.nextLine());\r\n\t\t\t\tisNumber =true;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tSystem.out.println(\"Nope, that's not a number/integer.\");\r\n\t\t\t\tSystem.out.println(\"Provide an integer answer.\");\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tisNumber = false;\r\n\t\t\t}\r\n\t\t} while (!isNumber);\r\n\t\treturn answer;\r\n\t}", "public static int inputValidation(Scanner sc) {\n int number;\n do {\n System.out.println(\"enter Postive Number: \");\n while (!sc.hasNextInt()) {\n System.out.println(\"This is not a nuber.Please Enter Positive Number: \");\n sc.next();\n }\n number = sc.nextInt();\n } while (number < 0);\n\n return number;\n }", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static int tryParse(String number) {\r\n\t\ttry {\r\n\t\t\treturn Integer.parseInt(number);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tthrow new java.lang.Error(\"Could not convert input to integer.\");\r\n\t\t}\r\n\t}", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic boolean validate(String num) {\n\t\treturn false;\r\n\t}", "private void numberPressed(String number){\n String value1;\n String value2;\n if (operatorPressed == true){\n txtBox.setText(\"\");\n operatorPressed = false;\n equals = false;\n value1 = txtBox.getText();\n }\n else if (equals == true){\n txtBox.setText(\"\");\n equals = false;\n value1 = txtBox.getText();\n }\n else{\n value1 = txtBox.getText();\n }\n value2 = value1 + number;\n\n // try catch block to validate number entered into textbox\n try {\n txtBox.setText(value2);\n test = Double.parseDouble(txtBox.getText());\n }\n catch (NumberFormatException nfe){\n if (nfe.getMessage().equals(\"multiple points\")){\n msgMessage.showMessageDialog(this, \"The number contains multiple decimal points\", \"Decimal Points Error\", javax.swing.JOptionPane.ERROR_MESSAGE);\n }\n else {\n msgMessage.showMessageDialog(this, \"You have not entered a valid number\", \"Number Format Exception Caught\", javax.swing.JOptionPane.ERROR_MESSAGE);\n } \n }\n \n }", "public boolean validateFieldInput(String input) {\n\t\tboolean valid = false;\n\t if (input.matches(\"^[0-9]{1,8}([.][0-9]{1,4})?$\") && Double.valueOf(input) >0.0) {\n\t \t\n\t \tvalid = true;\n\t }\n\t \n\t return valid;\n\t}", "private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }", "private boolean isNumber(char input) {\n\t\tboolean isNumber = false;\n\t\t\n\t\tif((input >= 48) && (input <= 57))\n\t\t{\n\t\t\tisNumber = true;\n\t\t}\n\t\telse if((input >= 65) && (input <= 70))\n\t\t{\n\t\t\tisNumber = true;\n\t\t}\n\t\t\n\t\t\n\t\treturn isNumber;\n\t}", "public static boolean IsNumber(double par_Number) {\n return true;\n }", "public static boolean IsNumber(int par_Numer) {\n return true;\n }", "public String validateNumberString() {\n String tempNumber = numberString;\n int start = 0;\n Pattern pattern = Pattern.compile(\"\\\\D+\");\n Matcher matcher = pattern.matcher(tempNumber);\n if (isZero()) {\n return \"0\";\n }\n if (isNegative()) {\n start++;\n }\n if (matcher.find(start)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n pattern = Pattern.compile(\"([1-9][0-9]*)\");\n matcher.usePattern(pattern);\n if (!matcher.find(0)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n return tempNumber.substring(matcher.start(), matcher.end());\n }", "private static double getNumber() {\n double number;\n\n // Repeat reading until the user enters a valid number.\n while (true) {\n try {\n number = scanner.nextDouble();\n scanner.nextLine(); // Remove \\n from the scanner.\n break;\n } catch (java.util.InputMismatchException ex) {\n System.out.println(\"Enter double\");\n scanner.nextLine(); // Remove invalid data from the scanner.\n }\n }\n\n return number;\n }", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void handleNumbers() {\n // TODO handle \"one\", \"two\", \"three\", etc.\n }", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tboolean check = true;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0) {\r\n\t\t\t\t\tnum = Math.abs(num);\r\n\t\t\t\t}\r\n\t\t\t\tcheck = false;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t\t\t// hvatanje greske i ispis da je unos pogresan\r\n\t\t\t\tSystem.out.println(\"You know it's wrong input, try again mate:\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (check);\r\n\t\treturn num;\r\n\t}", "private void handleNumber() {\n while (isDigit(peek())) {\n advance();\n }\n\n // Look for decimals; Will be allowing extension calls like 140.abs() so make sure it's a numerical decimal\n if (peek() == '.' && isDigit(peekFurther(1))) {\n\n // Consume the decimal\n advance();\n\n // Consume the digits following the decimal\n while (isDigit(peek())) {\n advance();\n }\n }\n\n addToken(NUMBER, Double.parseDouble(source.substring(start, current)));\n }", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "private boolean isInteger(String value){\n try{\n Integer.parseInt(value);\n }catch(NumberFormatException exc)\n {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Не верно указано затраченное время!\");\n alert.setHeaderText(null);\n alert.setContentText(\"Введите целое число затраченного времени!\\nЗатраченное время не может превышать 2147483647 (245000 лет)!\");\n alert.showAndWait();\n return false;\n }\n return true;\n }", "private boolean isNotNumeric(String s) {\n return s.matches(\"(.*)\\\\D(.*)\");\n }", "public static boolean isNumeric(String input) {\n\t\ttry {\n\t\t\tInteger.parseInt(input);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\t// string is not numeric\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean containsOnlyNumbers(String inputString)\r\n {\r\n inputString = inputString.trim();\r\n if (inputString.equals(null))\r\n return false;\r\n else\r\n for (int i = 0; i < inputString.length(); i++)\r\n if (!(inputString.charAt(i) >= '0' && inputString.charAt(i) <= '9'))\r\n return false;\r\n return true;\r\n }", "private boolean isNumber(char c){\n if(c >= 48 && c < 58)\n return true;\n else{\n return false;\n }\n }", "public static boolean isNumber(String input) {\n boolean hasDecimal = false;\n for (int i = 0; i < input.length(); i++) {\n char test = input.charAt(i);\n if (test == '-' && i == 0)\n continue; // Allow negative indicator.\n\n if (test == '.') {\n if (!hasDecimal) {\n hasDecimal = true;\n continue;\n } else {\n return false; // Multiple decimal = invalid number.\n }\n }\n\n if (!Character.isDigit(test))\n return false; // Character isn't a digit, so it can't be a number.\n }\n\n return true;\n }", "private void processNumber() {\r\n\t\tString number = extractNumber();\r\n\r\n\t\tif ((!number.equals(\"1\")) && (!number.equals(\"0\"))) {\r\n\t\t\tthrow new LexerException(String.format(\"Unexpected number: %s.\", number));\r\n\t\t}\r\n\r\n\t\ttoken = new Token(TokenType.CONSTANT, number.equals(\"1\"));\r\n\t}", "public boolean checkInput(String str)\n {\n try\n {\n Integer.parseInt(str);\n } \n catch(NumberFormatException ex)\n {\n return false;\n } \n return true;\n }", "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }", "private void errorCheck(String nonterminal, int number) {\r\n if (nonterminal == null || !isNonTerminal(nonterminal) || number < 0) {\r\n throw new IllegalArgumentException();\r\n }\r\n }", "public static int inputMes(){\r\n Scanner sc = new Scanner(System.in);\r\n \r\n // creamos while-loop, si el formato del numero es incorrecto la pregunta se repute\r\n while(true){\r\n System.out.print(\"Intoduce un mes en formato numerico: \");\r\n \r\n // ponems InputMismactException si el usuario no introduce el numero entero\r\n try{\r\n mes = sc.nextInt();\r\n return mes;\r\n }\r\n \r\n catch(InputMismatchException ex){\r\n System.out.println(\"Formato incorrecto!\");\r\n sc.nextLine();\r\n } \r\n }\r\n }", "private boolean isNumberAhead() {\r\n\t\treturn Character.isDigit(expression[currentIndex]);\r\n\t}", "@Test\n\tpublic void testNumberType() throws Exception {\n\t\tassertThat(0, is(0));\n\t}", "public String checkFormat() {\r\n\t\t\r\n\t\tString msg = null;\r\n\t\t\r\n\t\ttry {\t\t\t\t\t\t\t\t\t\t\t//input is not a number\r\n\t\t\t\r\n\t\t\tDouble.parseDouble(price.getText());\r\n\t\t\tInteger.parseInt(quantity.getText());\r\n\t\t\t \r\n\t\t}\r\n\t\t\r\n\t\tcatch(Exception e) {\r\n\t\t\t\r\n\t\t\treturn msg = \"Data format is invalid\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(name.getText().isEmpty() \t\t\t\t\t//wine name is empty\r\n\t\t\t\t|| name.getText().length() > 30\t\t\t//wine name is more than 30 letters\r\n\t\t\t\t\t|| quantity.getText().isEmpty()\t\t//quantity is empty\r\n\t\t\t\t\t\t||price.getText().isEmpty()\t\t//price is empty\r\n\t\t\t\t\t\t\t||((!(price.getText().length() - price.getText().indexOf('.') == 3))\t//price is not two decimal spaces \r\n\t\t\t\t\t\t\t\t\t&& price.getText().indexOf('.') != -1))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tmsg = \"Data format is invalid\";\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tmsg = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn msg;\r\n\t\t\r\n\t}", "public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }", "static void myMethod(){\r\n\t\t\r\n\t\tSystem.out.println(\"enter a divisor : \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint value = sc.nextInt();\r\n\t\tif(value==0){\r\n\t\t\ttry {\r\n\t\t\t\tthrow new DivideByZeroException();\r\n\t\t\t} catch (DivideByZeroException e) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t\tSystem.out.println(\"Divisor cant be 0.\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tSystem.out.println(10/value);\r\n\t\t}\r\n\t}", "private boolean isLegalNumChar(char c) {\n return c == '-'\n || c == '+'\n || (c >= '0' && c <= '9')\n || c == 'e'\n || c == 'E'\n || c == '.';\n }", "@Override\n public String checkRule() {\n if (line.matches(\"^\\\\D+$\")) {\n return (\"Complies rule 'Has no numbers' \\n\");\n } else {\n return \"\";\n }\n }", "public int checkValidate() {\n while (true) {\n if (scanner.hasNextInt()) {\n // Get input from user\n int choice = scanner.nextInt();\n scanner.nextLine(); // Remove enter key\n return choice; // Return choice\n } else {\n // Show out error if not an interger number\n System.out.println(\"Your inputted not an integer number!\");\n System.out.print(\"Choice again: \"); // Retype\n scanner.next();\n }\n }\n }", "public static void stinException(String nameField,Editable number) throws Exceptions {\n if(nameField.equals(\"stock\") && number.toString().isEmpty()){\n numberObtained=0;\n }\n if(nameField.equals(\"stock\") && number.toString().isEmpty()==false) {\n try {\n if (Integer.parseInt(number.toString()) < 0) {\n throw new Exceptions(\"You need to insert positive integer numbers\");\n }\n } catch (Exception e) {\n throw new Exceptions(\"Insert correctly the number of the stock\");\n }\n }\n try {\n if (nameField.equals(\"cost\") && Double.parseDouble(number.toString()) <= 0) {\n throw new Exceptions(\"You need to insert positive decimal numbers\");\n }\n }catch (Exceptions fs){\n throw new Exceptions(\"You need to insert positive decimal numbers\");\n }catch (Exception e){\n throw new Exceptions(\"The cost is a decimal number\");\n }\n\n\n }", "private int receiveNumberInput() {\n int number;\n while (true) {\n try {\n String temp = userInput.nextLine();\n number = Integer.parseInt(temp);\n break;\n } catch (NumberFormatException e) {\n System.out.println(\"Invalid Input. Please enter a valid number.\");\n continue;\n }\n\n }\n return number;\n }", "public boolean validateStringIsNumericAndPositive(String numberAsString, String fieldName)\n { //if text field is empty, then execute statement\n if(numberAsString.isEmpty())\n { //display alert message\n propertyAlert.createAlert(\"you must enter a \" + fieldName + \"!\");\n //return false\n return false;\n }//end of if\n \n //declare variable\n double number;\n \n //try block to check if the text field input is a number \n try\n { /*REFERENCE:\n https://www.w3schools.com/java/java_type_casting.asp\n */\n //assign a value to variable\n /*I am passing numberAsString as a double type so I can use:\n Widening Casting (automatically) - converting a smaller type to a larger type size\n if a numberAsString is a int type */\n number = Double.parseDouble(numberAsString);\n }//end of try block\n //catch NumberFormatException exception \n catch(NumberFormatException ex)\n { //display alert\n propertyAlert.createAlert(fieldName + \" must contain numbers only!\");\n //return false\n return false;\n }//end of catch \n \n //if number is a negative number, then execute statement\n if(number < 0d)\n { //display alert\n propertyAlert.createAlert(\"You cannot enter a negative number\");\n //return false\n return false;\n }//end of if\n //return true\n return true;\n }", "private int validateIntegerInput(int input) {\n if (input < 1 ) {\n input = -1;\n }\n return input;\n }", "private String isValid(String number)\n {\n\tif(number.matches(\"\\\\d+\")) return number;\n\treturn null;\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "public void invalid() {\r\n\t\tSystem.out.println(\"Please enter a valid input\");\r\n\t}", "private boolean isInt(String num) {\n boolean isInt;\n try {\n Integer.parseInt(num);\n isInt = true;\n } catch (Exception e) {\n isInt = false;\n }\n return isInt;\n }", "Boolean isNumeric(PrintWriter out, String strNum);", "public static int getNumber(){\r\n\t\tint number=0;\r\n\t\twhile(true){\r\n\t\t\tString value = \"\" + input.next().charAt(0);\r\n\t\t\tif(Character.isDigit(value.charAt(0))){\r\n\t\t\tnumber = Integer.parseInt(value);\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Incorrect input! try again.\");\r\n\t\t}\r\n\t\treturn number;\r\n\t}", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private static String validateNumber(String number) {\r\n\r\n\t\t/*Checking if the number is null, or if its length is not equals to 16\r\n\t\t * or if the first two digits are not between 51 and 55.\r\n\t\t * If one of the following is not respected, an Illegal Argument\r\n\t\t * Exception with an appropriate message will be thrown.\r\n\t \t */\r\n\t\ttry{\r\n\t\t\tif (number == null \r\n\t\t\t\t\t|| number.length() != 16 \r\n\t\t\t\t\t|| Integer.parseInt(number.substring(0, 2)) < 51\r\n\t\t\t\t\t|| Integer.parseInt(number.substring(0, 2)) > 55)\r\n\t\t\tthrow new IllegalArgumentException(\"The Master card given does not respect the validation.\");\r\n\t\t}catch(NumberFormatException npe){\r\n\t\t\tthrow new IllegalArgumentException(\"The Master card given does not respect the validation.\");\r\n\t\t} \r\n\t\treturn number;\r\n\t}", "private void validateValue()\r\n {\r\n try\r\n {\r\n Long.parseLong(getText());\r\n }\r\n catch (NumberFormatException ex)\r\n {\r\n setText(\"\");\r\n }\r\n \r\n }", "private int getNumber() {\n while (!scanner.hasNextInt()) {\n scanner.nextLine();\n System.out.print(\"Please, Enter a munber : \");\n }\n return scanner.nextInt();\n }", "public static int integerValidation() {\n\t\tboolean flag = true;\n\t\tint input = 0;\n\t\tString temp = \"\";\n\t\twhile (flag) {\n\t\t\ttry {\n\t\t\t\ttemp = in.nextLine().trim();\n\t\t\t\tinput = Integer.parseInt(temp);\n\t\t\t\tflag = false;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Please Enter a valid input\");\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "private int errorCheckingInt(String display) {\n\n\t\tint tempChoice;\n\t\tScanner input = new Scanner(System.in);\n\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"\\n\" + display);\n\t\t\ttry {\n\t\t\t\ttempChoice = input.nextInt();\n\t\t\t\tif(display.equals(\"Enter number of kids: \")) { //only for kids\n\t\t\t\t\tif(tempChoice < 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\t}\n\t\t\t\telse if (tempChoice < 1)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\tbreak;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Error input \\n\");\n\t\t\t\tinput.next();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t}\n\n\t\tinput.nextLine();\n\n\t\treturn tempChoice;\n\t}", "private static boolean isNumeric(String str)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdouble d = Double.parseDouble(str);\n\t\t}\n\t\tcatch (NumberFormatException nfe)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.71490943", "0.69270575", "0.69073236", "0.69034827", "0.6897848", "0.68222064", "0.68073887", "0.6741084", "0.6729305", "0.65663826", "0.65601677", "0.6489245", "0.6487806", "0.648148", "0.64604586", "0.6457289", "0.64529175", "0.6452798", "0.6447044", "0.6438005", "0.6437877", "0.63845557", "0.6314803", "0.6296995", "0.6294518", "0.6279332", "0.62621856", "0.6251108", "0.6215244", "0.62080264", "0.6202195", "0.6199614", "0.61897343", "0.6183366", "0.6181585", "0.6148334", "0.6141414", "0.6126497", "0.6124416", "0.61188614", "0.6111262", "0.6106166", "0.61050975", "0.6083955", "0.60776895", "0.6077119", "0.60691494", "0.6057864", "0.6052875", "0.6048909", "0.6045885", "0.6043698", "0.6034047", "0.6031867", "0.6027451", "0.6013074", "0.6009445", "0.60047555", "0.59857935", "0.5975938", "0.5971846", "0.59682375", "0.5967708", "0.5963642", "0.5955837", "0.5949634", "0.59432864", "0.5935637", "0.5933045", "0.5930978", "0.5927675", "0.5924466", "0.5907009", "0.59064233", "0.58967596", "0.58829457", "0.58681285", "0.5863235", "0.5860991", "0.5848984", "0.5841328", "0.5836513", "0.58362186", "0.58328897", "0.5832076", "0.583202", "0.5824325", "0.5809361", "0.5798364", "0.57951653", "0.5793071", "0.5790726", "0.57843673", "0.57657045", "0.57615453", "0.5760419", "0.5758443", "0.57563436", "0.5754337", "0.57490164", "0.57471085" ]
0.0
-1
skip specVersion == 1.0
@Test public void testExpand() { assumeFalse(Version.V1_0.equals(testCase.options.specVersion)); try { (new JsonLdTestRunnerJunit(testCase)).execute(options -> JsonLd.expand(testCase.input).options(options).get() ); } catch (JsonLdError e) { Assert.fail(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testGetSpecVersion() {\n assertEquals(mb.getSpecVersion(), System\n .getProperty(\"java.vm.specification.version\"));\n }", "public void testGetSpecVendor() {\n assertEquals(mb.getSpecVendor(), System\n .getProperty(\"java.vm.specification.vendor\"));\n }", "@Test\n public void testCreateLatestMajorOnPreviousMajorIfItFailsOnMajorVersion8() {\n deployWithModelForLatestMajorVersionFailing(8);\n }", "protected void skipTestIfScopesNotSupported() {\n\t}", "@Test\n\tpublic void testVersionCheck() throws Exception{\n\t}", "public void testGetManagementSpecVersion() {\n String specVersion = mb.getManagementSpecVersion();\n assertNotNull(specVersion);\n assertTrue(specVersion.length() > 0);\n }", "private boolean isBadVersion(int version) {\n return false;\n }", "@Test\n public void versionTest() {\n // TODO: test version\n }", "protected void skipTestIfSigningAlgorithmNotSupported() {\n\t}", "@Override\n public void checkVersion() {\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Test(enabled = true)\r\n\tpublic void PrepareSpecification() {\r\n\t\tRequestSpecBuilder rsb = new RequestSpecBuilder();\r\n\t\trsb.addHeader(\"content-type\",\"application/json\");\r\n\t\trsb.addQueryParam(\"page\", \"2\");\r\n\t\trsb.setBaseUri(\"https://reqres.in/\");\r\n\t\tRequestSpecification reqSpec = rsb.build();\r\n\r\n\t\t/**\r\n\t\t * Step 2: Asserting response\r\n\t\t */\r\n\t\tgiven()\r\n\t\t.spec(reqSpec)\r\n\t\t.when()\r\n\t\t.get(\"api/users\").then().assertThat().statusCode(200);\r\n\r\n\t}", "boolean isBadVersion(int version) {\n return true;\n }", "public void skipVerify() {\n\tskipVerify = true;\n }", "@Before\n public void setUp() {\n Assume.assumeThat(JavaVersion.getMajorVersion(), Matchers.lessThanOrEqualTo(8));\n }", "@Test\n public void testConfigurationDeclarationIsReservedOptional()\n {\n checkOldReservedAttribute(\"optional\");\n }", "public void setSpec(String spec) {\n this.spec = spec;\n }", "@Test(dependsOnMethods = \"testUpdateCertificate\")\n public void testUpdateCertificateVersion() {\n throw new SkipException(\"bug in requirements for function\");\n }", "public int getSpecVersion() {\r\n return specVersion;\r\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@Test\n public void testPermitUpgradeUberNew() {\n assertFalse(underTest.permitCmAndStackUpgrade(\"2.2.0\", \"3.2.0\"));\n\n assertFalse(underTest.permitExtensionUpgrade(\"2.2.0\", \"3.2.0\"));\n }", "public static final boolean shouldUseVersions() {\n return true;\n }", "@Test\r\n \tpublic void testGetBaseVersion() {\n \t\tESPrimaryVersionSpec version = localProject.getBaseVersion();\r\n \t\tassertNull(version);\r\n \t}", "@Test @SpecAssertion(id = \"432-A2\", section=\"4.3.2\")\n public void testConversionComparedWithRate(){\n Assert.fail();\n }", "public void testGetSpecName() {\n assertEquals(mb.getSpecName(), System\n .getProperty(\"java.vm.specification.name\"));\n }", "public void testVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1,1.5)\\\"\" , TEST_IMPORT_SYM_NAME + \"_1.1.0\");\n\t}", "@Override\n\tpublic void skip() {\n\t}", "@Override\n\tpublic boolean getCheckOlderVersion()\n\t{\n\t\treturn false;\n\t}", "@Stub\n\tpublic void before()\n\t{\n\t\t//\n\t}", "@Test\n public void testWantedVersionIsRequiredAlsoWhenThereIsAnOlderMajorThatDoesNotFailModelBuilding() {\n int oldMajor = 7;\n int newMajor = 8;\n Version wantedVersion = new Version(newMajor, 1, 2);\n Version oldVersion = new Version(oldMajor, 2, 3);\n List<Host> hosts = createHosts(9, oldVersion.toFullString());\n\n CountingModelFactory oldFactory = createHostedModelFactory(oldVersion);\n ModelFactory newFactory = createFailingModelFactory(wantedVersion);\n List<ModelFactory> modelFactories = List.of(oldFactory, newFactory);\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n\n // Not OK when failing version is requested.\n assertEquals(\"Invalid application\",\n assertThrows(IllegalArgumentException.class,\n () -> tester.deployApp(\"src/test/apps/hosted/\", wantedVersion.toFullString()))\n .getMessage());\n\n // OK when older version is requested.\n tester.deployApp(\"src/test/apps/hosted/\", oldVersion.toFullString());\n assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());\n\n // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background\n assertTrue(oldFactory.creationCount() > 0);\n }", "protected void assertNoTESpec() {\n\t\tassertFalse(\"A TE spec was generated, but it shouldn't\", \n\t\t\trecorder.recorded(EC.TLC_TE_SPEC_GENERATION_COMPLETE));\n\t}", "@Test\n\tpublic void testGetDriverExcludeAllocations(){ \n\t\tassertNotNull(driverService.getDriverExcludeAllocations(239537L)); \n\t}", "@Test(expected = Exception.class)\n public void testDescUnSuportedContext() throws Throwable\n {\n testDescDeployment(\"unsupported\");\n }", "@Ignore(\"test in testPGNT0102002, testPGNT0101001, testPGNT0101002\")\n public void testDAM30507001() {\n }", "@Test\n public void requestFormatIncreased() {\n assertOpenApiBackwardIncompatible(BASE, \"bc_request_schema_format_increased.yaml\");\n }", "@Test\n public void appVersionTest() {\n // TODO: test appVersion\n }", "@Test\n\tpublic void testGetSparePartSpec() {\n\t\t\t\n\t\tassertTrue(spReg.getSparePartSpecification(\"1\") != null);\n\t\t\n\t\t//fail(\"Not yet implemented\");\n\t}", "@Test\n public void testSemanticVersion_withBuildMetadata() throws Exception{\n SemanticVersion version = SemanticVersion.createFromVersionString(\"1.2.3+ignore.me.plz\");\n assertThat(version.majorVersion()).isEqualTo(1);\n assertThat(version.minorVersion()).isEqualTo(Optional.of(2));\n assertThat(version.patchVersion()).isEqualTo(Optional.of(3));\n }", "@Override\n\t\tprotected void loadSpecification(SpecificationContext context) {\n\t\t}", "public void setSpecification(String specs) {\n specification = specs;\n }", "@Ignore\n public void testDisapproveReason() throws Exception {\n\n }", "@Test\n public void ncitVersionTest() {\n // TODO: test ncitVersion\n }", "@Test\n public void apiVersionTest() {\n // TODO: test apiVersion\n }", "@Override\n public void onNoNewVersionDetected() {\n\n }", "public static void crdHasV1Beta2Only(KubernetesClient client) {\n for (String kind : AbstractCommand.STRIMZI_KINDS) {\n String crdName = CrdUpgradeCommand.CRD_NAMES.get(kind);\n CustomResourceDefinition crd = client.apiextensions().v1beta1().customResourceDefinitions().withName(crdName).get();\n\n if (kind.equals(\"KafkaTopic\") || kind.equals(\"KafkaUser\")) {\n // KafkaTopic and KafkaUser resources have even in CRD v1 also the old versions v1alpha1 and v1beta1.\n // This is in order to allow smooth migration for the Topic and User Operators without users or topics\n // deleted when the CRDs are upgraded from apiextensions/v1beta1 to apiextensions/v1.\n assertThat(crd.getSpec().getVersions().size(), is(3));\n assertThat(crd.getSpec().getVersions().stream().map(CustomResourceDefinitionVersion::getName).collect(toList()), containsInAnyOrder(\"v1alpha1\", \"v1beta1\", \"v1beta2\"));\n } else {\n assertThat(crd.getSpec().getVersions().size(), is(1));\n assertThat(crd.getSpec().getVersions().stream().map(CustomResourceDefinitionVersion::getName).collect(toList()), contains(\"v1beta2\"));\n }\n }\n }", "private boolean isBadVersion(int n) {\n\t\treturn false;\n\t}", "@Ignore\n @Test\n public void discoverNoTypes() throws Exception {\n }", "public void testIgnore() {\n final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);\n settings.addIgnoredBuildNumber(\"95.627\");\n //first time load\n UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString(\"IU-95.429\"), UpdatesInfoXppParserTest.InfoReader.read(\"idea-new9eap.xml\"), settings);\n\n final CheckForUpdateResult result = strategy.checkForUpdates();\n Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());\n final BuildInfo update = result.getNewBuildInSelectedChannel();\n Assert.assertNull(update);\n }", "@Test\n public void testNoWarningOnDeprecatedPrototype() {\n testSame(\n \"/** @constructor */ var Foo = function() {};\"\n + \"/** @deprecated */ Foo.prototype = {};\"\n + \"Foo.prototype.bar = function() {};\");\n }", "private static FaultyVersion createDummyVersion1() {\n\t\t/**\tzur Initialisierung der Coverage arrays in der TestCase Klasse wird auf\n\t\t * \tFaultyProjectGlobals.methodsCount zugegriffen\t*/\n\t\tFaultyProjectGlobals.methodsCount = 8;\n\t\t\n\t\tTestCase[] failures = new TestCase[6];\n\t\tfailures[0] = new TestCase(\"Test-A-Fail\", false, new Boolean[] {true, false, true, false, true, false, true, false});\n\t\tfailures[1] = new TestCase(\"Test-B-Fail\", false, new Boolean[] {true, false, true, false, true, false, true, false});\n\t\tfailures[2] = new TestCase(\"Test-C-Fail\", false, new Boolean[] {false, true, false, true, false, true, true, true});\n\t\tfailures[3] = new TestCase(\"Test-D-Fail\", false, new Boolean[] {false, false, false, false, false, false, true, true});\n\t\tfailures[4] = new TestCase(\"Test-E-Fail\", false, new Boolean[] {false, true, false, true, true, true, false, false});\n\t\tfailures[5] = new TestCase(\"Test-F-Fail\", false, new Boolean[] {false, true, true, true, true, true, false, false});\n\t\t\n\t\tTestCase[] passedTCs = new TestCase[8];\n\t\tpassedTCs[0] = new TestCase(\"Test-G-Success\", true, new Boolean[] {false, false, false, false, true, true, true, true});\n\t\tpassedTCs[1] = new TestCase(\"Test-H-Success\", true, new Boolean[] {true, false, true, false, false, false, false, true});\n\t\tpassedTCs[2] = new TestCase(\"Test-I-Success\", true, new Boolean[] {true, true, false, true, false, true, true, true});\n\t\tpassedTCs[3] = new TestCase(\"Test-J-Success\", true, new Boolean[] {false, false, false, true, true, true, false, true});\n\t\tpassedTCs[4] = new TestCase(\"Test-K-Success\", true, new Boolean[] {false, true, true, false, false, true, false, false});\n\t\tpassedTCs[5] = new TestCase(\"Test-L-Success\", true, new Boolean[] {true, false, true, true, true, true, false, false});\n\t\tpassedTCs[6] = new TestCase(\"Test-M-Success\", true, new Boolean[] {true, true, true, false, true, true, true, true});\n\t\tpassedTCs[7] = new TestCase(\"Test-N-Success\", true, new Boolean[] {false, false, false, true, false, false, true, true});\n\t\treturn new FaultyVersion(failures, passedTCs, \"dummyVersion-1\", 8);\n\t}", "@Test\n public void patchNoOp() throws Exception {\n\n }", "public void onTestSkipped() {}", "@BeforeClass\n static public void _preconditionJavaVersion() {\n Assume.assumeTrue(\"Java6 is not supported\", !System.getProperty(\"java.version\",\n \"NA\").startsWith(\"1.6\"));\n }", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "@Ignore\n @Test\n public void discoverOneTypes() throws Exception {\n }", "public int getVersion() { return 1; }", "@Test @SpecAssertion(id = \"432-A1\", section=\"4.3.2\")\n public void testConversion(){\n Assert.fail();\n }", "public void testMandatoryAttributeConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";prop=val\", TEST_IMPORT_SYM_NAME + \"_1.6.0\");\n\t}", "@BeforeTest\r\n\tpublic void checkTestSkip(){\r\n\t\t\t\t\r\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suite_cart_xls,this.getClass().getSimpleName())){\r\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\r\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\r\n\t\t\t\t}\r\n\trunmodes=TestUtil.getDataSetRunmodes(suite_cart_xls, this.getClass().getSimpleName());\t\r\n\t\t\t}", "@Override\r\n\t\tprotected boolean skipInitialType() {\r\n\t\t\treturn false;\r\n\t\t}", "@Test\n public void noProfile() {\n Properties props = new Properties();\n props.setProperty(DeploymentDescriptorConfiguration.MODULE_NAME, \"com.alipay.dal\");\n assertThat(sofaModuleProfileChecker.acceptModule(SampleDeploymentDescriptor.create(props)))\n .isTrue();\n }", "public void testBSNAndVersionConstrainedDynamicImport() throws Exception {\n\t\tdoTest(\";version=\\\"[1.0,1.1)\\\";\" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + \"=\"\n\t\t\t\t+ TEST_IMPORT_SYM_NAME, TEST_IMPORT_SYM_NAME + \"_1.0.0\");\n\t}", "public Spec__1() {\n }", "@Override\n public double getVersion() {\n return 0;\n }", "@Override\n\tpublic void onConfigurationSkip(ITestResult itr) {\n\t\t\n\t}", "@Test\n @DisplayName(\"Enabled when it is built\")\n @Disabled\n @Tag(\"development\")\n void developmentTest() {\n }", "@Override\n\tpublic void testCompatibility() {\n\t\tSystem.out.println(\"compatibility test success\");\n\t}", "@Test(expected = AssertionError.class)\n public void testSchemaVersionMismatch() {\n PowerMock.replayAll();\n Map<String, String> sampleConfig = new HashMap<>();\n sampleConfig.put(SCHEMA_VERSION, \"1\");\n Map<String, Object> checkConfig = connector.config().parse(sampleConfig);\n assertEquals(2, checkConfig.get(SCHEMA_VERSION));\n PowerMock.verifyAll();\n }", "public void setSpec(String spec) {\n this.spec = spec == null ? null : spec.trim();\n }", "@Test(expected = Exception.class)\n public void testDescMixedContext() throws Throwable\n {\n testDescDeployment(\"mixed\");\n }", "@Test\n public void testSpecificationFile() {\n \texpectedExit = 0;\n \tignoreNotes = true;\n \tString subdir = \"testspecs\" + \"/\" + classname;\n \tString testname = null;\n for (File f: new File(subdir).listFiles()) {\n \tif (f.getName().startsWith(\"Test\")) {\n \t\ttestname = f.getName().replace(\".java\",\"\");\n \t\tbreak;\n \t}\n }\n \thelpTCF(subdir,subdir,testname);\n }", "@BeforeTest\n\t\t\tpublic void checkTestSkip(){\n\t\t\t\t\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suiteCxls,this.getClass().getSimpleName())){\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\n\t\t\t\t}\n\t\t\t\t\t\t}", "@Test\n\tpublic void extractVersionInfo_version0() {\n\t\tQrCodeDecoderImage<GrayU8> mock = new QrCodeDecoderImage(EciEncoding.UTF8,GrayU8.class){\n\t\t\t@Override\n\t\t\tint estimateVersionBySize(QrCode qr) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tint decodeVersion() {\n\t\t\t\treturn 8;\n\t\t\t}\n\t\t};\n\n\t\tQrCode qr = new QrCode();\n\t\tqr.version = 8;\n\t\tassertFalse(mock.extractVersionInfo(qr));\n\t\tassertEquals(-1,qr.version);\n\t}", "public String getSpec() {\n return spec;\n }", "public String getSpec() {\n return spec;\n }", "@RecentlyNullable\n/* */ public String getWidgetVersion() {\n/* 57 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void removeSpecification() {\n simSpec = null;\n }", "@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }", "@Override\n public boolean isVersionCodeCompatible(int version) {\n return true;\n }", "public SpecValidator() {\n\t\tsuper();\n\t}", "@Override\npublic void onTestSkipped(ITestResult result) {\n\t\n}", "@Test\n public void testCase4() {\n throw new SkipException(\"Skipping test case\"); \n }", "@Override\n public void onTestSkipped(ITestResult result) {\n\n }", "@Override\n public void onTestSkipped(ITestResult result) {\n\n }", "public void testSoThatTestsDoNotFail() {\n\n }", "@Test\n public void productSpecificationTest() {\n // TODO: test productSpecification\n }", "@Test\n\tpublic void testDiffLibs() \n\t{\n\t\tString id = \"diffLib\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertLCVol2NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t}", "@Override\n public boolean preconditionsSatisfied() {\n return true;\n }", "@Test\n public void testMinimumCloudSdkVersion() {\n assertTrue(CloudSdk.MINIMUM_VERSION.getMajorVersion() > 170);\n }", "@Disabled\n @Test\n void processDepositValidatorPubkeysDoesNotContainPubkeyAndMinEmptyValidatorIndexIsNegative() {\n }", "@Test\n\tpublic void testReasonerVersionOld() throws Exception {\n\t\tIPRProof proof1 = prRoot.createChild(IPRProof.ELEMENT_TYPE, null, null);\n\n\t\tfinal IProofTree proofTree = makeVersionProof(OLD_VERSION, IConfidence.DISCHARGED_MAX);\n\t\tfinal IProofTree expectedDeserialized = makeVersionProof(OLD_VERSION, IConfidence.UNCERTAIN_MAX);\n\t\tcheckProofTreeSerialization(proof1, proofTree, expectedDeserialized, true);\n\t\t// check stability for deserialized proof tree\n\t\tcheckProofTreeSerialization(proof1, expectedDeserialized, true);\n\t}", "public void testMissingDirectiveSpecification() throws Exception {\n File file = getResourceFile(\"/testdata/javascript/testMissingDirectiveSpecification.js\");\n DirectiveBasedJavascriptGroup jg = new DirectiveBasedJavascriptGroup(\"testDummy\", file.getParentFile(),\n file.getName(), ImmutableList.<DirectiveType<?>> of(DirectiveFactory.getMockDirective()),\n EnumSet.of(JavascriptGeneratorMode.TESTING));\n DirectiveParser dp = new DirectiveParser(jg, jg.getStartFile());\n dp.parseFile();\n List<JavascriptProcessingError> error = dp.validate(new JavascriptValidator());\n assertTrue(\"Should have thrown one error for unrecognized directive\", error.size() == 1);\n }", "@Override\r\npublic void onTestSkipped(ITestResult arg0) {\n\t\r\n}", "@Test\n public void testReportIteration_noIterationSet() throws Throwable {\n ArgumentCaptor<Description> captor = ArgumentCaptor.forClass(Description.class);\n RunNotifier notifier = mock(RunNotifier.class);\n mRunner = spy(new LongevityClassRunner(NoOpTest.class));\n mRunner.run(notifier);\n verify(notifier).fireTestStarted(captor.capture());\n Assert.assertFalse(\n \"Description class name should not contain the iteration number.\",\n captor.getValue()\n .getClassName()\n .matches(\n String.join(\n LongevityClassRunner.ITERATION_SEP_DEFAULT,\n \"^.*\",\n \"[0-9]+$\")));\n }", "@Test\n public void testCanRun() {\n final int oldestSupported = AccumuloDataVersion.ROOT_TABLET_META_CHANGES;\n final int currentVersion = AccumuloDataVersion.get();\n IntConsumer shouldPass = ServerContext::ensureDataVersionCompatible;\n IntConsumer shouldFail = v -> assertThrows(IllegalStateException.class,\n () -> ServerContext.ensureDataVersionCompatible(v));\n IntStream.rangeClosed(oldestSupported, currentVersion).forEach(shouldPass);\n IntStream.of(oldestSupported - 1, currentVersion + 1).forEach(shouldFail);\n }", "public Spec() {\n super();\n // TODO Auto-generated constructor stub\n }", "@Override\n\tpublic boolean shouldSkipClass(Class<?> classe) {\n\t\t\n\t\t \n\t\treturn false;\n\t}", "@java.lang.Override\n public boolean hasAppEngineVersion() {\n return stepInfoCase_ == 22;\n }", "@Override\r\n\tpublic String getVersion() {\r\n\t\treturn \"1.0.5\";\r\n\t}", "@Override\n public boolean isSkipTests() {\n return skipTests;\n }", "private void reloadVersion2(BufferedReader in)\n throws ReloadFault, IOException {\n String line;\n\n // look for optional checksum and then test description,\n // skipping comments\n while ((line = in.readLine()) != null) {\n if (line.equals(JTR_V2_TESTDESC)) {\n break;\n }\n //else if (line.startsWith(JTR_V2_CHECKSUM)) {\n //checksumText = line.substring(JTR_V2_CHECKSUM.length());\n //}\n else if (!line.startsWith(\"#\")) {\n throw new ReloadFault(i18n, \"rslt.badLine\", line);\n }\n }\n\n // this probably won't work with a normal Properties object\n String[] tdProps = PropertyArray.load(in);\n\n if (desc == null) {\n uniquifyStrings(tdProps);\n desc = TestDescription.load(tdProps);\n }\n tdProps = null; // dump it\n\n // XXX compare to TD\n\n // remove comment lines and look for test env props\n while ((line = in.readLine()) != null) {\n if (line.startsWith(JTR_V2_RESPROPS)) {\n break;\n } else if (line.startsWith(JTR_V2_ENVIRONMENT)) {\n env = PropertyArray.load(in);\n uniquifyStrings(env);\n } else if (!line.startsWith(\"#\")) {\n throw new ReloadFault(i18n, \"rslt.badLine\", line);\n }\n }\n\n if (env == null) {\n env = new String[]{};\n }\n\n if (line == null) {\n throw new ReloadFault(i18n, \"rslt.badFormat\");\n }\n\n String[] trProps = PropertyArray.load(in);\n\n if (props == null) {\n // restore the properties of this result\n uniquifyStrings(trProps);\n props = trProps;\n }\n\n trProps = null; // dump it\n\n // read the sections\n int sectionCount = parseSectionCount(PropertyArray.get(props, SECTIONS));\n sections = new Section[sectionCount];\n for (int i = 0; i < getSectionCount(); i++) {\n sections[i] = new Section(in);\n }\n\n // get the final test status\n while ((line = in.readLine()) != null) {\n if (line.startsWith(JTR_V2_TSTRESULT)) {\n execStatus = Status.parse(line.substring(JTR_V2_TSTRESULT.length()));\n break;\n }\n }\n\n if (execStatus == null) {\n execStatus = Status.error(\"NO STATUS RECORDED IN FILE\");\n }\n\n // checksum support removed\n checksumState = NO_CHECKSUM;\n }" ]
[ "0.612285", "0.6046229", "0.5813729", "0.57422006", "0.5681015", "0.56251967", "0.5588215", "0.5565455", "0.55574316", "0.5552418", "0.5533348", "0.5532751", "0.54876775", "0.5468944", "0.5467197", "0.54657084", "0.5427099", "0.54181725", "0.5416291", "0.54080784", "0.5405803", "0.5387077", "0.5383878", "0.5380256", "0.5357792", "0.5321194", "0.5314969", "0.53103846", "0.53084207", "0.5289441", "0.5273858", "0.527367", "0.5269988", "0.52622336", "0.525083", "0.52483535", "0.52476716", "0.5246371", "0.523819", "0.52257717", "0.52117074", "0.5206115", "0.5194703", "0.51877606", "0.51857185", "0.5179319", "0.5159391", "0.515875", "0.515438", "0.5143538", "0.51294893", "0.5105458", "0.5097001", "0.5095339", "0.5093331", "0.5080832", "0.508051", "0.50701624", "0.5049246", "0.50488204", "0.50447524", "0.5042802", "0.5041664", "0.5014437", "0.50023544", "0.4995525", "0.49846536", "0.4982746", "0.49821463", "0.4977767", "0.49774218", "0.49759302", "0.49616393", "0.49476144", "0.49476144", "0.49452412", "0.4938845", "0.49371994", "0.49318916", "0.49296865", "0.49249005", "0.49160063", "0.4915312", "0.4915312", "0.49097043", "0.490636", "0.4898871", "0.48984239", "0.48871198", "0.48871106", "0.48867568", "0.48770565", "0.48737562", "0.4873565", "0.48679397", "0.48581332", "0.48545942", "0.48479158", "0.4846708", "0.48466718", "0.48462704" ]
0.0
-1
Constructor with necessary information (model, how wide and tall to draw the worksheet) to render the actual spreadsheet without the column or row labels.
WorksheetPanel(WorksheetReadOnlyModel model, Dimension frameSize) { if (model == null || frameSize == null) { throw new IllegalArgumentException("null inputs"); } this.model = model; this.frameSize = frameSize; this.setOpaque(true); this.setBackground(Color.WHITE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WorksheetBuilderImpl() {\n model = new BasicWorksheet();\n }", "@Override\n public Worksheet createWorksheet() {\n return model;\n }", "public WorksheetPanel(ReadOnlyWorksheetModel model, int rows, int cols,\n int cellWidth, int cellHeight) {\n if (model == null) {\n throw new IllegalArgumentException(\"The model cannot be null\");\n }\n\n if (cellWidth < 0 || cellHeight < 0) {\n throw new IllegalArgumentException(\"Cell width and height must be positive\");\n }\n\n if (rows < 0 || cols < 0) {\n throw new IllegalArgumentException(\"The number of rows and columns must be positive\");\n }\n\n this.model = model;\n this.horizontalScroll = 0;\n this.verticalScroll = 0;\n this.cellWidth = cellWidth;\n this.cellHeight = cellHeight;\n this.rows = rows;\n this.cols = cols;\n\n this.selected = null;\n }", "public SpreadsheetPanel(final SpreadSheet the_spreadsheet) {\r\n\t\tsuper(new GridLayout(ROWS + 1, COLUMNS + 1));\r\n\t\tmySpreadsheet = the_spreadsheet;\r\n\r\n\t\tmyRows = ROWS;\r\n\t\tmyColumns = COLUMNS;\r\n\t\tcellHeight = INIT_CELL_HEIGHT;\r\n\t\tcellWidth = INIT_CELL_WIDTH;\r\n\r\n\t\tsetPreferredSize(new Dimension(myColumns * cellWidth, myRows\r\n\t\t\t\t* cellHeight));\r\n\t\tcellArray = new CellsGUI[myRows][myColumns];\r\n\t\tinitialize();\r\n\r\n\t}", "@Override\n protected Sheet createSheet() {\n Sheet sheet = Sheet.createDefault();\n // Create a set of properties\n Sheet.Set set = Sheet.createPropertiesSet();\n\n set.put(getNameProperty());\n set.put(getMajorProperty());\n set.put(getMinorProperty());\n set.put(getPatchProperty());\n set.put(getDescriptionProperty());\n set.put( getGitProperty());\n set.put( getBranchProperty());\n\n // Add the set of properties to the sheet\n sheet.put(set);\n\n return sheet;\n }", "public Sheet createSheet() {\n\t\treturn null;\n\t}", "protected abstract void buildExcelDocument(Map<String, Object> model,\n Workbook workbook, HttpServletRequest request,\n HttpServletResponse response) throws Exception;", "private void renderTitle() {\n this.row = sheet.createRow(INT_ROW_START);\n //se crea titulos de la tabla\n this.addCell(column_++, \"CODIGO DE BARRAS\", this.cellStyleTitle());\n this.addCell(column_++, \"FECHA\", this.cellStyleTitle());\n this.addCell(column_++, \"HORA\", this.cellStyleTitle());\n this.addCell(column_++, \"MARBETE\", this.cellStyleTitle());\n this.addCell(column_++, \"PRODUCTO\", this.cellStyleTitle());\n this.addCell(column_++, \"DESCRIPCIÓN\", this.cellStyleTitle());\n this.addCell(column_++, \"LOTE\", this.cellStyleTitle());\n this.addCell(column_++, \"PESO\", this.cellStyleTitle());\n this.addCell(column_++, \"RESPONSABLE\", this.cellStyleTitle());\n }", "public NotebookCell() {}", "protected XSSFChart() {\n\t\tsuper();\n\t\tcreateChart();\n\t}", "void createWorkSheet() {\n wb = new HSSFWorkbook();\n for (int SheetNumber = 0; SheetNumber < keywords.length - 1; SheetNumber++) {\n sheet[SheetNumber] = wb.createSheet(keywords[SheetNumber]);\n // Create row at index zero ( Top Row)\n HSSFRow row = sheet[SheetNumber].createRow((short) 0);\n String[] headers = {\"Title\", \"Category\", \"Developer\", \"Description\", \"Release Date\", \"currentVersionReleaseDate\", \"Version\", \"Website\", \"Rating Counts\", \"Average User Rating\", \"Average User Rating For Current Version\", \"Market URL\", \"Size\"};\n for (int i = 0; i <= 12; i++) {\n\n HSSFCell cell = row.createCell((short) i);\n cell.setCellType(HSSFCell.CELL_TYPE_STRING);\n cell.setCellValue(headers[i]);\n excelFileCreated = false;\n }\n }\n }", "@Override\n\tprotected void buildExcelDocument(Map<String, Object> model,\n\t\t\tHSSFWorkbook workbook, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\tDate date = new Date();\n\t\tString filename = Tools.date2Str(date, \"yyyyMMddHHmmss\");\n\t\tHSSFSheet sheet;\n\t\tHSSFCell cell;\n\t\tresponse.setContentType(\"application/octet-stream\");\n\t\tresponse.setHeader(\"Content-Disposition\", \"attachment;filename=\"+filename+\".xls\");\n\t\tsheet = workbook.createSheet(\"sheet1\");\n\t\t\n\t\t//第一行表头\n\t\tPageData pdHead = (PageData) model.get(\"pdHead\");\n\t\t//第二行标题\n\t\tList<String> titles = (List<String>) model.get(\"titles\");\n\t\tint row = 0;\n\t\t\n\t\tif(StringUtil.isNotEmpty(pdHead)) {\n\t\t\tHSSFCellStyle headerStyle = workbook.createCellStyle(); //标题样式\n\t\t\theaderStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\t\theaderStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);\n\t\t\tHSSFFont headerFont = workbook.createFont();\t//标题字体\n\t\t\theaderFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);\n\t\t\theaderFont.setFontHeightInPoints((short)11);\n\t\t\theaderStyle.setFont(headerFont);\n\t\t\t\n\t\t\tCellRangeAddress region = new CellRangeAddress(row, row, (short) 0, (short) titles.size()); \n\t\t\t\n\t\t\tString title = pdHead.getString(\"name\");\n\t\t\tcell = getCell(sheet, row, 0);\n\t\t\tcell.setCellStyle(headerStyle);\n\t\t\tsetText(cell,title);\n\t\t\tshort height=25*18*2;\n\t\t\tsheet.getRow(row).setHeight(height);\n\t\t\tsheet.addMergedRegion(region);\n\t\t\t\n\t\t\trow = 1;\n\t\t}\n\t\t\n\t\t\n\t\tint len = titles.size();\n\t\tHSSFCellStyle headerStyle = workbook.createCellStyle(); //标题样式\n\t\theaderStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\theaderStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);\n\t\tHSSFFont headerFont = workbook.createFont();\t//标题字体\n\t\theaderFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);\n\t\theaderFont.setFontHeightInPoints((short)11);\n\t\theaderStyle.setFont(headerFont);\n\t\tshort width = 20,height=25*20;\n\t\tsheet.setDefaultColumnWidth(width);\n\t\tfor(int i=0; i<len; i++){ //设置标题\n\t\t\tString title = titles.get(i);\n\t\t\tcell = getCell(sheet, row, i);\n\t\t\tcell.setCellStyle(headerStyle);\n\t\t\tsetText(cell,title);\n\t\t}\n\t\t\n\t\tsheet.getRow(row).setHeight(height);\n\t\t\n\t\tHSSFCellStyle contentStyle = workbook.createCellStyle(); //内容样式\n\t\tcontentStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);\n\t\tList<PageData> varList = (List<PageData>) model.get(\"varList\");\n\t\tint varCount = varList.size();\n\t\tfor(int i=0; i<varCount; i++){\n\t\t\trow++;\n\t\t\tPageData vpd = varList.get(i);\n\t\t\tfor(int j=0;j<len;j++){\n\t\t\t\tString varstr = vpd.get(\"var\"+(j+1)).toString() != null ? vpd.get(\"var\"+(j+1)).toString() : \"\";\n\n\n\t\t\t\tcell = getCell(sheet, row, j);\n\t\t\t\tcell.setCellStyle(contentStyle);\n\t\t\t\tsetText(cell,varstr);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n protected void buildExcelDocument(Map<String, Object> model, Workbook workbook,\n HttpServletRequest request, HttpServletResponse response) throws Exception {\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"Du Report.xls\\\"\");\n\n @SuppressWarnings(\"unchecked\")\n List<ReportByGroup> reportList = (List<ReportByGroup>) model.get(\"reportList\");\n\n String[] month = new String[] { \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\", \"January\",\n \"February\", \"March\" };\n\n // create excel xls sheet\n Sheet sheet = workbook.createSheet(\"Report Du Detail\");\n // sheet.setDefaultColumnWidth(12);\n\n // create style for header cells\n CellStyle style = workbook.createCellStyle();\n Font font = workbook.createFont();\n font.setFontName(\"Arial\");\n style.setFillForegroundColor(HSSFColor.BLUE.index);\n style.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n style.setAlignment(HorizontalAlignment.CENTER);\n style.setWrapText(true);\n style.setBorderRight(BorderStyle.THIN);\n style.setRightBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderLeft(BorderStyle.THIN);\n style.setLeftBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderTop(BorderStyle.THIN);\n style.setTopBorderColor(IndexedColors.BLACK.getIndex());\n style.setBorderBottom(BorderStyle.THIN);\n style.setBottomBorderColor(IndexedColors.BLACK.getIndex());\n font.setBold(true);\n font.setColor(HSSFColor.WHITE.index);\n style.setFont(font);\n\n CellStyle style1 = workbook.createCellStyle();\n // style1.setAlignment(HorizontalAlignment.CENTER);\n // style1.setWrapText(true);\n style1.setBorderRight(BorderStyle.THIN);\n style1.setRightBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderLeft(BorderStyle.THIN);\n style1.setLeftBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderTop(BorderStyle.THIN);\n style1.setTopBorderColor(IndexedColors.BLACK.getIndex());\n style1.setBorderBottom(BorderStyle.THIN);\n style1.setBottomBorderColor(IndexedColors.BLACK.getIndex());\n // style1.setFont(font);\n\n // create header row\n Row header = sheet.createRow(0);\n Row header1 = sheet.createRow(1);\n Row header2 = sheet.createRow(2);\n\n header.createCell(0).setCellValue(\"STT\");\n header.getCell(0).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 0, // first column (0-based)\n 0 // last column (0-based)\n ));\n header.createCell(1).setCellValue(\"Vị trí\");\n header.getCell(1).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 1, // first column (0-based)\n 1 // last column (0-based)\n ));\n\n header.createCell(2).setCellValue(\"\");\n header.getCell(2).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 2, // first column (0-based)\n 2 // last column (0-based)\n ));\n\n header.createCell(3).setCellValue(\"Số lượng đã tuyển trong tháng\");\n header.getCell(3).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 0, // last row (0-based)\n 3, // first column (0-based)\n 26 // last column (0-based)\n ));\n header.createCell(27).setCellValue(\"SL tuyển dụng \" + this.year);\n header.getCell(27).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(0, // first row (0-based)\n 2, // last row (0-based)\n 27, // first column (0-based)\n 27 // last column (0-based)\n ));\n\n header1.createCell(0).setCellValue(\"\");\n header1.getCell(0).setCellStyle(style);\n header1.createCell(1).setCellValue(\"\");\n header1.getCell(1).setCellStyle(style);\n int k = 0;\n for (int i = 3; i < 27; i++) {\n if (i % 2 != 0) {\n header1.createCell(i).setCellValue(month[k++]);\n header1.getCell(i).setCellStyle(style);\n sheet.addMergedRegion(new CellRangeAddress(1, // first row (0-based)\n 1, // last row (0-based)\n i, // first column (0-based)\n i + 1 // last column (0-based)\n ));\n } else {\n header1.createCell(i).setCellValue(\"\");\n header1.getCell(i).setCellStyle(style);\n }\n }\n\n header2.createCell(0).setCellValue(\"\");\n header2.getCell(0).setCellStyle(style);\n header2.createCell(1).setCellValue(\"\");\n header2.getCell(1).setCellStyle(style);\n for (int i = 3; i < 27; i++) {\n if (i % 2 != 0) {\n header2.createCell(i).setCellValue(\"NEW\");\n header2.getCell(i).setCellStyle(style);\n } else {\n header2.createCell(i).setCellValue(\"TT\");\n header2.getCell(i).setCellStyle(style);\n }\n }\n\n int rowCount = 3;\n\n for (ReportByGroup item : reportList) {\n Row row = sheet.createRow(rowCount++);\n row.createCell(0).setCellValue(rowCount - 3);\n if (item.getDepartment() == null) {\n row.createCell(1).setCellValue(item.getGroup());\n } else {\n row.createCell(1).setCellValue(\"\");\n }\n row.createCell(2).setCellValue(item.getDepartment());\n int a = 3;\n for (StatisticMonth number : item.getStatisticMonth()) {\n if (number.getNumberOfNew() == 0) {\n row.createCell(a++).setCellValue(\"\");\n } else {\n row.createCell(a++).setCellValue(number.getNumberOfNew());\n }\n if (number.getNumberOfTT() == 0) {\n row.createCell(a++).setCellValue(\"\");\n } else {\n row.createCell(a++).setCellValue(number.getNumberOfTT());\n }\n }\n if (item.getTotal() == 0) {\n row.createCell(a).setCellValue(\"\");\n } else {\n row.createCell(a).setCellValue(item.getTotal());\n }\n\n for (int i = 0; i < 28; i++) {\n row.getCell(i).setCellStyle(style1);\n }\n }\n sheet.autoSizeColumn(0);\n sheet.autoSizeColumn(1);\n sheet.autoSizeColumn(2);\n sheet.autoSizeColumn(3);\n sheet.autoSizeColumn(4);\n sheet.autoSizeColumn(5);\n sheet.autoSizeColumn(6);\n sheet.autoSizeColumn(7);\n sheet.autoSizeColumn(8);\n sheet.autoSizeColumn(9);\n sheet.autoSizeColumn(10);\n sheet.autoSizeColumn(11);\n sheet.autoSizeColumn(12);\n sheet.autoSizeColumn(13);\n sheet.autoSizeColumn(14);\n sheet.autoSizeColumn(15);\n sheet.autoSizeColumn(16);\n sheet.autoSizeColumn(17);\n sheet.autoSizeColumn(18);\n sheet.autoSizeColumn(19);\n sheet.autoSizeColumn(20);\n sheet.autoSizeColumn(21);\n sheet.autoSizeColumn(22);\n sheet.autoSizeColumn(23);\n sheet.autoSizeColumn(24);\n sheet.autoSizeColumn(25);\n }", "public XL() {\n Reporter.log(\"New XL ctor\", true);\n }", "public XL(XLList xlList, XLCounter counter) {\n super(\"Untitled-\" + counter);\n this.xlList = xlList;\n this.counter = counter;\n xlList.add(this);\n counter.increment();\n statusPanel = new StatusPanel(statusLabel);\n sheetPanel = new SheetPanel(ROWS, COLUMNS);\n editor = new Editor();\n\n sheet = new Sheet();\n sheet.addObserver(this);\n\n add(NORTH, statusPanel);\n add(CENTER, editor);\n add(SOUTH, sheetPanel);\n setJMenuBar(new XLMenuBar(this, xlList, statusLabel));\n pack();\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n setResizable(false);\n setVisible(true);\n sheetPanel.addMouseListener(new SheetPanelMouseAdapter());\n\n editor.addActionListener(new EditorActionListener());\n\n }", "public WinScreen()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(1500, 500, 1); \r\n\r\n prepare();\r\n }", "@Override\n public void initialiseUiCells() {\n }", "public ExcelSheet(HSSFWorkbook wb, String _sheetName) {\n\t\t// create a sheet with the provided name \n\t\t// in the provided workbook\n\t\t// limit to the 31 first characters\n\t\tif (_sheetName.length() > 31) {\n\t\t\tthis.SheetName = _sheetName.substring(0, 31);\n\t\t} else {\n\t\t\tthis.SheetName = _sheetName;\n\t\t}\n\t\tsheet = wb.createSheet(SuppressForbiddenChar(this.SheetName));\n\t\trowIndex = 0 ;\n\t\tcellStyles = new CellStyles(wb);\n\t}", "public MapSheetTemplate(String sheetName) {\n\t\tsuper(sheetName);\n\t\ttileType = 0;\n\n\t\tfor (int x = 0; x < size.x; x++) {\n\t\t\tfor (int y = 0; y < size.y; y++) {\n\t\t\t\tdata[x][y] = new TileDataOLD(x, y);\n\t\t\t}\n\t\t}\n\t\tTileDataOLD td;\n\n\t\tloadData();\n\n\t\tcreateAnimationData(1, 20, 1, 11, 4, 0.07); // Flower\n\t\t// createAnimationData(2, 26, 5, 0, 4, 0.07); // Water\n\t\t// createAnimationData(2, 27, 5, 1, 4, 0.07); // Puddle\n\t\t// createAnimationData(2, 25, 5, 15, 4, 0.07); // Ocean Water\n\n\t\t// Terrain.\n\t\tcreateLedgeData(1, 3, Direction.SOUTH);\n\t\tcreateLedgeData(1, 4, Direction.SOUTH);\n\n\t\tcreateCollisionData(4, 0, MODEL_CORNER_NW);\n\t\tcreateCollisionLedgeData(5, 0, MODEL_EDGE_N, Direction.NORTH);\n\t\tcreateCollisionData(6, 0, MODEL_CORNER_NE);\n\t\tcreateCollisionLedgeData(4, 1, MODEL_EDGE_W, Direction.WEST);\n\t\tcreateCollisionLedgeData(6, 1, MODEL_EDGE_E, Direction.EAST);\n\t\tcreateCollisionData(4, 2, MODEL_CORNER_SW);\n\t\tcreateCollisionLedgeData(5, 2, MODEL_EDGE_S, Direction.SOUTH);\n\t\tcreateCollisionData(6, 2, MODEL_CORNER_SE);\n\n\t\tcreateCollisionData(4, 3, MODEL_INSIDE_CORNER_SE);\n\t\tcreateCollisionData(5, 3, MODEL_INSIDE_CORNER_SW);\n\t\tcreateCollisionData(4, 4, MODEL_INSIDE_CORNER_NE);\n\t\tcreateCollisionData(5, 4, MODEL_INSIDE_CORNER_NW);\n\n\t\tcreateCollisionData(6, 3, MODEL_EDGE_W);\n\t\tcreateCollisionData(7, 3, MODEL_EDGE_E);\n\t\tcreateCollisionData(6, 4, MODEL_CORNER_SW);\n\t\tcreateCollisionData(7, 4, MODEL_CORNER_SE);\n\n\t\tcreateCollisionData(7, 0, MODEL_CORNER_NW);\n\t\tcreateCollisionLedgeData(8, 0, MODEL_EDGE_N, Direction.NORTH);\n\t\tcreateCollisionData(9, 0, MODEL_CORNER_NE);\n\t\tcreateCollisionLedgeData(7, 1, MODEL_EDGE_W, Direction.WEST);\n\t\tcreateCollisionLedgeData(9, 1, MODEL_EDGE_E, Direction.EAST);\n\t\tcreateCollisionData(7, 2, MODEL_CORNER_SW);\n\t\tcreateCollisionLedgeData(8, 2, MODEL_EDGE_S, Direction.SOUTH);\n\t\tcreateCollisionData(9, 2, MODEL_CORNER_SE);\n\n\t\tcreateCollisionData(8, 3, MODEL_INSIDE_CORNER_SE);\n\t\tcreateCollisionData(9, 3, MODEL_INSIDE_CORNER_SW);\n\t\tcreateCollisionData(8, 4, MODEL_INSIDE_CORNER_NE);\n\t\tcreateCollisionData(9, 4, MODEL_INSIDE_CORNER_NW);\n\n\t\tcreateCollisionData(8, 5, MODEL_EDGE_W);\n\t\tcreateCollisionData(9, 5, MODEL_EDGE_E);\n\t\tcreateCollisionData(8, 6, MODEL_CORNER_SW);\n\t\tcreateCollisionData(9, 6, MODEL_CORNER_SE);\n\n\t\tcreateCollisionLedgeData(8, 7, MODEL_EDGE_S, Direction.SOUTH);\n\n\n\t\t// Doorways/Entrances.\n\t\tcreateCollisionData(10, 7, MODEL_EDGE_N);\n\t\tcreateCollisionData(11, 7, MODEL_EDGE_N);\n\t\tcreateCollisionData(11, 8, MODEL_EDGE_N);\n\t\tcreateCollisionData(6, 25, MODEL_EDGE_N);\n\t\tcreateCollisionData(3, 33, MODEL_EDGE_N);\n\n\n\t\t// Bridges.\n\t\tcreateCollisionData(5, 33, MODEL_BRIDGE_H_TOP);\n\t\tcreateCollisionData(5, 34, MODEL_BRIDGE_H_BOTTOM);\n\t\tcreateCollisionData(6, 33, MODEL_BRIDGE_H);\n\t\tcreateCollisionData(6, 34, MODEL_BRIDGE_V_LEFT);\n\t\tcreateCollisionData(7, 34, MODEL_BRIDGE_V_RIGHT);\n\t\tcreateCollisionData(7, 33, MODEL_BRIDGE_V);\n\n\n\t\t// Waterfalls.\n\t\ttd = createCollisionLedgeData(0, 25, MODEL_BLOCK, Direction.SOUTH);\n\t\ttd.setAnimation(5, 13, 4, 0.07);\n\t\ttd = createCollisionLedgeData(0, 26, MODEL_BLOCK, Direction.SOUTH);\n\t\ttd.setAnimation(5, 14, 4, 0.07);\n\t}", "public MainClass()\n\t{\n\t\t// Set the frame characteristics\n\t\tsetTitle( \"Excel Table In Java\" );\n\t\tsetSize( 300, 200 );\n\t\tsetBackground( Color.gray );\n\n\t\t// Create a panel to hold all other components\n\t\ttopPanel = new JPanel();\n\t\ttopPanel.setLayout( new BorderLayout() );\n\t\tgetContentPane().add( topPanel );\n\n\t\t//func to find length and get coulomn data\n\t\tArrayList list = new ArrayList();\n\t\tint columnslength=FuncFillColumnList(list,0);\n\t\tint rowslength=list.size();\n\t\t// Create columns array and fill from the list\n\t\tString columnNames[] = new String[rowslength];\n\t\tfor(int i=0;i<rowslength;i++){\n\t\t\ttry{\n\t\t\tcolumnNames[i]=(String) list.get(i);\n\t\t\t}catch(Exception e){\n\t\t\t\tcolumnNames[i]=String.valueOf(list.get(i));\n\t\t\t}\n\t\t}\n\n\n\t\t// fill body\n\t\tString bodyValues[][] =new String[columnslength][rowslength];\n\t\tFuncFillbody(bodyValues,0,rowslength);\n\n\t\t// Create a new table instance\n\t\ttable = new JTable( bodyValues, columnNames );\n\t\tDefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();\n\t\tcenterRenderer.setHorizontalAlignment( JLabel.CENTER );\n\t\t//center all cells\n\t\tfor(int i=0;i<rowslength;i++){\n\t\ttable.getColumnModel().getColumn(i).setCellRenderer( centerRenderer );\n\t\t}\n\t\t// Add the table to a scrolling pane\n\t\tscrollPane = new JScrollPane( table );\n\t\ttopPanel.add( scrollPane, BorderLayout.CENTER );\n\t\tthis.addWindowListener(new WindowAdapter() {\n\t public void windowClosing(WindowEvent e) {\n\t \tSystem.exit(0);\n\t }\n\n\t });\n\n\t}", "private void createLabel(WritableSheet sheet)\n throws WriteException {\n WritableFont times10pt = new WritableFont(WritableFont.TIMES, 10);\n // Define the cell format\n times = new WritableCellFormat(times10pt);\n // Lets automatically wrap the cells\n times.setWrap(true);\n\n // create create a bold font with unterlines\n WritableFont times10ptBoldUnderline = new WritableFont(\n WritableFont.TIMES, 10, WritableFont.BOLD, true,\n UnderlineStyle.SINGLE);\n timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline);\n // Lets automatically wrap the cells\n timesBoldUnderline.setWrap(true);\n\n CellView cv = new CellView();\n cv.setFormat(times);\n cv.setFormat(timesBoldUnderline);\n cv.setAutosize(true);\n\n// addCaption(sheet, 3, 0, mExcelObject.getHourActivity()); // ชั่วโมง\n\n // Write a few headers\n// addCaption(sheet, 0, 0, \"ชื่อกิจกรรม \"+mExcelObject.getActivityName()); // ชื่อกิจกรรม\n// addCaption(sheet, 1, 0, \"วันที่จัด \"+mExcelObject.getTimeStart()); // วันที่จัด\n// addCaption(sheet, 2, 0, \"สถานที่่่ \"+mExcelObject.getLocationName()); // สถานที่\n\n\n\n\n\n addCaption(sheet, 0, 1, \"ลำดับ\");\n addCaption(sheet, 1, 1, \"ชื่อผู้ปกครอง\");\n addCaption(sheet, 2, 1, \"ชื่อเด็กนักเรียน\");\n //addCaption(sheet, 3, 1, \"ระดับชั้น\");\n // addCaption(sheet, 4, 1, \"เวลามารับ\");\n\n\n\n\n\n }", "public ReportingExcelView() {\r\n\t\tsetContentType(CONTENT_TYPE);\r\n\t}", "public Excel_Reporte_Borrador() {\r\n }", "public Cell(){}", "public Sheet() {\n gearRatio = 4;\n }", "public Layout() {\n\n //nao precisa colocar externo, apenas referencia com a linha 0\n for (int i = 0; i < 4; i++) {\n matrix[0][i] = Estados.EXTERNO;\n }\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = Estados.ROOM;\n }\n\n matrix[2][1] = Estados.ROOM_EMPTY;\n matrix[2][2] = Estados.ROOM_EMPTY2;\n\n matrix[2][0] = Estados.ACESSO_EXTERNO;\n matrix[2][3] = Estados.ACESSO_INTERNO;\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = Estados.ROOM;\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[4][i] = Estados.EXTERNO2;\n }\n\n }", "public void exportXLS() {\n\t\t// Create a Workbook\n\t\tWorkbook workbook = new HSSFWorkbook(); // new HSSFWorkbook() for\n\t\t\t\t\t\t\t\t\t\t\t\t// generating `.xls` file\n\n\t\t/*\n\t\t * CreationHelper helps us create instances of various things like DataFormat,\n\t\t * Hyperlink, RichTextString etc, in a format (HSSF, XSSF) independent way\n\t\t */\n\t\tCreationHelper createHelper = workbook.getCreationHelper();\n\n\t\t// Create a Sheet\n\t\tSheet sheet = workbook.createSheet(\"العقود\");\n\n\t\t// Create a Font for styling header cells\n\t\tFont headerFont = workbook.createFont();\n\t\theaderFont.setBold(true);\n\t\theaderFont.setFontHeightInPoints((short) 14);\n\t\theaderFont.setColor(IndexedColors.RED.getIndex());\n\n\t\t// Create a CellStyle with the font\n\t\tCellStyle headerCellStyle = workbook.createCellStyle();\n\t\theaderCellStyle.setFont(headerFont);\n\n\t\t// Create a Row\n\t\tRow headerRow = sheet.createRow(0);\n\n\t\tString[] columns = { \"الرقم\", \"رقم العقد \", \"تاريخ البداية\", \"تاريخ النهاية\", \"المستثمر\", \"حالة الفاتورة\" };\n\t\t// Create cells\n\t\tfor (int i = 0; i < columns.length; i++) {\n\t\t\tCell cell = headerRow.createCell(i);\n\t\t\tcell.setCellValue(columns[i]);\n\t\t\tcell.setCellStyle(headerCellStyle);\n\t\t}\n\n\t\t// Create Cell Style for formatting Date\n\t\tCellStyle dateCellStyle = workbook.createCellStyle();\n\t\tdateCellStyle.setDataFormat(createHelper.createDataFormat().getFormat(\"dd-MM-yyyy\"));\n\n\t\t// Create Other rows and cells with employees data\n\t\tint rowNum = 1;\n\t\tint num = 1;\n//\t\tfor (ContractDirect contObj : contractsDirectList) {\n//\t\t\tRow row = sheet.createRow(rowNum++);\n//\t\t\trow.createCell(0).setCellValue(num);\n//\t\t\trow.createCell(1).setCellValue(contObj.getContractNum());\n//\n//\t\t\tif (!tableHigriMode) {\n//\t\t\t\tCell date1 = row.createCell(2);\n//\t\t\t\tdate1.setCellValue(contObj.getStartContDate());\n//\t\t\t\tdate1.setCellStyle(dateCellStyle);\n//\t\t\t\tCell date2 = row.createCell(3);\n//\t\t\t\tdate2.setCellValue(contObj.getEndContDate());\n//\t\t\t\tdate2.setCellStyle(dateCellStyle);\n//\t\t\t} else {\n//\t\t\t\tCell date1 = row.createCell(2);\n//\t\t\t\tdate1.setCellValue(contObj.getStartDate());\n//\t\t\t\tdate1.setCellStyle(dateCellStyle);\n//\t\t\t\tCell date2 = row.createCell(3);\n//\t\t\t\tdate2.setCellValue(contObj.getEndDate());\n//\t\t\t\tdate2.setCellStyle(dateCellStyle);\n//\t\t\t}\n//\n//\t\t\tInvestor inv = (Investor) dataAccessService.findEntityById(Investor.class, contObj.getInvestorId());\n//\t\t\trow.createCell(4).setCellValue(inv.getName());\n//\t\t\trow.createCell(5).setCellValue(contObj.getPayStatusName());\n//\t\t\tnum++;\n//\t\t}\n\n\t\t// Resize all columns to fit the content size\n\t\tfor (int i = 0; i < columns.length; i++) {\n\t\t\tsheet.autoSizeColumn(i);\n\t\t}\n\n\t\t// Write the output to a file\n\n\t\ttry {\n\t\t\tString path = \"D:/العقود.xls\";\n\t\t\tFileOutputStream fileOut = new FileOutputStream(path);\n\t\t\tworkbook.write(fileOut);\n\t\t\tfileOut.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\n\t\t\tworkbook.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Closing the workbook\n\n\t}", "protected CellStyle makeStyleForEmptyTitleCell(final Workbook workbook) {\n final CellStyle myStyle = workbook.createCellStyle();\n myStyle.setBorderTop(CellStyle.BORDER_THIN);\n myStyle.setBorderBottom(CellStyle.BORDER_THIN);\n myStyle.setBorderLeft(CellStyle.BORDER_NONE);\n myStyle.setBorderRight(CellStyle.BORDER_NONE);\n return myStyle;\n }", "@Override\n\tprotected void buildExcelDocument(Map<String, Object> model, HSSFWorkbook workbook, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception \n\t{\n\t\t\n\t\tString formName = (String)model.get(\"formName\");\n\t\tif (\"Supplier\".equals(formName))\n\t\t\tsetSupplierExcelData(model, workbook);\n\t\telse if (\"Customer\".equals(formName))\n\t\t\tsetCustomerExcelData(model, workbook);\n\t\telse if (\"Item\".equals(formName))\n\t\t\tsetItemExcelData(model, workbook);\n\t\telse if (\"NonInventoryItem\".equals(formName))\n\t\t\tsetNonInventoryExcelData(model, workbook);\n\t\telse if (\"Project\".equals(formName))\n\t\t\tsetProjectExcelData(model, workbook);\n\t\telse if (\"Warehouse\".equals(formName))\n\t\t\tsetWarehouseExcelData(model, workbook);\n\t\t\n\t\tSystem.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\" + formName);\n\t\n\t}", "public ModelExportToExcelService() {\n\t\tsuper();\n\t}", "@Override\n\tpublic Sheet getSheet() {\n\t\treturn null;\n\t}", "@Override\r\n\tprotected final void renderMergedOutputModel(\r\n\t\t\tMap<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n\r\n\t\tExcelForm excelForm = (ExcelForm) model.get(\"excelForm\");\r\n\r\n\t\tHSSFWorkbook workbook;\r\n\t\tHSSFSheet sheet;\r\n\t\tif (excelForm.getTemplateFileUrl() != null) {\r\n\t\t\tworkbook = getTemplateSource(excelForm.getTemplateFileUrl(), request);\r\n\t\t\tsheet = workbook.getSheetAt(0);\r\n\t\t} else {\r\n\t\t\tString sheetName = excelForm.getSheetName();\r\n\r\n\t\t\tworkbook = new HSSFWorkbook();\r\n\t\t\tsheet = workbook.createSheet(sheetName);\r\n\t\t\tlogger.debug(\"Created Excel Workbook from scratch\");\r\n\t\t}\r\n\t\t\r\n\t\tresponse.setHeader( \"Content-Disposition\", \"attachment; filename=\" + URLEncoder.encode(excelForm.getFileName(), \"UTF-8\"));\r\n\r\n\t\tcreateColumnStyles(excelForm, workbook);\r\n\t\tcreateMetaRows(excelForm, workbook, sheet);\r\n\t\tcreateHeaderRow(excelForm, workbook, sheet);\r\n\t\tfor (Object review : excelForm.getData()) {\r\n\t\t\tcreateRow(excelForm, workbook,sheet, review);\r\n\t\t\tdetectLowMemory();\r\n\t\t}\r\n\t\t\r\n\t\t// Set the content type.\r\n\t\tresponse.setContentType(getContentType());\r\n\r\n\t\t// Should we set the content length here?\r\n\t\t// response.setContentLength(workbook.getBytes().length);\r\n\r\n\t\t// Flush byte array to servlet output stream.\r\n\t\tServletOutputStream out = response.getOutputStream();\r\n\t\tworkbook.write(out);\r\n\t\tout.flush();\r\n\t}", "@Override\r\n\tpublic String getGridText()\r\n\t{\r\n\t\t// TODO Auto-generated method stub\\\r\n\t\tString sheet = \"\";\r\n\t\tfor(int i = 0; i <= 20; i++) { //20 rows\r\n\t\t\tfor(char j = 'A'; j <= 'L';j++) { //A through L\r\n\t\t\t\tif(i == 0) { //Creates row headers\r\n\t\t\t\t\tif(j == 'A') { // Creates letter headers\r\n\t\t\t\t\t\tsheet += \" |\"; //pads for headers\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsheet += String.format(\"%-10c|\",j);\r\n\t\t\t\t} else{\r\n\t\t\t\t\tif(j == 'A') {\r\n\t\t\t\t\t\tsheet += String.format(\"%-3d|\", i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsheet += cells[i-1][j-'A'].abbreviatedCellText() + \"|\"; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//enters new row\r\n\t\t\tsheet += \"\\n\";\r\n\t\t}\r\n\t\t//prints sheet\r\n\t\treturn sheet;\r\n\t}", "public ZonaFasciculataCells() {\r\n\r\n\t}", "SheetTableModel(final Table<D> table, final int row, final int column, final int lastRow, final int lastCol) {\r\n super();\r\n this.table = table;\r\n this.row = row;\r\n this.column = column;\r\n this.lastRow = lastRow;\r\n this.lastCol = lastCol;\r\n }", "private CellPanel defineUI()\n\t{\n\t\t//TODO define all UI Stuff here - not needed if GWT Designer is used as it will do the work for us.\n\n\t\tcellPanelContainer = new VerticalPanel();\t\t\n\t cellPanelContainer.setSize(\"598px\", \"530px\");\n\t\treturn cellPanelContainer;\n\t}", "private static Map<String, CellStyle> createStyles(Workbook wbl) {\r\n\r\n\tMap<String, CellStyle> styles = new HashMap<String, CellStyle>();\r\n\ttry {\r\n\t CellStyle style;\r\n\t Font titleFont = wbl.createFont();\r\n\t titleFont.setFontHeightInPoints((short) 18);\r\n\t titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n\t style = wbl.createCellStyle();\r\n\t style.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t style.setFont(titleFont);\r\n\t styles.put(\"title\", style);\r\n\r\n\t Font monthFont = wbl.createFont();\r\n\t monthFont.setFontHeightInPoints((short) 11);\r\n\t monthFont.setColor(IndexedColors.WHITE.getIndex());\r\n\t style = wbl.createCellStyle();\r\n\t style.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());\r\n\t style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n\t style.setFont(monthFont);\r\n\t style.setWrapText(true);\r\n\t style.setRightBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderRight(CellStyle.BORDER_THIN);\r\n\t style.setLeftBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderLeft(CellStyle.BORDER_THIN);\r\n\t style.setTopBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderTop(CellStyle.BORDER_THIN);\r\n\t style.setBottomBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderBottom(CellStyle.BORDER_THIN);\r\n\t styles.put(\"header\", style);\r\n\t \r\n\t //MandatoryColumn to admission process\r\n\t Font mandatoryColumnFont = wbl.createFont();\r\n\t mandatoryColumnFont.setFontHeightInPoints((short) 11);\r\n\t mandatoryColumnFont.setColor(IndexedColors.RED.getIndex());\r\n\t style = wbl.createCellStyle();\r\n\t style.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());\r\n\t style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n\t style.setFont(mandatoryColumnFont);\r\n\t style.setWrapText(true);\r\n\t style.setRightBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderRight(CellStyle.BORDER_THIN);\r\n\t style.setLeftBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderLeft(CellStyle.BORDER_THIN);\r\n\t style.setTopBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderTop(CellStyle.BORDER_THIN);\r\n\t style.setBottomBorderColor(IndexedColors.WHITE.getIndex());\r\n\t style.setBorderBottom(CellStyle.BORDER_THIN);\r\n\t styles.put(\"headers\", style);\r\n\r\n\t style = wbl.createCellStyle();\r\n\t style.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t style.setWrapText(true);\r\n\t style.setBorderRight(CellStyle.BORDER_THIN);\r\n\t style.setRightBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderLeft(CellStyle.BORDER_THIN);\r\n\t style.setLeftBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderTop(CellStyle.BORDER_THIN);\r\n\t style.setTopBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderBottom(CellStyle.BORDER_THIN);\r\n\t style.setBottomBorderColor(IndexedColors.BLACK.getIndex());\r\n\t styles.put(\"cell\", style);\r\n\r\n\t style = wbl.createCellStyle();\r\n\t style.setWrapText(true);\r\n\t style.setBorderRight(CellStyle.BORDER_THIN);\r\n\t style.setRightBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderLeft(CellStyle.BORDER_THIN);\r\n\t style.setLeftBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderTop(CellStyle.BORDER_THIN);\r\n\t style.setTopBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderBottom(CellStyle.BORDER_THIN);\r\n\t style.setBottomBorderColor(IndexedColors.BLACK.getIndex());\r\n\t styles.put(\"string\", style);\r\n\r\n\t CreationHelper createHelper = wbl.getCreationHelper();\r\n\t style = wbl.createCellStyle();\r\n\t style.setDataFormat(createHelper.createDataFormat().getFormat(\"dd-MMM-yyyy\"));\r\n\t style.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t style.setWrapText(true);\r\n\t style.setBorderRight(CellStyle.BORDER_THIN);\r\n\t style.setRightBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderLeft(CellStyle.BORDER_THIN);\r\n\t style.setLeftBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderTop(CellStyle.BORDER_THIN);\r\n\t style.setTopBorderColor(IndexedColors.BLACK.getIndex());\r\n\t style.setBorderBottom(CellStyle.BORDER_THIN);\r\n\t style.setBottomBorderColor(IndexedColors.BLACK.getIndex());\r\n\t styles.put(\"date\", style);\r\n\r\n\t} catch (Exception ex) {\r\n\t ex.printStackTrace();\r\n\t JRExceptionClient jre = new JRExceptionClient();jre.sendException(ex);jre = null;\r\n\t}\r\n\r\n\treturn styles;\r\n }", "public interface SpreadsheetModel {\n\n /**\n * Gets the cell value at the given coordinate.\n *\n * @param coord the coordinates of the desired cell\n * @return The cell at the given coordinate.\n */\n Cell getCellAt(Coord coord);\n\n /**\n * <p>Gets the raw contents of the Cell at the given coordinate.</p>\n *\n * @param coord the coordinates of the desired cell\n * @return the raw String value of the requested cell.\n */\n String getRawCellAt(Coord coord);\n\n /**\n * Updates or adds a cell at the desired coordinates.\n *\n * @param coord spot to add or update the cell.\n * @param string new value of the cell.\n */\n void editCell(Coord coord, String string);\n\n /**\n * Gets the map of coordinates and their associated Cells.\n *\n * @return\n */\n Map<Coord, ICell> getAllCells();\n\n /**\n * Clears the sheet of all cell values.\n */\n void clearSheet();\n}", "protected void paintSheet( Graphics g, int w, int h )\n {\n int cx = w/2;\n int cy = 21 * h/27;\n int rx, ry;\n \n g.setColor(Color.BLUE);\n rx = 6 * w/15; ry = 6 * h/27;\n g.fillOval(cx - rx, cy - ry, 2*rx, 2*ry); g.setColor(Color.BLACK);\n g.drawOval(cx - rx, cy - ry, 2*rx, 2*ry);\n \n g.setColor(Color.WHITE);\n rx = 4 * w/15; ry = 4 * h/27;\n g.fillOval(cx - rx, cy - ry, 2*rx, 2*ry); g.setColor(Color.BLACK);\n g.drawOval(cx - rx, cy - ry, 2*rx, 2*ry);\n \n g.setColor(Color.RED.darker());\n rx = 2 * w/15; ry = 2 * h/27;\n g.fillOval(cx - rx, cy - ry, 2*rx, 2*ry); g.setColor(Color.BLACK);\n g.drawOval(cx - rx, cy - ry, 2*rx, 2*ry);\n \n g.setColor(Color.WHITE);\n rx = w/30; ry = h/54;\n g.fillOval(cx - rx, cy - ry, 2*rx, 2*ry); g.setColor(Color.BLACK);\n g.drawOval(cx - rx, cy - ry, 2*rx, 2*ry);\n \n g.setColor(Color.BLACK);\n g.drawLine(cx, 0, cx, h);\n g.drawLine(0, cy, w, cy);\n \n g.drawRect(0, 0, w-1,h-1);\n }", "private void initSpreadSheet()\n {\n if (documentFile != null && (documentFile.getName().endsWith(\".docx\") || documentFile.getName().endsWith(\".odt\")))\n {\n setIsSpreadsheet(false);\n }\n else\n {\n setIsSpreadsheet(true);\n }\n }", "@Override\n\tpublic void createCellStructure() {\n\t\t\n\t}", "void onActionFromExport() {\n\t\ttry {\n\t\t\tHSSFWorkbook document = new HSSFWorkbook();\n\t\t\tHSSFSheet sheet = ReportUtil.createSheet(document);\n\n\t\t\tsheet.setMargin((short) 0, 0.5);\n\t\t\tReportUtil.setColumnWidths(sheet, 0, 0.5, 1, 0.5, 2, 2, 3, 2, 3, 2, 4, 3, 5, 2, 6, 2, 7, 2, 8, 3, 9, 3, 10,\n\t\t\t\t\t3, 11, 2, 12, 2);\n\n\t\t\tMap<String, HSSFCellStyle> styles = ReportUtil.createStyles(document);\n\n\t\t\tint sheetNumber = 0;\n\t\t\tint rowIndex = 1;\n\t\t\tint colIndex = 1;\n\t\t\tLong index = 1L;\n\n\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2, messages.get(\"empList\"), styles.get(\"title\"), 5);\n\n\t\t\tExcelAPI.setCellValue(document, sheetNumber, ++rowIndex, 1,\n\t\t\t\t\tmessages.get(\"date\") + \": \" + format.format(new Date()), styles.get(\"plain-left-wrap\"), 5);\n\t\t\trowIndex += 2;\n\n\t\t\t/* column headers */\n\n\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 1, messages.get(\"number-label\"),\n\t\t\t\t\tstyles.get(\"header-wrap\"));\n\n\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2, messages.get(\"firstname-label\"),\n\t\t\t\t\tstyles.get(\"header-wrap\"));\n\n\t\t\tif (lastname) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"lastname-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (origin1) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"persuasion-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (register) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"register-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (status) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"status-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (gender) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"gender-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (occ) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"occupation-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (birthday) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"birthDate-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (phoneNo) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"phoneNo-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (email) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"email-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (org) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"organization-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (appointment) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"appointment-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (militaryDegree) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, \"Цэргийн цол\", styles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (militaryDegreeStatus) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, \"Цолны статус\",\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (militaryDegreeDate) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, \"Цол авсан огноо\",\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (TotalWorkedYear) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"TotalOrgWorkedYear-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (StateWorkedYear) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"stateWorkedYear-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (CourtWorkedYear) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i,\n\t\t\t\t\t\tmessages.get(\"courtOrgTotalWorkedYear-label\"), styles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (CourtMilitaryWorkedYear) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i,\n\t\t\t\t\t\tmessages.get(\"CourtMilitaryWorkedYear-label\"), styles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (CourtSimpleWorkedYear) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i,\n\t\t\t\t\t\tmessages.get(\"CourtSimpleWorkedYear-label\"), styles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tif (familyCount) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"familyCount-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\t\t\tif (childCount) {\n\t\t\t\ti++;\n\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 2 + i, messages.get(\"childCount-label\"),\n\t\t\t\t\t\tstyles.get(\"header-wrap\"));\n\t\t\t}\n\n\t\t\tReportUtil.setRowHeight(sheet, rowIndex, 3);\n\n\t\t\trowIndex++;\n\t\t\tif (listEmployee != null)\n\t\t\t\tfor (Employee empDTO : listEmployee) {\n\n\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\tlistEmployee.indexOf(empDTO) + 1 + \"\", styles.get(\"plain-left-wrap-border\"));\n\n\t\t\t\t\tif (lastname) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t(empDTO.getLastname() != null) ? empDTO.getLastname() : \"\",\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++, empDTO.getFirstName(),\n\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t\n\t\t\t\t\tif (origin1) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t(empDTO.getOrigin().getName() != null) ? empDTO.getOrigin().getName() : \"\",\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (register) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t(empDTO.getRegisterNo() != null) ? empDTO.getRegisterNo() : \"\",\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (status) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t(empDTO.getEmployeeStatus() != null) ? empDTO.getEmployeeStatus().name() : \"\",\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (gender) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\tmessages.get((empDTO.getGender() != null) ? empDTO.getGender().toString() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (occ) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t(empDTO.getOccupation() != null) ? empDTO.getOccupation().getName() : \"\",\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (birthday) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((empDTO.getBirthDate() != null) ? format.format(empDTO.getBirthDate()) : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (phoneNo) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((empDTO.getPhoneNo() != null) ? empDTO.getPhoneNo() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (email) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((empDTO.geteMail() != null) ? empDTO.geteMail() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (org) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((empDTO.getOrganization() != null) ? empDTO.getOrganization().getName() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (appointment) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((empDTO.getAppointment() != null) ? empDTO.getAppointment().getAppointmentName() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (militaryDegree) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((dao.getEmployeeMilitary(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? dao.getEmployeeMilitary(empDTO.getId()).getMilitary().getMilitaryName() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (militaryDegreeStatus) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((dao.getEmployeeMilitary(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? dao.getEmployeeMilitary(empDTO.getId()).getDegreeStatus().name() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (militaryDegreeDate) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((dao.getEmployeeMilitary(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? format.format(dao.getEmployeeMilitary(empDTO.getId()).getOlgosonOgnoo())\n\t\t\t\t\t\t\t\t\t\t: \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (TotalWorkedYear) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((getTotalOrgWorkedYearExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getTotalOrgWorkedYearExport(empDTO.getId()).toString() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t\tif (StateWorkedYear) {\n\t\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t\t((getStateWorkedYearExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t\t? getStateWorkedYearExport(empDTO.getId()).toString() : \"\"),\n\t\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (CourtWorkedYear) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((getCourtOrgTotalWorkedYearExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getCourtOrgTotalWorkedYearExport(empDTO.getId()).toString() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (CourtMilitaryWorkedYear) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((getCourtMilitaryWorkedYearExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getCourtMilitaryWorkedYearExport(empDTO.getId()).toString() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (CourtSimpleWorkedYear) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, colIndex++,\n\t\t\t\t\t\t\t\t((getCourtSimpleWorkedYearExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getCourtSimpleWorkedYearExport(empDTO.getId()).toString() : \"\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (familyCount) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex,\n\t\t\t\t\t\t\t\tcolIndex++, ((getFamilyCountExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getFamilyCountExport(empDTO.getId()) : \"0\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (childCount) {\n\t\t\t\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex,\n\t\t\t\t\t\t\t\tcolIndex++, ((getChildCountExport(empDTO.getId()) != null)\n\t\t\t\t\t\t\t\t\t\t? getChildCountExport(empDTO.getId()) : \"0\"),\n\t\t\t\t\t\t\t\tstyles.get(\"plain-left-wrap-border\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tReportUtil.setRowHeight(sheet, rowIndex, 3);\n\t\t\t\t\trowIndex++;\n\t\t\t\t\tindex++;\n\t\t\t\t\tcolIndex = 1;\n\n\t\t\t\t}\n\n\t\t\trowIndex += 2;\n\n\t\t\tExcelAPI.setCellValue(document, sheetNumber, rowIndex, 1,\n\t\t\t\t\t\"ТАЙЛАН ГАРГАСАН: \" + \"..................................... / \"\n\t\t\t\t\t\t\t+ loginState.getEmployee().getLastname().charAt(0) + \".\"\n\t\t\t\t\t\t\t+ loginState.getEmployee().getFirstName() + \" /\",\n\t\t\t\t\tstyles.get(\"plain-left-wrap\"), 8);\n\t\t\trowIndex++;\n\n\t\t\tOutputStream out = response.getOutputStream(\"application/vnd.ms-excel\");\n\t\t\tresponse.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"employeeList.xls\\\"\");\n\n\t\t\tdocument.write(out);\n\t\t\tout.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public RegularGrid() {\r\n }", "private static Map<String, CellStyle> createStyles(Workbook wb)\r\n\t{\r\n\t\tMap<String, CellStyle> styles = new HashMap<String, CellStyle>();\r\n\t\tDataFormat df = wb.createDataFormat();\r\n\r\n\t\tFont titleFont = wb.createFont();\r\n\t\ttitleFont.setFontHeightInPoints((short) 18);\r\n\t\ttitleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n\t\ttitleFont.setColor(IndexedColors.DARK_BLUE.getIndex());\r\n\t\tCellStyle titleStyle = wb.createCellStyle();\r\n\t\ttitleStyle.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t\ttitleStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t\ttitleStyle.setFont(titleFont);\r\n\t\tborderCell(titleStyle, CellStyle.BORDER_THICK, IndexedColors.BLUE.getIndex());\r\n\t\tstyles.put(TITLE_STYLE_NAME, titleStyle);\r\n\r\n\t\tFont headerFont = wb.createFont();\r\n\t\theaderFont.setFontHeightInPoints((short) 11);\r\n\t\theaderFont.setColor(IndexedColors.WHITE.getIndex());\r\n\t\tCellStyle headerStyle = wb.createCellStyle();\r\n\t\theaderStyle.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t\theaderStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t\theaderStyle.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());\r\n\t\theaderStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n\t\theaderStyle.setFont(headerFont);\r\n\t\theaderStyle.setWrapText(true);\r\n\t\tstyles.put(HEADER_STYLE_NAME, headerStyle);\r\n\r\n\t\tCellStyle plainCellStyle = wb.createCellStyle();\r\n\t\tplainCellStyle.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t\tborderCell(plainCellStyle, CellStyle.BORDER_THIN, IndexedColors.BLACK.getIndex());\r\n\t\tstyles.put(PLAIN_CELL_STYLE_NAME, plainCellStyle);\r\n\r\n\t\tCellStyle dateCellStyle = wb.createCellStyle();\r\n\t\tdateCellStyle.cloneStyleFrom(plainCellStyle);\r\n\t\tdateCellStyle.setDataFormat(df.getFormat(\"yyyy-mm-dd\"));\r\n\t\tstyles.put(DATE_CELL_STYLE_NAME, dateCellStyle);\r\n\r\n\t\tCellStyle integerFormulaStyle = wb.createCellStyle();\r\n\t\tintegerFormulaStyle.setAlignment(CellStyle.ALIGN_CENTER);\r\n\t\tintegerFormulaStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);\r\n\t\tintegerFormulaStyle.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());\r\n\t\tintegerFormulaStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n\t\tborderCell(integerFormulaStyle, CellStyle.BORDER_DOTTED, IndexedColors.GREY_80_PERCENT.getIndex());\r\n\t\tintegerFormulaStyle.setDataFormat(df.getFormat(\"0\"));\r\n\t\tintegerFormulaStyle.setWrapText(true);\r\n\t\tstyles.put(INTEGER_FORMULA_STYLE_NAME, integerFormulaStyle);\r\n\r\n\t\tCellStyle floatFormulaStyle = wb.createCellStyle();\r\n\t\tfloatFormulaStyle.cloneStyleFrom(integerFormulaStyle);\r\n\t\tfloatFormulaStyle.setDataFormat(df.getFormat(\"0.00\"));\r\n\t\tstyles.put(FLOAT_FORMULA_STYLE_NAME, floatFormulaStyle);\r\n\r\n\t\tCellStyle percentageFormulaStyle = wb.createCellStyle();\r\n\t\tpercentageFormulaStyle.cloneStyleFrom(integerFormulaStyle);\r\n\t\tpercentageFormulaStyle.setDataFormat(df.getFormat(\"0.00 %\"));\r\n//\t\tpercentageFormulaStyle.setDataFormat((short) 9); // See BuiltinFormats\r\n\t\tshort colorIndex = IndexedColors.INDIGO.getIndex();\r\n\t\tColor customColor = defineColor(wb, colorIndex, 0x88, 0xFF, 0x55);\r\n\t\tif (percentageFormulaStyle instanceof XSSFCellStyle)\r\n\t\t{\r\n\t\t\t((XSSFCellStyle) percentageFormulaStyle).setFillForegroundColor((XSSFColor) customColor);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpercentageFormulaStyle.setFillForegroundColor(colorIndex);\r\n\t\t}\r\n\t\tstyles.put(PERCENTAGE_FORMULA_STYLE_NAME, percentageFormulaStyle);\r\n\r\n\t\treturn styles;\r\n\t}", "private Chart(int dimensionality)\r\n {\r\n DataTable.getInstance().getModel().addTableModelListener(this);\r\n this.setLayout(null);\r\n this.setMinimumSize(new Dimension(400,300));\r\n this.setPreferredSize(new Dimension(500000,500000));\r\n this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(5,5,5,5,SystemColor.control),BorderFactory.createLineBorder(SystemColor.control.darker())));\r\n background = new Background(this);\r\n backpane = new Backpane(this);\r\n axes = new Axes2D(this);\r\n data = new DataPoints2D(this);\r\n this.addMouseListener(new ChartPropertiesTrigger());\r\n }", "public Title()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(PlatformWorld.sWidth, PlatformWorld.sHeight, 1); \n \n addObject(new TitleController(), 0, 0);\n }", "public WriteExcelXLS(String filePath) {\n\t\tsuper(filePath);\n\t\tthis.book = new HSSFWorkbook();\n\t\tthis.sheet = book.createSheet(\"Teste\");\n\t\tthis.cstyle = new CellStyleList(book);\n\t}", "public Horizontal() {\r\n }", "public NewImportForm(Company co, Branch br, File excelFile) {\n initComponents();\n this.company = co;\n this.branch = br;\n \n try {\n workBook = new HSSFWorkbook(new FileInputStream(excelFile));\n workSheet = workBook.getSheetAt(0); \n MyTableModel tableModel = new MyTableModel();\n SimpleDateFormat dateFormatter = new SimpleDateFormat(\"MM/dd/yy\");\n \n for(int i = 0; i <= workSheet.getLastRowNum(); i++) {\n HSSFRow row = workSheet.getRow(i);\n Object[] rowData = new Object[row.getLastCellNum()];\n \n if(row.getLastCellNum() > tableModel.getColumnCount())\n tableModel.setColumnCount(row.getLastCellNum());\n \n for(short c = 0; c < row.getLastCellNum(); c++) {\n int cellType = row.getCell(c).getCellType();\n switch(cellType) {\n \n case HSSFCell.CELL_TYPE_STRING:\n rowData[c] = row.getCell(c).getStringCellValue();\n break;\n \n \n case HSSFCell.CELL_TYPE_NUMERIC:\n double value = row.getCell(c).getNumericCellValue();\n \n if(HSSFDateUtil.isValidExcelDate(value))\n rowData[c] = dateFormatter.format(row.getCell(c).getDateCellValue());\n else\n rowData[c] = value; \n break;\n \n \n case HSSFCell.CELL_TYPE_BOOLEAN:\n rowData[c] = row.getCell(c).getBooleanCellValue();\n break;\n \n \n case HSSFCell.CELL_TYPE_FORMULA:\n rowData[c] = row.getCell(c).getCellFormula();\n break;\n \n \n case HSSFCell.CELL_TYPE_ERROR:\n rowData[c] = row.getCell(c).getErrorCellValue();\n break;\n \n \n default:\n rowData[c] = \"\";\n break;\n }\n }\n tableModel.addRow(rowData);\n } \n \n this.dataTable.setModel(tableModel);\n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n this.dataTable.getColumnModel().getColumn(i).setHeaderValue(\"Unassigned\");\n this.dataTable.getColumnModel().getColumn(i).setMinWidth(150);\n }\n \n this.dataTable.setMinimumSize(new Dimension(this.dataTable.getColumnCount()*150, 32000));\n this.dataTable.getTableHeader().setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n this.dataTable.revalidate();\n this.importButton.setEnabled(true);\n \n } catch(Exception ex) { JOptionPane.showMessageDialog(this, \"Unable to load data from file!\\n\" + ex.getMessage(), \"Error!\", JOptionPane.ERROR_MESSAGE); }\n \n this.setTitle(\"Importing Employees into \" + this.company.getName() + \", \" + this.branch.getBranchName());\n \n this.allLists = new ArrayList<ArrayList<String>>();\n this.allLists.add(employee_first_name);\n this.allLists.add(employee_last_name);\n this.allLists.add(employee_middle_initial);\n this.allLists.add(employee_ssn);\n this.allLists.add(employee_address);\n this.allLists.add(employee_address2);\n this.allLists.add(employee_city);\n this.allLists.add(employee_state);\n this.allLists.add(employee_zip);\n this.allLists.add(employee_phone);\n this.allLists.add(employee_phone2);\n this.allLists.add(employee_pager);\n this.allLists.add(employee_cell);\n this.allLists.add(employee_email);\n this.allLists.add(employee_birthdate);\n }", "public EmpleadoPOI() {//Constructor\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Cell()\n\t{\n\t}", "public SheetEditor(Sheet sheet, ExcelContext context) {\n\t\tsuper(context);\n\t\tthis.sheet = sheet;\n\t\tsheetIndex = workBook.getSheetIndex(this.sheet);\n\t}", "private void initExcelReport() {\n DocumentItem documentItem = new DocumentItem(\"Source Node ID\", \"File Name\", \"Target Destination Folder\", \"Target Node ID\", null, \"Target Node Status\", \"Message\", null, null);\n ExcelUtil.addMigrationRow(jobParameters.getMigrationReport(), \"Date Time\", \"Source Node Status\", \"Source Destination Folder\", documentItem);\n ExcelUtil.addErrorRow(jobParameters.getErrorReport(), \"Date Time\", \"Source Node Status\", \"Source Destination Folder\", documentItem);\n }", "public ExcelSheetExporter<T> build(List<T> dataModel, RowMapper<T> rowMapper) {\n\t\tthis.dataModelList = dataModel;\n\t\tthis.rowMapper = rowMapper;\n\t\texporterOptions = new ExporterOptions(new SimpleDateFormat(\"MM-dd-yyyy\"), ExporterOptions.FileExtension.XLS, true);\n\t\treturn this;\n\t}", "public ReportMakerTab() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t}", "public FieldView(int height, int width, Model model)\n {\n// super(model);\n \tgridHeight = height;\n gridWidth = width;\n size = new Dimension(0, 0);\n }", "public DataCell() {\n super();\n }", "public SalesReportView() {\n initComponents();\n }", "public ChessboardView() {\n\t\t\n\t\tcontroller = new ChessController(this);\n\t\t\n\t\tsetLayout(new GridLayout(10, 10));\n\t\t\n\t\t// creo i bottoni (caselle della scacchiera)\n\t\tcreateButtons();\n\t\t\n\t\t// assegno componenti alla griglia (buttons e labels)\n\t\taddComponents();\n\t}", "@Override\n public ReportDesign buildReportDesign(ReportDefinition reportDefinition) {\n ReportDesign rd = createExcelTemplateDesign(getExcelDesignUuid(), reportDefinition, \"SMCRegister.xls\");\n Properties props = new Properties();\n props.put(\"repeatingSections\", \"sheet:1,row:10-12,dataset:SMC\");\n props.put(\"sortWeight\", \"5000\");\n rd.setProperties(props);\n return rd;\n }", "public Bout()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n CreaBoutique();\n\n }", "public WorksheetTextualView(WorksheetAdapter model, Appendable ap) {\n this.model = model;\n this.ap = ap;\n }", "public void creatTemplate(Sheet sheet, String title) {\n\n String label1 = \"TẬP ĐOÀN VIỄN THÔNG QUÂN ĐỘI\";\n String label2 = \"TỔNG CÔNG TY VIỄN THÔNG VIETTEL\";\n String label3 = \"CỘNG HOÀ Xà HỘI CHỦ NGHĨA VIỆT NAM\";\n String label4 = \"Độc Lập - Tự Do - Hạnh Phúc\";\n\n createCellObject(sheet, 0, 0, label1, getCsSubTitle());\n createCellObject(sheet, 0, 1, label2, getCsCenterNoboderBoldweight());\n createCellObject(sheet, 5, 0, label3, getCsSubTitle());\n createCellObject(sheet, 5, 1, label4, getCsCenterNoboderBoldweight());\n createCellObject(sheet, 1, 4, title, getCsTitle());\n\n ExcelWriterUtils.mergeCells(sheet, 0, 0, 0, 2);\n ExcelWriterUtils.mergeCells(sheet, 1, 1, 0, 2);\n ExcelWriterUtils.mergeCells(sheet, 0, 0, 5, 8);\n ExcelWriterUtils.mergeCells(sheet, 1, 1, 5, 8);\n ExcelWriterUtils.mergeCells(sheet, 4, 4, 1, 6);\n\n setRowHeight(sheet, 4, 630);\n }", "private static Map<String, CellStyle> createStyles(Workbook wb) {\r\n Map<String, CellStyle> styles = new HashMap<>();\r\n DataFormat df = wb.createDataFormat();\r\n\r\n Font font1 = wb.createFont();\r\n\r\n CellStyle style;\r\n Font headerFont = wb.createFont();\r\n headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());\r\n style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n style.setFont(headerFont);\r\n styles.put(\"header\", style);\r\n\r\n style = wb.createCellStyle();\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setFont(font1);\r\n style.setLocked(false);\r\n styles.put(\"cell_centered\", style);\r\n\r\n style = wb.createCellStyle();\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setFont(font1);\r\n style.setLocked(true);\r\n styles.put(\"cell_centered_locked\", style);\r\n// style = createBorderedStyle(wb);\r\n// style.setAlignment(CellStyle.ALIGN_CENTER);\r\n// style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());\r\n// style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n// style.setFont(headerFont);\r\n// style.setDataFormat(df.getFormat(\"d-mmm\"));\r\n// styles.put(\"header_date\", style);\r\n font1.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_LEFT);\r\n style.setFont(font1);\r\n styles.put(\"cell_b\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setFont(font1);\r\n style.setLocked(false);\r\n styles.put(\"cell_b_centered\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setFont(font1);\r\n style.setLocked(true);\r\n styles.put(\"cell_b_centered_locked\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_RIGHT);\r\n style.setFont(font1);\r\n style.setDataFormat(df.getFormat(\"d-mmm\"));\r\n styles.put(\"cell_b_date\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_RIGHT);\r\n style.setFont(font1);\r\n style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());\r\n style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n style.setDataFormat(df.getFormat(\"d-mmm\"));\r\n styles.put(\"cell_g\", style);\r\n\r\n Font font2 = wb.createFont();\r\n font2.setColor(IndexedColors.BLUE.getIndex());\r\n font2.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_LEFT);\r\n style.setFont(font2);\r\n styles.put(\"cell_bb\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_RIGHT);\r\n style.setFont(font1);\r\n style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());\r\n style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n style.setDataFormat(df.getFormat(\"d-mmm\"));\r\n styles.put(\"cell_bg\", style);\r\n\r\n Font font3 = wb.createFont();\r\n font3.setFontHeightInPoints((short) 14);\r\n font3.setColor(IndexedColors.DARK_BLUE.getIndex());\r\n font3.setBoldweight(Font.BOLDWEIGHT_BOLD);\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_LEFT);\r\n style.setFont(font3);\r\n style.setWrapText(true);\r\n styles.put(\"cell_h\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_LEFT);\r\n style.setWrapText(true);\r\n styles.put(\"cell_normal\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_CENTER);\r\n style.setWrapText(true);\r\n styles.put(\"cell_normal_centered\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_RIGHT);\r\n style.setWrapText(true);\r\n style.setDataFormat(df.getFormat(\"d-mmm\"));\r\n styles.put(\"cell_normal_date\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setAlignment(CellStyle.ALIGN_LEFT);\r\n style.setIndention((short) 1);\r\n style.setWrapText(true);\r\n styles.put(\"cell_indented\", style);\r\n\r\n style = createBorderedStyle(wb);\r\n style.setFillForegroundColor(IndexedColors.BLUE.getIndex());\r\n style.setFillPattern(CellStyle.SOLID_FOREGROUND);\r\n styles.put(\"cell_blue\", style);\r\n\r\n return styles;\r\n }", "public Excel(Workbook workbook){\n this.workbook = workbook;\n isValid = false;\n initialized = false;\n }", "public GeometryWKTCellRenderer() {\n this(DEFAULT_MAX_WKT_LENGTH, DEFAULT_MAX_ROW_HEIGHT);\n }", "protected Stylesheet stylesheet () {\n return SimpleStyles.newSheet();\n }", "protected SheetCollate(int paramInt) {\n/* 182 */ super(paramInt);\n/* */ }", "public void initComponent(List<BatFileModel> modelList) throws Exception {\n\t\tsetTitle(\"Batch Manager\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetResizable(false);\n\t\tthis.setLayout(new MigLayout(\"\", \"[]\", \"\"));\n\n\t\t/*\n\t\t * Init ContainerPanel JPanel\n\t\t */\n\t\tcontainerPanel = new JPanel();\n\t\tcontainerPanel.setLayout(new MigLayout(\"wrap 2\", \"[100][1100]\", \"\"));\n\t\tcontainerPanel.setPreferredSize(new Dimension(1200, 600)); // This will\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// be\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// deactivated\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to test!\n\t\tcontainerPanel.setBorder(BorderFactory\n\t\t\t\t.createTitledBorder(\"ContainerPanel\"));\n\t\tcontainerPanel.setVisible(true);\n\n\t\t/*\n\t\t * Init navigationPanel JPanel\n\t\t */\n\t\tnavigationPanel = new JPanel();\n\t\tnavigationPanel.setLayout(new MigLayout(\"wrap 1\", \"[80]\", \"[]\"));\n\t\tnavigationPanel.setPreferredSize(new Dimension(100, 600));\n\t\tnavigationPanel.setBorder(BorderFactory\n\t\t\t\t.createTitledBorder(\"Navigation\"));\n\n\t\t/*\n\t\t * Init tablePanel JPanel This Panel contains all table elements!\n\t\t */\n\t\ttablePanel = new JPanel();\n\t\ttablePanel.setLayout(new MigLayout(\"wrap 1\", \"[1100]\", \"\"));\n\t\ttablePanel.setPreferredSize(new Dimension(1100, 600));\n\t\ttablePanel.setBorder(BorderFactory.createTitledBorder(\"Table\"));\n\n\t\t/*\n\t\t * Inýt TableModel\n\t\t */\n\t\ttableModel = new BatTableModel(modelList);\n\n\t\t/*\n\t\t * Init table JTable\n\t\t */\n\t\ttable = new JTable();\n\t\ttable.setPreferredSize(new Dimension(900, 600));\n\n\t\t/*\n\t\t * Init scrollTablePanel JScrollPane This panel is wrapper for JTable\n\t\t */\n\t\tscrollTablePanel = new JScrollPane();\n\t\tscrollTablePanel.setPreferredSize(new Dimension(1000, 600));\n\t\tscrollTablePanel.setBorder(BorderFactory\n\t\t\t\t.createTitledBorder(\"ScrollPane\"));\n\n\t\t/*\n\t\t * Init Buttons\n\t\t */\n\t\tokeyButton = new JButton(\"Add\");\n\t\teditButton = new JButton(\"Edit\");\n\t\tdeleteButton = new JButton(\"Remove\");\n\t\taddActionListeners();\n\n\t\t/*\n\t\t * Adding Components Each Other\n\t\t */\n\t\ttable.setModel(tableModel);\n\t\tscrollTablePanel.setViewportView(table);\n\t\ttablePanel.add(scrollTablePanel, \"span\");\n\n\t\tnavigationPanel.add(okeyButton, \"w 100!\");\n\t\tnavigationPanel.add(editButton, \"w 100!\");\n\t\tnavigationPanel.add(deleteButton, \"w 100!\");\n\n\t\tcontainerPanel.add(navigationPanel);\n\t\tcontainerPanel.add(tablePanel);\n\t\tsetPresenter(MainPresenter.getInstance());\n\t\tthis.add(containerPanel);\n\t\tthis.validate();\n\t\tpack();\n\t}", "private void initComponent() {\n\t\t// Create Table Model (rows, columns...)\n\t\ttableur = new DefaultTableModel();\n\t\t// Add title column\n\t\ttableur.addColumn(fileNumber);\n\t\ttableur.addColumn(fileName);\n\t\ttableur.addColumn(\"\");\n\t\t// Add line of Action History with NodeStructureDTO\n\t\twhile(rootNode != null){\n\t\t\ttableur.addRow(new Object[] {rootNode.getId() , rootNode.getCompletePath()});\n\t\t\trootNode = rootNode.getNextNode();\n\t\t}\n\t\t//Create JTable \n\t\ttableHistory = new JTable(tableur);\n\t\t//Change the renderer of third cells whith grey font \n\t\ttableHistory.getColumn(\"\").setCellRenderer(new ButtonRenderer());\n\t\t//Make a CheckBox in this cell\n\t\ttableHistory.getColumn(\"\").setCellEditor(new ButtonEditor(new JCheckBox()));\n\t\t//Block reordering\n\t\ttableHistory.getTableHeader().setReorderingAllowed(false);\n\t\ttableHistory.setPreferredScrollableViewportSize(new Dimension(600 , 400));\n\t\tadd(new JScrollPane(tableHistory) , BorderLayout.CENTER);\n\t}", "public Home() {\n initComponents();\n setExtendedState(MAXIMIZED_BOTH);\n setLocationRelativeTo(null);\n\n loadNews();\n loadBlog();\n this.model = new DefaultTableModel();\n\n TableColumnModel columnmodel = tableNotifications.getColumnModel();\n columnmodel.removeColumn(columnmodel.getColumn(4));\n //tableNotifications.getTableHeader().setUI(null);\n tableNotifications.setShowGrid(false);\n scrNotifications.getViewport().setBackground(Color.white);\n loadNotifications();\n }", "public Sheet createSheet(String arg0) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void initialize(URL location, ResourceBundle resources) {\n\t\tnomCol.setCellValueFactory(\r\n\t\t\t\tnew Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() {\r\n\t\t\t @Override\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) {\r\n\t\t\t return new ReadOnlyStringWrapper(data.getValue().get(0)) ;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t) ;\r\n\t\tprenomCol.setCellValueFactory(\r\n\t\t\t\t\tnew Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() {\r\n\t\t\t\t\t @Override\r\n\t\t\t\t\t public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) {\r\n\t\t\t\t\t return new ReadOnlyStringWrapper(data.getValue().get(1)) ;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}) ;\r\n\t\tcinCol.setCellValueFactory(\r\n\t\t\t\t\tnew Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() {\r\n\t\t\t\t\t @Override\r\n\t\t\t\t\t public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) {\r\n\t\t\t\t\t return new ReadOnlyStringWrapper(data.getValue().get(2)) ;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t\t) ;\r\n\t\ttypeCol.setCellValueFactory(\r\n\t\t\t\t\tnew Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() {\r\n\t\t\t\t\t @Override\r\n\t\t\t\t\t public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) {\r\n\t\t\t\t\t return new ReadOnlyStringWrapper(data.getValue().get(3)) ;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t\t) ;\r\n\t}", "public void initialize() {\n ResourceMap resourceMap = BDApp.getResourceMap(LoadTestReportTable.class);\n for (int i = 0; i < LoadTestReportTableModel.columnNames.length; i++) {\n TableColumn column = getColumnModel().getColumn(i);\n column.setResizable(true);\n final String headerText = resourceMap.getString(LoadTestReportTableModel.columnNames[i] + \"ColumnHeader.text\");\n column.setHeaderValue(headerText);\n int width = resourceMap.getInteger(LoadTestReportTableModel.columnNames[i] + \"Column.width\");\n column.setPreferredWidth(width);\n if (headerText.length() == 0) {\n column.setMinWidth(width);\n column.setMaxWidth(width);\n }\n // Install our special column renderer.\n column.setCellRenderer(specialCellRenderer);\n }\n cvsHeaders = resourceMap.getString(\"cvsHeaders.text\");\n }", "public DisplayPanel(final Ensemble model) {\n this.model = model;\n this.setPreferredSize(new Dimension(700,\n 600));\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(final ComponentEvent e) {\n final Component c = (Component)e.getSource();\n model.setWalls(DisplayPanel.COLS, DisplayPanel.ROWS, c.getWidth() - DisplayPanel.COLS, c.getHeight() - DisplayPanel.ROWS);\n }\n\n });\n }", "private ByaTableModel() {\n\t}", "ISheet addSheet();", "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 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 }", "public ChartCustom(int type,Chathurangam mapp,WorkSheet ws)\n\t{\n\t\tsuper(\"Chart Options\");\n\t\tmap=mapp;\n\t\tsetIconImage(img);\n\t\tthis.type=type;\n\t\tthis.ws=ws;\n\t\ttitles=new String[3];\n\t\tString XAxisHelp=new String(map.getWordBundle().getString(\"XaxRange\"));\n\t\tString XAxisEg=new String(map.getWordBundle().getString(\"Example\")+\":- 1,1:2,2\");\n\t\tGridLayout gl,glMain;\n\t\tglMain=new GridLayout(2,1);\n\t\tif(type!=0)\n\t\t{\n\t\t\tgl=new GridLayout(4,2);\n\t\t\tgl.setVgap(5);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgl=new GridLayout(2,2);\n\t\t\tgl.setVgap(20);\n\t\t}\n\t\tjp.setLayout(gl);\n\t\tContainer contents=getContentPane();\n\t\tchartLabel=new JLabel(\" õ¬óðì î¬ôð¢¹\");\n\t\tchartLabel.setFont(curFont);\n\t\tchartLabel.setForeground(Color.black);\n\t\txLabel=new JLabel(\" 褬ì Üꢲ î¬ôð¢¹\");\n\t\txLabel.setFont(curFont);\n\t\txLabel.setForeground(Color.black);\n\t\tyLabel=new JLabel(\" àòó¢ Üꢲ î¬ôð¢¹\");\n\t\tyLabel.setFont(curFont);\n\t\tyLabel.setForeground(Color.black);\n\t\txValLabel=new JLabel(\" 褬ì Üꢲ âô¢¬ô\");\n\t\txValLabel.setFont(curFont);\n\t\txValLabel.setForeground(Color.black);\n\t\tchartTitle=new JTextField();\n\t\tchartTitle.setFont(curFont);\n\t\txTitle=new JTextField();\n\t\txTitle.setFont(curFont);\n\t\tyTitle=new JTextField();\n\t\tyTitle.setFont(curFont);\n\t\txValue=new JTextField();\n\t\txValue.setFont(curFont);\n\t\tjp.add(chartLabel);\n\t\tjp.add(chartTitle);\n\t\tif(type!=0)\n\t\t{\n\t\t\tjp.add(xLabel);\n\t\t\tjp.add(xTitle);\n\t\t\tjp.add(yLabel);\n\t\t\tjp.add(yTitle);\n\t\t}\n\t\t//jp.add(xValLabel);\n\t\t//jp.add(xValue);\n\t\tok=new JButton(map.getWordBundle().getString(\"ok\"));\n\t\tok.setFont(curFont);\n\t\tok.addActionListener(this);\n\t\tcancel=new JButton(map.getWordBundle().getString(\"cancel\"));\n\t\tcancel.setFont(curFont);\n\t\tcancel.addActionListener(this);\n\t\tjp1.add(ok);\n\t\tjp1.add(cancel);\n\t\tJLabel X1=new JLabel(XAxisHelp);\n\t\tX1.setForeground(Color.black);\n\t\tjp1.add(X1);\n\t\tJLabel X2=new JLabel(XAxisEg);\n\t\tX2.setForeground(Color.black);\n\t\tjp1.add(X2);\n\t\tcontents.setLayout(glMain);\n\t\tcontents.add(jp);\n\t\tcontents.add(jp1);\n\t\tif(type!=0)\n\t\t\tsetSize(650,250);\n\t\telse\n\t\t\tsetSize(650,200);\n\t\tsetVisible(true);\n\n\t\taddKeyListener(new KeyAdapter()\n\t\t\t\t{\n\t\t\t\t\tpublic void keyPressed(KeyEvent ke)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ke.getKeyCode() == 27)//Esc\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t}", "private JPanel getPageSheet() {\r\n\t\tif (pageSheet == null) {\r\n\t\t\trecordNumInit = new JLabel();\r\n\t\t\trecordNumInit.setBounds(new java.awt.Rectangle(497,0,70,20));\r\n\t\t\trecordNumInit.setText(\"\");\r\n\t\t\trecordNumInit.setBackground(new Color(255, 204, 204));\r\n\t\t\tfieldIdInit = new JLabel();\r\n\t\t\tfieldIdInit.setBounds(new Rectangle(83, 20, 87, 20));\r\n\t\t\tfieldIdInit.setText(\"JLabel\");\r\n\t\t\tpageSheet = new JPanel();\r\n\t\t\tpageSheet.setBounds(new Rectangle(10, 135, 770, 340));\r\n\t\t\tpageSheet.setLayout(null);\r\n\t\t\tpageSheet.add(fieldIdInit, null);\r\n\t\t\t\r\n\t\t\timageButton = new CustomerImage(\"\");\r\n\t\t\timageButton.setVerticalAlignment(SwingConstants.CENTER);\r\n\t\t\timageButton.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\timageButton.setBounds(new Rectangle(480, 0, 207, 60));\r\n\t\t\tpageSheet.add(imageButton);\r\n\t\t\tpageSheet.add(recordNumInit, null);\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tcheckInit = new JCheckBox(\"\");\r\n\t\t\tcheckInit.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\t\tcheckInit.setBounds(3, 20, 70, 20);\r\n\t\t\tpageSheet.add(checkInit);\r\n\t\t\t\r\n\t\t\tfiledNameInit = new JLabel();\r\n\t\t\tfiledNameInit.setText(\"JLabel\");\r\n\t\t\tfiledNameInit.setBounds(new Rectangle(83, 20, 87, 20));\r\n\t\t\tfiledNameInit.setBounds(180, 20, 140, 20);\r\n\t\t\tpageSheet.add(filedNameInit);\r\n\t\t\t\r\n\t\t\tfieldTypeInit = new JLabel();\r\n\t\t\tfieldTypeInit.setText(\"JLabel\");\r\n\t\t\tfieldTypeInit.setBounds(new Rectangle(83, 20, 87, 20));\r\n\t\t\tfieldTypeInit.setBounds(348, 20, 100, 20);\r\n\t\t\tpageSheet.add(fieldTypeInit);\r\n\t\t}\r\n\t\treturn pageSheet;\r\n\t}", "SpreadSheet() {\n /* Taene Onwane Windowz wa andazeye an*/\n super(\"My Basic SpreadSheet \"+namC+\", Spring 2011, University of Kurdistan-MOHSENmirzay\");\n setSize(1100, 700);\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n /*ezafe kardane menu wa item haye an*/\n setJMenuBar(jmb);\n jmb.add(jmFile); jmb.add(jmEdit); jmb.add(jmFunction);\n jmFile.add(jmiNew); jmFile.add(jmiOpen); jmFile.add(jmiSave); jmFile.add(jmiSaveAs); jmFile.add(jmiExit);\n jmEdit.add(jmiCut); jmEdit.add(jmiCopy); jmEdit.add(jmiPaste); jmEdit.addSeparator(); jmEdit.add(jmiSelAll);\n jmFunction.add(jmiMax); jmFunction.add(jmiMin); jmFunction.add(jmiSum); jmFunction.add(jmiAve); jmFunction.add(jmiCount);\n /*ezafe kardane khate zirin baraye menu ha wa item ha*/\n jmFile.setMnemonic('F'); jmEdit.setMnemonic('E'); jmFunction.setMnemonic('u'); jmiSelAll.setMnemonic('l');\n jmiNew.setMnemonic('N'); jmiOpen.setMnemonic('O'); jmiSave.setMnemonic('S'); jmiSaveAs.setMnemonic('A'); jmiExit.setMnemonic('E');\n jmiMax.setMnemonic('M'); jmiMin.setMnemonic('i'); jmiSum.setMnemonic('S'); jmiAve.setMnemonic('A'); jmiCount.setMnemonic('C');\n /*ezafe kardane Item Popupmenu baraye klike RAST*/\n jpm.add(jpmiCut);\n jpm.add(jpmiCopy);\n jpm.add(jpmiPaste);\n /*ezafe kardane Listener be meno ha jahat fa'al sazi events*/\n jmiNew.addActionListener(new AL(1));\n jmiOpen.addActionListener(new AL(2));\n jmiSave.addActionListener(new AL(3));\n jmiSaveAs.addActionListener(new AL(4));\n jmiExit.addActionListener(new AL(5));\n jmiCut.addActionListener(new AL(6));\n jmiCopy.addActionListener(new AL(7));\n jmiPaste.addActionListener(new AL(8));\n jmiSelAll.addActionListener(new AL(14));\n jpmiCut.addActionListener(new AL(6));\n jpmiCopy.addActionListener(new AL(7));\n jpmiPaste.addActionListener(new AL(8));\n jmiMax.addActionListener(new AL(9));\n jmiMin.addActionListener(new AL(10));\n jmiSum.addActionListener(new AL(11));\n jmiAve.addActionListener(new AL(12));\n jmiCount.addActionListener(new AL(13));\n jmFile.addMouseListener(new ML());\n jmFile.addFocusListener(new FL());\n jmFile.addKeyListener(new KL());\n jmEdit.addMouseListener(new ML());\n jmEdit.addFocusListener(new FL());\n jmEdit.addKeyListener(new KL());\n jmFunction.addMouseListener(new ML());\n jmFunction.addFocusListener(new FL());\n jmFunction.addKeyListener(new KL());\n /* ezafe kardane khanehaye Excel be Panel barname*/\n for(int i=0; i<30; i++)\n for(int j=0; j<26; j++){\n jtf[i][j]=new JTextField();\n jtf[i][j].setEnabled(false);\n jtf[i][j].addMouseListener(new ML(i,j));\n jtf[i][j].addFocusListener(new FL(i,j));\n jtf[i][j].addKeyListener(new KL(i, j));\n jtf[i][j].addMouseMotionListener(new MML(i,j));\n jtf[i][j].setToolTipText(\"cell[\"+i+\"]\"+\"[\"+j+\"]\");\n jtf[i][j].setDisabledTextColor(Color.red);\n jtf[i][j].add(jpm);\n jp.add(jtf[i][j]);\n }\n /* Fa'al sazi Windowse marbut be barname*/\n addKeyListener(new KL());\n jp.addKeyListener(new KL());\n getContentPane().add(scp);\n setVisible(true);\n }", "public CrosstabFigure(MCrosstab crosstabModel) {\n\t\tsuper(crosstabModel);\n\t\tsetLayoutManager(new XYLayout());\n\t}", "public ColumnRow ()\r\n {\r\n super();\r\n }", "public void setSheetNumber(int number){\n this.sheetNumber = number;\n }", "private void createNewSheet(SXSSFSheet sheet, int rowNum, int countColumns, ResultSet result, SXSSFWorkbook workbook) throws SQLException {\n ResultSetMetaData metaDataColumns = result.getMetaData();\n sheet.setAutobreaks(true);\n sheet.setAutoFilter(new CellRangeAddress(0, rowNum, 0, countColumns - 1));\n// sheet.autoSizeColumn(0);\n sheet.setFitToPage(true);\n // Creamos un nuevo ROW para el header\n SXSSFRow header = sheet.createRow(rowNum);\n System.out.println(\"Add Header\");\n for (int colHeader = 1; colHeader <= countColumns; colHeader++) {\n // Creamos una nueva celda para cada una de las celdas\n SXSSFCell cellHeader = header.createCell(colHeader - 1);\n // agregamos el valor de la celda\n cellHeader.setCellValue(metaDataColumns.getColumnName(colHeader).toUpperCase());\n }\n rowNum++;\n // Verificamos si hay datos\n System.out.println(\"Add Row Data\");\n while (result.next()) {\n // Creamos un nuevo ROW para los cada nueva fila del resultSet\n SXSSFRow data = sheet.createRow(rowNum);\n // Recorremos los datos de las columnas\n for (int rowdata = 1; rowdata <= countColumns; rowdata++) {\n // Creamos una nueva celda para cada una de las celdas\n SXSSFCell cellData = data.createCell(rowdata - 1);\n // agregamos el valor de la celda\n Object object = result.getObject(rowdata);\n if (object == null) {\n cellData.setCellValue(\"\");\n } else {\n switch (metaDataColumns.getColumnType(rowdata)) {\n case Types.BOOLEAN:\n cellData.setCellValue((boolean) object);\n break;\n case Types.DATE:\n cellData.setCellValue((Date) object);\n case Types.TIMESTAMP_WITH_TIMEZONE:\n cellData.setCellValue((Date) object);\n break;\n case Types.NUMERIC:\n cellData.setCellValue(((BigDecimal) object).doubleValue());\n break;\n case Types.FLOAT:\n cellData.setCellValue(((Float) object).doubleValue());\n break;\n case Types.INTEGER:\n cellData.setCellValue(((Integer) object).doubleValue());\n break;\n case Types.SMALLINT:\n cellData.setCellValue(((Integer) object).doubleValue());\n break;\n case Types.BIGINT:\n cellData.setCellValue(((Long) object).doubleValue());\n break;\n default:\n cellData.setCellValue(object + \"\");\n break;\n }\n }\n }\n // Incrementamos el contador de registros\n rowNum++;\n // Imprimimos cada 10000 registros procesados\n if ((rowNum % 10000) == 0) {\n System.out.println(\"Procesando \" + rowNum);\n }\n // Validamos el maximo de registros que soporta excel 2007\n // Creamos una nueva hoja para los siguinetes registros\n if ((rowNum % 1048570) == 0) {\n // creamos una nueva hoja\n sheet = workbook.createSheet(name + (workbook.getNumberOfSheets() + 1));\n // enviamos a llenar la hoja\n createNewSheet(sheet, 0, countColumns, result, workbook);\n }\n }\n }", "public salida()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n }", "public GamRowsVORowImpl() {\n }", "public void createMarksheet() {\n }", "public void addNotDefinedCells()\r\n {\r\n if (getCrosstabElement() == null) return;\r\n\r\n // First of all we have to calc what cells we have and in what position they are...\r\n int cellGridWidth = getCrosstabElement().getColumnGroups().size();\r\n int cellGridHeight = getCrosstabElement().getRowGroups().size();\r\n\r\n // We assume that cell D/D (detail/detail) is defined.\r\n // Cell x,y is the cell with totalColumnGroup = colums(x) and totalRowGroup the rows(y)\r\n\r\n for (int y = cellGridHeight; y >= 0; --y)\r\n {\r\n\r\n\r\n for (int x = cellGridWidth; x >= 0; --x)\r\n {\r\n\r\n String totalRowGroupName = \"\";\r\n if (y < cellGridHeight) totalRowGroupName = ((CrosstabGroup)getCrosstabElement().getRowGroups().get(y)).getName();\r\n\r\n String totalColumnGroupName = \"\";\r\n if (x < cellGridWidth) totalColumnGroupName = ((CrosstabGroup)getCrosstabElement().getColumnGroups().get(x)).getName();\r\n\r\n CrosstabCell cell = findCell( totalRowGroupName,\r\n totalColumnGroupName);\r\n\r\n if (cell == null)\r\n {\r\n // we have to find a cell on the same row that matchs the width to inherit by...\r\n int cellHeight = getRowHeight( totalRowGroupName );\r\n int cellWidth = getColumnWidth( totalColumnGroupName );\r\n\r\n\r\n // look for a good row cell with the same width on the same row...\r\n CrosstabCell templateCell = null;\r\n for (int k=x+1; k < cellGridWidth; ++k)\r\n {\r\n templateCell = findCell( totalRowGroupName,\r\n ((CrosstabGroup)getCrosstabElement().getColumnGroups().get(k)).getName());\r\n if (templateCell == null)\r\n {\r\n continue;\r\n }\r\n\r\n if (templateCell.getWidth() == cellWidth)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n templateCell = null;\r\n }\r\n }\r\n if (templateCell == null)\r\n {\r\n templateCell = findCell( totalRowGroupName, \"\");\r\n if (templateCell != null && templateCell.getWidth() != cellWidth) templateCell = null;\r\n }\r\n\r\n if (templateCell == null) // Look on the same column...\r\n {\r\n for (int k=y+1; k < cellGridHeight; ++k)\r\n {\r\n templateCell = findCell( ((CrosstabGroup)getCrosstabElement().getRowGroups().get(k)).getName(),\r\n totalColumnGroupName);\r\n\r\n if (templateCell.getHeight() == cellHeight)\r\n {\r\n // FOUND IT!\r\n break;\r\n }\r\n else\r\n {\r\n templateCell = null;\r\n }\r\n }\r\n if (templateCell == null)\r\n {\r\n templateCell = findCell( \"\", totalColumnGroupName);\r\n if (templateCell != null && templateCell.getHeight() != cellHeight) templateCell = null;\r\n }\r\n }\r\n\r\n if (templateCell == null)\r\n {\r\n // Default not found!!!! Our cell will be void!\r\n cell = new CrosstabCell();\r\n cell.setParent( this.getCrosstabElement());\r\n cell.setWidth(cellWidth);\r\n cell.setHeight(cellHeight);\r\n cell.setColumnTotalGroup( totalColumnGroupName);\r\n cell.setRowTotalGroup( totalRowGroupName );\r\n }\r\n else\r\n {\r\n cell = templateCell.cloneMe();\r\n cell.setColumnTotalGroup( totalColumnGroupName);\r\n cell.setRowTotalGroup( totalRowGroupName );\r\n cell.setParent( this.getCrosstabElement());\r\n\r\n // Duplicate all elements of this cell, and reassign parent cell...\r\n int currentElements = getCrosstabElement().getElements().size();\r\n for (int i=0; i<currentElements; ++i)\r\n {\r\n ReportElement re = (ReportElement)getCrosstabElement().getElements().elementAt(i);\r\n // WARNING this copy does not support container and group elements!!!\r\n if (re.getCell() == templateCell)\r\n {\r\n re = re.cloneMe();\r\n cell.setColumnTotalGroup(totalColumnGroupName );\r\n cell.setRowTotalGroup(totalRowGroupName );\r\n re.setCell( cell );\r\n getCrosstabElement().getElements().add(re);\r\n }\r\n }\r\n }\r\n\r\n getCrosstabElement().getCells().add( cell );\r\n }\r\n }\r\n }\r\n\r\n }", "public BasicTableModel() {\n\t\tcolNames = new ArrayList<String>();\n\t\tdata = new ArrayList<List>();\n\t}", "Cell() {\r\n\t\tstate = CellState.EMPTY;\r\n\t}", "public SudokuModel() {\n board = new Board();\n\t\tisEditing = false;\n\t\teditIndex = new int[2];\n }", "public SalesView() {\n initComponents();\n salesDetailTable.setAutoCreateColumnsFromModel(false);\n jdcTransaksi.setDate(new Date());\n enableForm(false);\n buttonConfig();\n salesDetailTable.getTableHeader().setFont(new Font(\"Segoe UI\", 0, 18)); \n }", "public Display() {\r\n\t\t//Fills the board with invalid positions\r\n\t\tboard = new int[17][17];\r\n\t\tfor (int i = 0; i < 17; i++)\r\n\t\t\tfor (int j = 0; j < 17; j++)\r\n\t\t\t\tboard[i][j] = -1;\r\n\r\n\t\t//Fills the center of the board with valid positions\r\n\t\tfor (int i = 4; i <= 12; i++)\r\n\t\t\tfor (int j = 4; j <= 12; j++)\r\n\t\t\t\tboard[i][j] = 0;\r\n\t\t\r\n\t\t//Fills the rest of the board with valid positions\r\n\t\tfillTriangle(-1, board, 0, 16, 12);\r\n\t\tfillTriangle(1, board, 0, 9, 13);\r\n\t\tfillTriangle(-1, board, 0, 7, 12);\r\n\t\tfillTriangle(1, board, 0, 0, 4);\r\n\t\tfillTriangle(-1, board, 0, 7, 3);\r\n\t\tfillTriangle(1, board, 0, 9, 4);\r\n\t\t\r\n\t\tthis.setPreferredSize(SIZE);\r\n\t}", "@Override\n\tpublic CellStyle getRowStyle() {\n\t\treturn null;\n\t}", "public Table(int m, double w, double h) {\r\n maxPoints = m;\r\n width = w;\r\n height = h;\r\n directionend = new int[]{0, 2};\r\n end = new int[]{100, 100};\r\n endy = new double[2];\r\n endx = new double[2];\r\n endy[0] = endy[1] = height / 2 - 80 / 2;\r\n endx[0] = endx[1] = width / 2 - 40 / 2;\r\n mixDominoes();\r\n }", "private void initComponents(Object[][] model) {\n\t\tDate DateNow = new Date();\n\t\tint second, minute, hour, AmPm;\n\n\t\tCalendar cal = new GregorianCalendar();\n\t\thour = cal.get(Calendar.HOUR);\n\t\tminute = cal.get(Calendar.MINUTE);\n\t\tAmPm = cal.get(Calendar.AM_PM);\n\n\t\tString timeOfDay = \"\";\n\n\t\tif (AmPm == 1) {\n\t\t\ttimeOfDay = \"PM\";\n\n\t\t} else {\n\t\t\ttimeOfDay = \"AM\";\n\t\t}\n\t\tString time = hour + \":\" + minute + \"\" + timeOfDay;\n\n\t\tJLabel jLabel1 = new JLabel();\n\t\tJScrollPane jScrollPane2 = new JScrollPane();\n\n\t\tjTable2 = new JTable(/* new FilesTable() */) {\n\t\t\tpublic Component prepareRenderer(TableCellRenderer r, int col, int row) {\n\n\t\t\t\tComponent comp = super.prepareRenderer(r, row, col);\n\n\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\tif (col == 0) {\n\t\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 2));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 1) {\n\t\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 2) {\n\t\t\t\t\tcomp.setBackground(Color.MAGENTA);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 3) {\n\t\t\t\t\tcomp.setBackground(Color.RED);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 4) {\n\t\t\t\t\tcomp.setBackground(Color.RED);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\n\t\t\t\t}\n\t\t\t\tif (col == 5) {\n\t\t\t\t\tcomp.setBackground(Color.BLUE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 6) {\n\t\t\t\t\tcomp.setBackground(Color.GREEN);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 7) {\n\t\t\t\t\tcomp.setBackground(Color.YELLOW);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 8) {\n\t\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 9) {\n\t\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\tif (col == 10) {\n\t\t\t\t\tcomp.setBackground(Color.WHITE);\n\t\t\t\t\tcomp.setFont(new Font(\"Burton Sketch\", 1, 12));\n\t\t\t\t\tcomp.setForeground(Color.BLACK);\n\n\t\t\t\t}\n\t\t\t\t// jTable2 = new JTable(new FilesTable());\n\n\t\t\t\treturn comp;\n\n\t\t\t}\n\t\t};\n\n\t\t/*\n\t\t * jTable21.addColumn(\"Channels\");\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t * jTable21.addColumn((hour++)+\":00\"+timeOfDay);\n\t\t */\n\n\t\tsetDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n\t\tjLabel1.setText(\n\t\t\t\t\"JCTCT Cable TV Programme Listing \" + \" \" + \" \" + \" \" + DateNow);\n\t\tjLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED,\n\t\t\t\tjava.awt.Color.cyan, java.awt.Color.lightGray, null, java.awt.Color.black));\n\n\t\tjScrollPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null,\n\t\t\t\tnew java.awt.Color(153, 153, 255), null, null));\n\t\tjScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t\tjScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tjScrollPane2.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);\n\n\t\tjTable2.setAutoCreateColumnsFromModel(true);\n\n\t\tjTable2.setModel(new javax.swing.table.DefaultTableModel(\n\t\t\t\tnew Object[][] {\n\t\t\t\t\t\t{ \"200- News\", \"201-TLC\", \"202-Disney Jnr\", \"203-Lifetime\", \"204-HBO Max\", \"205-TBN\",\n\t\t\t\t\t\t\t\t\"206-Today Weather\", \"207-TBS\", \"208-MTV\", \"209-TNT\", \"210-USA\" },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },\n\t\t\t\t\t\t{ null, null, null, null }, { null, null, null, null }, { null, null, null, null },},\n\t\t\t\tnew String[] { \"Channels\", (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay, (hour++) + \":00\" + timeOfDay,\n\t\t\t\t\t\t(hour++) + \":00\" + timeOfDay,(hour++) + \":00\" + timeOfDay\n\t\t}));\n\n\t\tTableColumn column = null;\n\t\tfor (int i = 0; i < 18; i++) {\n\t\t\tcolumn = jTable2.getColumnModel().getColumn(i);\n\t\t\tif (i > 0) {\n\t\t\t\tcolumn.setPreferredWidth(200); // third column is bigger\n\t\t\t} else {\n\t\t\t\tcolumn.setPreferredWidth(150);\n\t\t\t}\n\t\t}\n\n\t\tint column_count = 0;\n\t\tint data_row = 0;\n\t\tint data_column = 0;\n\t\tfor (int i = 1; i < 11; i++) {\n\t\t\twhile (column_count < 18) {\n\t\t\t\tjTable2.setValueAt(model[data_column][data_row], i, column_count);\n\t\t\t\tdata_column++;\n\t\t\t\tcolumn_count++;\n\t\t\t}\n\t\t\tdata_row++;\n\t\t\tdata_column = 0;\n\t\t\tcolumn_count = 0;\n\t\t}\n\n\t\tfinal Popup pop = new Popup(jTable2);\n\n\t\t// Event\n\t\tjTable2.addMouseListener(new MouseAdapter() {\n\t\t\tpublic void mouseClicked(MouseEvent me) {\n\t\t\t\t// determine if right clicked\n\t\t\t\t//System.out.println(detailed_model[jTable2.rowAtPoint(me.getPoint())][jTable2.columnAtPoint(me.getPoint())]);\n\t\t\t\trow_position = jTable2.rowAtPoint(me.getPoint());\n\t\t\t\tcolumn_position = jTable2.columnAtPoint(me.getPoint());\n\t\t\t\tif (SwingUtilities.isRightMouseButton(me)) {\n\t\t\t\t\tpop.show(me.getComponent(), me.getX(), me.getY());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tjTable2.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {\n\n\t\t});\n\n\t\tjTable2.setPreferredScrollableViewportSize(new Dimension(1800, 400));\n\t\tjTable2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\t\tjTable2.getTableHeader().setReorderingAllowed(false);\n\t\tjTable2.setColumnSelectionAllowed(true);\n\t\tjTable2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tjTable2.setDragEnabled(true);\n\t\tjTable2.setInheritsPopupMenu(true);\n\t\tjTable2.setIntercellSpacing(new java.awt.Dimension(3, 3));\n\t\tjTable2.setBounds(300, 300, 100, 200);\n\t\tjScrollPane2.setViewportView(jTable2);\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n\t\tgetContentPane().setLayout(layout);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 551, Short.MAX_VALUE));\n\t\tlayout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(jLabel1)\n\t\t\t\t\t\t.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane2,\n\t\t\t\t\t\t\t\tjavax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)\n\t\t\t\t.addContainerGap()));\n\n\t\tpack();\n\t}", "public void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 806, 499);\n\t\tframe.setDefaultCloseOperation(1);\n\t\tframe.getContentPane().setLayout(null);\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(\"javax.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t} catch (ClassNotFoundException | InstantiationException | IllegalAccessException\n\t\t\t\t| UnsupportedLookAndFeelException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBounds(0, 243, 790, 217);\n\t\tframe.getContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane();\n\t\tscrollPane.setBounds(10, 11, 770, 169);\n\t\tpanel.add(scrollPane);\n\t\t\n\t\ttable = new JTable();\n\t\ttable.setModel(model);\n\t\tmodel.setColumnIdentifiers(inventory);\n\t\tscrollPane.setViewportView(table);\n\t\ttable.getColumnModel().getColumn(0).setPreferredWidth(100);\n\t\ttable.getColumnModel().getColumn(1).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(2).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(3).setPreferredWidth(110);\n\t\ttable.getColumnModel().getColumn(4).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(5).setPreferredWidth(100);\n\t\ttable.getColumnModel().getColumn(6).setPreferredWidth(110);\n\t\ttable.getColumnModel().getColumn(7).setPreferredWidth(120);\n\t\ttable.getColumnModel().getColumn(7).setPreferredWidth(120);\n\n//\n//\t\ttable.setShowGrid(false);\n//\t\ttable.setShowHorizontalLines(true);\n//\t\ttable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\t\ttable.setDefaultEditor(Object.class, null);\n\t\tscrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n\t\t\n\t\tJPanel panel_1 = new JPanel();\n\t\tpanel_1.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), \"Add New Item\", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 205)));\n\t\tpanel_1.setBounds(10, 11, 770, 194);\n\t\tframe.getContentPane().add(panel_1);\n\t\tpanel_1.setLayout(null);\n\t\t\n\t\tdrugIDGen = new JTextField();\n\t\tdrugIDGen.setBounds(123, 32, 146, 26);\n\t\tpanel_1.add(drugIDGen);\n\t\tdrugIDGen.setColumns(10);\n\t\t\n\t\texDate = new JTextField();\n\t\texDate.setColumns(10);\n\t\texDate.setBounds(123, 143, 146, 26);\n\t\tpanel_1.add(exDate);\n\t\t\n\t\tdate = new JTextField();\n\t\tdate.setColumns(10);\n\t\tdate.setBounds(388, 143, 146, 26);\n\t\tpanel_1.add(date);\n\t\t\n\t\tdrugname = new JTextField();\n\t\tdrugname.setColumns(10);\n\t\tdrugname.setBounds(123, 69, 146, 26);\n\t\tpanel_1.add(drugname);\n\t\t\n\t\tuPrice = new JTextField();\n\t\tuPrice.setColumns(10);\n\t\tuPrice.setBounds(388, 32, 146, 26);\n\t\tpanel_1.add(uPrice);\n\t\t\n\t\tqSold = new JTextField();\n\t\tqSold.setColumns(10);\n\t\tqSold.setBounds(388, 69, 146, 26);\n\t\tpanel_1.add(qSold);\n\t\tqSold.setText(0+\"\");\n\t\tqSold.setEditable(false);\n\t\t\n\t\tgrammage = new JTextField();\n\t\tgrammage.setColumns(10);\n\t\tgrammage.setBounds(123, 106, 146, 26);\n\t\tpanel_1.add(grammage);\n\t\t\n\t\tqRemaining = new JTextField();\n\t\tqRemaining.setColumns(10);\n\t\tqRemaining.setBounds(388, 106, 146, 26);\n\t\tpanel_1.add(qRemaining);\n\t\t\n\t\tdrugidTxt = new JLabel(\"Drug ID\");\n\t\tdrugidTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugidTxt.setBounds(10, 33, 103, 20);\n\t\tpanel_1.add(drugidTxt);\n\t\t\n\t\tdrugnameTxt_1 = new JLabel(\"Drug Name\");\n\t\tdrugnameTxt_1.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugnameTxt_1.setBounds(10, 75, 103, 20);\n\t\tpanel_1.add(drugnameTxt_1);\n\t\t\n\t\tdrugnameTxt = new JLabel(\"Grammage\");\n\t\tdrugnameTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tdrugnameTxt.setBounds(10, 112, 103, 20);\n\t\tpanel_1.add(drugnameTxt);\n\t\t\n\t\tlblExpiryDate = new JLabel(\"Expiry Date\");\n\t\tlblExpiryDate.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblExpiryDate.setBounds(10, 149, 103, 20);\n\t\tpanel_1.add(lblExpiryDate);\n\t\t\n\t\tunitpriceTxt = new JLabel(\"Unit Price\");\n\t\tunitpriceTxt.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tunitpriceTxt.setBounds(279, 32, 103, 20);\n\t\tpanel_1.add(unitpriceTxt);\n\t\t\n\t\tlblQtySold = new JLabel(\"QTY Sold\");\n\t\tlblQtySold.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblQtySold.setBounds(279, 69, 103, 20);\n\t\tpanel_1.add(lblQtySold);\n\t\t\n\t\tlblQtyReamin = new JLabel(\"Drug QTY \");\n\t\tlblQtyReamin.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblQtyReamin.setBounds(275, 107, 103, 20);\n\t\tpanel_1.add(lblQtyReamin);\n\t\t\n\t\tlblPurchDate = new JLabel(\"Purch. Date\");\n\t\tlblPurchDate.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblPurchDate.setBounds(279, 144, 103, 20);\n\t\tpanel_1.add(lblPurchDate);\n\t\t\n\t\tpanel_2 = new JPanel();\n\t\tpanel_2.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(255, 255, 255), new Color(160, 160, 160)), \"Menu\", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 205)));\n\t\tpanel_2.setBounds(544, 32, 216, 138);\n\t\tpanel_1.add(panel_2);\n\t\tpanel_2.setLayout(null);\n\t\t\n\t\tbtnNewButton = new JButton(\"Generate ID\");\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tdouble num = Math.floor(Math.random() * 1600);\n\t\t\t\tint runout = (int) num;\n\t\t\t\tString coll = drugname.getText();\n\t\t\t\tString output = \"\";\n\t\t\t\t\n\t\t\t\tif(drugname.getText().isEmpty()) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Enter Drug Name in order to generate ID\");\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\n\t\t\t\tif(coll.length()>=4) {\n\t\t\t\t\toutput = coll.substring(0, 4);\n\t\t\t\t\tdrugIDGen.setText(output + runout+\"\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\toutput = coll.substring(0, 3);\n\t\t\t\t\tdrugIDGen.setText(output + runout+\"\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBackground(new Color(50, 205, 50));\n\t\tbtnNewButton.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tbtnNewButton.setBounds(10, 20, 196, 29);\n\t\tpanel_2.add(btnNewButton);\n\t\t\n\t\tbtnAddDrugs = new JButton(\"Add New\");\n\t\tbtnAddDrugs.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\taddNewDrug();\n\t\t\t}\n\t\t});\n\t\tbtnAddDrugs.setBackground(new Color(50, 205, 50));\n\t\tbtnAddDrugs.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\t\tbtnAddDrugs.setBounds(10, 60, 196, 29);\n\t\tpanel_2.add(btnAddDrugs);\n\t\t\n\t\tbtnNewButton_2 = new JButton(\"View Details\");\n\t\tbtnNewButton_2.setBackground(new Color(50, 205, 50));\n\t\tbtnNewButton_2.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\t\tbtnNewButton_2.setBounds(10, 100, 196, 29);\n\t\tpanel_2.add(btnNewButton_2);\n\t\t\n\t\tlblNewLabel = new JLabel(\"Enter drug name to generate drug ID\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 11));\n\t\tlblNewLabel.setBounds(544, 11, 216, 20);\n\t\tpanel_1.add(lblNewLabel);\n\t\t\n\t\ttextField = new JTextField();\n\t\ttextField.setColumns(10);\n\t\ttextField.setBounds(78, 210, 199, 26);\n\t\tframe.getContentPane().add(textField);\n\t\t\n\t\tlblSearch = new JLabel(\"Search\");\n\t\tlblSearch.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\n\t\tlblSearch.setBounds(20, 212, 63, 20);\n\t\tframe.getContentPane().add(lblSearch);\n\t\tmodel.setColumnIdentifiers(inventory);\n\t}", "public PoiSheet(final org.apache.poi.ss.usermodel.Sheet delegate) {\n super();\n this.delegate = delegate;\n this.numberOfRows = this.delegate.getLastRowNum() + 1;\n this.name=this.delegate.getSheetName();\n }" ]
[ "0.6949572", "0.67997015", "0.66303426", "0.63186544", "0.62993056", "0.5985878", "0.5956429", "0.5891065", "0.5873157", "0.5848137", "0.5799385", "0.5760475", "0.5740362", "0.57080764", "0.5700677", "0.5665044", "0.56253475", "0.56252426", "0.56214714", "0.5621294", "0.5588708", "0.5576841", "0.5539981", "0.5533403", "0.5531978", "0.5521057", "0.548303", "0.54627675", "0.545873", "0.5443321", "0.54291916", "0.5398951", "0.5391825", "0.53878427", "0.53821546", "0.5381774", "0.5381173", "0.5320071", "0.5313331", "0.5305097", "0.5295231", "0.52950186", "0.5290713", "0.52850634", "0.5280417", "0.5280106", "0.52280587", "0.52259785", "0.52154183", "0.52146167", "0.52084905", "0.52057284", "0.5193298", "0.51932234", "0.5190955", "0.5190481", "0.5183142", "0.5160287", "0.51573765", "0.5120236", "0.51137924", "0.510467", "0.5102842", "0.5095851", "0.5095284", "0.5086604", "0.50851494", "0.50789034", "0.5075813", "0.5057979", "0.5045409", "0.5042719", "0.50375", "0.501736", "0.5015022", "0.50008327", "0.49923512", "0.49901053", "0.49861676", "0.49845618", "0.4979001", "0.49725062", "0.49712276", "0.49655718", "0.49653637", "0.49631122", "0.4962706", "0.495792", "0.495251", "0.49517757", "0.4948797", "0.49424356", "0.49410316", "0.49344024", "0.4933747", "0.4932714", "0.49314773", "0.49289668", "0.4925102", "0.4921956" ]
0.6407335
3
Update the selected coordinate to the given coordinate.
void updateSelected(Coord c) { this.selected = c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLocation(Coordinate coordinate);", "public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }", "public void editCoordinatesInCommit(int x, int y, int id) {\n Commit commit = dataModel.getCommit(id);\n Coordinates coordinates = dataModel.createCoords(x, y);\n dataModel.setCoordinatesToCommit(coordinates, commit);\n }", "public void setPosition(Coordinate coord) {\n this.coordinate = coord;\n }", "public void setCoord(Coords coord) {\r\n\t\tthis.coord = coord;\r\n\t}", "@Override\n\tpublic void SetCoord(double x, double y) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void setCoordinate(Coordinate coordinate) {\n\t\tthis.coordinate = coordinate;\n\t}", "public void editCoordinatesInPerson(int x, int y, int id) {\n Person role = dataModel.getPerson(id);\n Coordinates coordinates = dataModel.createCoords(x, y);\n dataModel.setCoordinatesToPerson(coordinates, role);\n }", "void setLocation(int x, int y);", "public void setPosition(Point newPosition);", "public static void updateCoordinates(int index, Coordinate newCoordinate){\n\t\tunitPositions[index] = newCoordinate;\n\t\tAlgorithm.setUnitPositions(unitPositions);\n\t}", "public void updateSelection() {\n\t\t\n\t}", "public void changePos(double xP, double yP){ \n this.xCoor += xP;\n this.yCoor += yP;\n \n }", "public void setLocation(float x, float y);", "public void setCoordinate(LatLng coordinate) {\n this.coordinate = coordinate;\n }", "public void setLocation(double x, double y) {\n currentLocation.x = (int) x;\n currentLocation.y = (int) y;\n refreshLocation();\n }", "@Override\n\tpublic void setLocation(double x, double y) {\n\t\tdouble oldX = getX();\n\t\tdouble oldY = getY();\n\t\tdouble dx = x - oldX;\n\t\tdouble dy = y - oldY;\n\t\tfor (GPoint point : this) {\n\t\t\tpoint.translate(dx, dy);\n\t\t}\n\t\trepaint();\n\t}", "public void setMoveTo(Coordinate coordinate);", "public void set(Coord dest) {\n x = dest.x;\n y = dest.y;\n }", "public void setFromCoordinates(int fromX, int fromY);", "void editCell(Coord coord, String string);", "@Override\n public void update() {\n if (changedState) {\n selectedPosY = selection * hItemBox + yPos + hItemBox;\n selectedPosX = xPos; \n changedState = false;\n }\n }", "public void setXCoordinates(double newX) { this.xCoordinates = newX; }", "public void setPosition(double x, double y){\r\n this.x = (float)x;\r\n this.y = (float)y;\r\n changed();\r\n }", "public void updateSelection()\n {\n \trectForSelection.setRect(rettangoloX,rettangoloY,larghezza,altezza);\n \trectSelTopLeft.setRect(rettangoloX-3,rettangoloY-3,6,6);\n \trectSelBottomLeft.setRect(rettangoloX-3,rettangoloY+altezza-3,6,6);\n \trectSelTopRight.setRect(rettangoloX+larghezza-3,rettangoloY-3,6,6);\n \trectSelBottomRight.setRect(rettangoloX+larghezza-3,rettangoloY+altezza-3,6,6);\n }", "public void editCoordinatesInArtifact(int x, int y, int id) {\n Artifact artifact = dataModel.getArtifact(id);\n Coordinates coordinates = dataModel.createCoords(x, y);\n dataModel.setCoordinatesToArtifact(coordinates, artifact);\n }", "@Override\n public void update(Observable o, Object arg) {\n if (arg instanceof Color && this.shapeSelected()) {\n Color color = (Color) arg;\n this.selectedShape.setColor(color);\n }\n }", "public void setSelectedCell(Coord c) {\n this.selected = c;\n }", "public void updateLocation();", "private void updateGeo(Double latitude, Double longitude) {\n latitudeValue = latitude;\n longitudeValue = longitude;\n }", "public void setSelection(int x, int y) {\n this.selectionX = x;\n this.selectionY = y;\n\n selectionChanged = true;\n }", "public void setToCoordinates(int toX, int toY);", "public void updatePosition(Coordinate c) {\n\t\tpointMoveTo.setCoordinate(c);\n\t\tPedSimCity.agents.setGeometryLocation(agentLocation, pointMoveTo);\n\t}", "public void setXCoordinate(int newValue)\n {\n x = newValue;\n }", "protected void update(){\n\t\t_offx = _x.valueToPosition(0);\n\t\t_offy = _y.valueToPosition(0);\n\t}", "public void editCoordinatesInCommitedConfiguration(int x, int y, int id) {\n CommitedConfiguration commitedConfiguration = dataModel.getCommitedConfiguration(id);\n Coordinates coordinates = dataModel.createCoords(x, y);\n dataModel.setCoordinatesToCommitedConfiguration(coordinates, commitedConfiguration);\n }", "void setCurrentPosition(Square currentPosition);", "public void update(int x,int y);", "public void setXY(int x, int y)\n\t{\n\t\tthis.x = x;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's x-coordinate \n\t\tthis.y = y;\t\t\t\t\t\t\t\t\t\t\t\t\t// Update point's y-coordinate \n\t}", "public void setObjectAtLocation(Point p, Object o);", "void update(int[] xyPos) {\n this.x = xyPos[0];\n this.y = xyPos[1];\n }", "public void update(int x, int y) {\n\t\t\n\t\tInvalidCoordinateException ice = new InvalidCoordinateException(\"Coordinates cannot be less than 0!\");\n\t\ttry {\n\t\t\t\n\t\t\tif(x>=0) {\n\t\t\tx=xCoord;\n\t\t\t}else {\n\t\t\t\tthrow ice;\n\t\t\t}//ends else\n\t\t\tif(y>=0) {\n\t\t\ty=yCoord;\n\t\t\t}else {\n\t\t\t\tthrow ice;\n\t\t\t}//ends else\n\t\t\t\n\t\t}catch(InvalidCoordinateException s) {\n\t\t\tSystem.out.println(s.getMessage());\n\t\t}//ends catch block\n\t\t\n\t}", "@Override\n public void propertyChange(PropertyChangeEvent e) {\n this.updateCoords();\n }", "void setPosition(double xPos, double yPos);", "void setPosition(Point point);", "public void updatePosition(float x, float y){\n rect = new Rectangle2D.Float(x,y,width,height);\n this.x = x;\n this.y = y;\n }", "public void setX (int index, int x) { coords[index][0] = x; }", "public void updateXLoc();", "public void setCoordinate(int PointX, int PointY)\n {\n rectangle.set(PointX - rectangle.width()/2, PointY - rectangle.height()/2, PointX + rectangle.width()/2,PointY + rectangle.height()/2);\n\n //hitBox(this.rectangle);\n }", "public void select(int x, int y)\n\t{\n\t\tif(!this.used[x][y])\n\t\t{\n\t\t\tthis.cur.move(x, y);\n\t\t\tthis.moved = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.selected = true;\n\t\t\tthis.cur = piece[x][y];\n\t\t}\n\t\t//drawState();\n\t}", "public void setX(int newX)\r\n {\r\n xCoord = newX;\r\n }", "public void setCoord(int coord, int pos) {\r\n this.coords[pos-1] = coord;\r\n }", "@Override\n public void setLocation(geo_location p) {\n this.location.setX(p.x());\n this.location.setY(p.y());\n this.location.setZ(p.z());\n }", "public void setPosition(double x, double y)\n {\n mPosition = new Point2D.Double(x, y);\n }", "public void set(int x, int y, double value) {\n\t\tmatrix.get(y).get(x).setValue(value);\n\t}", "public void update(MazeEventPickup e) {\r\n }", "public Coordinate set(final Coordinate c) { row=c.row; col=c.col; return this; }", "public void setLocation(Vector location);", "public void setPosition(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public void updateLocation()\r\n {\r\n\t\timg.setUserCoordinator(latitude, longitude);\r\n\t\timg.invalidate();\r\n\t}", "public void setLocation(Point newLocation) {\r\n this.p = newLocation;\r\n }", "public void setLocation(int X, int Y){\n \tlocation = new Point(X,Y);\n }", "public void setLocation(Point2D p);", "void update(String selectedGene);", "public void update(int location, Object o)\n {\n notifyItemChanged(location);\n }", "public void setPosition(float x, float y);", "void setPos(float x, float y);", "public void setY (int index, int y) { coords[index][1] = y; }", "public void setYCoordinate(int newValue)\n {\n y = newValue;\n }", "public void update(){\r\n\t\tList<Point> list = new ArrayList<Point>();\r\n\t\t\r\n\t\tlist.addAll(Arrays.asList(points));\r\n\t\t\r\n\t\tsetPoints(list);\r\n\t}", "public void editCoordinatesInConfiguration(int x, int y, int id) {\n Configuration configuration = dataModel.getConfiguration(id);\n Coordinates coordinates = dataModel.createCoords(x, y);\n dataModel.setCoordinatesToConfiguration(coordinates, configuration);\n }", "@Override\n public Position setPosition(double x, double y) {\n this.x = x;\n this.y = y;\n\n return new Position(x, y);\n }", "public void moveTo(int newX, int newY) {\n xPosition = newX-radius;\n yPosition = newY-radius;\n }", "public void setXY(Point2D aPoint) { setXY(aPoint.getX(), aPoint.getY()); }", "private void updateArrayListCoordinates() {\n this.coordinates = makeCoordinatesFromCenterCoordinate(centerPointCoordinate);\n }", "public void setLoc(int x, int y) {\n locX = x;\n locY = y;\n }", "public void setPosition(double x, double y) {\n this.x = x;\n this.y = y;\n }", "void update(Location location);", "public void set(double x, double y) {\n \n _x = x;\n _y = y;\n \n }", "public void setPosicion(double x, double y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public void setCoordinates(double[] pos) {\n \tthis.currentX = pos[0];\n \tthis.currentY = pos[1];\n }", "public int setPoint(float x, float y, int gnum);", "public void setPosition(int x, int y) {\n this.coordX = x;\n this.coordY = y;\n }", "public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}", "public void setLocation(int x,int y)\n\t{\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t}", "public void setLocation(int someX, int someY) {\r\n\t\tx = someX;\r\n\t\ty = someY;\r\n\t}", "public void updateYLoc();", "public void update(ImageObject nImage) { \r\n selectedImage = nImage;\r\n \r\n update();\r\n }", "public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\n\t}", "public void setPosition(Point position);", "@Override\n public void setCoord(PuertoPosition pp, Point2D newCoord) {\n layout.setLocation(pp, newCoord);\n }", "public void setUserLocation(double lat, double lon) {\n\tuserLocation = new Point2D.Double(lon,lat);\n }", "public Point2D setPoint(int i, double x, double y);", "public void setLocation(int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}", "public void setChessLocation(ChessPiece aPiece, int xx, int yy) {//Just for test, set the selected chess piece(a JButton)'s location\n aPiece.setLocation(xx, yy);\n\n }", "public void setYCoordinates(double newY) { this.yCoordinates = newY; }", "public void update() {\r\n if(selectedImage == null) {\r\n xStartProperty.setText(\"\");\r\n yStartProperty.setText(\"\");\r\n xEndProperty.setText(\"\");\r\n yEndProperty.setText(\"\");\r\n rotationProperty.setText(\"\");\r\n } else {\r\n xStartProperty.setText(String.valueOf(selectedImage.getXStart()));\r\n yStartProperty.setText(String.valueOf(selectedImage.getYStart()));\r\n xEndProperty.setText(String.valueOf(selectedImage.getXEnd()));\r\n yEndProperty.setText(String.valueOf(selectedImage.getYEnd()));\r\n rotationProperty.setText(String.valueOf(selectedImage.getRotation()));\r\n }\r\n }", "public void set(float newX, float newY) {\r\n\t\tx = newX;\r\n\t\ty = newY;\r\n\t}", "public void setY(int newY)\r\n {\r\n yCoord = newY;\r\n }", "public void setXY(double anX, double aY) { setX(anX); setY(aY); }" ]
[ "0.6662235", "0.6231263", "0.6121368", "0.60725576", "0.60448825", "0.60074484", "0.5973385", "0.59186184", "0.5893729", "0.58843696", "0.58714485", "0.58372545", "0.5819968", "0.580596", "0.5797532", "0.578061", "0.57762766", "0.577042", "0.57437366", "0.57127315", "0.5702458", "0.56919664", "0.56780994", "0.56760156", "0.5675649", "0.5672045", "0.56613076", "0.5661285", "0.56551456", "0.56528836", "0.56124467", "0.5608874", "0.5593568", "0.55788743", "0.5566634", "0.556571", "0.55652016", "0.5553949", "0.55437446", "0.5530346", "0.5528145", "0.5524367", "0.5495769", "0.549457", "0.5493567", "0.5458335", "0.5458228", "0.54515374", "0.5449231", "0.54471296", "0.5431933", "0.5430127", "0.5417257", "0.5415458", "0.541124", "0.5409593", "0.54016924", "0.54010993", "0.5400832", "0.53971386", "0.5393851", "0.53908426", "0.53884196", "0.538356", "0.5369634", "0.53692865", "0.53601956", "0.534413", "0.53381574", "0.533633", "0.5333738", "0.53305197", "0.53204185", "0.5311393", "0.53096896", "0.5288374", "0.5287318", "0.5284577", "0.52829075", "0.5281386", "0.5281145", "0.52799153", "0.52774984", "0.5274963", "0.527267", "0.52714884", "0.52636564", "0.52498394", "0.5232525", "0.5223883", "0.5220089", "0.5216855", "0.5200686", "0.51999664", "0.51964194", "0.5191103", "0.51815224", "0.5170753", "0.5162557", "0.5162103" ]
0.71530384
0
Gets the coordinate of the user's selected cell on the worksheet.
Coord getSelected() { if (selected == null) { return null; } return new Coord(selected.col, selected.row); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Cell getSelectedCell() {\n return selectedCell;\n }", "public Object getCurrentCellX() {\n\t\treturn x;\n\t}", "public int getPosition(){\n\t\treturn this.cell;\n\t}", "public int getSelectedPosition() {\n return mLayoutManager.getSelection();\n }", "public Point2D getCellCoordinates(JmtCell cell) {\r\n \t\tRectangle2D bounds = GraphConstants.getBounds(cell.getAttributes());\r\n \t\treturn new Point2D.Double(bounds.getMinX(), bounds.getMinY());\r\n \t}", "public int getXcoord(){\n\t\treturn this.coordinates[0];\n\t}", "public CellSelection getSelectCell() {\n return selection;\n }", "private User getUser(MouseEvent e) {\n int index = locationToIndex(e.getPoint());\n Rectangle bounds = getCellBounds(index, index);\n if (bounds != null && bounds.contains(e.getPoint())) {\n setSelectedIndex(index);\n return getSelectedValue();\n }\n return null;\n }", "public Cell getPosition() {\n return position;\n }", "private double getSelectedX() {\n return (double) xSpinner.getValue();\n }", "public Coordinate getCoordinate() {\n\t\treturn super.listCoordinates().get(0);\n\t}", "public Point getLocation ( )\r\n\t{\r\n\t\treturn new Point ( currentCol, currentRow );\r\n\t}", "public int getX() {\n return this.coordinate.x;\n }", "public int getCellXCoord(int col) {\n return TOP_LEFT_X + (col * BLOCK_WIDTH);\n }", "public Point2D getMousePosition() {\n\t\treturn Lel.coreEngine.panelPositionToWorld(input.getMousePosition());\n\t}", "public Object getCurrentCellY() {\n\t\treturn y;\n\t}", "public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }", "public double getXPos() {\n\t\treturn this.position[0];\n\t}", "public double getX() {\n return position.getX();\n }", "@Override\n\tpublic double getSelectedSensorPosition() {\n\t\treturn encoder.getPosition();\n\t}", "public int getX(){\n return this.position[0];\n }", "public int getLocationX() {\r\n\t\treturn x;\r\n\t}", "public String getUserCell() {\n\t\treturn userCell;\n\t}", "public int getXCoordinate ()\n {\n return xCoordinate;\n }", "private Point2D getBoardPosition() {\n double size = getCellSize();\n double x = canvas.getWidth() / 2 - board.getWidth() * size / 2;\n double y = canvas.getHeight() / 2 - board.getHeight() * size / 2;\n\n return new Point2D(x, y);\n }", "public final double getX() { return location.getX(); }", "public int getX(){\n\t\treturn this.x_location;\n\t}", "public int getLocation(int x, int y) {\n\t\treturn grid[x][y];\n\t}", "private Point2D mouseLocation() {\n return FXGL.getInput().getMousePositionWorld();\n\n }", "public int getX() { return position.x; }", "public int getSelectionX() {\n return selectionX;\n }", "public Integer getValueForCell(int x, int y)\n {\n Integer value=_cells[x][y].getValue();\n return value;\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "public Point getLocation() {\n Map<String, Long> map = (java.util.Map<String, Long>) driver.executeAtom(\n atoms.getLocationJs, false, this);\n return new Point(map.get(\"x\").intValue(), map.get(\"y\").intValue());\n }", "public int getActualCurrentPosition() {\r\n int position = getCurrentPosition();\r\n return transformToActualPosition(position);\r\n }", "public Point getLocation() {\r\n\t\treturn this.center;\r\n\t}", "public Coordinate getPosition();", "public int getX()\r\n {\r\n return xCoord;\r\n }", "public int getX() {\r\n return (int) center.getX();\r\n }", "public int getX() {\n return (int) center.getX();\n }", "public int getX() {\n return xCoord;\n }", "Coordinates getCoordinates(int rowIndex);", "public int getSelectedRow()\n {\n \treturn this.getSelectedIndex();\n }", "public int getSelectedValue() {\n\t\treturn this.slider.getValue();\n\t}", "public int getX() {\n return (int) this.center.getX();\n }", "public int getCurrentPosition(){\n return Integer.parseInt(currentPosition);\n }", "public int getX() {\r\n\t\treturn xcoord;\r\n\t}", "public int[] getCellCoordinates(CellRecord cellRecord) {\r\n com.google.gwt.core.client.JsArrayInteger cellCoodJS = doGetCellCoordinates(cellRecord.getJsObj());\r\n return new int[]{cellCoodJS.get(0), cellCoodJS.get(1)};\r\n }", "public int getX()\r\n {\r\n return xLoc;\r\n }", "public Integer getCaretPosX() {\n\t\tint[] caretPos = getCaretPos();\n\t\treturn (caretPos == null) ? null : caretPos[0];\n\t}", "public GridCoord getCoord() {\n\t\treturn this.coord;\n\t}", "double getXPosition();", "public Vector2 getMousePosition() {\n\t\tif (camera == null)\n\t\t\treturn new Vector2(0,0);\n\t\tfloat mx = Program.mouse.getX(), my = Program.mouse.getY();\n\t\tfloat xPercent = mx/Program.DISPLAY_WIDTH, yPercent = my/Program.DISPLAY_HEIGHT;\n\t\tfloat x = camera.getX() + camera.getWidth() * xPercent,\n\t\t\t y = camera.getY() + camera.getHeight() * yPercent;\n\t\treturn new Vector2(x,y);\n\t}", "public Point getLocation() {\r\n return new Point((int)x,(int)y);\r\n }", "public int getX() {\n return pos_x;\n }", "public void getCoord(MouseEvent me){\n if(mapImage.getImage()!=null) {\n double xPos = me.getX();\n double yPos = me.getY();\n Main.ps.setTitle(xPos + \" \" + yPos);\n }\n }", "public final int getX()\n\t{\n\t\treturn pos.x;\n\t}", "public Point2D getUIMousePosition() {\n\t\treturn Lel.coreEngine.panelPositionToGame(input.getMousePosition());\n\t}", "public double getLocationX() {\r\n\t\treturn location.getX();\r\n\t}", "int getX_coordinate(){\n return x_coordinate;\n }", "public int getX() { return loc.x; }", "public int getElement(Pair<Integer, Integer> cell){\n\t\treturn numbers[cell.getFirst()][cell.getSecond()];\n\t}", "public int getX() {\n return positionX;\n }", "public int getXPos();", "public String getRealCell(){\n\t\treturn userInput;\n\t}", "public int getLocationX( )\n\t{\n\t\treturn locationX;\n\t}", "public double getX() {\n return origin.getX();\n }", "public int getPosition() {\n return preferences.getInt(\"position\",0);\n }", "public double getMouseClickedX() {\n\t\treturn Lel.coreEngine.panelPositionToWorld(input.getMouseClickedPosition()).getX();\n\t}", "@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}", "public int getCell() {\n return this.cell;\n }", "public double getXCoordinate() {\n return xCoordinate;\n }", "public Location getLocation(int row, int column) {\n\t\treturn this.grid[row][column];\n\t}", "public Point getLocation() {\n return pos;\n }", "@Override\n public Point2D getMouseLocation() {\n if (PlatformAdapter.getOs() == PlatformAdapter.OS.UNIX &&\n !JavaVersionAdapter.currentVersion().isJava11Compatible()) {\n return waitForAsyncFx(RETRIEVAL_TIMEOUT_IN_MILLIS,\n () -> new Point2D(((Double) getRobot().getClass().getMethod(\"getMouseX\").invoke(\n getRobot())).intValue() / JavaVersionAdapter.getScreenScaleX(),\n ((Double) getRobot().getClass().getMethod(\"getMouseY\").invoke(\n getRobot())).intValue() / JavaVersionAdapter.getScreenScaleY()));\n }\n else {\n return waitForAsyncFx(RETRIEVAL_TIMEOUT_IN_MILLIS, () -> new Point2D(\n ((Double) getRobot().getClass().getMethod(\"getMouseX\").invoke(glassRobot)).intValue(),\n ((Double) getRobot().getClass().getMethod(\"getMouseY\").invoke(glassRobot)).intValue()));\n }\n }", "private int getIdx(MouseEvent e) {\n Point p = e.getPoint();\n p.translate(-BORDER_SIZE, -BORDER_SIZE);\n int x = p.x / CELL_SIZE;\n int y = p.y / CELL_SIZE;\n if (0 <= x && x < GUI.SIZE[1] && 0 <= y && y < GUI.SIZE[1]) {\n return GUI.SIZE[1] * x + y;\n } else {\n return -1;\n }\n }", "public Coordinate getPosition() {\n return cPosition;\n }", "public int getValue(int row, int column);", "public int getCurrentOffset () {\n if (SwingUtilities.isEventDispatchThread()) {\n return getCurrentOffset_();\n } else {\n final int[] ln = new int[1];\n try {\n SwingUtilities.invokeAndWait(new Runnable() {\n public void run() {\n ln[0] = getCurrentOffset_();\n }\n });\n } catch (InvocationTargetException ex) {\n ErrorManager.getDefault().notify(ex.getTargetException());\n } catch (InterruptedException ex) {\n // interrupted, ignored.\n }\n return ln[0];\n }\n }", "public int getXPoint() {\r\n return this.x;\r\n }", "public Coord getCoordAt(Point pos) {\n return new Coord((int)Math.floor((float)pos.x / (float)cellWidth) + horizontalScroll + 1,\n (int)Math.floor((float)pos.y / (float)cellHeight) + verticalScroll + 1);\n }", "public Point getLocation() {\r\n\t\tint[] p = value.getIntArray();\r\n\t\tif (p.length < 2) {\r\n\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\t\"Location parameters must contain at least 2 values\");\r\n\t\t}\r\n\t\treturn (new Point(p[0], p[1]));\r\n\t}", "public CursorPosition getCurrentCursorPosition(){\n return XSelection.getCurrentCursorPosition(this);\n }", "double getX() { return pos[0]; }", "public int getxCoordinate() {\n return xCoordinate;\n }", "public int getxCoordinate() {\n return xCoordinate;\n }", "public int getX() {\r\n return xpos;\r\n }", "public int getSelectionY() {\n return selectionY;\n }", "public Object getCellEditorValue() {\n\treturn realEditor.getCellEditorValue();\n }", "public int getLocX() {\n return locX;\n }", "public int getX() {\n return (int) xPos;\n }", "public double getX_location() {\n return x_location;\n }", "public double getMouseX() {\n\t\treturn getMousePosition().getX();\n\t}", "public int getX() {\n return posX;\n }", "Square getCurrentPosition();", "public Point getPosition()\n\t{\n\t\treturn pos;\n\t}", "public int getXOrigin() {\n return ic.getXOrigin();\n }", "private Point getPopupLocation()\n {\n Dimension popupSize = comboBox.getSize();\n Insets insets = getInsets();\n \n // reduce the width of the scrollpane by the insets so that the popup\n // is the same width as the combo box.\n popupSize.setSize(popupSize.width - (insets.right + insets.left), getPopupHeightForRowCount(comboBox.getMaximumRowCount()));\n Rectangle popupBounds = computePopupBounds(0, comboBox.getBounds().height, popupSize.width, popupSize.height);\n Dimension scrollSize = popupBounds.getSize();\n Point popupLocation = popupBounds.getLocation();\n \n scroller.setMaximumSize(scrollSize);\n scroller.setPreferredSize(scrollSize);\n scroller.setMinimumSize(scrollSize);\n \n list.revalidate();\n \n return popupLocation;\n }", "public long getCellAt(Point point)\n\t{\n\t\tfor (CIntentionCell cell : cells.values())\n\t\t{\n\t\t\tif (cell.contains(point))\n\t\t\t{\n\t\t\t\treturn cell.getId();\n\t\t\t}\n\t\t}\n\t\treturn -1L;\n\t}", "public double getX() {\n\t\treturn point[0];\n\t}" ]
[ "0.6710079", "0.66200686", "0.6542905", "0.6492219", "0.6492058", "0.6481529", "0.63562256", "0.6313367", "0.6188509", "0.61761504", "0.6150584", "0.61095506", "0.6103297", "0.6098553", "0.6091135", "0.60518336", "0.604827", "0.6046958", "0.6030201", "0.60081136", "0.5999842", "0.59564716", "0.5942373", "0.5938952", "0.5931263", "0.5928839", "0.59082323", "0.5876066", "0.5862498", "0.5860656", "0.5841521", "0.5841505", "0.5821001", "0.5810933", "0.5795399", "0.57918537", "0.57886374", "0.5788387", "0.57868636", "0.5781028", "0.57713324", "0.5770502", "0.5769539", "0.5768825", "0.5764105", "0.57556736", "0.57492995", "0.57255644", "0.57015145", "0.56962997", "0.5694905", "0.56943643", "0.5693313", "0.5687793", "0.56853217", "0.5679754", "0.5679013", "0.5674906", "0.56746674", "0.5670343", "0.5667388", "0.56515336", "0.5646381", "0.56445086", "0.5632953", "0.5624758", "0.56148916", "0.56111467", "0.560676", "0.5603674", "0.5601147", "0.55852044", "0.5583036", "0.55818224", "0.5574552", "0.5567143", "0.5562769", "0.55610937", "0.5556856", "0.5552928", "0.5543795", "0.5539997", "0.5535694", "0.5535683", "0.5534903", "0.5534903", "0.55345076", "0.55318004", "0.55316603", "0.5525417", "0.55215764", "0.55212206", "0.55183923", "0.5518063", "0.5516633", "0.5511553", "0.55105793", "0.55096596", "0.5508956", "0.5507727" ]
0.7282312
0
Constructor for a monster object, which will set all necessary components. Constructor will also set necessary default monster cords.
public Monster(String name,int monsterType,int health,int monstersWalkDistanceX,int monstersWalkDistanceY,int resourceReward,int monsterSize,int whichSide,int respawnTime) { this.name=name; this.monsterType=monsterType; this.health=health; this.monstersWalkDistanceX=monstersWalkDistanceX; this.monstersWalkDistanceY=monstersWalkDistanceY; this.resourceReward=resourceReward; this.monsterSize=monsterSize; this.whichSide=whichSide; this.maxHealth=health; this.targetable=true; this.visible=true; this.respawnTime=respawnTime; setDefaultMonsterCords(); this.firstCross=pathDrawLots(2)+1; this.secondCross=pathDrawLots(2)+3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Monster()\n {\n this.name=\"Noname\";\n this.monsterType=0;\n this.health=0;\n this.maxHealth=0;\n this.monstersWalkDistanceX=0;\n this.monstersWalkDistanceY=0;\n this.resourceReward=0;\n this.monsterSize=0;\n this.whichSide=0;\n this.firstCross=0;\n this.secondCross=2;\n targetable=false;\n this.visible=false;\n\n setDefaultMonsterCords();\n }", "public Monster() {\n\t super();\n\t _hitPts = 150;\n\t _strength = 20 + (int)( Math.random() * 45 ); // [20,65)\n _defense = 40;\n\t _attack = .4;\n }", "public Monster() {\r\n\t\tthis(\"Blabberghast\", MIN_MONSTER_HEALTH);\r\n\t}", "public Monster(Object[] parameters) {\n setName((String) parameters[0]);\n setLevel((int) parameters[1]);\n setAttribute(Attributes.valueOf(((String) parameters[2]).toUpperCase()));\n setMonsterType(MonsterTypes.valueOf(((String) parameters[3]).toUpperCase()));\n setCardType(CardType.valueOf(((String) parameters[4]).toUpperCase()));\n if (cardType.getName().equals(\"Effect\")) this.setHasEffect(true);\n setAtk((int) parameters[5]);\n setAtkHolder((int) parameters[5]);\n setDef((int) parameters[6]);\n setDefHolder((int) parameters[6]);\n setDescription((String) parameters[7]);\n setPrice((int) parameters[8]);\n Set<String> keys = this.getEffectsMap().keySet();\n for (String key : keys) {\n this.getEffectsMap().get(key).accept(new Effect(0, 0));\n }\n DataController.monsterEffectParser((String) parameters[9], this);\n DataController.cardPairsParser((String) parameters[10], this);\n setHasAttackedOnceInTurn(false);\n }", "public Monster(){\r\n super();\r\n id=nextid++; //id of monster (increments nextid everytime a new lifeform is made)\r\n }", "public Monster() {\n\t\t\n\t}", "public Monster(String name, String monster, Element element) {\r\n this.name = name;\r\n this.monster = monster;\r\n this.element = element;\r\n // TODO: add code to include runes.\r\n }", "public void initMob() {\n this.lLegGeom.setName(\"Mob/\" + this.id + \"/lLeg\");\n this.rLegGeom.setName(\"Mob/\" + this.id + \"/rLeg\");\n this.bodyGeom.setName(\"Mob/\" + this.id + \"/Body\");\n this.lArmGeom.setName(\"Mob/\" + this.id + \"/lArm\");\n this.rArmGeom.setName(\"Mob/\" + this.id + \"/rArm\");\n this.headGeom.setName(\"Mob/\" + this.id + \"/Head\");\n this.weaponGeom.setName(\"Mob/\" + this.id + \"/Weapon\"); \n \n this.armMat.setColor(\"Color\",ColorRGBA.Black);\n this.legMat.setColor(\"Color\",ColorRGBA.Black);\n this.bodyMat.setColor(\"Color\",ColorRGBA.Black);\n \n //Refactor boss ActorControl into MobControl with MonkeyBrains\n CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(2.5f,4.5f,1);\n this.mobControl = new CharacterControl(capsuleShape, 3f);//Step size is set in last argument\n this.mobControl.setJumpSpeed(20);\n this.mobControl.setFallSpeed(45);\n this.mobControl.setGravity(50);\n \n }", "public Monster() {\n super(MONSTERS_LIST[(new Random()).nextInt(MONSTERS_LIST.length - 1)],\n new Random().nextFloat() * 5F,\n new Random().nextFloat() * 2F);\n }", "public CombatController(Player player, Monster monster) {\n this.player = player;\n this.monster = monster;\n\n\n\n }", "public DBMonster() {\n\n }", "public FastMonster(int x, int y) {\n\t\tsuper(x, y, \"Fast\");\n\t}", "public Chamber() {\n this.treasures = new ArrayList<Treasure>();\n this.monsters = new ArrayList<Monster>();\n this.doors = new ArrayList<Door>();\n myContents = new ChamberContents();\n d20 = new D20();\n makeShape(mySize);\n d100 = new Percentile();\n stairs = null;\n trap = null;\n //choosing contents randomly\n myContents.chooseContents(d20.roll());\n //checking descriptions and creating contents accordingly\n makeContents();\n //calls setExits to set all exits of a chamber\n setExits();\n\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 DwarfEnemy()\r\n\t{\r\n\t\tdamagePower = GameStatics.Enemies.Dwarf.damagePower;\r\n\t\tspeed = GameStatics.Enemies.Dwarf.speed;\r\n\t\thp = GameStatics.Enemies.Dwarf.initHp;\r\n\t}", "public Monster(String name, Level level, HealthPower healthPower,\n Ability strength, Ability defense, Ability agility) {\n super(name, level, healthPower, strength, defense, agility);\n }", "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 Creature() {\r\n\t\tname = \"\";\r\n\t\tdescription = \"\";\r\n\t\thp = 0;\r\n\t\tdmg = 0;\r\n//\t\troom = null;\r\n\t}", "Creature()\n {\n super();\n this.glyph = new Glyph('c', TextColor.ANSI.WHITE, TextColor.ANSI.BLACK);\n }", "public Monster(String name) {\r\n\t\tsuper();\r\n\t\tthis.name = name;\r\n\t\thealth = rnd.nextInt(MAX_MONSTER_HEALTH - MIN_MONSTER_HEALTH + 1)\r\n\t\t\t\t+ MIN_MONSTER_HEALTH;\r\n\t}", "private void setDefaultMonsterCords()\n {\n this.xBeginMap=0;\n this.yBeginMap=0;\n this.xEndMap=16;\n this.yEndMap=16;\n\n this.xBeginSrc=0;\n this.yBeginSrc=0;\n this.xEndSrc=0;\n this.yEndSrc=0;\n\n }", "public Character()\n\t{\n\t\tthis(450,810);\n\t}", "public Mountain(int l, int w, int m)\n {\n super(l, w);\n // initialise instance variables\n numMountains = m;\n }", "public Chamber(int mId) {\n //Added init lists so that recurring code from both constructors was written in one function\n initLists();\n myContents = new ChamberContents();\n int roll;\n roll = (int) (Math.random() * ((17 - 1) + 1)) + 1;\n while (roll == 9 || roll == 10) {\n roll = (int) (Math.random() * ((17 - 1) + 1)) + 1;\n }\n System.out.println(\"Room id: \" + id + \" has roll \" + (roll));\n mySize = ChamberShape.selectChamberShape(roll);\n generateContents();\n this.id = mId;\n }", "public Monster(Image image, double health, double damage, int x, int y) {\r\n\t\tthis.image = image;\r\n\t\tthis.health = health;\r\n\t\tthis.damage = damage;\r\n\t\tthis.x = y;\r\n\t\tthis.y = y;\r\n\t}", "public Monster(String name, int health) {\r\n\t\tsuper((health > MAX_MONSTER_HEALTH) ? MAX_MONSTER_HEALTH : health);\r\n\t\tthis.name = name;\r\n\t}", "public BossRoom() {\n\t\ttiles = new WorldTiles(width, height, width);\n\t\tbackground = new Sprite(SpriteList.BOSS_ROOM_BACKGROUND);\n\t}", "public Wand() {\n damage = 5;\n damageType = \"Magic\";\n }", "public Knight() {\r\n\thp = 150;\r\n\tstrength = 100;\r\n\tdefense = 60;\r\n\tattack = .2;\r\n\tevade=0;\r\n\tcrit=0;\r\n }", "public MonsterStatus()\n {\n mMonster = null;\n mStatus = \"\";\n mInitial = -1;\n mIncrease = -1;\n mMax = -1;\n mDamage = -1;\n mDuration = -1;\n }", "public Knight()\n\t{\n\t\tsuper(name, 100);\n\t}", "private Monster(String name, String[] types) {\r\n\t\tthis.name = name;\r\n\t\tthis.types = types;\r\n\t\tthis.validateTypes();\r\n\t\tthis.moves = new Move[4];\r\n\t}", "public Character()\n\t{\n\t\tlevel = 0;\n\t\thealth = 0;\n\t}", "public ArcherTower() {\n\t\tsuper(defaultAttack, defaultRange, defaultAttackSpeed, name);\n\t}", "public Chamber(ChamberShape theShape, ChamberContents theContents) {\n this.treasures = new ArrayList<Treasure>();\n this.monsters = new ArrayList<Monster>();\n this.doors = new ArrayList<Door>();\n d20 = new D20();\n d100 = new Percentile();\n myContents = theContents;\n makeShape(theShape);\n stairs = null;\n trap = null;\n //checking description and creating contents accordingly\n makeContents();\n //calling setExits to set all the exits of the chamber\n setExits();\n }", "public Weapon(){\n \n name = \"Claw\"; // will be treated as a sword\n type = 'R';\n advType = 'G';\n disType = 'B';\n mt = 4;\n hit = 85;\n crit = 0;\n wt = 1;\n isMagic = true;\n \n }", "public Charmander(World w)\n {\n //TODO (48): Add a third parameter of Fire to this super line\n super(700, 1);\n getImage().scale(150, 100);\n w.addObject( getHealthBar() , 300, w.getHeight() - 50 );\n }", "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 CrabWorld()\n {\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n musica=new GreenfootSound(\"Ufo-t-balt.mp3\");\n super(560,560, 1);\n }", "public Mumie(Room room, Player p) {\r\n\t\tsuper(room, p);\r\n\t\tattackDamage = (-10);\r\n\t\tattackRange = 10;\r\n\t\tsenseRange = 70;\r\n\t\tspeed = 0.005f;\r\n\t\tcurrentRoom = room;\r\n\t\tplayer = p;\r\n\t\tmonsterSpecificCooldown = 1000;\r\n\t\tmonsterSpecificValue = 750;\r\n\t}", "public Character() {\n\t\tlocation = new Location[21];\n\t\t\n\t\t/***********************ERSTELLEN DER RÄUME***************************************/\n\t\tlocation[0] = new Location(\"Büro\", \"In deinem Büro ist mittig ein überfüllter Schreibtisch [desk] an dem ein Scott Chefsessel mit original Kunstleder im Wert von 500€ \"\n\t\t\t\t+ \"steht [chair]. Außerdem stehen zwei Schränke in jeweils einer Ecke des Raumes.\");\n\t\tlocation[1] = new Location(\"Korridor 2 Etage\", \"Im Korridor angekommen siehst du mehrere Räume.\");\n\t\tlocation[2] = new Location(\"Kaffeeraum\", \"Dies ist der Kaffee- und Kuchenraum der Lehrer.\"\n\t\t\t\t+ \"\\nDu siehst eine neumodische Ikea Küche, mit vielen Küchenschränken [cupboards] auf denen eine uralte verrostete vermutlich aus dem \"\n\t\t\t\t+ \"1. Weltkrieg stammende Kaffeemaschine [coffeemachine] und eine Mikrowelle steht!\");\n\t\tlocation[3] = new Location(\"Konferenzraum\", \"In diesem Raum werden Konferenzen zu wichtigen Themen abgehalten und unwichtigen, aber die betreffen dich ja eh nicht!\"\n\t\t\t\t+ \"\\nEinem Konferenzraum entsprechend befindet sich in der Mitte ein Tisch in der Form eines U's. Außerdem hängt an der Wand ein \"\n\t\t\t\t+ \"Stundenplan und ein Schrank mit den Fächern für die Lehrer.\");\n\t\tlocation[4] = new Location(\"Kammer der Leere\", \"Dieser Raum sieht aus als wenn hier seit Jahren niemand mehr drin gewesen wäre.\", false);\n\t\tlocation[5] = new Location(\"Ventilationraum\", \"Ein Ventilationsraum. Alt, veranzt und staubig. Gelüftet wurde hier schon seit Jahren nicht mehr!\", false);\n\t\tlocation[6] = new Location(\"Damentoilette\", \"In der Damentoilette angekommen, sieht Kollegin Stelz dich irritiert an und geht mit den Worten: \\\"Sie überraschen mich immer wieder\\\" raus.\"\n\t\t\t\t+ \"\\nBeschreibung: Warst du noch nie in einer Damentoilette?\");\n\t\tlocation[7] = new Location(\"Herrentoilette\", \"Als du die Herrentoilette betrittst, weht dir ein animalischer Duft entgegen, welchen du dem ebenfalls \\\"leicht\\\" animalischen Direktor zuordnest!\");\n\t\tlocation[8] = new Location(\"Schulleiterraum\", \"Das Büro des Direktors ist ähnlich wie deines, über den vermüllten Schreibtisch schaut dich ein grimmiger Haufen Kalorien an. Dies müsste \"\n\t\t\t\t+ \"deiner mathematisch hoch komplexen Überlegungen nach der Direktor sein.\");\n\t\tlocation[9] = new Location(\"Fahrstuhl\", \"An einer der blank geputzten grauen Fahrstuhlwände steht:\\\"Im Brandfall nicht benutzbar!\\\".\");\n\t\tlocation[10] = new Location(\"Treppenhaus\", \"Ein Treppenhaus... es brennt!\");\n\t\tlocation[11] = new Location(\"Korridor 1 Etage\", \"Ein langer Korridor...\"\n\t\t\t\t+ \"\\nAn ihm liegen vier vom Aufbau her identische Hörsäle, jedoch gehört der erste den musischen Wissenschaften, der \"\n\t\t\t\t+ \"zweite zu den literarischen, der dritte zu den gesellschaftlichen und als letztes kommt endlich der naturwissenschaftliche Hörsal.\", false);\n\t\tlocation[12] = new Location(\"Hörsaal 1\", \"Man darf sich bekanntlich nicht mehr fragen, ob musische Wissenschaften überhaupt als eine Wissenschaft gelten, da Künstler und Freidenker \"\n\t\t\t\t+ \"sich sonst angegriffen fühlen, aber ein Naturwissenschaftler wie du hat wohl besseres verdient!\");\n\t\tlocation[13] = new Location(\"Spindraum\", \"Modrig steigt der Geruch ranziger Käsebrote durch die Lüftungsschlitze einiger Schließfächer, welche jedoch alle durch Algen in einem schönen \"\n\t\t\t\t+ \"Armee-Grünton gehalten werden. Alle? Nein, nicht alle! Eine glanzpolierte Marmorvariante, die dem Hausmeister gehört, koexistiert tatsächlich noch in diesem Raum.\");\n\t\tlocation[14] = new Location(\"Abstellraum\", \"Ein Mob, ein Eimer, ein Feuchttuch.... dich verwundert es, wie der Hausmeister nur mit diesen Sachen zumindest sein Revier so poliert\");\n\t\tlocation[15] = new Location(\"Hörsaal 2\", \"Im vorderen Teil liest der Professor aus einem Buch einen Text in einer Sprache, die du nicht verstehst, während im hinteren Teil sich Schüler \"\n\t\t\t\t+ \"mit Käsekästchen, Schere-Stein-Papier und Battlefield die Zeit vertreiben.\");\n\t\tlocation[16] = new Location(\"Hörsaal 3\", \"Der Lehrende zeigt aufgeregt auf eine Karte, welchen Schwerpunkt diese Vorlesung auch immer hat, eine Karte macht alles spannender! \"\n\t\t\t\t+ \"Sein Gegenspieler gewinnt in dem Pokerduell und jubelt laut auf!\");\n\t\tlocation[17] = new Location(\"Hörsaal 4\", \"Dein Reich ist gerade von einem Chemieprofessor belegt. Dieser ist grade dabei mit peinlicher Sorgfalt den Tisch in alle vier \"\n\t\t\t\t+ \"Himmelsrichtungen gleichzeitig zu katapultieren!\");\n\t\tlocation[18] = new Location(\"Damentoilette\", \"Es riecht herrlich nach Einhorn und Regenbogen, und nach dem alkohoisierten Hausmeister, der dabei ist den Lippenstift vom Spiegel zu \"\n\t\t\t\t+ \"entfernen und dich nicht bemerkt.\");\n\t\tlocation[19] = new Location(\"Herrentoilette\", \"Das Putzfrauenspecialcorps hat sich gestern zur Aufgabe gemacht den grünen Schleim von der Wand zu entfernen... \"\n\t\t\t\t+ \"Nur noch ein wenig Neutralreiniger auf dem Boden und eine Cap, mit dem Wort \\\"Obey\\\", schaukelnd an einer Lampe, sind noch übrig geblieben.\");\n\t\tlocation[20] = new Location(\"Fahrstuhlschacht\", \"Im Raum angekommen fällt dir sofort die ganze Elektronik hier unten auf. Ob hier noch mehr ist?\", false);\n\t\t\n\t\t\n\t\t\n\t\t/*************************BESCHREIBUNG BEIM EXPLOREN******************************/\n\t\tlocation[0].getDescriptions().setExploreDescription(\"Das Büro ist nicht besonders groß, aber du bist trotzdem stolz auf deinen Chefsessel. Außerdem steht eine Vitrine in dem \"\n\t\t\t\t+ \"Raum, in der deine Preise und Trophäen stehen.\");\n\t\tlocation[1].getDescriptions().setExploreDescription(\"Was willst du wissen? Es ist nur ein typischer langweiliger Korridor, mit einem Kaffeelöscherkasten [extinguisher box], wie man's in Uni's gewohnt ist!\");\n\t\tlocation[2].getDescriptions().setExploreDescription(\"Du fragst dich, was in den ganzen Küchenschränken [cupboards] sein könnte und warum der Boden hier höher ist!\");\n\t\tlocation[3].getDescriptions().setExploreDescription(\"Die Lehrer starren dich aus großen Augen an. Du bist wohl mitten in eine Versammlung reingeplatzt. Kann dir auch egal sein, \"\n\t\t\t\t+ \"ist keine Konferenz von der du weißt. Dir fällt der Ventilationsschacht [ventilation shaft] auf, bei dem das Gitter nur noch an den Schacht gelehnt ist.\");\n\t\tlocation[4].getDescriptions().setExploreDescription(\"Du siehst eine deiner Notizen [note] zwischen zwei Kartons gequetscht. Keine Ahnung wie der Windstoß das verursachen konnte...\");\n\t\tlocation[5].getDescriptions().setExploreDescription(\"Du siehst eine deiner Notizen [note].\");\n\t\tlocation[6].getDescriptions().setExploreDescription(\"Jetzt bloß nicht spülen. Es sei denn du magst keine Skillbooks... [skillbook]. Bei diesem Skillbook scheinst du eine Beamfähigkeit \"\n\t\t\t\t+ \"erlernen zu können.\");\n\t\tlocation[7].getDescriptions().setExploreDescription(\"Der Geruch ist wirklich unerträglich. Lange wirst du es hier nicht mehr aushalten können.\");\n\t\tlocation[8].getDescriptions().setExploreDescription(\"Meisterhaft in Inneneinrichtung hat der Direktor hier einen braunen Tisch, zwei graue Stühle und eine Ansammlung von an Krawatten erhängten Skelette.\\nEr ist damit beschäftigt, Frederic Chopin's neunte Death Metal Komposition zu hören.\");\n\t\tlocation[9].getDescriptions().setExploreDescription(\"Erst jetzt fällt dir der Gully [gully] auf dem Boden auf. Wo der wohl hinführt...\\n\"\n\t\t\t\t+ \"Um das herauszufinden wirst du definitiv so etwas wie einen Hebel benötigen.\"\n\t\t\t\t+ \"\\nDie Feueraxt [fire ax] ist dir eigentlich schon vorher aufgefallen, doch vielleicht wird sie jetzt wichtig?\");\n\t\tlocation[10].getDescriptions().setExploreDescription(\"Das Feuer ist echt frech! Es blockiert dir doch tatsächlich den Weg in den ersten Stock [floor 1].\");\n\t\tlocation[11].getDescriptions().setExploreDescription(\"Grau.Und unspektakulär. Der Mülleimer muss unbedingt mal geleert werden.\");\n\t\tlocation[12].getDescriptions().setExploreDescription(\"Der Professor liegt in ziemlich bizarren Posen auf dem Tisch und erklärt den Studenten(und Studentinnen), welche Pose welche Wirkung hat.\"\n\t\t\t\t+ \"\\nDu kannst das Geld, dass für jede Pose gazahlt wird, förmlich von dem Direktor in die Tasche des Professors wandern sehen.\\nHier steht noch Maribelle [student], obwohl sie wesentlich kleiner ist, schaut sie hochnäsig auf dich herab.\");\n\t\tlocation[13].getDescriptions().setExploreDescription(\"So viele Schließfächer [locker], und alle sind nummeriert. Verhindert wird jedoch eine genaue Identifikation des Hausmeisterfaches [shiny locker], da die Nummer wegpoliert wurde.\");\n\t\tlocation[14].getDescriptions().setExploreDescription(\"Dir fällt ein Spachtel [spatula] auf, der eindeutig aus der Chemiesammlung genommen wurde. Hol zurück, was dir gehört!\");\n\t\tlocation[15].getDescriptions().setExploreDescription(\"Schon wieder eine Runde 4-1 KD, der Schüler ist wirklich gut darin, Minen im richtigen Moment hochzujagen. Der Professer liest weiterhin monoton aus dem Buch vor.\"\n\t\t\t\t+ \"\\nJochen [student] ist so gelangweilt, dass er deinen Schritten Aufmerksamkeit schenkt.\");\n\t\tlocation[16].getDescriptions().setExploreDescription(\"Alle Studierenden sind inzwischen wieder drin, während der Professor eine Runde in der Ecke schmollt.\"\n\t\t\t\t+ \"\\nOh-oh, da kommt Anthon [student]\");\n\t\tlocation[17].getDescriptions().setExploreDescription(\"Die Frau braucht wieder einmal zu lange, du musst den Vortrag wohl beginnen, während sie noch Chemikalien mischt.\"\n\t\t\t\t+ \"\\nGerhard [student], dein persöhnlicher Fanboy, starrt dich mit großen Augen an.\");\n\t\tlocation[18].getDescriptions().setExploreDescription(\"Es ist ein Graus, Steven hat sich von Rebecca getrennt, und Grün ist das neue Schwarz, zumindest nach den Tratschtanten auf dem Klo.\");\n\t\tlocation[19].getDescriptions().setExploreDescription(\"Der Schleim heißt Wilhelm von Kaiser [wilhelm] und verkauft während der Pausen Katzenbabys für diejenigen in Not, ein sehr angenehmer Geselle.\");\n\t\tlocation[20].getDescriptions().setExploreDescription(\"Hier liegt eine Kaffeetasse mit, wer hätte es gedacht, heißem Kaffee [cup coffee] drin.\");\n\t\t\n\t\t\n\t\t/******************BESCHREIBUNG FÜR BEREITS UNTERSUCHTE RÄUME*********************/\n\t\tlocation[0].getDescriptions().setAlreadyExploredDescription(\"Der Raum ist nicht besonders groß, aber auf deinen Chefsessel bist du trotzdem stolz und natürlich auf deine Preis und Trophäen \"\n\t\t\t\t+ \"in deiner Vitrine.\");\n\t\tlocation[1].getDescriptions().setAlreadyExploredDescription(\"Ein typischer Korridor mit einem Kaffeelöscherkasten [extinguisher box]. Ist halt 'ne Uni!\");\n\t\tlocation[2].getDescriptions().setAlreadyExploredDescription(\"Weißt du noch als du dich gefragt hast was in den ganzen Küchenschränken sein könnte und warum der Boden hier höher ist?\");\n\t\tlocation[3].getDescriptions().setAlreadyExploredDescription(\"Die Konferenz wird wohl nie zu Ende gehen. Der Ventilationssacht [ventilation shaft] ist auch echt auffällig.\");\n\t\tlocation[4].getDescriptions().setAlreadyExploredDescription(\"Eine deiner Notiz [note] liegt zwischen zwei Kartons.\");\n\t\tlocation[5].getDescriptions().setAlreadyExploredDescription(\"Aber immerhin liegt hier eine deiner Notizen\");\n\t\tlocation[6].getDescriptions().setAlreadyExploredDescription(\"Naja, hier liegt halt noch ein Skillbook [skillbook].\");\n\t\tlocation[7].getDescriptions().setAlreadyExploredDescription(\"Der Geruch ist wirklich unerträglich. Lange wirst du es hier nicht mehr aushalten können.\");\n\t\tlocation[8].getDescriptions().setAlreadyExploredDescription(\"Der Direktor hört noch immer laute Musik von Frederic Chopin.\");\n\t\tlocation[9].getDescriptions().setAlreadyExploredDescription(\"Auch ein Gullideckel ist hier noch. #normal\");\n\t\tlocation[10].getDescriptions().setAlreadyExploredDescription(\"Das Feuer blockiert dir immer noch den Weg in den ersten Stock [floor 1]!\");\n\t\tlocation[11].getDescriptions().setAlreadyExploredDescription(\"Grau. Und unspektakulär.\");\n\t\tlocation[12].getDescriptions().setAlreadyExploredDescription(\"Maribelle [student] stolziert hier immer noch herum.\");\n\t\tlocation[13].getDescriptions().setAlreadyExploredDescription(\"Jedoch sind sowohl die Normalen [locker] als auch der Besondere [shiny locker] relativ uninteressant.\");\n\t\tlocation[14].getDescriptions().setAlreadyExploredDescription(\"Hier liegt ein Spachtel [spatula], der eindeutig aus der Chemiesammlung genommen wurde.\");\n\t\tlocation[15].getDescriptions().setAlreadyExploredDescription(\"Der Professer liest noch immer aus dem Buch vor, während dir Jochen noch immer hinterher starrt.\");\n\t\tlocation[16].getDescriptions().setAlreadyExploredDescription(\"Anthon [student] bemerkt dich sofort, als du den Raum betrittst.\");\n\t\tlocation[17].getDescriptions().setAlreadyExploredDescription(\"Gerhards Blick bleibt sofort auf dir haften, als du in Raum gehst.\");\n\t\tlocation[18].getDescriptions().setAlreadyExploredDescription(\"Die Tratschtanten reden noch immer.\");\n\t\tlocation[19].getDescriptions().setAlreadyExploredDescription(\"Wilhelm von Kaiser [wilhelm] schleimt noch immer hier rum.\");\n\t\t\n\t\t\n\t\t/****************************AUSGÄNGE*********************************************/\n\t\tlocation[0].setExits(\"Korridor [corridor]\");\n\t\tlocation[1].setExits(\"Büro [office]\" + \"\\nKaffeeraum [coffeeroom]\" + \"\\nKonferenzraum [conference room]\" + \"\\nSchulleiterraum [principalsroom]\"\n\t\t\t\t\t\t\t+ \"\\nHerrentoilette [gentlemenstoilet]\" + \"\\nTreppenhaus [stairwell]\" + \"\\nFahrstuhl [elevator]\");\n\t\tlocation[2].setExits(\"Korridor [corridor]\" + \"\\nKonferenzraum [conference room]\");\n\t\tlocation[3].setExits(\"Korridor [corridor]\" + \"\\nKaffeeraum [coffeeroom]\");\n\t\tlocation[4].setExits(\"Kaffeeraum [coffeeroom]\");\n\t\tlocation[5].setExits(\"Konferenzraum [conference room]\");\n\t\tfor (int i = 6; i < 10; i++) {\n\t\t\tlocation[i].setExits(\"Korridor [corridor]\");\n\t\t}\n\t\tlocation[10].setExits(\"Lehreretage [floor 2]\" + \"\\nSchüleretage [floor 1]\");\n\t\tlocation[11].setExits(\"Hörsaal <1-4> [lecture hall <1-4>]\" + \"\\nSpindraum [lockerroom]\" + \"\\nAbstellraum [storeroom]\" + \"\\nDamentoilette [ladiestoilet]\"\n\t\t\t\t\t\t\t\t+ \"\\nHerrentoilette [gentlemenstoilet]\" + \"\\nFahrstuhl [elevator]\" + \"\\nTreppenhaus [stairwell]\");\n\t\tfor (int i = 12; i <= 19; i++) {\t\t// Die restlichen Räume haben anfangs alle den Korridor als einzigen Ausgang\n\t\t\tlocation[i].setExits(\"Korridor [corridor]\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/**********************ERSTELLEN VON GEGENSTÄNDEN*********************************/\n\t\tlocation[0].createItem(0, \"Schrank\", 0, 000);\t\t\t\t\t\t\t// wird nie benutzt oder erwähnt TODO\n\t\tlocation[0].createItem(1, \"Stuhl\", 0, 001);\n\t\tlocation[0].createItem(2, \"Schreibtisch\", 0, 002);\n\t\tlocation[0].createItem(3, \"Rätsellösung\", 0, 003, false);\n\t\tlocation[1].createItem(0, \"Kaffeelöscherkasten\", 1, 100, false);\n\t\tlocation[1].createItem(1, \"Kaffeelöscher\", 1, 101, false);\n\t\tlocation[2].createItem(0, \"Kaffeemaschine\", 2, 200);\n\t\tlocation[2].createItem(1, \"Küchenschränke\", 2, 201);\n\t\tlocation[3].createItem(0, \"Lüftungsschacht\", 3, 300, false);\n\t\tlocation[4].createItem(0, \"Notiz\", 4, 400, false);\n\t\tlocation[5].createItem(0, \"Notiz\", 5, 500, false);\n\t\tlocation[6].createItem(0, \"Skillbook\", 6, 600, false);\n\t\tlocation[9].createItem(0, \"Feueraxt\", 9, 900);\n\t\tlocation[9].createItem(1, \"Gulli\", 9, 901, false);\n\t\tlocation[13].createItem(0, \"Notiz\", 13, 1300, false);\n\t\tlocation[13].createItem(1, \"Spind 42\", 13, 1301, false);\n\t\tlocation[14].createItem(0, \"Spachtel\", 14, 1400, false);\n\t\tlocation[19].createItem(0, \"Notiz\", 19, 1900);\n\t\tlocation[20].createItem(0, \"Kaffeetasse\", 20, 2000, false);\n\t\t\n\t\t\n\t\t/***********************BESCHREIBUNGEN DER GEGENSTÄNDE****************************/\n\t\tlocation[0].getItemByName(\"Schrank\").setDescription(\"Funzt >> desSchrank!\");\n\t\tlocation[0].getItemByName(\"Stuhl\").setDescription(\"Ein Scott Chefsessel aus original Kunstleder im Wert von 500€, der nur dir gehört.\");\n\t\tlocation[0].getItemByName(\"Schreibtisch\").setDescription(\"Dieser Schreibtisch braucht eine neue Lackierung. Achso, und ein Putzkommando!\"\n\t\t\t\t+ \"\\nTrotz der Unordnung fällt dir ein vollgekritzeltes Papier [paper] auf, auf dem du dein letztes Meisterwerk, das Ergebnis der unendlichen Summe, niedergeschrieben hast!\");\n\t\tlocation[0].getItemByName(\"Rätsellösung\").setDescription(\"Du hast hier die Summe der Unendlichkeit errechnet. Sie lautet -1/12!\");\n\t\tlocation[1].getItemByName(\"Kaffeelöscherkasten\").setDescription(\"Dieser Kasten beinhaltet einen Kaffeelöscher [coffee extinguisher], dieser ist der (un)natürlichste Bestandteil einer Feuerwehrausrüstung! \"\n\t\t\t\t+ \"Der Kasten ist durch ein elektronisches Sicherheitsschloss gesichert!\");\n\t\tlocation[1].getItemByName(\"Kaffeelöscher\").setDescription(\"Ein Feuerlöscher mit komisch riechendem Kaffee gefüllt.\");\n\t\tlocation[2].getItemByName(\"Kaffeemaschine\").setDescription(\"Eine hochwertig billige Kaffeemaschine. Die nicht funktoniert, irgendwer muss wohl das Stromkabel rausgezogen haben.\");\n\t\tlocation[2].getItemByName(\"Küchenschränke\").setDescription(\"Unter einem der Schränke ist ein Hohlraum, welcher unter dem ganzen Kaffeeraum hindurch führt zu einem\"\n\t\t\t\t+ \"\\ngeheimen Raum [chamber].\");\n\t\tlocation[3].getItemByName(\"Lüftungsschacht\").setDescription(\"Du entdeckst einen Geheimraum [ventilationroom].\");\n\t\tlocation[4].getItemByName(\"Notiz\").setDescription(\"Funzt >> desNotiz4!\");\n\t\tlocation[5].getItemByName(\"Notiz\").setDescription(\"Funzt >> desNotiz5!\");\n\t\tlocation[6].getItemByName(\"Skillbook\").setDescription(\"Dies ist das verstaubte Skillbook des toten Beammeisters.\");\n\t\tlocation[9].getItemByName(\"Feueraxt\").setDescription(\"Es ist eine Feueraxt!\");\n\t\tlocation[9].getItemByName(\"Gulli\").setDescription(\"Ein Gullideckel... er ist eckig, er ist halt auch ein Individuum.\"\n\t\t\t\t+ \"\\nDu brauchst irgendeinen Trick um den Gullideckel anheben zu können.\");\n\t\tlocation[14].getItemByName(\"Spachtel\").setDescription(\"Du wolltest ihn eigentlich der Chemiesammlung wiedergeben, aber er glänzt so schön.\");\n\t\tlocation[20].getItemByName(\"Kaffeetasse\").setDescription(\"Frischer Kaffee... Yammy\");\n\t\t\n\t\t\n\t\t/**********************BESCHREIBUNGEN BEIM INTERAGIEREN***************************/\n\t\tlocation[0].getItemByName(\"Stuhl\").setInteractDescription(\"Du setzt dich auf deinen Stuhl.\"\n\t\t\t\t+ \"\\nEs macht knack und du sitzt auf'm Boden... Das Steak zum Frühstück war wohl doch zu viel.\");\n\t\tlocation[1].getItemByName(\"Kaffeelöscherkasten\").setInteractDescription(\"Das kannst du nicht machen. Das elektronische Sicherheitsschloss will das nicht! \"\n\t\t\t\t+ \"Ob du einen Weg findest es zu bezwingen?\");\n\t\tlocation[1].getItemByName(\"Kaffeelöscher\").setInteractDescription(\"Jetzt bist du ein wahrer Feuerwehrmann.... Naja, nicht ganz, aber fast.\");\n\t\tlocation[2].getItemByName(\"Kaffeemaschine\").setInteractDescription(\"Du willst den Stecker in die Steckdose stecken, aber die Steckdose will das nun halt nicht und gibt dir deswegen einen tödlichen Stromschlag.\");\n\t\tlocation[6].getItemByName(\"Skillbook\").setInteractDescription(\"Du kannst dich nun beamen!\");\n\t\tlocation[9].getItemByName(\"Feueraxt\").setInteractDescription(\"Diese Axt gehört zur Grundausstattung eines Feuerbekämpfers.\");\n\t\tlocation[20].getItemByName(\"Kaffeetasse\").setInteractDescription(\"Bei dem Versuch die Kaffeetasse hochzuheben, schmeißt du sie um, wodurch du einen schönen Kurzschluss verursachst.\"\n\t\t\t\t+ \"Wenn du Glück hast, hast du nur dich damit getötet und nicht gleich die ganze Welt!\");\n\t\t\n\t\t\n\t\t\n\t\t/*************************ERSTELLEN DER STUDENTEN*********************************/\n\t\tlocation[12].createStudent(\"Maribelle\", 12);\n\t\tlocation[15].createStudent(\"Jochen\", 15);\n\t\tlocation[16].createStudent(\"Anthon\", 16);\n\t\tlocation[17].createStudent(\"Gerhard\", 17);\n\t\t\n\t\t/****************************SETZEN DER FRAGE*************************************/\n\t\tlocation[12].getStudent().setQuestionText(\"Ahh, Sie lassen sich also hier blicken, Herr Euler! Beantworten sie mir doch, wie Chopin mit Vornamen hieß.\");\n\t\tlocation[15].getStudent().setQuestionText(\"Greetings Mate! Is english DLC working right know?\");\n\t\tlocation[16].getStudent().setQuestionText(\"Ehehe Euler, was sind Dreipacken minus Zweipacken?\");\n\t\tlocation[17].getStudent().setQuestionText(\"Moin Euler, sagen Sie doch mal Ihre Summe des Unendlichen!\");\n\t\t\n\t\t\n\t\t/***************************SETZEN DER ANTWORT************************************/\n\t\tlocation[12].getStudent().setAnswerText(\"Frederic\");\n\t\tlocation[15].getStudent().setAnswerText(\"No\");\n\t\tlocation[16].getStudent().setAnswerText(\"Einpacken\");\n\t\tlocation[17].getStudent().setAnswerText(\"-1/12\");\n\t\t\n\t\t/******************SETZEN DES HINWEISES AUF DIE NOTIZEN***************************/\n\t\tlocation[12].getStudent().setHint(\"Ahh, woher wissen Sie denn das. Als ich das letzte Mal im Konferenzraum war, war die Luft so stickig!\\nJemand müsste mal den Lüftungsschacht untersuchen.\");\n\t\tlocation[15].getStudent().setHint(\"Oh, I see. Do you think locker 42 is somewhat special? Because I do think so!\");\n\t\tlocation[16].getStudent().setHint(\"Ihihi, fürchte dich vor Kaffe, der ist Tödlich!\");\n\t\tlocation[17].getStudent().setHint(\"Boah, darauf wäre ich nicht gekommen!\\nWissen Sie, warum der Boden im Kaffeeraum so hoch ist? Na, egal...\");\n\t}", "public WiuWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1xpixels.\n super(WIDTH_WORLD, HEIGHT_WORLD, 1); \n }", "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 }", "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 }", "public Monster(int x,int y){\n\tposition[0] = x; //x position\n\tposition[1] = y; //y position\n }", "public Monster(MonsterType id, int life)\n {\n setId(id);\n setLife(life);\n }", "public Classroom()\n { \n // Create a new world with 10x6 cells with a cell size of 130x130 pixels.\n super(10, 6, 130); \n prepare();\n }", "public ClassTester()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1);\n addObject(new NonScrollingBackground(\"Stage - 0.jpg\"),300,131);\n addObject(playerMage,35,170);\n addObject(new AbilityDisplayer(playerMage),125,268);\n }", "private Room (String roomName,boolean isHealingPot, boolean isPit,boolean isEntrance, boolean isExit, boolean isPillar, Monster monster, int numMons, boolean isVisionPot){\n this.roomName = roomName;\n this.isHealingPot = isHealingPot;\n this.isPit = isPit;\n this.isEntrance = isEntrance;\n this.isExit = isExit;\n this.isPillar = isPillar;\n\n this.monster = monster;\n this.numMons = numMons;\n this.isVisionPot = isVisionPot;\n }", "public Mage(String c) {\n super(7, 1, \"*\", \"walk\", 0, 2, \"\", c, \"0\");\n super.imageName =\"piece_mage\";\n super.spells=\"FHRT\";\n super.playerY=2;\n switch (c) {\n case \"white\":\n super.type = \"M\";\n super.initPositionX = 0;\n super.initPositionY = 3;\n break;\n case \"black\":\n super.type = \"m\";\n super.initPositionX = 5;\n super.initPositionY = 2;\n break;\n default:\n System.out.println(\"ERROR:<Invalid color for piece Mage!>\");\n }\n }", "Hero()\n\t{\n\t\t\n\t\tsuper(152,500,97,124);\n\t\tlife = 3;\n\t\tdoubleFire = 0;\n\t\t\n\t}", "public Asteroid()\r\n\t{\r\n\t\tsuper.setDirection(rn.nextInt(360));\r\n\t\tsuper.setSpeed(rn.nextInt(100));\r\n\t\tsuper.setLocalX(rn.nextFloat() * 1024);\r\n\t\tsuper.setLocalY(rn.nextFloat() * 786);\r\n\t\tsuper.setColor(250);\r\n\t\tsize = rn.nextInt(10);\r\n\t\t\r\n\t}", "public Creature(String name, String description, int hp, int dmg) {\r\n\t\tthis.name = name;\r\n\t\tthis.description = description;\r\n\t\tthis.hp = hp;\r\n\t\tthis.dmg = dmg;\r\n//\t\tthis.room = null;\r\n\t}", "public Warlock() {\n name = \"\";\n className = \"\";\n currentHealth = 0;\n strength = 0;\n defense = 0;\n special = 0;\n points = 0;\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 }", "protected Human(String name, char displayChar, int hitPoints) {\n\t\tsuper(name, displayChar, hitPoints, ZombieCapability.ALIVE);\n\t}", "public Mueble() {\n }", "public Monstruo(int posX, int posY ,Image image) {\n\t\tsuper(posX, posY, image);\n\t\torientacion = 3;\n\t\tvida = 10;\n\t\tdinero = 0;\n\t\tspeed = 1;\n\t\tstrength = 1;\n\t\tdefense = 1;\n\t\tweapon = 1;\n\t\tarmor = 1;\n\t}", "public Monster(String name, String type) {\r\n\t\tthis(name, new String[] { type });\r\n\t}", "public sword ( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor stub\r\n\t\tsuper();\r\n\t\tthis.setDamageBuff (3);\r\n\t\tthis.setDurability (15);\r\n\t\tthis.setWeaponName (\"Sword\");\r\n\t}", "public WaterWorld()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n populateWorld();\r\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 smallMonster(int points, String name, int id, int width, int height, int y, int x) {\n super(points, name, id, width, height, y, x);\n }", "public MyWorld()\n {\n super(600, 400, 1);\n }", "public Monster(Game game, int row, int col)\n\t{\n\t\tthis.game = game;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}", "public Armor() {\n super();\n}", "public MyWorld()\n { \n // Create a new world with 1600x1200 cells with a cell size of 1x1 pixels.\n super(1125, 1125, 1);\n //Adds the Cornucopia to the center of the Arena.\n int centerX = this.getWidth()/2;\n int centerY = this.getHeight()/2;\n this.addObject(new Cornucopia(), centerX, centerY);\n \n //The following adds the main character for the game.\n int CharacterX = 1125/2;\n int CharacterY = 770;\n this.addObject(new Character(), CharacterX, CharacterY);\n \n //The following code adds 6 \"Careers\" into the arena.\n int CareerX = 405;\n int CareerY = 328;\n this.addObject(new Careers(), CareerX, CareerY);\n this.addObject(new Careers(), CareerX+310, CareerY-5);\n this.addObject(new Careers(), CareerX+90, CareerY+430);\n this.addObject(new Careers(), CareerX+290, CareerY+405);\n this.addObject(new Careers(), CareerX+190, CareerY-60);\n \n //The following code add the remaining 17 Tributes to the arena.\n //Also, I cannot add like a normal person so there will only be twenty-three tributes. The Capitol goofed this year.\n int TribX = 660;\n int TribY = 288;\n this.addObject(new Tributes(), TribX, TribY);\n this.addObject(new Tributes(), TribX-200, TribY);\n this.addObject(new Tributes(), TribX-227, TribY+443);\n this.addObject(new Tributes(), TribX-280, TribY+400);\n this.addObject(new Tributes(), TribX-34, TribY+467);\n this.addObject(new Tributes(), TribX+86, TribY+397);\n this.addObject(new Tributes(), TribX-134, TribY-22);\n this.addObject(new Tributes(), TribX+103, TribY+82);\n this.addObject(new Tributes(), TribX+139, TribY+144);\n this.addObject(new Tributes(), TribX+150, TribY+210);\n this.addObject(new Tributes(), TribX+150, TribY+280);\n this.addObject(new Tributes(), TribX+120, TribY+342);\n this.addObject(new Tributes(), TribX-338, TribY+275);\n this.addObject(new Tributes(), TribX-319, TribY+343);\n this.addObject(new Tributes(), TribX-343, TribY+210);\n this.addObject(new Tributes(), TribX-330, TribY+150);\n this.addObject(new Tributes(), TribX-305, TribY+80);\n \n //The following code should add the forest onto the map.\n int ForX = this.getWidth()/2;\n int ForY = 900;\n this.addObject(new Forest(), ForX, ForY);\n \n //The following code should add the lake to the map.\n int LakX = 790;\n int LakY = 990;\n this.addObject(new Lake(), LakX, LakY);\n \n //The following should add the cave to the map.\n int CavX = 125;\n int CavY = 110;\n this.addObject(new Cave(), CavX, CavY);\n \n \n int actorCount = getObjects(Tributes.class).size();\n if(actorCount == 17) {\n int BeastX = 200;\n int BeastY = 200;\n this.addObject(new Beasts(), BeastX, BeastY);\n this.addObject(new Beasts(), BeastX+100, BeastY+100);\n }\n }", "public Builder setMonsterID(int value) {\n bitField0_ |= 0x00000002;\n monsterID_ = value;\n onChanged();\n return this;\n }", "public MyWorld()\n { \n super(1200, 600, 1); \n prepare();\n bienvenida();\n instrucciones();\n sonido();\n }", "public Character(String name, int armor, int attack, int stamina, int speed, int luck) {\r\n\t\tthis.name.set(name);\r\n\t\tthis.armor.set(armor);\r\n\t\tthis.attack.set(attack);\r\n\t\tthis.stamina.set(stamina);\r\n\t\tthis.speed.set(speed);\r\n\t\tthis.luck.set(luck);\r\n\t\tthis.level.set((armor + attack + stamina + speed + luck) / 100);\r\n\t}", "public Agent(int sx, int sy, int gx, int gy) {\n mStart = new Point(sx, sy);\n mGoal = new Point(gx, gy);\n }", "public Program7()\n { \n _tc = new TravelingCreature( 200, 200 );\n }", "public Monster getMonster() {\r\n\t\t\r\n\t\tString[] monsters = {\"ACROMANTULA\", \"BOGGART\", \"DEMENTOR\", \"TROLL\",\r\n\t\t\t\t\t\t\t \"CORNISH PIXIE\", \"BASILISK\", \"CHIMERA\"};\r\n\r\n\t\tRandom randomizer = new Random();\r\n\t\tString monsterType = monsters[randomizer.nextInt(monsters.length)];\r\n\r\n\t\tif(monsterType.equals(\"ACROMANTULA\")) {\r\n\t\t\treturn new Acromantula();\r\n\r\n\t\t} else if(monsterType.equals(\"BOGGART\")) {\r\n\t\t\treturn new Boggart();\r\n\r\n\t\t} else if(monsterType.equals(\"DEMENTOR\")) {\r\n\t\t\treturn new Dementor();\r\n\r\n\t\t} else if(monsterType.equals(\"TROLL\")) {\r\n\t\t\treturn new Troll();\r\n\r\n\t\t} else if(monsterType.equals(\"CORNISH PIXIE\")) {\r\n\t\t\treturn new CornishPixie();\r\n\t\t\t\r\n\t\t} else if(monsterType.equals(\"BASILISK\")) {\r\n\t\t\treturn new Basilisk();\r\n\r\n\t\t} else if(monsterType.equals(\"CHIMERA\")) {\r\n\t\t\treturn new Chimera();\r\n\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "Sorcerer (String cName){\n name = cName;\n hp = 20;\n mana = 100; \n strength = 2;\n vitality = 4;\n energy = 10;\n }", "public void initCreature() {\n }", "public Mage() {\r\n\thp = 75;\r\n\tstrength = 50;\r\n\tdefense = 30;\r\n\tattack = .4;\r\n\tcrit=.3;\r\n\tevade=0;\r\n }", "public Asteroid(int x, int y) {\r\n super(x, y);\r\n speed = 1;\r\n initialY = y;\r\n initAsteroid();\r\n }", "public Builder setMonsterID(int value) {\n bitField0_ |= 0x00000001;\n monsterID_ = value;\n onChanged();\n return this;\n }", "public Dungeon() {\n dungeon = new Object[10];\n }", "protected Demon(int str, int hp)\n {\n super(str, hp);\n }", "public PlayerPiece()\n {\n // initialise instance variables\n //Use the values listed in the comments\n //above that are next to each instance variable\n pieceName = \"no name\";\n pieceType = \"human\";\n currentHealth = 100;\n maxHealth = 100;\n locX = 7;\n locY = 8;\n attackPower = 25;\n defensePower = 20;\n currentSpecialPower = 50;\n maxSpecialPower = 50;\n \n }", "public Monster(T green) { // constructor\n this.green = green;\n }", "public MageTowerCard() {\n\t\tsuper(cardName, cardId, cardCost);\n\t}", "public Unit (int hp, int str, int mag, int def, int x, int y) {\n this.stats = new Stats(hp, str, mag, def);\n this.position = new Position(x, y);\n }", "public Mitarbeit() {\r\n }", "@Override\n\tpublic function initFromString(String s) {\n\t\treturn new Monom(s);\n\t}", "public EngineClass()\n {\n cyl = 10;\n fuel = new String( BATT );\n }", "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 }", "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 Human(int theShipType){\n super(theShipType);\n }", "public CourtMovement() {\r\n\t\tsuper();\r\n\t\tstart = 0;\r\n\t\tend = 0;\r\n\t}", "public Door() {\n // needs to set defaults\n d20 = new D20();\n d10 = new D10();\n d6 = new D6();\n trapState = false;\n openState = false;\n archwayState = false;\n\n if (d10.roll() == 1) {\n // Is an archways\n archwayState = true;\n trapState = false;\n openState = true;\n } else {\n archwayState = false;\n // Is a door\n if (d20.roll() == 1) {\n\n trapState = true;\n } else {\n trapState = false;\n }\n\n if (d6.roll() == 1) {\n openState = false;\n } else {\n openState = true;\n }\n }\n myTrap = null;\n mySpaceList = new ArrayList<Space>();\n\n doorDescription = getDescription();\n }", "public Monster(String name, int level, Prize mPrize, BadConsequence mBC, int levelChange) {\r\n this.name = name;\r\n this.combatlevel = level;\r\n this.monsterPrize = mPrize;\r\n this.monsterBadConsequence = mBC;\r\n this.levelChangeAgainstCultistPlayer = levelChange;\r\n }", "public Wander() \t\r\n\t{ \r\n\t\tm_pos = new Point2d(30,0); \r\n\t\tm_r = 20; \r\n\t\tm_influence = 1; \r\n\t\tm_seekPoint = new Point2d(0,0);\r\n\t\tm_rate = 10;\r\n\t\tinit();\r\n\t}", "public SniperEnemy()\n { \n scoreBoost = 15;\n moneyBoost = 300;\n healthPoints = 500; \n fireRate = 45; \n movementCounter = 20;\n movementMod = 20;\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 ActorNPC() {\r\n }", "public WorldGenGrassUnderbean()\n {\n }", "public Unit(String name, int calories, String side) {\n super(name);\n this.side = side;\n setStrength(calories);\n setTagged(false);\n bandanas = 1;\n // profile = new Profile();\n setInJail(false);\n column = -1;\n row = -1;\n challenges = 0;\n challengesWon = 0;\n rewards = new ArrayList<Reward>();\n }", "public WallAnt()\n {\n health = 4;\n cost = 4;\n }" ]
[ "0.7907262", "0.72785795", "0.71575165", "0.7044519", "0.6948288", "0.68459344", "0.6718111", "0.6695963", "0.6641883", "0.6620702", "0.6587776", "0.64381003", "0.64236766", "0.639393", "0.6376573", "0.634066", "0.6297827", "0.6279826", "0.6246702", "0.62420374", "0.6241646", "0.61798227", "0.6168829", "0.61482084", "0.6120353", "0.61192584", "0.61121464", "0.60744023", "0.6071245", "0.6057618", "0.6055977", "0.6055319", "0.60407376", "0.6038409", "0.6022877", "0.6020419", "0.6019837", "0.6010746", "0.6003917", "0.6003817", "0.5993789", "0.5986664", "0.5966514", "0.59584266", "0.5952424", "0.5946789", "0.59440804", "0.59358823", "0.59346265", "0.5919525", "0.5910462", "0.5862246", "0.5856346", "0.585128", "0.58510864", "0.5844392", "0.58306134", "0.5823635", "0.58179575", "0.58158433", "0.5813341", "0.5785984", "0.57807463", "0.57801217", "0.57725775", "0.5756524", "0.5753076", "0.57462865", "0.57325786", "0.5730139", "0.57292706", "0.5721419", "0.57130677", "0.57066035", "0.57045895", "0.5704574", "0.57032883", "0.5700761", "0.5693932", "0.56900007", "0.5681597", "0.56739", "0.56681377", "0.56672394", "0.56566495", "0.56503457", "0.5646181", "0.5644328", "0.5642422", "0.5638477", "0.563671", "0.5627233", "0.5623774", "0.56211305", "0.5620518", "0.5617241", "0.56081307", "0.56055284", "0.5604049", "0.55924284" ]
0.68265796
6
Default constructor, which will set all components on base values.
public Monster() { this.name="Noname"; this.monsterType=0; this.health=0; this.maxHealth=0; this.monstersWalkDistanceX=0; this.monstersWalkDistanceY=0; this.resourceReward=0; this.monsterSize=0; this.whichSide=0; this.firstCross=0; this.secondCross=2; targetable=false; this.visible=false; setDefaultMonsterCords(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeviceSelectionComponentBase() {\n initComponents();\n }", "public BaseParameters(){\r\n\t}", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "@Override\n\tpublic void initializeValues() {\n\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "public StandardValues() {\n super(ForwardingMap.this);\n }", "public BaseDatos() {\r\n super();\r\n listaNumeros.add(6.0f);\r\n }", "public BaseFrame() {\n initComponents();\n }", "private Values(){}", "public Property() {\n this(0, 0, 0, 0);\n }", "@Override\n\tpublic void initValue() {\n\t\t\n\t}", "public RaceBasePanel()\n\t{\n\t\tinitComponents();\n\t\tinitComponentContents();\n\t}", "private void initValues() {\n \n }", "@Override public void init()\n\t\t{\n\t\t}", "public Shape() { this(X_DEFAULT, Y_DEFAULT); }", "public BaseElement() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private Value() {\n\t}", "public ScaleControl() {\n super();\n }", "public BaseStatistics() {\n\t\tsuper();\n\t}", "public ReferenceBasePUSData() {\n\t\tsuper();\n\t}", "public CarFuelPanel() {\n this(false, null);\n }", "public AllDifferent()\n {\n this(0);\n }", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t}", "Rectangle()\n {\n this(1.0,1.0);\n }", "public Component() {\n }", "public GenerateurImpl() {\n\t\tsuper();\n\t\tthis.value = 0;\n\t}", "public void init() {\r\n\t\t// to override\r\n\t}", "Composite() {\n\n\t}", "public LabelValueBean() {\r\n\t\tsuper(\"\", \"\");\r\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "public AbstractRecombinator() \r\n\t{\r\n\t\tsuper();\r\n\t\tsetPpl();\r\n\t\tsetSpl();\t\t\r\n\t}", "public Component() {\n\t\tlocation = new Point(0, 0);\n\t\tsize = new Dimension(100, 80);\n\t\tproperties = new LinkedHashMap<>();\n\t\tsubJobContainer= new LinkedHashMap<>();\n\t\tleftPortCount = 0;\n\t\trightPortCount = 0;\n\t\tbottomPortCount = 0;\n\t\tinputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\n\t\tinputLinks = new ArrayList<Link>();\n\t\toutputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\t\toutputLinks = new ArrayList<Link>();\n\t\tinputportTerminals = new ArrayList<String>();\n\t\toutputPortTerminals = new ArrayList<String>();\n\t\twatcherTerminals = new HashMap();\n\t\tnewInstance = true;\n\t\tvalidityStatus = ValidityStatus.WARN.name();\n\t\tcomponentName = DynamicClassProcessor.INSTANCE.getClazzName(this\n\t\t\t\t.getClass());\n\n\t\tcomponentLabel = new ComponentLabel(componentName);\n\t\tcomponentLabelMargin = 16;\n\n\t\tprefix = XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\t\n\t\tdefaultPrefix=XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\tinitPortSettings();\n\t\ttoolTipErrorMessages = new LinkedHashMap<>();\n\t\tstatus = ComponentExecutionStatus.BLANK;\n\t}", "public Child() {\n\t\tsuper(20);\n\t}", "private Converter()\n\t{\n\t\tsuper();\n\t}", "public TelaValores() {\n initComponents();\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public AbstractValueHolder() {\n }", "public void initDefaultValues() {\n }", "public LifeComponent() {\n // call other constructor with null param\n this(null);\n }", "protected Vehicle() {\n setColor(Color.WHITE);\n setEnginePower(100);\n }", "private UI()\n {\n this(null, null);\n }", "public BatchControl() {\n super();\n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public DriverControl(){\n super(0);\n }", "protected Product()\n\t{\n\t}", "public Prism(){//consturctor for Cube class with h initialzed to 10.0.\r\n super();//constructor of superclass called.\r\n h = 10.0;\r\n }", "public ComponentsFactory() {\n\t\tsuper();\n\t}", "protected AbstractAggregateComponent() {\n\t\tsuper();\n\t}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n public void init() {\n\n super.init();\n\n }", "@Override\r\n\tpublic void init() {}", "@Override\n protected void init() {\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 CalculatorDevice() {\n initComponents();\n }", "public AlgorithmDesign() {\n initComponents();\n }", "protected BaseTestObject()\n {\n\n fProp = new Properties(); // empty properties object\n fLog = TestLogger.getInstance(); // default level is DEBUG\n\n }", "public Allocation() {\n initComponents();\n }", "protected Coord() {\n\t}", "protected Product() {\n\t\t\n\t}", "public SuperProduct() {\n\t\tsuper();\n\t}", "@Override\n public final void init() {\n super.init();\n UIUtils.clearAllFields(upperPane);\n changeStatus(Status.NONE);\n intCombo();\n }", "public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}", "public ScaleInformation() {\n\t\tthis(0.0, 0.0, 800.0, 540.0, 800, 540);\n\t}", "public Shape() {\n\t\tthis(DEFAULT_X_POS, DEFAULT_Y_POS, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}", "public BaseView() {\r\n\t\tsuper();\r\n\t\tthis.modelView = new BaseModelView();\r\n\t\tthis.buildLayout();\r\n\t\tthis.setVisible(true);\r\n\t}", "public Avontool() {\n initComponents();\n }", "@Model\r\n\tpublic Vector() {\r\n\t\tthis(50,50);\r\n\t}", "public Calculator() {\n initComponents();\n \n }", "@Override\n public void init() {\n }", "private Default()\n {}", "private ARXDate() {\r\n this(\"Default\");\r\n }", "public JXGraph() {\r\n this(0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.2, 4, 0.2, 4);\r\n }", "public Rectangle() {\n this(50, 40);\n }", "public Boleto() {\n this(3.0);\n }", "public Scale()\n\t{\n\t\tthis.scaleName = \"no scale\";\n\t\tthis.scaleDegrees = \"no degrees\";\n\t\tthis.degreeCount = -99;\n\t}", "public Valvula(){}", "public Constructor(){\n\t\t\n\t}", "public Value() {\n }", "@Override // opcional\n public void init(){\n\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public Core() {\r\n inputs = new ArrayList<>();\r\n outputs = new ArrayList<>();\r\n converter = new Converter();\r\n\r\n }", "public Cadastros() {\n initComponents();\n }", "@Override\n protected void initialize() { \n\n \n SmartDashboard.putNumber(\"Side Velocity\", sideVelocity);\n SmartDashboard.putNumber(\"Belt velocity\", beltVelocity);\n\n }", "public xo() {\n initComponents();\n }", "protected VoltexGroup() {\n\t\tsuper();\n\t}", "public ProductoAbm() {\n initComponents();\n }", "public PerformanceAmigos() {\n initComponents();\n }", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t\tCursurIndex = 1;\n\t\t\n\t}", "public Soru1() {\n initComponents();\n }", "public periodictable() {\n initComponents();\n }", "public PayrollPeriodInformation() {\n initComponents();\n }", "public Assignment() {\n initComponents();\n }", "public ActuatorData()\n\t{\n\t\tsuper(); \n\t}", "public ValorVariavel() {\r\n }", "public ComponentDescriptor() {\r\n\t\t// initialize empty collections\r\n\t\tconstructorParametersTypes = new LinkedList<List<Class<?>>>();\r\n//\t\trequiredProperties = new HashMap<String, MetaProperty>();\r\n//\t\toptionalProperties = new HashMap<String, MetaProperty>();\r\n\t}" ]
[ "0.6676608", "0.66068447", "0.64681107", "0.64616287", "0.641056", "0.6392844", "0.63776135", "0.6327028", "0.6303617", "0.62844545", "0.6274401", "0.6250053", "0.6238565", "0.6238224", "0.6232178", "0.6217839", "0.61455053", "0.6131922", "0.61220986", "0.6076541", "0.60663617", "0.6049736", "0.60488087", "0.6047894", "0.6040448", "0.6036675", "0.60277766", "0.6026658", "0.6017859", "0.6012024", "0.6009742", "0.60021436", "0.5999909", "0.59986144", "0.59920824", "0.59869844", "0.59779865", "0.59728146", "0.59683114", "0.59637743", "0.5957262", "0.595124", "0.5949215", "0.59318364", "0.5931577", "0.59277004", "0.5926347", "0.5926347", "0.5926347", "0.5925091", "0.59215945", "0.59207463", "0.5920219", "0.5918998", "0.59157836", "0.5913844", "0.5913311", "0.5902921", "0.59017205", "0.5900122", "0.58967704", "0.5888237", "0.5877814", "0.5871642", "0.58686066", "0.58647454", "0.5863191", "0.58619976", "0.5860058", "0.5852989", "0.5851186", "0.58418113", "0.58380216", "0.5834424", "0.58330035", "0.5832304", "0.5831809", "0.58282816", "0.5823949", "0.5823318", "0.5823149", "0.58221716", "0.5819493", "0.5817075", "0.58103627", "0.58096015", "0.5807234", "0.5802883", "0.58025175", "0.57971424", "0.579391", "0.5792851", "0.579225", "0.5792189", "0.57907355", "0.57907283", "0.5789182", "0.57891476", "0.5788197", "0.5787706", "0.5786474" ]
0.0
-1
Sets proper cords for monster, when he will be created. Sets proper source cords, to get proper part of external Image.
private void setDefaultMonsterCords() { this.xBeginMap=0; this.yBeginMap=0; this.xEndMap=16; this.yEndMap=16; this.xBeginSrc=0; this.yBeginSrc=0; this.xEndSrc=0; this.yEndSrc=0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected ImgProcessor() {\n\t\talbert = new Midi();\n\t\tharmon1 = new Midi();\n\t\tharmon2 = new Midi();\n\t\tharmon3 = new Midi();\n\t}", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\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\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "private void updateMowerCords() {\n\t\tfor (int i = 0; i < this.map.size(); i++) {\r\n\t\t\tfor (int j = 0; j < this.map.get(i).size(); j++) {\r\n\t\t\t\tif (this.map.get(i).get(j) == this.mower) {\r\n\t\t\t\t\tthis.x = j;\r\n\t\t\t\t\tthis.y = i;\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 Monster(String name,int monsterType,int health,int monstersWalkDistanceX,int monstersWalkDistanceY,int resourceReward,int monsterSize,int whichSide,int respawnTime)\n {\n this.name=name;\n this.monsterType=monsterType;\n this.health=health;\n this.monstersWalkDistanceX=monstersWalkDistanceX;\n this.monstersWalkDistanceY=monstersWalkDistanceY;\n this.resourceReward=resourceReward;\n this.monsterSize=monsterSize;\n this.whichSide=whichSide;\n this.maxHealth=health;\n this.targetable=true;\n this.visible=true;\n this.respawnTime=respawnTime;\n\n setDefaultMonsterCords();\n\n this.firstCross=pathDrawLots(2)+1;\n this.secondCross=pathDrawLots(2)+3;\n\n }", "private void setUpSharp() {\n Image sharp = new Image(this.getClass().getResourceAsStream(\"Sharp.png\"));\n _accidentalImage.setImage(sharp);\n _accidentalImage.setFitHeight(26);\n _accidentalImage.setFitWidth(26);\n _accidentalImage.setX(_noteHead.getCenterX() + Constants.SHARP_X_OFFSET);\n _accidentalImage.setY(_noteHead.getCenterY() + Constants.ACCIDENTAL_Y_OFFSET);\n }", "protected void putMonsters() {\n\t\tRandom rand = new Random();\n\t\tfor (int monsterCount = 0; monsterCount < 4; monsterCount++){\n\t\t\tint x, y;\n\t\t\tdo {\n\t\t\t\tx = rand.nextInt(xSize);\n\t\t\t\ty = rand.nextInt(ySize);\n\t\t\t} while((levelSetup[x][y] instanceof SimpleRoom) && (x == 0 & y == 0) && !levelSetup[x][y].hasItem());\n\t\t\tlevelSetup[x][y].putMonster(new BasicMonster());\n\t\t}\n\t}", "public CopyOfPlayer(){ //Loads and scales the images\n for (int i = 0; i < robotImages.length; i++){\n for (int j = 0; j < black.length; j++){\n robotImages[i][j].scale(300, 300);\n }\n }\n costume = PrefLoader.getCostume(); //Sets costume according to file\n setImage(robotImages[costume][2]);\n }", "public void initMob() {\n this.lLegGeom.setName(\"Mob/\" + this.id + \"/lLeg\");\n this.rLegGeom.setName(\"Mob/\" + this.id + \"/rLeg\");\n this.bodyGeom.setName(\"Mob/\" + this.id + \"/Body\");\n this.lArmGeom.setName(\"Mob/\" + this.id + \"/lArm\");\n this.rArmGeom.setName(\"Mob/\" + this.id + \"/rArm\");\n this.headGeom.setName(\"Mob/\" + this.id + \"/Head\");\n this.weaponGeom.setName(\"Mob/\" + this.id + \"/Weapon\"); \n \n this.armMat.setColor(\"Color\",ColorRGBA.Black);\n this.legMat.setColor(\"Color\",ColorRGBA.Black);\n this.bodyMat.setColor(\"Color\",ColorRGBA.Black);\n \n //Refactor boss ActorControl into MobControl with MonkeyBrains\n CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(2.5f,4.5f,1);\n this.mobControl = new CharacterControl(capsuleShape, 3f);//Step size is set in last argument\n this.mobControl.setJumpSpeed(20);\n this.mobControl.setFallSpeed(45);\n this.mobControl.setGravity(50);\n \n }", "public void setCords(float xCord, float yCord) {\n this.xCord = xCord;\n this.yCord = yCord;\n }", "@Override\n\tpublic void setChaseTarget(){\n\t\tthis.setTarget(_pacman.getX()+Constants.SQUARE_SIDE,_pacman.getY()-(4*Constants.SQUARE_SIDE));\n\t}", "@Override\n protected void generateMonsters()\n {\n generateWeakEnemies(2);\n generateStrongEnemies(12);\n generateElites(10);\n }", "private void createMonsters() {\n monsters = new ArrayList<Monster>();\n\n Integer value;\n Integer key;\n for(Map.Entry<Integer, Integer> entry : characterLoader.getMonsters().entrySet()){\n\n key = entry.getKey();\n value = entry.getValue();\n\n for(int i=0;i<value;i++) {\n\n Point newPoint = findEmptyCell();\n\n switch (key) {\n\n // Case Ghost\n case LabyrinthFactory.GHOST:\n monsters.add(new Ghost(newPoint.x, newPoint.y));\n break;\n\n // Case Troll\n case LabyrinthFactory.TROLL:\n monsters.add(new Troll(newPoint.x, newPoint.y));\n break;\n }\n }\n }\n\n playThread();\n }", "public Monster()\n {\n this.name=\"Noname\";\n this.monsterType=0;\n this.health=0;\n this.maxHealth=0;\n this.monstersWalkDistanceX=0;\n this.monstersWalkDistanceY=0;\n this.resourceReward=0;\n this.monsterSize=0;\n this.whichSide=0;\n this.firstCross=0;\n this.secondCross=2;\n targetable=false;\n this.visible=false;\n\n setDefaultMonsterCords();\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t\ttarget = pointEntity(caster,50);\r\n\t\tif (target == null) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\trefund = true;\r\n\t\t\tdead = true;\r\n\t\t\tif (refined)\r\n\t\t\t\tsteprange = 240;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_ACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tdist = target.getLocation().distance(caster.getLocation());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void initSpriteSheet() {\n\t\tString url = \"https://amiealbrecht.files.wordpress.com/2016/08/set-cards.jpg?w=1250\";\n\n\t\tcimg = loadImage(url, \"png\");\n\t}", "public Fighter(double init_x, double init_y) \n\t\tthrows SlickException, NumberFormatException\n\t{\n\t\tsuper(init_x, init_y);\n\t\tthis.img = new Image(image_file);\n\t\tthis.setShield(24);\n\t\tthis.setDamage(9);\n\t\tthis.setFirepower(0);\n\t\tthis.setDestroyed(false);\n\t}", "private void init(final Context ct) {\n\n Log.d(TAG, \"init: \");\n \n mBitmap = BitmapFactory.decodeResource(ct.getResources(), R.drawable.logo);\n canvasOverlay = BitmapFactory.decodeResource(ct.getResources(), R.drawable.canvasoverlay);\n landmarkBitmap = BitmapFactory.decodeResource(ct.getResources(), R.drawable.landmark_icon);\n\t\tskinTonePicker = BitmapFactory.decodeResource(ct.getResources(), R.drawable.ic_action_picker);\n moverBitmap = BitmapFactory.decodeResource(ct.getResources(), R.drawable.movercircle);\n\n\n moverBitmap = Bitmap.createScaledBitmap(moverBitmap, 50, 50, false);\n landmarkBitmap = Bitmap.createScaledBitmap(landmarkBitmap, landmarkBitmap.getWidth()/2, landmarkBitmap.getHeight()/2,false);\n\t\tskinTonePicker = Bitmap.createScaledBitmap(skinTonePicker, skinTonePicker.getWidth(), skinTonePicker.getHeight(),false);\n colorPicker = new CircleArea(0, 0, 150);\n \n mCirclePaint = new Paint();\n\n mCirclePaint.setColor(Color.BLUE);\n mCirclePaint.setStrokeWidth(40);\n mCirclePaint.setStyle(Paint.Style.FILL);\n }", "public MediaImageSpriteInfo(MediaImageSpriteInfo source) {\n if (source.Height != null) {\n this.Height = new Long(source.Height);\n }\n if (source.Width != null) {\n this.Width = new Long(source.Width);\n }\n if (source.TotalCount != null) {\n this.TotalCount = new Long(source.TotalCount);\n }\n if (source.ImageUrlSet != null) {\n this.ImageUrlSet = new String[source.ImageUrlSet.length];\n for (int i = 0; i < source.ImageUrlSet.length; i++) {\n this.ImageUrlSet[i] = new String(source.ImageUrlSet[i]);\n }\n }\n if (source.WebVttUrl != null) {\n this.WebVttUrl = new String(source.WebVttUrl);\n }\n }", "public Mountains() {\n\t\tparallaxes = new Parallax[6];\n\t\tbgImage = ResourceManager.createCompatible(ResourceManager\n\t\t\t\t.getMountain());\n\t\tbgImage2 = ResourceManager.createCompatible(ResourceManager\n\t\t\t\t.getMountain2());\n\t\tbgImage3 = ResourceManager.createCompatible(ResourceManager\n\t\t\t\t.getBlueSky());\n\t\tcurrHeight = 0;\n\t\tfor (int i = 0; i < parallaxes.length; i++) {\n\t\t\tparallaxes[i] = new MountainParallax(i);\n\t\t}\n\t}", "public MediaImageSpriteItem(MediaImageSpriteItem source) {\n if (source.Definition != null) {\n this.Definition = new Long(source.Definition);\n }\n if (source.Height != null) {\n this.Height = new Long(source.Height);\n }\n if (source.Width != null) {\n this.Width = new Long(source.Width);\n }\n if (source.TotalCount != null) {\n this.TotalCount = new Long(source.TotalCount);\n }\n if (source.ImagePathSet != null) {\n this.ImagePathSet = new String[source.ImagePathSet.length];\n for (int i = 0; i < source.ImagePathSet.length; i++) {\n this.ImagePathSet[i] = new String(source.ImagePathSet[i]);\n }\n }\n if (source.WebVttPath != null) {\n this.WebVttPath = new String(source.WebVttPath);\n }\n if (source.Storage != null) {\n this.Storage = new TaskOutputStorage(source.Storage);\n }\n }", "private void setPic() {\n int targetW = img_clip.getWidth();\n int targetH = img_clip.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n img_clip.setImageBitmap(bitmap);\n }", "Wolf(int x, int y, Resources res) {\n super(x, y, res);\n touched = false;\n goingRight = true;\n wolfLeft = BitmapFactory.decodeResource(res, R.drawable.sheep_left);\n wolfRight = BitmapFactory.decodeResource(res, R.drawable.sheep_right);\n appearance = wolfRight;\n wolfWidth = wolfLeft.getWidth();\n wolfHeight = wolfRight.getHeight();\n }", "public static void init()\n {\n \tSpriteSheet sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/spritesheet.png\"));\n BufferedImage img;\n /*for(int y = 0;y<4;y++)\n \t{\n \t\t\n \timg = sheet.crop(width*y,0,width,height);\n \t\t\n \t\tplayer.add(img);\n \t}*/\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n heroDown1 = sheet.crop(0,height+32,width+1,height);\n heroDown2 = sheet.crop(width+1,height+32,width+1,height);\n heroUp1 = sheet.crop(width*2+2,height+32,width,height);\n heroUp2 = sheet.crop(width*3+2,height+32,width,height);\n heroLeft1 = sheet.crop(width*4+2,height+32,width,height);\n heroLeft2 = sheet.crop(width*5+2,height+32,width,height);\n heroRight1 = sheet.crop(width*6+2,height+32,width,height);\n heroRight2 = sheet.crop(width*7+2,height+32,width,height);\n \n /*for(int i = 0;i<4;i++)\n {\n \tfor(int y = 0;y<4;y++)\n \t{\n \t\tif(y==1)\n \t\t{\n \t\t\timg = sheet.crop(width*y,height*i,width,height);\n \t\t}\n \t\telse\n \t\t{\n \t\t\timg = sheet.crop(width*y+1,height*i+1,width,height);\n \t\t}\n \t\tplayer.add(img);\n \t}\n }*/\n sheet = new SpriteSheet(ImageLoader.loadImage(\"/sprites/PokemonTileSet.png\"));\n for(int i = 0;i<50;i++)\n {\n \tfor(int y = 0;y<8;y++)\n \t{\n \t\timg = sheet.crop(tileW*y,tileH*i,tileW,tileH);\n \t\tassets.add(img);\n \t}\n }\n \n /*\n hero = sheet.crop(0,0,width,height);\n heroUp = sheet.crop(width,0,width,height);\n heroLeft = sheet.crop(width*2,0,width,height);\n heroRight = sheet.crop(width*3,0,width,height);\n \n treeTopLeft = sheet.crop(0,firstRow,tWidth,tHeight);\n treeTopRight = sheet.crop(tWidth,firstRow,tWidth,tHeight);\n treeMidLeft = sheet.crop(tWidth*2,firstRow,tWidth,tHeight);\n treeMidRight = sheet.crop(tWidth*3,firstRow,tWidth,tHeight);\n treeBotLeft = sheet.crop(tWidth*4,firstRow,tWidth,tHeight);\n treeBotRight = sheet.crop(tWidth*5,firstRow,tWidth,tHeight);\n treeTopLeftGrass = sheet.crop(tWidth*6,firstRow,tWidth,tHeight);\n treeTopRightGrass = sheet.crop(tWidth*7,firstRow,tWidth,tHeight);\n treeTopLeftMushroom = sheet.crop(tWidth*8,firstRow,tWidth,tHeight);\n grass = sheet.crop(tWidth*9,firstRow,tWidth,tHeight);\n \n wildGrass = sheet.crop(0,secondRow,tWidth,tHeight);\n mushroom = sheet.crop(tWidth,secondRow,tWidth,tHeight);\n logLeft = sheet.crop(tWidth*2,secondRow,tWidth,tHeight);\n logRight = sheet.crop(tWidth*3,secondRow,tWidth,tHeight);\n ledgeLeft = sheet.crop(tWidth*4,secondRow,tWidth,tHeight);\n ledgeMid = sheet.crop(tWidth*5,secondRow,tWidth,tHeight);\n ledgeRight = sheet.crop(tWidth*6,secondRow,tWidth,tHeight);\n treeLeftOverlap = sheet.crop(tWidth*7,secondRow,tWidth,tHeight);\n treeRightOverlap = sheet.crop(tWidth*8,secondRow,tWidth,tHeight);\n \n heroWalkingDown1 = sheet.crop(0,thirdRow,width+1,height);\n heroWalkingDown2 = sheet.crop(width+1,thirdRow,width+1,height);\n heroWalkingUp1 = sheet.crop(width*2+1,thirdRow,width,height);\n heroWalkingUp2 = sheet.crop(width*3+1,thirdRow,width,height);\n heroWalkingLeft1 = sheet.crop(width*4+1,thirdRow,width,height);\n heroWalkingLeft2 = sheet.crop(width*5+1,thirdRow,width,height);\n heroWalkingRight1 = sheet.crop(width*6+1,thirdRow,width,height);\n heroWalkingRight2 = sheet.crop(width*7+1,thirdRow,width,height);\n */\n }", "private void setup()\r\n {\r\n \r\n char[][] examplemap = {\r\n { 'e','w','e','e','e','e','e','e','e','e' },\r\n { 'e','w','e','w','w','w','w','e','w','w' },\r\n { 'e','w','e','w','e','w','w','e','w','e' },\r\n { 'e','e','e','w','e','w','e','e','w','e' },\r\n { 'e','w','e','e','e','w','e','e','w','e' },\r\n { 'e','w','w','w','e','w','e','w','w','e' },\r\n { 'e','e','e','e','e','e','e','w','e','e' },\r\n { 'e','w','w','e','w','e','w','w','w','e' },\r\n { 'e','e','w','e','e','w','w','e','e','e' },\r\n { 'e','e','w','e','e','e','e','e','e','w' }};\r\n for (int i=0; i<map.length; i++)\r\n {\r\n for (int n=0; n<map[i].length; n++)\r\n {\r\n if (examplemap[n][i] == 'e')\r\n map[i][n].setBackground(Color.white);\r\n else\r\n map[i][n].setBackground(Color.black);\r\n }\r\n }\r\n \r\n map[0][0].setBackground(Color.red);\r\n this.Playerpos[0]=0;\r\n this.Playerpos[1]=0;\r\n \r\n \r\n map[9][8].setBackground(Color.blue);\r\n this.Goalpos[0]=9;\r\n this.Goalpos[1]=8;\r\n \r\n \r\n \r\n \r\n }", "protected void setPic() {\n }", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public void init() {\n\t\t// Image init\n\t\tcharacter_static = MainClass.getImage(\"\\\\data\\\\character.png\");\n\t\tcharacter_static2 = MainClass.getImage(\"\\\\data\\\\character2.png\");\n\t\tcharacter_static3 = MainClass.getImage(\"\\\\data\\\\character3.png\");\n\t\t\n\t\tcharacterCover = MainClass.getImage(\"\\\\data\\\\cover.png\");\n\t\tcharacterJumped = MainClass.getImage(\"\\\\data\\\\jumped.png\");\n\t\t\n\t\t// Animated when static.\n\t\tthis.addFrame(character_static, 2000);\n\t\tthis.addFrame(character_static2, 50);\n\t\tthis.addFrame(character_static3, 100);\n\t\tthis.addFrame(character_static2, 50);\n\t\t\n\t\tthis.currentImage = super.getCurrentImage();\n\t}", "private void initCharAreas() {\n\n characterAreas = new LinkedList<CharacterArea>();\n float x = 0;\n float y = 0;\n //TODO do this nice @me\n if (KeyboardHandler.character_set.length() > 36) {\n\n float width = mWidth / 10;\n float height = mHeight / 2;\n characterAreas.add(new CharacterArea(x, y, width * 3, height,\n KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x + width * 3, y, width * 4, height,\n KeyboardHandler.char_view_light_color));\n characterAreas.add(new CharacterArea(x + width * 7, y, width * 3, height,\n KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x, y + height, width * 3, height,\n KeyboardHandler.char_view_light_color));\n characterAreas.add(new CharacterArea(x + width * 3, y + height, width * 4,\n height, KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x + width * 7, y + height, width * 3,\n height, KeyboardHandler.char_view_light_color));\n } else {\n float width = mWidth / 3;\n float height = mHeight / 2;\n characterAreas.add(new CharacterArea(x, y, width, height,\n KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x + width, y, width, height,\n KeyboardHandler.char_view_light_color));\n characterAreas.add(new CharacterArea(x + 2 * width, y, width, height,\n KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x, y + height, width, height,\n KeyboardHandler.char_view_light_color));\n characterAreas.add(new CharacterArea(x + width, y + height, width,\n height, KeyboardHandler.char_view_dark_color));\n characterAreas.add(new CharacterArea(x + 2 * width, y + height, width,\n height, KeyboardHandler.char_view_light_color));\n }\n\n setLevelUpChars();\n }", "private void initAreaImageFilm() {\n\n }", "public void setCards(String murder, String weapon, String scene){\t\t\n\t\thbox.setPadding(new Insets(4,4,4,4));\n\t\thbox.setSpacing(8);\n\t\thbox.setAlignment(Pos.CENTER);\n\n\t\tImageView cardiv = new ImageView(new Image(getClass().getResourceAsStream(\"/cards/\" + murder + \".png\")));\n\t\tcardiv.setPreserveRatio(false);\n\t\tcardiv.setSmooth(true);\n\t\thbox.getChildren().add(cardiv);\n\t\t\n\t\tImageView cardiv2 = new ImageView(new Image(getClass().getResourceAsStream(\"/cards/\" + scene + \".png\")));\n\t\tcardiv2.setPreserveRatio(false);\n\t\tcardiv2.setSmooth(true);\n\t\thbox.getChildren().add(cardiv2);\n\t\t\n\t\tImageView cardiv3 = new ImageView(new Image(getClass().getResourceAsStream(\"/cards/\" + weapon + \".png\")));\n\t\tcardiv3.setPreserveRatio(false);\n\t\tcardiv3.setSmooth(true);\n\t\thbox.getChildren().add(cardiv3);\n\t}", "private void loadAreas() {\r\n\t\tareas = map.getAreas();\r\n\t\tfor (Area area : areas) {\r\n\t\t\tfor (AreaOrMonster monster : area.getChildren()) {\r\n\t\t\t\tmonster.getImageView().setX(monster.getX() * scalingFactor);\r\n\t\t\t\tmonster.getImageView().setY(monster.getY() * scalingFactor);\r\n\t\t\t\troot.getChildren().add(monster.getImageView());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void init() {\n\t\tthis.image = Helper.getImageFromAssets(AssetConstants.IMG_ROAD_NORMAL);\n\t}", "public StoneSummon() {\n// ArrayList<BufferedImage> images = SprssssssaasssssaddddddddwiteUtils.loadImages(\"\"\n createStones();\n\n }", "public void initCapes() {}", "private void initDungeon() {\n\t\tengine = new GameEngine(map, this::handleObjectStateChange);\n\n\t\tplayer = engine.getPlayer();\n\t\tObservableList<Node> nodes = dungeonPane.getChildren();\n\n // draw grids\n resources.drawGridLine(nodes, map.getSizeX(), map.getSizeY());\n\n\t\tfor(GameObject obj: engine.getAllObjects()) {\n resources.createImageViewByGameObject(obj, nodes);\n }\n\n\n\t\tfinal LongProperty lastUpdateTime = new SimpleLongProperty(0);\n\t\tmainAnimation = new AnimationTimer() {\n\t\t\t@Override\n\t\t\tpublic void handle(long now) {\n\t\t\t\tdouble elapsedSeconds = (now - lastUpdateTime.get()) / 1000000000.0 ;\n\t\t\t\t// make sure at most go 40 ms for each frame\n\t\t\t\telapsedSeconds = elapsedSeconds > 0.04 ? 0.04 : elapsedSeconds;\n\t\t\t\ttimeConsumed += elapsedSeconds;\n\n\t\t\t\tupdatePlayerMovingStatus();\n\n\t\t\t\tif(keyPressed.contains(KeyCode.A))\n\t\t\t\t handlePlayerShootArrow();\n\n\t\t\t\tif(keyPressed.contains(KeyCode.B))\n\t\t\t\t handlePlayerSetBomb();\n\n\t\t\t\tif(updateMovingObjects(elapsedSeconds))\n\t\t\t\t return;\n\n\t\t\t\t// update timer last in case bomb went off and player is dead\n timers.updateAll((int)(elapsedSeconds * 1000));\n\t\t\t\tlastUpdateTime.set(now);\n\t\t\t}\n\t\t};\n\t\tmainAnimation.start();\n\t}", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public void init()\n {\n MyRand.Init();\n // this class knows about how to load images from disk, and\n // stores them by name\n ImageManager imgr = new ImageManager(this);\n\n // --- this next section preloads all images.\n\n // the WoodPieceFactory object knows about the wood piece \n // images\n WoodPieceFactory.Initialize();\n // these are miscellaneous images\n imgr.addImage(\"PirateMousie.png\");\n imgr.addImage(\"PirateMousie2.png\");\n imgr.addImage(\"PirateMousie3.png\");\n imgr.addImage(\"PirateMousie4.png\");\n imgr.addImage(\"SushiWater.png\");\n imgr.addImage(\"Workbench3.png\");\n imgr.addImage(\"Blueprint.png\");\n\n // scroll images.\n String[] scrolls = {\"Blank\",\"Booched\",\"Poor\",\"Fine\",\"Good\",\"Excellent\",\"Incredible\"};\n int i;\n for (i = 0 ; i < scrolls.length ; ++i)\n {\n imgr.addImage(\"Scroll_\" + scrolls[i] + \".png\");\n }\n\n // wait until they load (pretty fast since they are in the same jar.\n while(!imgr.allLoaded())\n ;\n\n System.out.println(\"All Images Loaded\");\n\n // --- this section loads sounds\n SoundManager smgr = new SoundManager(this);\n smgr.addSound(\"piRat_Nom.wav\");\n // wait until sounds load.\n while(!smgr.allSoundsLoaded())\n ;\n\n System.out.println(\"All Sounds Loaded\");\n\n // the card layout is so that we can change from\n // menus to the game board \n setLayout(new CardLayout());\n\n // the control panel embodies and manages all the other\n // panels of the game, drawn as cards onto \n // the applet panel.\n ControlPanel cp = new ControlPanel(this);\n add(cp,\"ControlPanel\");\n }", "public void initialize2() {\n\t\txHero1 = 10;\n\t\tinsecondmode=true;\n\t\tImageIcon bg = new ImageIcon(\"bg for one player.png\");\n\t\tBackground = (bg.getImage().getScaledInstance(bg.getIconWidth(), bg.getIconHeight(), Image.SCALE_DEFAULT));\n\t\tImageIcon[] in1 = new ImageIcon[12];\n\t\tin1[0] = new ImageIcon(\"\");\n\t\tin1[1] = new ImageIcon(\"\");\n\t\tin1[2] = new ImageIcon(\"\");\n\t\tin1[3] = new ImageIcon(\"\");\n\t\tin1[4] = new ImageIcon(\"\");\n\t\tin1[5] = new ImageIcon(\"\");\n\t\tin1[6] = new ImageIcon(\"\");\n\t\tin1[7] = new ImageIcon(\"\");\n\t\tin1[8] = new ImageIcon(\"\");\n\t\tin1[9] = new ImageIcon(\"\");\n\t\tin1[10] = new ImageIcon(\"\");\n\t\tin1[11] = new ImageIcon(\"\");\n\t\tImageIcon[] in2 = new ImageIcon[12];\n\t\tin2[0] = new ImageIcon(\"Hero02.png\");\n\t\tin2[1] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[2] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[3] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[4] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[5] = new ImageIcon(\"Hero02inj.png\");\n\t\tin2[6] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[7] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[8] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[9] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[10] = new ImageIcon(\"Hero02 Attack01.png\");\n\t\tin2[11] = new ImageIcon(\"Hero02 Die.png\");\n\t\tImageIcon[] inBullet1 = new ImageIcon[3];\n\t\tinBullet1[0] = new ImageIcon(\"\");\n\t\tinBullet1[1] = new ImageIcon(\"\");\n\t\tinBullet1[2] = new ImageIcon(\"\");\n\t\tImageIcon[] inBullet2 = new ImageIcon[5];\n\t\tinBullet2[0] = new ImageIcon(\"20.png\");\n\t\tinBullet2[1]= new ImageIcon(\"50.png\");\n\t\tinBullet2[2]= new ImageIcon(\"100.png\");\n\t\tinBullet2[3]= new ImageIcon(\"200.png\");\n\t\tinBullet2[4]= new ImageIcon(\"500.png\");\n\t\tcannotdefend(1);\n\t\tHero1.settemplate(in2);\n\t\tHero2.settemplate(in1);\n\t\tBullet1.settemplate(inBullet2);\n\t\tBullet2.settemplate(inBullet1);\n\t\tHero1.setstatus(0);\n\t\tHero2.setstatus(0);\n\t}", "public final void setPiece(String piece){\r\n switch (piece) {\r\n case \"black King\":\r\n {\r\n this.piece = new King(\"black King\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Rook\":\r\n {\r\n this.piece = new Rook(\"black Rook\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Knight\":\r\n {\r\n this.piece = new Knight(\"black Knight\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Bishop\":\r\n {\r\n this.piece = new Bishop(\"black Bishop\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Queen\":\r\n {\r\n this.piece = new Queen(\"black Queen\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Pawn\":\r\n {\r\n this.piece = new Pawn(\"black Pawn\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white King\":\r\n {\r\n this.piece = new King(\"white King\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Rook\":\r\n {\r\n this.piece = new Rook(\"white Rook\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Knight\":\r\n {\r\n this.piece = new Knight(\"white Knight\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Bishop\":\r\n {\r\n this.piece = new Bishop(\"white Bishop\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Queen\":\r\n {\r\n this.piece = new Queen(\"white Queen\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Pawn\":\r\n {\r\n this.piece = new Pawn(\"white Pawn\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n default:\r\n {\r\n this.piece = new Empty(\" \");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n this.piece.color=\"empty\";\r\n this.piece.imageName=\"empty\";\r\n break;\r\n }\r\n }\r\n }", "@Override\n public void commandAddMonster(int id, String name, float x, float y, int gameLevel, int hp, int mp, int power,\n Direction direction, String imgRef)\n {\n }", "public void initVisualProperties(GraphicsDirector gDirector) {\n\n if (!getLocation().isTileMap()) {\n if (this.isMaster)\n gDirector.addDrawable(this.wotCharacter.getShadow()); // Drawable has already been added\n else {\n gDirector.addDrawable(this.wotCharacter.getDrawable(this));\n gDirector.addDrawable(this.wotCharacter.getShadow());\n }\n } else {\n gDirector.addDrawable(this.wotCharacter.getDrawable(this));\n }\n }", "public MapGen()//Collect images, create Platform list, create grassy array and generate a random integer as the map wideness\n\t{\n\t\tblocksWide= ThreadLocalRandom.current().nextInt(32, 64 + 1);\n\t\tclouds=kit.getImage(\"Resources/SkyBackground.jpg\");\n\t\tdirt=kit.getImage(\"Resources/Dirt.png\");\n\t\tgrass[0]=kit.getImage(\"Resources/Grass.png\");\n\t\tgrass[1]=kit.getImage(\"Resources/Grass1.png\");\n\t\tgrass[2]=kit.getImage(\"Resources/Grass2.png\");\n\t\tplatforms=new ArrayList<Platform>();\n\t\tgrassy=new int[blocksWide];\n\t\tgrassT=new int[blocksWide];\n\t\tgenerateTerrain();\n\t\t\n\t\t\n\t\t\n\t}", "public void init() {\n if (!getLocation().isTileMap()) {\n //Debug.signal( Debug.NOTICE, null, \"PlayerImpl::init\");\n this.animation = new Animation(this.wotCharacter.getImage(), ClientDirector.getDataManager().getImageLibrary());\n this.sprite = (Sprite) this.wotCharacter.getDrawable(this);\n this.brightnessFilter = new BrightnessFilter();\n this.sprite.setDynamicImageFilter(this.brightnessFilter);\n }\n this.movementComposer.init(this);\n }", "public Monstruo(int posX, int posY ,Image image) {\n\t\tsuper(posX, posY, image);\n\t\torientacion = 3;\n\t\tvida = 10;\n\t\tdinero = 0;\n\t\tspeed = 1;\n\t\tstrength = 1;\n\t\tdefense = 1;\n\t\tweapon = 1;\n\t\tarmor = 1;\n\t}", "@Override \n public void init() {\n intakeLeft = hardwareMap.crservo.get(\"intakeLeft\");\n intakeRight = hardwareMap.crservo.get(\"intakeRight\");\n topLeft = hardwareMap.servo.get(\"topLeft\");\n bottomLeft = hardwareMap.servo.get(\"bottomRight\");\n topRight = hardwareMap.servo.get(\"topRight\");\n bottomRight = hardwareMap.servo.get(\"bottomRight\");\n lift = hardwareMap.dcMotor.get(\"lift\");\n }", "private void setNewTarget() {\n startPoint = new Circle(targetPoint);\n projection.addShift(this.targetGenerator.shiftX(startPoint), this.targetGenerator.shiftY(startPoint),\n this.targetGenerator.gridManager);\n this.targetPoint = new Circle(this.targetGenerator.generateTarget(startPoint), this.targetGenerator.gridManager.pointSize);\n projection.convertFromPixels(this.targetPoint);\n \n gameListeners.addedNewLine(startPoint, targetPoint);\n \n // TODO make probability upgradeable to spawn a new pickup\n if (Math.random() < pickupSpawnProbability) {\n generateNewPickup(); \n }\n }", "private void addCharacters() {\r\n\t\tplayer = new GImage(\"PlayerEast.png\");\r\n\t\tplayer.scale(.75);\r\n\t\tadd(player, player.getWidth() / 2.0, level1.getY() - player.getHeight());\r\n\t\t\r\n\t\tdragon1 = new GImage(\"Dragon1.png\");\r\n\t\tadd(dragon1, getWidth() - dragon1.getWidth() * 1.5, level1.getY() - dragon1.getHeight());\r\n\t\t\r\n\t\tdragon2 = new GImage(\"Dragon2.png\");\r\n\t\tadd(dragon2, dragon2.getWidth() / 2.0, level2.getY() - dragon2.getHeight());\r\n\t\t\r\n\t\tGObject karel = new GImage(\"karel.png\");\r\n\t\tadd(karel, getWidth() - karel.getWidth(), level3.getY() - karel.getHeight());\r\n\t\t\r\n\t\tmehran = new GImage(\"EvilMehran1.png\");\r\n\t\tadd(mehran, getWidth() - mehran.getWidth() - karel.getWidth(), level3.getY() - mehran.getHeight());\r\n\t}", "public CombatController(Player player, Monster monster) {\n this.player = player;\n this.monster = monster;\n\n\n\n }", "public void initialHeroCastle() {\n Pair<Integer, Integer> heroCastlePosition = world.getHeroCastlePosition();\n SimpleIntegerProperty x2 = new SimpleIntegerProperty();\n SimpleIntegerProperty y2 = new SimpleIntegerProperty();\n x2.set(heroCastlePosition.getValue0());\n y2.set(heroCastlePosition.getValue1());\n String type = \"HeroCastle\";\n Building heroBuilding = new HeroCastleBuilding(x2, y2, type, 0);\n ImageView view = new ImageView(heroBuilding.getImage());\n addEntity(heroBuilding, view);\n squares.getChildren().add(view);\n }", "public void setHasLightSource(Creature creature, @Nullable Item lightSource) {\n/* 5438 */ if (lightSource != null && lightSource.getTemplateId() == 1243)\n/* */ return; \n/* 5440 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 5444 */ if (lightSource == null) {\n/* */ \n/* 5446 */ if (vz.getWatcher().getWurmId() == creature.getWurmId()) {\n/* 5447 */ vz.sendRemoveEffect(-1L, (byte)0);\n/* */ } else {\n/* 5449 */ vz.sendRemoveEffect(creature.getWurmId(), (byte)0);\n/* */ }\n/* */ \n/* */ }\n/* 5453 */ else if (vz.getWatcher().getWurmId() == creature.getWurmId()) {\n/* */ \n/* 5455 */ if (lightSource.getColor() != -1) {\n/* */ \n/* 5457 */ int lightStrength = Math.max(WurmColor.getColorRed(lightSource.color), \n/* 5458 */ WurmColor.getColorGreen(lightSource.color));\n/* 5459 */ lightStrength = Math.max(lightStrength, WurmColor.getColorBlue(lightSource.color));\n/* 5460 */ byte r = (byte)(WurmColor.getColorRed(lightSource.color) * 128 / lightStrength);\n/* 5461 */ byte g = (byte)(WurmColor.getColorGreen(lightSource.color) * 128 / lightStrength);\n/* 5462 */ byte b = (byte)(WurmColor.getColorBlue(lightSource.color) * 128 / lightStrength);\n/* */ \n/* 5464 */ vz.sendAttachCreatureEffect(null, (byte)0, r, g, b, lightSource\n/* 5465 */ .getRadius());\n/* */ \n/* */ \n/* */ }\n/* 5469 */ else if (lightSource.isLightBright()) {\n/* */ \n/* 5471 */ int lightStrength = (int)(80.0F + lightSource.getCurrentQualityLevel() / 100.0F * 40.0F);\n/* 5472 */ vz.sendAttachCreatureEffect(null, (byte)0, \n/* 5473 */ Item.getRLight(lightStrength), Item.getGLight(lightStrength), \n/* 5474 */ Item.getBLight(lightStrength), lightSource.getRadius());\n/* */ } else {\n/* */ \n/* 5477 */ vz.sendAttachCreatureEffect(null, (byte)0, \n/* 5478 */ Item.getRLight(80), Item.getGLight(80), Item.getBLight(80), lightSource.getRadius());\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* 5483 */ else if (lightSource.getColor() != -1) {\n/* */ \n/* 5485 */ int lightStrength = Math.max(WurmColor.getColorRed(lightSource.color), \n/* 5486 */ WurmColor.getColorGreen(lightSource.color));\n/* 5487 */ lightStrength = Math.max(lightStrength, WurmColor.getColorBlue(lightSource.color));\n/* 5488 */ byte r = (byte)(WurmColor.getColorRed(lightSource.color) * 128 / lightStrength);\n/* 5489 */ byte g = (byte)(WurmColor.getColorGreen(lightSource.color) * 128 / lightStrength);\n/* 5490 */ byte b = (byte)(WurmColor.getColorBlue(lightSource.color) * 128 / lightStrength);\n/* */ \n/* 5492 */ vz.sendAttachCreatureEffect(creature, (byte)0, r, g, b, lightSource\n/* 5493 */ .getRadius());\n/* */ \n/* */ \n/* */ }\n/* 5497 */ else if (lightSource.isLightBright()) {\n/* */ \n/* 5499 */ int lightStrength = (int)(80.0F + lightSource.getCurrentQualityLevel() / 100.0F * 40.0F);\n/* 5500 */ vz.sendAttachCreatureEffect(creature, (byte)0, \n/* 5501 */ Item.getRLight(lightStrength), Item.getGLight(lightStrength), \n/* 5502 */ Item.getBLight(lightStrength), lightSource.getRadius());\n/* */ } else {\n/* */ \n/* 5505 */ vz.sendAttachCreatureEffect(creature, (byte)0, \n/* 5506 */ Item.getRLight(80), Item.getGLight(80), Item.getBLight(80), lightSource.getRadius());\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* 5511 */ catch (Exception e) {\n/* */ \n/* 5513 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }", "void setRenderableSource(Long id, RenderedImage source, int index)\n\tthrows RemoteException;", "private void setPic() {\n\t\tint targetW = Constant.sRealWidth;\n\t\tint targetH = Constant.sRealHeight;\n\n\t\t/* Get the size of the image */\n\t\tBitmapFactory.Options bmOptions = new BitmapFactory.Options();\n\t\tbmOptions.inJustDecodeBounds = true;\n\t\tBitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\tint photoW = bmOptions.outWidth;\n\t\tint photoH = bmOptions.outHeight;\n\t\t\n\t\t/* Figure out which way needs to be reduced less */\n\t\tint scaleFactor = 1;\n\t\tif ((targetW > 0) || (targetH > 0)) {\n\t\t\tscaleFactor = Math.min(photoW/targetW, photoH/targetH);\t\n\t\t}\n\n\t\t/* Set bitmap options to scale the image decode target */\n\t\tbmOptions.inJustDecodeBounds = false;\n\t\tbmOptions.inSampleSize = scaleFactor;\n\t\tbmOptions.inPurgeable = true;\n\n\t\t/* Decode the JPEG file into a Bitmap */\n\t\tBitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\t\t\n\t\tint rotate = ViewUtils.handleRotateBitmap(mCurrentPhotoPath);\n\t\tif (rotate != 0) {\n\t\t\tbitmap = ViewUtils.rotaingBitmap(\n\t\t\t\t\trotate, bitmap);\n\t\t}\n\t\t/* Associate the Bitmap to the ImageView */\n\t\tmPictureView.setImageBitmap(bitmap);\n\t}", "private void initObjects()\n {\n //creating a new board of 8x8 array \n board = new Disc[Constants.ROWS][Constants.COLUMNS];\n //loops through and creates all empty discs to be filled\n for(int row = 0; row < Constants.ROWS; row++)\n {\n for(int col = 0; col < Constants.COLUMNS; col++)\n {\n board[row][col] = new Disc();\n }\n }\n//initial board setup \n board[3][3].setDisColor(Constants.LIGHT);\n board[3][4].setDisColor(Constants.DARK);\n board[4][3].setDisColor(Constants.DARK);\n board[4][4].setDisColor(Constants.LIGHT);\n \n }", "private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }", "public void setDistortion(boolean distorted) {\n\t\tif (isDistorted != distorted) {\n\t\t\tisDistorted = distorted;\n\t\t\tpauseMusic();\n\t\t\tint position;\n\t\t\tif (distorted) {\n\t\t\t\tif (!isReverse && !isWah) {\n\t\t\t\t\tposition = alGetSourcei(musicSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(distortSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\telse if (isReverse && !isWah) {\n\t\t\t\t\tposition = alGetSourcei(reverseSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revDistortSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\tif (!isReverse && isWah) {\n\t\t\t\t\tposition = alGetSourcei(wahSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(wahDistortSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\telse if (isReverse && isWah) {\n\t\t\t\t\tposition = alGetSourcei(revWahSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revWahDistortSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!isReverse && !isWah) {\n\t\t\t\t\tposition = alGetSourcei(distortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(musicSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\telse if (isReverse && !isWah) {\n\t\t\t\t\tposition = alGetSourcei(revDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(reverseSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\tif (!isReverse && isWah) {\n\t\t\t\t\tposition = alGetSourcei(wahDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(wahSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t\telse if (isReverse && isWah) {\n\t\t\t\t\tposition = alGetSourcei(revWahDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revWahSourceIndex, AL_BYTE_OFFSET, position);\n\t\t\t\t}\n\t\t\t}\n\t\t\tplayMusic();\n\t\t}\n\t}", "public void setStartConditions() {\r\n\t\tplayer1.relocate(0, 0);\r\n\t\tgamemap.setPlayerLocation(1, 1);\r\n\t\tgamemap.setEnemyLocation(20, 10);\r\n\t\tenemy1.relocate(19*46, 9*85);\r\n\t\tportal1.relocate(9*46, 9*85);\r\n\t\tportal2.relocate(9*46, 0*85);\r\n\t\tspikes1.relocate(5*46,0*85);\r\n\t\tspikes2.relocate(5*46,1*85);\r\n\t\tspikes3.relocate(5*46,2*85);\r\n\t\tspikes4.relocate(5*46,7*85);\r\n\t\tspikes5.relocate(5*46,8*85);\r\n\t\tspikes6.relocate(5*46,9*85);\r\n\t\tspikes7.relocate(10*46,2*85);\r\n\t\tspikes8.relocate(10*46,3*85);\r\n\t\tspikes9.relocate(10*46,4*85);\r\n\t\tspikes10.relocate(10*46,5*85);\r\n\t\tspikes11.relocate(10*46,6*85);\r\n\t\tspikes12.relocate(10*46,7*85);\r\n\t\tspikes13.relocate(15*46,0*85);\r\n\t\tspikes14.relocate(15*46,1*85);\r\n\t\tspikes15.relocate(15*46,2*85);\r\n\t\tspikes16.relocate(15*46,7*85);\r\n\t\tspikes16.relocate(15*46,8*85);\r\n\t\tspikes17.relocate(15*46,9*85);\r\n\t\tRandom randomObj = new Random();\r\n\t\tint randomX = randomObj.nextInt(20);\r\n\t\tint randomY = randomObj.nextInt(10);\r\n\t\tcoins1.relocate(randomX*46, randomY*85);\r\n\t\tgamemap.setLootLocation(randomX + 1, randomY + 1);\r\n\t\t//coins1.relocate(10*46,5*85);\r\n\t\t//gamemap.setLootLocation(11, 6);\r\n\t}", "void setRenderableSource(Long id, SerializableRenderableImage source,\n\t\t\t int index) throws RemoteException;", "public Cow() {\n\t\tsuper();\n\t\tloadImages();\n\t}", "public StrongMonster(GamePanel parent, ImageIcon[] icons) {\n\t\tsuper(parent, icons[1]);\n\t\ticonUp = icons[0];\n\t\ticonRight = icons[1];\n\t\ticonDown = icons[2];\n\t\ticonLeft = icons[3];\n\t\tstate = CHASE;\n\t}", "public void initialize() {\n\t\tImageIcon bg = new ImageIcon(\"bg.png\");\n\t\tBackground = (bg.getImage().getScaledInstance(bg.getIconWidth(), bg.getIconHeight(), Image.SCALE_DEFAULT));\n\t\tImageIcon[] in1 = new ImageIcon[12];\n\t\tin1[0] = new ImageIcon(\"Hero1 Normal.png\");\n\t\tin1[1] = new ImageIcon(\"20ed.png\");\n\t\tin1[2] = new ImageIcon(\"50ed.png\");\n\t\tin1[3] = new ImageIcon(\"100ed.png\");\n\t\tin1[4] = new ImageIcon(\"200ed.png\");\n\t\tin1[5] = new ImageIcon(\"500ed.png\");\n\t\tin1[6] = new ImageIcon(\"Hero1 Att200.png\");\n\t\tin1[7] = new ImageIcon(\"Hero1 Att500.png\");\n\t\tin1[8] = new ImageIcon(\"Hero1 Defence01.png\");\n\t\tin1[9] = new ImageIcon(\"Hero1Defence02.png\");\n\t\tin1[10] = new ImageIcon(\"Hero1 to fire.png\");\n\t\tin1[11] = new ImageIcon(\"Hero1 die.png\");\n\t\tImageIcon[] in2 = new ImageIcon[12];\n\t\tin2[0] = new ImageIcon(\"Hero02.png\");\n\t\tin2[1] = new ImageIcon(\"20ed02.png\");\n\t\tin2[2] = new ImageIcon(\"50ed02.png\");\n\t\tin2[3] = new ImageIcon(\"100ed02.png\");\n\t\tin2[4] = new ImageIcon(\"200ed02.png\");\n\t\tin2[5] = new ImageIcon(\"500ed02.png\");\n\t\tin2[6] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[7] = new ImageIcon(\"Hero02 Attack02.png\");\n\t\tin2[8] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[9] = new ImageIcon(\"Hero02 Defence.png\");\n\t\tin2[10] = new ImageIcon(\"Hero02 Attack01.png\");\n\t\tin2[11] = new ImageIcon(\"Hero02 Die.png\");\n\t\tImageIcon[] inBullet1 = new ImageIcon[3];\n\t\tinBullet1[0] = new ImageIcon(\"B1fire02.png\");\n\t\tinBullet1[1] = new ImageIcon(\"B1fire03.png\");\n\t\tinBullet1[2] = new ImageIcon(\"B1fire05.png\");\n\t\tImageIcon[] inBullet2 = new ImageIcon[5];\n\t\tinBullet2[0] = new ImageIcon(\"20.png\");\n\t\tinBullet2[1]= new ImageIcon(\"50.png\");\n\t\tinBullet2[2]= new ImageIcon(\"100.png\");\n\t\tinBullet2[3]= new ImageIcon(\"200.png\");\n\t\tinBullet2[4]= new ImageIcon(\"500.png\");\n\t\tHero1.settemplate(in2);\n\t\tHero2.settemplate(in1);\n\t\tBullet1.settemplate(inBullet2);\n\t\tBullet2.settemplate(inBullet1);\n\t\tHero1.setstatus(0);\n\t\tHero2.setstatus(0);\n\t}", "public Celda(int x, int y) {\n this.x=x;\n this.y=y;\n this.tipo=CAMINO;\n this.celdaSelec =false;\n\n indexSprite = 0; //indice que corresponde a una subimagen de frente\n\n try {\n jugador = ImageIO.read(new File(\"images/jugador.png\"));\n obstaculo = ImageIO.read(new File(\"images/obstaculo.png\"));\n obstaculo20 = ImageIO.read(new File(\"images/obstaculo-2.png\"));\n obstaculo21 = ImageIO.read(new File(\"images/obstaculo-3.png\"));\n obstaculo22 = ImageIO.read(new File(\"images/obstaculo-4.png\"));\n obstaculo23 = ImageIO.read(new File(\"images/obstaculo-5.png\"));\n obstaculo24 = ImageIO.read(new File(\"images/obstaculo-6.png\"));\n obstaculo25 = ImageIO.read(new File(\"images/obstaculo-7.png\"));\n adversario = ImageIO.read(new File(\"images/adversario.png\"));\n recompensa = ImageIO.read(new File(\"images/recompensa.png\"));\n casa = ImageIO.read(new File(\"images/casa.png\"));\n\n imagenSprites = ImageIO.read(new File(\"images/sprite_jugador.png\"));\n imagenSpritesAdversario = ImageIO.read(new File(\"images/sprite_adversario.png\"));\n //creo una array de 4 x 1\n sprites = new BufferedImage[4 * 1];\n spritesAdversario = new BufferedImage[4 * 1];\n //lo recorro separando las imagenes\n for (int i = 0; i < 1; i++) {\n for (int j = 0; j < 4; j++) {\n sprites[(i * 4) + j] = imagenSprites.getSubimage(i * PIXEL_CELDA, j * PIXEL_CELDA,PIXEL_CELDA, PIXEL_CELDA);\n spritesAdversario[(i * 4) + j] = imagenSpritesAdversario.getSubimage(i * PIXEL_CELDA, j * PIXEL_CELDA, PIXEL_CELDA, PIXEL_CELDA);\n }\n }\n //adversario = spritesAdversario[indexSprite];\n } catch (IOException error) {\n System.out.println(\"Error: \" + error.toString());\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 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 static void createImages()\n {\n //Do if not done before\n if(!createdImages)\n {\n createdImages = true;\n for(int i=0; i<rightMvt.length; i++)\n {\n rightMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n leftMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n rightMvt[i].scale(rightMvt[i].getWidth()*170/100, rightMvt[i].getHeight()*170/100);\n leftMvt[i].scale(leftMvt[i].getWidth()*170/100, leftMvt[i].getHeight()*170/100);\n }\n for(int i=0; i<leftMvt.length; i++)\n {\n leftMvt[i].mirrorHorizontally();\n }\n for(int i=0; i<upMvt.length; i++)\n {\n upMvt[i] = new GreenfootImage(\"sniperEnemyUp\"+i+\".png\");\n downMvt[i] = new GreenfootImage(\"sniperEnemyDown\"+i+\".png\");\n upMvt[i].scale(upMvt[i].getWidth()*170/100, upMvt[i].getHeight()*170/100);\n downMvt[i].scale(downMvt[i].getWidth()*170/100, downMvt[i].getHeight()*170/100);\n }\n }\n }", "private void initialize(int index) {\n\t\tthis.NW = new Point((int) this.getCoarseGrainedMinX(), (int) this.getCoarseGrainedMinY());\n\t\tthis.NE = new Point((int) this.getCoarseGrainedMaxX(), (int) this.getCoarseGrainedMinY());\n\t\tthis.SW = new Point((int) this.getCoarseGrainedMinX(), (int) this.getCoarseGrainedMaxY());\n\t\tthis.SE = new Point((int) this.getCoarseGrainedMaxX(), (int) this.getCoarseGrainedMaxY());\n\t\tswitch (this.type) {\n\t\tcase (TownTile.GRASS):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.grassImages[index]));\n\t\t\tbreak;\n\t\tcase (TownTile.WALL):\n\t\t\tthis.addImageWithBoundingBox(ResourceManager.getImage(DogWarriors.wallImages[index]));\n\t\t\tbreak;\n\t\tcase (TownTile.EXIT_ROAD):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.roadImages[index]));\n\t\t\tthis.addShape(new ConvexPolygon(16.0f));\n\t\t\tbreak;\n\t\tcase (TownTile.EXIT_GRASS):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.grassImages[index]));\n\t\t\tthis.addShape(new ConvexPolygon(16.0f, 16.0f));\n\t\t\tbreak;\n\t\tcase (TownTile.ROAD):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.roadImages[index]));\n\t\t\tbreak;\n\t\tcase (TownTile.SHRUB):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.worldImages[index]), \n\t\t\t\t\tnew Vector(0.0f, -16.0f));\n\t\t\tthis.addShape(new ConvexPolygon(16.0f, 16.0f));\n\t\t\tbreak;\n\t\tcase (TownTile.CAT_GRASS):\n\t\t\tthis.addImage(ResourceManager.getImage(DogWarriors.grassImages[index]));\n\t\t\tbreak;\n\t\t}\n\t}", "public void fill(String thing){\n try{\n \n FileReader fr = new FileReader(\"src//monsters//\" + thing + \".txt\");\n BufferedReader br = new BufferedReader(fr);\n //the monster's name\n String monName = br.readLine();\n lblMonName.setText(monName);\n \n //monster's health\n String h = br.readLine();\n monHealth = Integer.parseInt(h); \n //loop to load up the health onto the health bar\n String H = \"\"; \n for(int i = 0; i < monHealth; i++){\n H += \"❤ \";\n }\n lblMonHealth.setText(H);\n \n //Monster's attack stats\n String f = br.readLine();\n String e = br.readLine();\n String i = br.readLine();\n String w = br.readLine();\n monFire = Double.parseDouble(f);\n monEarth = Double.parseDouble(e);\n monIce = Double.parseDouble(i);\n monWater = Double.parseDouble(w);\n //displays the monster's stats\n lblMonStats.setText(\"Earth: \" + monEarth + \"\\nFire: \" + monFire + \"\\nWater: \" + monWater + \"\\nIce: \" + monIce);\n \n //the amount of XP the player will gain if this monster is defeated\n String x = br.readLine();\n expGain = Integer.parseInt(x);\n \n //creates a new monster to hold all of this information for referance later\n m = new monster(thing, monFire, monEarth, monIce, monWater, monHealth);\n }catch(IOException e){\n //if something goes wrong, you will find it here\n System.out.println(e + \": Error reading monster file: \" + thing);\n }\n \n //set the image of the monster - depends on what level the user is at\n ImageIcon im = new ImageIcon(\"src//elementals//images//\" + thing + \".png\");\n lblMonster.setIcon(im);\n \n //set the players box to their color\n lblPlayer.setBackground(c.getUserColor());\n \n }", "private void prepare()\n {\n addObject(player,185,196);\n player.setLocation(71,271);\n Ground ground = new Ground();\n addObject(ground,300,360);\n invent invent = new invent();\n addObject(invent,300,375);\n }", "public void customizeMob(LivingEntity mob, LeveledMonster leveledMonster, CreatureSpawnEvent.SpawnReason spawnReason){\n mob.getPersistentDataContainer().set(monsterIdKey, PersistentDataType.STRING, leveledMonster.getName());\n assert mob.getEquipment() != null;\n mob.getEquipment().setHelmet(leveledMonster.getHelmet());\n mob.getEquipment().setChestplate(leveledMonster.getChestPlate());\n mob.getEquipment().setLeggings(leveledMonster.getLeggings());\n mob.getEquipment().setBoots(leveledMonster.getBoots());\n mob.getEquipment().setItemInMainHand(leveledMonster.getMainHand());\n mob.getEquipment().setItemInOffHand(leveledMonster.getOffHand());\n\n mob.getEquipment().setHelmetDropChance((float) leveledMonster.getHelmetDropChance());\n mob.getEquipment().setChestplateDropChance((float) leveledMonster.getChestplateDropChance());\n mob.getEquipment().setLeggingsDropChance((float) leveledMonster.getLeggingsDropChance());\n mob.getEquipment().setBootsDropChance((float) leveledMonster.getBootsDropChance());\n mob.getEquipment().setItemInMainHandDropChance((float) leveledMonster.getMainHandDropChance());\n mob.getEquipment().setItemInOffHandDropChance((float) leveledMonster.getOffHandDropChance());\n\n if (leveledMonster.getMainHand() != null){\n mob.setCanPickupItems(false);\n }\n\n AttributeInstance attribute = mob.getAttribute(Attribute.GENERIC_MAX_HEALTH);\n assert attribute != null;\n if (mob instanceof Slime){\n Slime slime = (Slime) mob;\n attribute.setBaseValue(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n mob.setHealth(leveledMonster.getBaseHealth() / (16/Math.pow(slime.getSize(), 2)));\n } else {\n attribute.setBaseValue(leveledMonster.getBaseHealth());\n mob.setHealth(leveledMonster.getBaseHealth());\n }\n if (leveledMonster.getDisplayName() != null){\n if (!leveledMonster.getDisplayName().equals(\"null\")){\n mob.setCustomName(leveledMonster.getDisplayName());\n mob.setCustomNameVisible(leveledMonster.isDisplayNameVisible());\n }\n }\n if (leveledMonster.isBoss()){\n String title = leveledMonster.getDisplayName();\n if (leveledMonster.getDisplayName() == null){\n title = Utils.chat(\"&c&lBoss\");\n } else if (leveledMonster.getDisplayName().equals(\"null\")){\n title = Utils.chat(\"&c&lBoss\");\n }\n Utils.createBossBar(Main.getInstance(), mob, title, BarColor.RED, BarStyle.SOLID, Main.getInstance().getConfig().getInt(\"boss_bar_view_distance\"));\n }\n\n for (String key : leveledMonster.getAbilities()){\n Ability instantAbility = AbilityManager.getInstance().getInstantAbilities().get(key);\n if (instantAbility != null){\n instantAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n Ability runningAbility = AbilityManager.getInstance().getRunningAbilities().get(key);\n if (runningAbility != null){\n runningAbility.execute(mob, null, new CreatureSpawnEvent(mob, spawnReason));\n }\n }\n }", "void setRenderedSource(Long id, RenderedImage source, int index)\n\tthrows RemoteException;", "@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 Mage(String c) {\n super(7, 1, \"*\", \"walk\", 0, 2, \"\", c, \"0\");\n super.imageName =\"piece_mage\";\n super.spells=\"FHRT\";\n super.playerY=2;\n switch (c) {\n case \"white\":\n super.type = \"M\";\n super.initPositionX = 0;\n super.initPositionY = 3;\n break;\n case \"black\":\n super.type = \"m\";\n super.initPositionX = 5;\n super.initPositionY = 2;\n break;\n default:\n System.out.println(\"ERROR:<Invalid color for piece Mage!>\");\n }\n }", "@Override\r\n\tpublic void setImageBitmap(Bitmap source) {\n//\r\n//\t\tMatrix matrix = new Matrix();\r\n//\t\tmatrix.postScale(ratio, ratio);\r\n//\t\tsource = Bitmap.createBitmap(source, 0, 0, width, height, matrix, true);\r\n//\r\n//\t\twidth = source.getWidth();\r\n//\t\theight = source.getHeight();\r\n//\r\n//\t\tx = (width - ConfigSize.SIZE_THUMB) / 2;\r\n//\t\ty = (height - ConfigSize.SIZE_THUMB) / 2;\r\n//\r\n//\t\tsource = Bitmap.createBitmap(source, x, y, ConfigSize.SIZE_THUMB,\r\n//\t\t\t\tConfigSize.SIZE_THUMB);\r\n\r\n\t\tsuper.setImageBitmap(source);\r\n\t}", "protected void setupPiece() {\n double radius = (this.size * 2) / 5;\n double height = radius / 1.5;\n\n this.material = new PhongMaterial();\n this.material.setDiffuseMap(\n new Image(getClass().getResourceAsStream(\n team == Controller.Team.BLACK ? \"/assets/piece_black.jpg\" : \"/assets/piece_white.jpg\"\n ))\n );\n\n this.cylinder = new Cylinder(radius, height);\n this.cylinder.setMaterial(this.getMaterial());\n this.cylinder.setRotationAxis(Rotate.X_AXIS);\n this.cylinder.setRotate(90);\n this.cylinder.setTranslateZ(height / 2);\n\n this.cylinderContainer.getChildren().add(this.cylinder);\n }", "private void initImages() throws SlickException {\n\t\t// laser images\n\t\tlaserbeamimageN = new Image(\"resources/images_Gameplay/laserBeam_Norm.png\");\n\t\tlaserbeamimageA = new Image(\"resources/images_Gameplay/laserBeam_Add.png\");\n\t\tlasertipimageN = new Image(\"resources/images_Gameplay/laserTip_Norm.png\");\n\t\tlasertipimageA = new Image(\"resources/images_Gameplay/laserTip_Add.png\");\n\t}", "public Action(int x, int y, int width, int height, Card source, ArrayList<Creature> targets){\n\t\tsuper(x, y, width, height);\n\t\tmSource = source;\n\t\tmTargets = new ArrayList<Creature>();\n\t\t\n\t\tif(targets != null)\n\t\t\tmTargets.addAll(targets);\n\t\tmSource.setLocation(200, 100);\n\t\tfor(int i = 0; i < mTargets.size(); i++)\n\t\t\tmTargets.get(i).setLocation(400 + i * 110, 100);\n\t}", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tif(directY != 0){\n\t\t\tif(directX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),900, 150, 150, 150);\n\t\t\t}else if(directX == -1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),1050, 150, 150, 150);\n\t\t\t}else{\n\t\t\t\tif(lastDirectX == 1){\n\t\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),900, 150, 150, 150);\n\t\t\t\t}else{\n\t\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),1050, 150, 150, 150);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(isMove){\n\t\t\tif(directX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),((Main.getInstance().getCurrentFrame() % 2) + 1) * 150, 150, 150, 150);\n\t\t\t}else if(directX == -1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),((Main.getInstance().getCurrentFrame() % 2) + 4)* 150, 150, 150, 150);\n\t\t\t}\n\t\t}else{\n\t\t\tif(lastDirectX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),0, 150, 150, 150);\n\t\t\t}else{\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 150, 150, 150);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tgc.drawImage(hanzoBody, x-55, y-50);\n\t\tgc.drawImage(hanzoLeg, x-55, y-50);\n\t\t//gc.drawImage(hanzoFX, x-55, y-50);\n\t\t\n\t}", "private void setLeadPlayerImage() {\n Player leadPlayer = game.getLeadingPlayer();\n if (leadPlayer == null) {\n // no lead so set images to default\n playerLeadImage.setImage(null);\n computerLeadImage.setImage(null);\n return;\n }\n if (leadPlayer.getName().equals(\"Computer\")) {\n computerLeadImage.setImage(new Image(\"Images/trophy.png\"));\n playerLeadImage.setImage(null);\n return;\n }\n playerLeadImage.setImage(new Image(\"Images/trophy.png\"));\n computerLeadImage.setImage(null);\n }", "@Override\r\n \tpublic void init(GameContainer gc) throws SlickException \r\n \t{\r\n \t\t// Initialization of map, camera, player, pathfinding\r\n \t\ttheMap = new TiledMap(\"res/tilemap01.tmx\");\r\n \t\tthePTBMap = new PropertyTileBasedMap(theMap);\r\n \t\tcamera = new Camera(0f, 0f);\r\n \t\tunitOne = new Player(64f, 64f);\r\n \t\tunitTwo = new Player(64f, 128f);\r\n \t\tpathFinder = new AStarPathFinder(thePTBMap, 100, false);\r\n \t\t\r\n \t\t// player's animation. Need a better way to deal with it\r\n \t\t\r\n \t\tint duration[] = {200, 200, 200};\r\n \t\tSpriteSheet character = new SpriteSheet(\"res/monsters.png\", tileSize, tileSize);\r\n \t\tImage[] walkUp = {character.getSubImage(6, 1), character.getSubImage(7, 1), character.getSubImage(8, 1)};\r\n \t\tImage[] walkDown = {character.getSubImage(0, 1), character.getSubImage(1, 1), character.getSubImage(2, 1)};\r\n \t\tImage[] walkLeft = {character.getSubImage(9, 1), character.getSubImage(10, 1), character.getSubImage(11, 1)};\r\n \t\tImage[] walkRight = {character.getSubImage(3, 1), character.getSubImage(4, 1), character.getSubImage(5, 1)};\r\n \t\t\r\n \t\tmovingUp = new Animation(walkUp, duration, true);\r\n \t\tmovingDown = new Animation(walkDown, duration, true);\r\n \t\tmovingLeft = new Animation(walkLeft, duration, true);\r\n \t\tmovingRight = new Animation(walkRight, duration, true);\r\n \t\t\r\n \t\tunitOne.setMovement(movingDown);\r\n \t\tunitTwo.setMovement(movingDown);\r\n \t}", "public Building (Pixmap image,\n Location3D center,\n Dimension size,\n Sound sound,\n int playerID,\n int health,\n double buildTime) {\n super(image, center, size, sound, playerID, MAXHEALTH, buildTime);\n myRallyPoint = new Location3D(getWorldLocation().getX(), getWorldLocation().getY() + 150, 0);\n \n }", "public void setImageView() {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image); \n }", "@Override\r\n public void init() {\r\n BackRight = hardwareMap.dcMotor.get(\"BackRight\");\r\n BackLeft = hardwareMap.dcMotor.get(\"BackLeft\");\r\n FrontRight = hardwareMap.dcMotor.get(\"FrontRight\");\r\n FrontLeft = hardwareMap.dcMotor.get(\"FrontLeft\");\r\n FrontRight.setDirection(DcMotor.Direction.REVERSE);\r\n BackRight.setDirection(DcMotor.Direction.REVERSE);\r\n\r\n TreadLeft = hardwareMap.dcMotor.get(\"TreadLeft\");\r\n TreadRight = hardwareMap.dcMotor.get(\"TreadRight\");\r\n\r\n ArmMotor = hardwareMap.dcMotor.get(\"ArmMotor\");\r\n }", "private void setPic() {\n int targetW = mainImageView.getWidth();\n int targetH = mainImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n// bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mainImageView.setImageBitmap(bitmap);\n\n// bmOptions.inBitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n// mainImageView.setImageBitmap(bmOptions.inBitmap);\n }", "public Monster() {\n\t super();\n\t _hitPts = 150;\n\t _strength = 20 + (int)( Math.random() * 45 ); // [20,65)\n _defense = 40;\n\t _attack = .4;\n }", "void defaultsetup(int phi) \n {// The Images should be loded here... Also add labels here\n System.out.println(\"IN DEFAULT SETUP..\");\n if( phi == 0) \n whiteToPlay = true;\n else if (phi == 1) \n whiteToPlay = false;\n // White Chess Pieces\n whiteHorse1.position = 1; whiteHorse1.color = 0;\n whiteHorse2.position = 6; whiteHorse2.color = 0;\n whiteQueen.position = 3; whiteQueen.color = 0;\n whiteKing.position =4 ; whiteKing.color = 0;\n whiteCastle1.position = 0; whiteCastle1.color = 0;\n whiteCastle2.position = 7; whiteCastle2.color = 0;\n whiteBishop1.position = 2; whiteBishop1.color = 0;\n whiteBishop2.position = 5; whiteBishop2.color = 0;\n int y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n whitePawn[x] = new pawn();\n whitePawn[x].position = 8+x;\n whitePawn[x].color = 0;\n }\n //Black Chess Pieces\n blackHorse1.position = 57; blackHorse1.color = 1;\n blackHorse2.position = 62; blackHorse2.color = 1;\n blackQueen.position = 59; blackQueen.color = 1;\n blackKing.position = 60; blackKing.color = 1;\n blackCastle1.position = 56;blackCastle1.color = 1;\n blackCastle2.position = 63;blackCastle2.color = 1;\n blackBishop1.position = 58;blackBishop1.color = 1;\n blackBishop2.position = 61;blackBishop2.color = 1;\n y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n blackPawn[x] = new pawn();\n blackPawn[x].position = 48+x;\n blackPawn[x].color = 1;\n }\n \n this.updatePositions();\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@Override\n\tpublic void init() {\n\t\tEffect().registerEffect(40, 40, 3, \"ExplosionSheet.png\");\n\t\tbg = new Background();\n\t\tobj = new TestObj();\n\t\tobj.init();\n\t\ttest = new Test2[50];\n\t\tfor(int x = 0; x < test.length; x++ )\n\t\t\ttest[x] = new Test2(x*30-600,30 *(float)Math.pow(-1, x), \"g.png\");\n\t\t\n\t\ttest2 = new Test2[50000];\n\t\tfor(int x = 0; x < test2.length; x++ )\n\t\t\ttest2[x] = new Test2(x*30-600,150+30 *(float)Math.pow(-1, x), \"AlienPawn.png\");\n\t\t\n\t\ttest3 = new Test2[50000];\n\t\tfor(int x = 0; x < test3.length; x++ )\n\t\t\ttest3[x] = new Test2(x*30-600,-200+30 *(float)Math.pow(-1, x), \"AlienPawn - Copy.png\");\n\t\n\t}", "public void reconstruct ()\n\t{\n\t\tsuper.reconstruct ();\t//calls the superclass's reconstruct method\n\t\txDimension1 = rXD1;\n\t\txDimension2 = rXD2;\n\t\txDimension3 = rXD3;\n\t\t\n\t\tyDimension1 = rYD1;\n\t\tyDimension2 = rYD2;\n\t\tyDimension3 = rYD3;\n\t\t\n\t\tturnInt = 0;\n\t}", "public Water_Hero(RefLinks refLink, float x, float y)\r\n {\r\n ///Apel al constructorului clasei de baza\r\n super(refLink, x,y, Character.DEFAULT_CREATURE_WIDTH, Character.DEFAULT_CREATURE_HEIGHT);\r\n\r\n ///Seteaza imaginea de start a eroului\r\n image = Assets.heroLeft;\r\n\r\n ///Stabilieste pozitia relativa si dimensiunea dreptunghiului de coliziune, starea implicita(normala)\r\n normalBounds.x = 16;\r\n normalBounds.y = 16;\r\n normalBounds.width = 16;\r\n normalBounds.height = 32;\r\n\r\n ///Stabilieste pozitia relativa si dimensiunea dreptunghiului de coliziune, starea de atac\r\n attackBounds.x = 10;\r\n attackBounds.y = 10;\r\n attackBounds.width = 38;\r\n attackBounds.height = 38;\r\n\r\n jumpingTimer = new Timer();\r\n\r\n lista_dinamic_element = new ArrayList<CollisionItem>();\r\n\r\n lista_static_element = new ArrayList<CollisionItem>();\r\n list_fire = new ArrayList<CollisionItem>();\r\n }", "public void init(GameContainer container) throws SlickException {\n\t\t\n\t\tswitch (species) {\n\t\tcase AQUA:\n\t\t\tmovmentUp = new SpriteSheet(\"data/Aqua_1S_U.png\", 25, 25);\n\t\t\tmovmentDown = new SpriteSheet(\"data/Aqua_1S_D.png\", 25, 25);\n\t\t\tmovmentLeft = new SpriteSheet(\"data/Aqua_1S_L.png\", 25, 25);\n\t\t\tmovmentRight = new SpriteSheet(\"data/Aqua_1S_R.png\", 25, 25);\n\t\t\tbreak;\n\t\tcase HERBA:\n\t\t\tmovmentUp = new SpriteSheet(\"data/Terra_S1_U.png\", 25, 25);\n\t\t\tmovmentDown = new SpriteSheet(\"data/Terra_S1_D.png\", 25, 25);\n\t\t\tmovmentLeft = new SpriteSheet(\"data/Terra_S1_L.png\", 25, 25);\n\t\t\tmovmentRight = new SpriteSheet(\"data/Terra_S1_R.png\", 25, 25);\n\t\t\tbreak;\n\t\tcase LITUS:\n\t\t\tmovmentUp = new SpriteSheet(\"data/Up.png\", 25, 25);\n\t\t\tmovmentDown = new SpriteSheet(\"data/Down.png\", 25, 25);\n\t\t\tmovmentLeft = new SpriteSheet(\"data/Left.png\", 25, 25);\n\t\t\tmovmentRight = new SpriteSheet(\"data/Right.png\", 25, 25);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmovmentUp = new SpriteSheet(\"data/Up.png\", 25, 25);\n\t\t\tmovmentDown = new SpriteSheet(\"data/Down.png\", 25, 25);\n\t\t\tmovmentLeft = new SpriteSheet(\"data/Left.png\", 25, 25);\n\t\t\tmovmentRight = new SpriteSheet(\"data/Right.png\", 25, 25);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tup = new Animation(movmentUp, 200);\n\t\tdown = new Animation(movmentDown, 200);\n\t\tleft = new Animation(movmentLeft, 200);\n\t\tright = new Animation(movmentRight, 200);\n\t\t\n\t\tsprite = right;\n\t}", "public Character(String name, int armor, int attack, int stamina, int speed, int luck, \r\n\t File imagePath) {\r\n\t\t\tthis.name.set(name);\r\n\t\t\tthis.armor.set(armor);\r\n\t\t\tthis.attack.set(attack);\t\r\n\t\t\tthis.stamina.set(stamina);\r\n\t\t\tthis.speed.set(speed);\r\n\t\t\tthis.luck.set(luck);\r\n\t\t\tportrait = imagePath;\r\n\t\t\tthis.level.set((armor + attack + stamina + speed + luck) / 100);\r\n\t}", "public void initChips() {\n\t\tfor(Player p:players) {\n\t\t\tfor(int i=0; i<7; i++) {\n\t\t\t\tp.addChip(new Chip(p));\n\t\t\t}\n\t\t}\n\t}", "public GridMapCompassMoves() {\n super();\n }", "public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tg.drawImage(iMonster, (int)x, (int)rely, (int)width, (int)height,null);\n\t}", "public void initialize()\r\n {\r\n ceresImage = new Image(\"Ceres.png\");\r\n erisImage = new Image(\"Eris.png\");\r\n haumeaImage = new Image(\"Haumea.png\");\r\n makemakeImage = new Image(\"MakeMake.png\");\r\n plutoImage = new Image(\"Pluto.png\");\r\n }", "protected void warp() {\n\t\tRandom r = new Random();\n\t\t\n\t\t// Get random index from coordinates list\n\t\tint nextPos = r.nextInt(this.coords.length);\n\t\t\n\t\t// Set new position for monster\n\t\tthis.setBounds(this.coords[nextPos].width, this.coords[nextPos].height, mWidth, mHeight);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "private void updateBoard() throws FileNotFoundException {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Creating board image\");\r\n\t\tBufferedImage combined = new BufferedImage(GlobalVars.images.get(\"Board1\").getWidth(), GlobalVars.images.get(\"Board1\").getHeight(), BufferedImage.TYPE_INT_ARGB);\r\n\t\t\r\n\t\tGraphics g = combined.getGraphics();\r\n\t\t// Draws board template first\r\n\t\tg.drawImage(GlobalVars.images.get(\"Board1\"), 0, 0, null);\r\n\t\t\r\n\t\t// Loops through contents and adds secrets, artifacts, idols\r\n\t\tfor (int i = 0; i < mapContents.length; i++) {\r\n\t\t\tif (mapContents[i] != null && mapContents[i] != \"heart\") {\r\n\t\t\t\tint offsetX = 4;\r\n\t\t\t\tint offsetY = -1;\r\n\t\t\t\tif (mapContents[i].startsWith(\"Minor\")) {\r\n\t\t\t\t\toffsetX = 7;\r\n\t\t\t\t\toffsetY = 3;\r\n\t\t\t\t}\r\n\t\t\t\t// Specific spots to this map\r\n\t\t\t\tif (i == 18) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 206, 286, null);\r\n\t\t\t\t} else if (i == 19) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 299, 287, null);\r\n\t\t\t\t} else if (i == 25) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 297, 352, null);\r\n\t\t\t\t} else if (i == 28) {\r\n\t\t\t\t\tint num = Integer.parseInt(mapContents[i].substring(10));\r\n\t\t\t\t\tif (num > 0) {\r\n\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 369, null);\r\n\t\t\t\t\t\tif (num > 1) {\r\n\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 395, null);\r\n\t\t\t\t\t\t\tif (num > 2) {\r\n\t\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 422, null);\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} else {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), GlobalVars.playerCoordsPerRoom[i][0]+offsetX, GlobalVars.playerCoordsPerRoom[i][1]+offsetY, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Draws dragons\r\n\t\tif (attackLevel == 0) g.drawImage(GlobalVars.images.get(\"Dragon\"), 395, 548, null);\r\n\t\telse if (attackLevel == 1) g.drawImage(GlobalVars.images.get(\"Dragon\"), 456, 542, null);\r\n\t\telse if (attackLevel == 2) g.drawImage(GlobalVars.images.get(\"Dragon\"), 513, 510, null);\r\n\t\telse if (attackLevel == 3) g.drawImage(GlobalVars.images.get(\"Dragon\"), 549, 462, null);\r\n\t\telse if (attackLevel == 4) g.drawImage(GlobalVars.images.get(\"Dragon\"), 561, 412, null);\r\n\t\telse if (attackLevel == 5) g.drawImage(GlobalVars.images.get(\"Dragon\"), 551, 349, null);\r\n\t\telse {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"Dragon\"), 552, 287, null);\r\n\t\t}\r\n\t\t\r\n\t\t// Draws characters\r\n\t\tg.drawImage(GlobalVars.images.get(\"RedChar\"), p1.getPiece().getX(), p1.getPiece().getY(), null);\r\n\t\tif (playerCount >= 2) {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"BlueChar\"), p2.getPiece().getX(), p2.getPiece().getY(), null);\r\n\t\t\tif (playerCount >= 3) {\r\n\t\t\t\tg.drawImage(GlobalVars.images.get(\"YellowChar\"), p3.getPiece().getX(), p3.getPiece().getY(), null);\r\n\t\t\t\tif (playerCount >= 4) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"GreenChar\"), p4.getPiece().getX(), p4.getPiece().getY(), null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Writes the combined image into a file\r\n\t\ttry {\r\n\t\t\tImageIO.write(combined, \"PNG\", new File(\"newboard.png\"));\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t// Builds an embed and sends it to the filesChannel\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(gameChannel.getName());\r\n\t\tembed.setColor(Color.GRAY);\r\n\t\tInputStream test = new FileInputStream(\"newboard.png\");\r\n\t\tembed.setImage(\"attachment://newboard.png\");\r\n\t\tMessageBuilder m = new MessageBuilder();\r\n\t\tm.setEmbed(embed.build());\r\n\t\tGlobalVars.filesChannel.sendFile(test, \"newboard.png\", m.build()).queue();\r\n\t}", "private void setUpReference() {\n txt_source = (TextView) findViewById(R.id.txt_source);\n txt_author = (TextView) findViewById(R.id.txt_author);\n txt_title = (TextView) findViewById(R.id.txt_title);\n txt_content = (TextView) findViewById(R.id.txt_content);\n txt_data_author = (TextView) findViewById(R.id.txt_data_author);\n txt_data_title = (TextView) findViewById(R.id.txt_data_title);\n txt_data_content = (TextView) findViewById(R.id.txt_data_content);\n imageView = (ImageView) findViewById(R.id.detsBandImage);\n\n Util.setFont(txt_source, this, 0);\n Util.setFont(txt_content, this, 0);\n Util.setFont(txt_title, this, 0);\n Util.setFont(txt_author, this, 0);\n Util.setFont(txt_data_author, this, 0);\n Util.setFont(txt_data_title, this, 0);\n Util.setFont(txt_data_content, this, 0);\n\n }", "private void moveMonsters() {\r\n\t\tfor (AreaOrMonster obj : areas) {\r\n\t\t\tif(obj.getLeftRight()) {\r\n\t\t\t\tif(!pirate1.currentLocation.equals(new Point(obj.getX()+1, obj.getY())) && !pirate2.currentLocation.equals(new Point(obj.getX()+1, obj.getY()))) {\r\n\t\t\t\t\tobj.move();\r\n\t\t\t\t\tobj.getImageView().setX(obj.getX() * scalingFactor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!pirate1.currentLocation.equals(new Point(obj.getX()-1, obj.getY())) && !pirate2.currentLocation.equals(new Point(obj.getX()-1, obj.getY()))) {\r\n\t\t\t\t\tobj.move();\r\n\t\t\t\t\tobj.getImageView().setX(obj.getX() * scalingFactor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setImageDynamic(){\n questionsClass.setQuestions(currentQuestionIndex);\n String movieName = questionsClass.getPhotoName();\n ImageView ReferenceToMovieImage = findViewById(R.id.Movie);\n int imageResource = getResources().getIdentifier(movieName, null, getPackageName());\n Drawable img = getResources().getDrawable(imageResource);\n ReferenceToMovieImage.setImageDrawable(img);\n }" ]
[ "0.53434366", "0.52936596", "0.5233283", "0.5193129", "0.51248825", "0.5085503", "0.5059146", "0.50588447", "0.505264", "0.5043882", "0.50242895", "0.49895096", "0.49559292", "0.49415424", "0.4870833", "0.48673692", "0.4866231", "0.48611137", "0.48602083", "0.48581618", "0.48580337", "0.4848734", "0.48425323", "0.48324785", "0.47936305", "0.47917286", "0.4789961", "0.47781855", "0.47737762", "0.47733617", "0.47640255", "0.4763889", "0.4761143", "0.47597227", "0.4758804", "0.47558132", "0.47549558", "0.47541025", "0.47471663", "0.4745462", "0.47441277", "0.47404787", "0.47394845", "0.47162652", "0.47070968", "0.47070447", "0.46995413", "0.46984953", "0.46891773", "0.4683756", "0.4679039", "0.46736282", "0.46703312", "0.46522936", "0.46495846", "0.46431726", "0.4637112", "0.46326724", "0.46326625", "0.46314013", "0.4631368", "0.46292907", "0.4629144", "0.46285617", "0.46182847", "0.46089372", "0.46053845", "0.45993322", "0.4597311", "0.45949122", "0.45925596", "0.45903203", "0.4588098", "0.45830035", "0.45802236", "0.45766792", "0.45755273", "0.45678607", "0.45644894", "0.45629185", "0.4562046", "0.4556434", "0.4546333", "0.45454985", "0.45451736", "0.45451534", "0.45327187", "0.45252773", "0.45213354", "0.45111483", "0.45108595", "0.45029715", "0.45008123", "0.44944227", "0.4491059", "0.44908002", "0.44859102", "0.44852144", "0.44826552", "0.44800496" ]
0.6516067
0
Method which is responsible for randomizing monster choice on first and second cross.
protected int pathDrawLots(int bound) { Random r= new Random(); int num = r.nextInt(bound); return num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toss()\n {\n rand = new Random();//create an object\n num = rand.nextInt(2);//randomly generate two numbers\n if(num == 0)\n sideUp = \"heads\";\n else\n sideUp = \"tails\";//decide what up side is\n }", "private void randomBehavior() {\n\t\trandom = rand.nextInt(50);\n\t\tif (random == 0) {\n\t\t\trandom = rand.nextInt(4);\n\t\t\tswitch (random) {\n\t\t\t\tcase 0:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "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 randomize()\n {\n a = (int)(Math.random()*(1110/15))*15 + 150; \n b = (int)(Math.random()*(480/15))*15 + 150; \n \n if(!specials || difficult.equals(\"GHOST\"))\n {\n dotColor = \"RED\";\n }\n else\n { \n double c = Math.random(); \n if(c < .65 || powerupTimer > 0 || hasItem)\n {\n dotColor = \"RED\";\n }\n else if(c>=.65 && c<.70 )\n \n {\n //dotColor = \"RED SHELL\";\n dotColor = \"RED\";\n }\n else if(c>=.70 && c<.75)\n {\n dotColor = \"TROLL\";\n }\n else if(c>=.75 && c <=.8)\n {\n dotColor = \"DOUBLE\";\n }\n else if(c>.8 && c<=.85 && powerupTimer <= 0)\n {\n dotColor = \"BLUE\"; \n }\n else if(c>.85 && c<=.90 && powerupTimer <= 0)\n {\n if(!difficult.equalsIgnoreCase(\"YOU WILL NOT SURVIVE\"))\n { \n if(modeT)\n dotColor = \"CRYSTAL\";\n else\n dotColor = \"BLACK\";\n }\n else\n dotColor = \"RED\";\n }\n else if(c>.90 && c<=.93 && powerupTimer <= 0)\n {\n dotColor = \"RAINBOW\"; \n }\n else if(c>.93 && c<=.97 && powerupTimer <= 0)\n {\n dotColor = \"YELLOW\"; \n }\n else if(c>.97 && c<=1.0 && powerupTimer <= 0)\n {\n dotColor = \"WHITE\"; \n } \n else if(c>1.0 && c<=1.0 && powerupTimer <= 0)\n {\n dotColor = \"PURPLE\";\n } \n }\n }", "void rndSwapTwo() {\r\n\t\t// index 0 has the start city and doesn't change\r\n\t\t// hence the random#s are from 1 onwards\r\n\t\trndSwapTwo(1, this.length());\r\n\t}", "private static void mating() {\n\t\tint getRand = 0;\n\t\tint parentA = 0;\n\t\tint parentB = 0;\n\t\tint newIndex1 = 0;\n\t\tint newIndex2 = 0;\n\t\tChromosome newChromo1 = null;\n\t\tChromosome newChromo2 = null;\n\n\t\tfor (int i = 0; i < OFFSPRING_PER_GENERATION; i++) {\n\t\t\tparentA = chooseParent();\n\t\t\t// Test probability of mating.\n\t\t\tgetRand = getRandomNumber(0, 100);\n\t\t\tif (getRand <= MATING_PROBABILITY * 100) {\n\t\t\t\tparentB = chooseParent(parentA);\n\t\t\t\tnewChromo1 = new Chromosome();\n\t\t\t\tnewChromo2 = new Chromosome();\n\t\t\t\tpopulation.add(newChromo1);\n\t\t\t\tnewIndex1 = population.indexOf(newChromo1);\n\t\t\t\tpopulation.add(newChromo2);\n\t\t\t\tnewIndex2 = population.indexOf(newChromo2);\n\n\t\t\t\t// Choose either, or both of these:\n\t\t\t\tpartiallyMappedCrossover(parentA, parentB, newIndex1, newIndex2);\n\t\t\t\t// positionBasedCrossover(parentA, parentB, newIndex1, newIndex2);\n\n\t\t\t\tif (childCount - 1 == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex1, 1);\n\t\t\t\t} else if (childCount == nextMutation) {\n\t\t\t\t\texchangeMutation(newIndex2, 1);\n\t\t\t\t}\n\n\t\t\t\tpopulation.get(newIndex1).computeConflicts();\n\t\t\t\tpopulation.get(newIndex2).computeConflicts();\n\n\t\t\t\tchildCount += 2;\n\n\t\t\t\t// Schedule next mutation.\n\t\t\t\tif (childCount % (int) Math.round(1.0 / MUTATION_RATE) == 0) {\n\t\t\t\t\tnextMutation = childCount + getRandomNumber(0, (int) Math.round(1.0 / MUTATION_RATE));\n\t\t\t\t}\n\t\t\t}\n\t\t} // i\n\t\treturn;\n\t}", "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "private static <T> T choose(T opt1, T opt2) {\n\t\tint choice = randInt(1, 2);\n\t\tswitch (choice) {\n\t\tcase 1:\n\t\t\treturn opt1;\n\t\tcase 2:\n\t\t\treturn opt2;\n\t\tdefault:\n\t\t\tSystem.err.println(\"Error: Invalid choice: \" + choice);\n\t\t\treturn null;\n\t\t}\n\t}", "public InputAction makeChoice() {\n int choice = (int) Math.floor(Math.random() * 12);\n if(choice < 6) {\n return new InputAction(player, InputAction.ActionType.WORK, null);\n } else {\n DirectionType direction = directionByNumber.get(choice);\n return new InputAction(player, InputAction.ActionType.EXPLORE, direction);\n }\n }", "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 String performMove(){\n\t\tRandom random = new Random();\t\t\t\t\n\t\tchoice = random.nextInt(3);\t\t\t\t\t//Randomly generating the choices\n if(choice == 0){\n \treturn \"Rock\";\n }else if(choice == 1){\n \treturn \"Paper\";\n }else{\n \treturn \"Scissor\";\n }\n }", "public void randomMove(){\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n int holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n ArrayList<Korgool> korgools = availableHoles.get(holeIndex).getKoorgools();\n while(korgools.size() == 0){\n holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n korgools = availableHoles.get(holeIndex).getKoorgools();\n }\n redistribute(availableHoles.get(holeIndex).getHoleIndex());\n }", "public void move(int marblesLeft){\n if ( mode == 1 || this.isPowerOfTwo(marblesLeft + 1) ) {\n\n //min = 1, max = marblesLeft/2\n choice = (int) ( Math.random() * (marblesLeft/2) + 1);\n }\n \n // play smart if 2\n else {\n /* calculate the least number of marbles should be taken:\n * \n * Find the power of 2 that is the closest to marblesLeft -->\n * floor(log base 2 of (marblesLeft)) = the closest exponent that -->\n * 2^closest exponent = closest powerOfTwo to marblesLeft\n * \n * After the draw, new marblesLeft should be powerOf2 -1 -->\n * new marblesLeft = (closest powerOfTwo)-1 -->\n * so choice is the difference between the old marblesLeft and new marblesLeft -->\n * choice = marblesLeft - new marblesLeft -->\n * choice = marblesLeft - ( (closest powerOfTwo)-1 ).\n */\n int closestExp = (int) ( Math.log(marblesLeft) / Math.log(2) );\n int closestPowerOfTwo = (int) Math.pow(2, closestExp);\n choice = marblesLeft - (closestPowerOfTwo - 1);\n } \n }", "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 static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "protected void randomStep() {\n\t\tint n = curNode.getDegree();\n\t\tint r = 0;\n\n\t\tif (n > 0) {\n\t\t\tr = ctx.random().nextInt(n);\n\n\t\t\tAntCo2Edge curEdge = (AntCo2Edge) curNode.getEdge(r);\n\n\t\t\tassert curEdge != null : \"found no edge\";\n\n\t\t\tcross(curEdge, true);\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void crossover() {\r\n\t\tfinal double CROSSOVER_PROB = 0.5;\r\n\t\tfor (int i=0; i<this.nChromosomes-(this.nChromosomes%2); i=i+2) {\r\n\t\t\tif (Math.random() < CROSSOVER_PROB) {\r\n\t\t\t\tArrayList<Integer> chr1 = (ArrayList<Integer>) this.chromosomes.get(i);\r\n\t\t\t\tArrayList<Integer> chr2 = (ArrayList<Integer>) this.chromosomes.get(i+1);\r\n\t\t\t\t// Uniform crossover\r\n\t\t\t\tif (!chr1.equals(chr2)) {\r\n\t\t\t\t\tfor (int j=0; j<this.nViaPoints; j=j+2) {\r\n\t\t\t\t\t\t// swap via points between 2 chromosomes\r\n\t\t\t\t\t\tInteger tmp = chr2.get(j);\r\n\t\t\t\t\t\tchr2.remove(j);\r\n\t\t\t\t\t\tchr2.add(j, chr1.get(j));\r\n\t\t\t\t\t\tchr1.remove(j);\r\n\t\t\t\t\t\tchr1.add(j, tmp);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.printChromosomes(\"After crossover\");\r\n\t}", "public void attack(String spell, character opponent){\n Random rand = new Random();\n int prob;\n String attack;\n \n prob = rand.nextInt(2); //we need two random numbers to allow us to use the two attacks:\n if(prob==0){\n attack = \"punch\";\n opponent.setHealth(opponent.getHealth() - 10);\n System.out.println(getName() + \" has landed \" + attack);\n System.out.println(opponent.getName() + \" health now \" + opponent.getHealth());\n }\n \n else if(prob==1){\n attack = \"kick\";\n opponent.setHealth(opponent.getHealth() - 15);\n System.out.println(getName() + \" has landed \" + attack);\n System.out.println(opponent.getName() + \" health now \" + opponent.getHealth());\n }\n \n \n }", "public int randomizeSecondNumber() {\n b = random.nextInt(100);\n question.setA(b);\n return b;\n }", "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 void random() {\n\n\t}", "@Override\n public void run() {\n int ran2 = random_number.nextInt(2) + 1;\n if (ran2 == 1) {\n //Play Win Sound\n mpWin.start();\n\n door3button.setImageResource(R.drawable.car);\n door2button.setImageResource(R.drawable.goat);\n door1button.setImageResource(R.drawable.goat);\n\n incrementWinCounter();\n }\n\n // Wrong door was chosen (door 1)\n else {\n //Play Loss Sound\n mpLoss.start();\n\n door3button.setImageResource(R.drawable.goat);\n door2button.setImageResource(R.drawable.goat);\n door1button.setImageResource(R.drawable.car);\n\n incrementLossCounter();\n }\n\n }", "private void randOre(int x, int y) {\n\t\tint rand = random.nextInt(20);\n\t\tif (rand == 1) {\n\t\t\tentities.add(new Ore(x << 4, y << 4, OreType.GOLD));\n\t\t\tgetTile(x, y).setSolid(true);\n\t\t} else {\n\t\t\tif (rand == 2) {\n\t\t\t\tentities.add(new Ore(x << 4, y << 4, OreType.IRON));\n\t\t\t\tgetTile(x, y).setSolid(true);\n\n\t\t\t}\n\t\t}\n\n\t}", "public int NewMonster(){\n int r = (int) (Math.random() * (9 - 2 + 1) + 2);\n return r;\n }", "public abstract int getRandomDamage();", "private void enemy_choose_player(){\n\t\tint i;\n\t\tRandom r_gen = new Random();\n\t\tfor(i=0;i<enemy_num;i++){\n\t\t\tenemy[i][2] = r_gen.nextInt(player_num);\n\t\t}\n\t}", "public Scenario generate() {\n\n //generate random number of Passenger(all human)\n ArrayList liPsg = new ArrayList();\n int totalNumOfPsg = (int) (rd.nextDouble() * PassengerCountMax + PassengerCountMin); //at least one Psg\n for (int i = 0; i < totalNumOfPsg; i++) {\n liPsg.add(getRandomPerson());\n }\n //System.out.println(\"PassengerNum= \"+totalNumOfPsg);\n\n\n //generate random number of Pedestrians(with Max 5) & allocate person+animal randomly(human+animal)\n ArrayList liPdt = new ArrayList();\n int totalNumOfPdst = (int) (rd.nextDouble() * PedestrianCountMax + PedestrianCountMin);//at least one Pdg\n int NumOfPerson = (int) Math.round(rd.nextDouble() * totalNumOfPdst);//if only 1 pdt,along with randomDouble<0.5 , 0.4x*1 rounded=0, will only an animal\n //so if you are random being in pdt but pdt only an animal, you neither wont be in scenario, so your negative probability in scenario is higher.\n int NumOfAnimal = totalNumOfPdst - NumOfPerson;\n for (int i = 0; i < NumOfPerson; i++) {\n liPdt.add(getRandomPerson());\n }\n for (int i = 0; i < NumOfAnimal; i++) {\n liPdt.add(getRandomAnimal());\n }\n //System.out.println(\"PedestrianNum= \"+totalNumOfPdst+\" with \"+NumOfPerson+\" human and \"+NumOfAnimal+\" animals\");\n\n\n //allocating where you are, 0=you absence & do nothing, 1=you in car, 2=you on road !!!!yeah happy solving\n int allocate_of_user = (int) Math.round(rd.nextDouble() * 2);\n if (allocate_of_user == 1) {\n ((Person) liPsg.get(0)).setAsYou(true); //set the first psg is you. !!!!!important Cast Obj into Person!!!!\n } else if (allocate_of_user == 2) {\n for (int i = 0; i < liPdt.size(); i++) {\n if (liPdt.get(i) instanceof Person) {//check whether a person\n ((Person) liPdt.get(i)).setAsYou(true);\n break; // only set once than break rather than set all of people of pdt is you\n }\n }\n }\n\n //Scenario(ArrayList<Character> passengers, ArrayList<Character> pedestrians, boolean isLegalCrossing)\n S = new Scenario(liPsg, liPdt, rd.nextBoolean()); //isLegalCrossing = red or green light;\n return S;\n }", "private void turnAround() {\n d = Math.random();\n if (d < 0.1) {\n changeAppearance();\n }\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}", "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}", "private String whichPlayerToStart(){\n\t\tdouble whichPlayerToCommence = Math.random();\n\t\tdouble randomLimit = Math.random();\n\t\tif(whichPlayerToCommence <= randomLimit){ \n\t\tthis.turn = \"blue\";\n\t\treturn this.turn;\n\t\t}\n\t\telse{\n\t\tthis.turn = \"red\";\n\t\treturn this.turn;\n\t\t} \n\t}", "public static void main(String[] args) {\n Hero aventurier = new Hero(200, 100);\n Equipement epee = new Equipement(\"epee\", 0);\n Monsters sorciere = new Monsters(\"witch\", 180, 0);\n Monsters barbare = new Monsters(\"olaf\", 160, 0);//Degat et point attaque sont à 0 car ils prendront les valeurs du random\n\n\n System.out.println(\"Bienvenue dans le dongeon\");\n System.out.println(\"Vous avez \" + aventurier.getPointDeVie() + \" Point de vie, \" + aventurier.getFlasqueDeau() + \" flasques pour combatre vos ennemies et une \");\n\n // i=room ;si pointdevie > room-->room+1 sinon game over(pas besoin de creer une classe)\n int i = 1;\n do {\n\n if (aventurier.getPointDeVie() > 0) ;\n {\n System.out.println(\"Room\" + i);\n\n Monsters enemieActuel = barbare;\n//nbr aleatoire entre sorcier et monster\n Random random = new Random();\n int nbrAl = random.nextInt(2 );\n//si nbr=0 = sorcier sinon barbare\n if (nbrAl == 0) {\n enemieActuel = sorciere;\n //sinon barbare\n } else {\n enemieActuel = barbare;\n }\n\n\n //Si barbare faire le do while\n\n if (enemieActuel == barbare) {\n\n do { //Faire des degats aleatoire grace au random à l'aide de l'epee\n epee.setDegat((int) (5 + (Math.random() * 30)));//comme .set dega=0 on lui donne la valeur de math.random\n int degat = epee.getDegat(); //.get renvoi la valeur au int nommer degat\n barbare.setPointDeVie(barbare.getPointDeVie() - degat);//vie - degat\n System.out.println(\"Il reste au barbare \" + barbare.getPointDeVie());//nouvelle valeur de point de vie\n\n\n //idem avec l'aventurier\n barbare.setPointAttaque((int) (5 + (Math.random() * 30)));\n int pointDattaque = barbare.getPointAttaque();\n aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque);\n System.out.println(\"il vous reste \" + aventurier.getPointDeVie());\n\n // tant que les Pvie de l'aventurier >= 0 et idem barbare continuer le combat\n } while (aventurier.getPointDeVie() >= 0 && barbare.getPointDeVie() >= 0);\n //à la fin du combat si pvie de l'aventurier sont >0 et que i (room) egale 5 \"gagné\"\n if (aventurier.getPointDeVie() > 0 && i==5) {\n System.out.println(\"Bravo vous avez gagné ! =)\");\n\n //Si juste pvie de l'aventurier > 0 --->room suivante\n }else if (aventurier.getPointDeVie() > 0 ){\n System.out.println(\"Bravo tu passes à la pièce suivante\");\n //on redonne les valeurs de depart pdeVie pour la nouvelle room\n aventurier.setPointDeVie(200);\n barbare.setPointDeVie(180);\n i+=1;\n }\n\n // sinon room = 6 pour envoyer le sout \"game over\"\n else {\n System.out.println(\"Game Over\");\n i = 6;\n }\n\n\n\n }\n\n //IDEM avec sorciere\n else {\n do {\n\n\n aventurier.setFlasqueDeau((int) (5 + (Math.random() * 30)));\n int degat = aventurier.getFlasqueDeau();\n sorciere.setPointDeVie(sorciere.getPointDeVie() - degat);\n System.out.println(\"Il reste à la sorciere \" + sorciere.getPointDeVie());\n\n sorciere.setPointAttaque((int) (5 + (Math.random() * 30)));\n int pointDattaque = sorciere.getPointAttaque();\n aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque);\n System.out.println(\"il vous reste \" + aventurier.getPointDeVie());\n\n } while (aventurier.getPointDeVie() >= 0 && sorciere.getPointDeVie() >= 0);\n if (aventurier.getPointDeVie() > 0 && i==5) {\n System.out.println(\"Bravo vous avez gagné ! =)\");\n }else if (aventurier.getPointDeVie() > 0 ){\n System.out.println(\"Bravo tu passes à la pièce suivante\");\n aventurier.setPointDeVie(200);\n sorciere.setPointDeVie(160);\n i+=1;\n }\n else {\n System.out.println(\"Game Over\");\n i = 6;\n }\n }\n } } while (i <= 5 && aventurier.getPointDeVie() > 0);\n\n\n }", "public abstract void randomize();", "@Override\n\tpublic void randomRoom() {\n\t\tint randSide = random.nextInt(3) + 1;\n\t\tString side = properties.getSideFromProperties().get(randSide);\n\t\tint randRoom = random.nextInt(6) + 1;\n\t\tthis.room = properties.getRoomFromProperties().get(randRoom);\n\t\tthis.side = this.room.substring(0, 1).toLowerCase() + side;\n\t}", "private void crossover(Chromosome c1, Chromosome c2){\n int split = (int)(Math.random()*c1.getNumWeights());\n \n double[][] m1 = c1.getGeneData();\n double[][] m2 = c2.getGeneData();\n double store;\n \n //Begin the switch\n for(int r=0; r<m1.length; r++){\n //Stop spliting\n if(split <= 0){\n break;\n }\n for(int c=0; c<m1[r].length;c++){\n store = m1[r][c];\n m1[r][c] = m2[r][c];\n m2[r][c] = store;\n split--;\n //Stop spliting\n if(split <= 0){\n break;\n }\n }\n }\n }", "private MoveAction wanderRandomly() {\n\t\tint intDir = rand.nextInt(8) + 1;\n\t\tDirection direction = Direction.fromInt(intDir);\n\t\treturn moveInDirection(direction);\n\t}", "public void spin () {\n //Decide outcome.\n Random rand=new Random();\n result=rand.nextInt(100)+1+prevSpin;\n\n /**\n * Set the images\n * Image 1-11 are pictures listed bellow. 12 is wild.\n */\n //Loss\n if (result<=10) {\n //Prevention of loss streak\n prevSpin+=1;\n spinsLeft-=1;\n\n img1=rand.nextInt(12)+1;\n if (img1==12) {\n img2=rand.nextInt(11)+1;\n }\n else {\n img2=rand.nextInt(12)+1;\n }\n\n if (img1==img2) {\n img3=rand.nextInt(11)+1;\n while (img1==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else if (img1==12 || img2==12) {\n img3=rand.nextInt(11)+1;\n while (img1==img3 || img2==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else {\n img3=rand.nextInt(12)+1;\n }\n }\n\n //Cherry (1)\n else if (11<=result && result<=27) {\n prevSpin=0;\n spinsLeft-=1;\n score+=10;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=1;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=1;\n if (rand.nextInt(wildChance)+1==1 && (img1==1 || img2==1))\n img3=12;\n else\n img3=1;\n }\n\n //Pine tree (2)\n else if (28<=result && result<=38) {\n prevSpin=0;\n spinsLeft-=1;\n score+=20;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=2;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=2;\n if (rand.nextInt(wildChance)+1==1 && (img1==2 || img2==2))\n img3=12;\n else\n img3=2;\n }\n\n //\"Bar\" (3)\n else if (39<=result && result<=49) {\n prevSpin=0;\n spinsLeft-=1;\n score+=40;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=3;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=3;\n if (rand.nextInt(wildChance)+1==1 && (img1==3 || img2==3))\n img3=12;\n else\n img3=3;\n }\n\n //Bell (4)\n else if (50<=result && result<=58) {\n prevSpin=0;\n spinsLeft-=1;\n score+=60;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=4;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=4;\n if (rand.nextInt(wildChance)+1==1 && (img1==4 || img2==4))\n img3=12;\n else\n img3=4;\n }\n\n //Snowflake (5)\n else if (59<=result && result<=67) {\n prevSpin=0;\n spinsLeft-=1;\n score+=100;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=5;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=5;\n if (rand.nextInt(wildChance)+1==1 && (img1==5 || img2==5))\n img3=12;\n else\n img3=5;\n }\n\n //Mead tankard (6)\n else if (68<=result && result<=75) {\n prevSpin=0;\n spinsLeft-=1;\n score+=150;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=6;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=6;\n if (rand.nextInt(wildChance)+1==1 && (img1==6 || img2==6))\n img3=12;\n else\n img3=6;\n }\n\n //Snowball (7)\n else if (76<=result && result<=82) {\n prevSpin=0;\n spinsLeft-=1;\n score+=250;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=7;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=7;\n if (rand.nextInt(wildChance)+1==1 && (img1==7 || img2==7))\n img3=12;\n else\n img3=7;\n }\n\n //Moose (8)\n else if (83<=result && result<=88) {\n prevSpin=0;\n spinsLeft-=1;\n score+=350;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=8;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=8;\n if (rand.nextInt(wildChance)+1==1 && (img1==8 || img2==8))\n img3=12;\n else\n img3=8;\n }\n\n //Coin (9)\n else if (89<=result && result<=93) {\n prevSpin=0;\n score+=500;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=9;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=9;\n if (rand.nextInt(wildChance)+1==1 && (img1==9 || img2==9))\n img3=12;\n else\n img3=9;\n }\n\n //\"7\" (10)\n else if (94<=result && result<=98) {\n prevSpin=0;\n spinsLeft+=2;\n score+=777;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=10;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=10;\n if (rand.nextInt(wildChance)+1==1 && (img1==10 || img2==10))\n img3=12;\n else\n img3=10;\n }\n\n //Barbarian \"Bar\" (11)\n else if (99<=result) {\n //Prevention of \"high win\" streak\n prevSpin-=1;\n spinsLeft+=9;\n score+=1000;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=11;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=11;\n if (rand.nextInt(wildChance)+1==1)\n img3=12;\n else\n img3=11;\n }\n\n else {\n System.out.println(\"Result Error.\");\n }\n }", "public void mutate() {\n if (this.offspring != null) {\n for (int i = 0; i < this.offspring.size(); i++) {\n\n if (Defines.probMutate > Math.random()) {\n // OK, choose two genes to switch\n int nGene1 = Defines.randNum(0, Defines.chromosomeSize - 1);\n int nGene2 = nGene1;\n // Make sure gene2 is not the same gene as gene1\n while (nGene2 == nGene1) {\n nGene2 = Defines.randNum(0, Defines.chromosomeSize - 1);\n }\n\n // Switch two genes\n String temp = this.offspring.get(i).getGene(nGene1);\n\n this.offspring.get(i).setGene(nGene1, this.offspring.get(i).getGene(nGene2));\n this.offspring.get(i).setGene(nGene2, temp);\n }\n // Regenerate the chromosome\n ChromosomeGenerator chromoGen = new ChromosomeGenerator();\n chromoGen.update(this.offspring.get(i));\n }\n\n }\n\n }", "private void spawnZombie(int choose) {\n\t\tswitch (choose) {\n\t\tcase (0):\n\t\t// spawn one zombie at once.\n\t\t\tint r = (new Random()).nextInt(5);\n\t\t\tint r1 = (new Random()).nextInt(2);\n\t\t\tArrayList<AbstractZombie> z = new ArrayList();\n\t\t\tConeHeadZombie cz = new ConeHeadZombie();\n\t\t\tFastZombie fz = new FastZombie();\n\t\t\tz.add(cz);\n\t\t\tz.add(fz);\n\t\t\tAbstractZombie a = z.get(r1);\n\t\t\tthis.board.addModel(a, r, this.board.getLength() - 1);\n\t\t\tbreak;\n\n\t\tcase (1):\n\t\t// spawn two zombies at once.\n\t\t\tint r2 = (new Random()).nextInt(5);\n\t\t\tint r3 = (new Random()).nextInt(5);\n\t\t\tConeHeadZombie cr = new ConeHeadZombie();\n\t\t\tFastZombie fr = new FastZombie();\n\t\t\tif (r2 != r3) {\n\t\t\t\tthis.board.addModel(fr, r2, this.board.getLength() - 1);\n\t\t\t\tthis.board.addModel(cr, r3, this.board.getLength() - 1);\n\t\t\t} \n\t\t\tif (r2==r3){\n\t\t\twhile(r3==r2) {\n\t\t\t\tr2 = (new Random()).nextInt(5);\n\t\t\t\tr3 = (new Random()).nextInt(5);\n\t\t\t\t}\n\t\t\tthis.board.addModel(fr, r2, this.board.getLength() - 1);\n\t\t\tthis.board.addModel(cr, r3, this.board.getLength() - 1);\n\t\t\t}\n\t\t break;\n\t\t\n\t\tcase (2):\n\t\t// spawn three zombies at once\n\t\t\tint r4 = (new Random()).nextInt(5);\n\t\t int r5 = (new Random()).nextInt(5);\n\t\t int r6 = (new Random()).nextInt(5);\n\t\t ConeHeadZombie cq = new ConeHeadZombie();\n\t\t\tFastZombie fq = new FastZombie();\n\t\t\tConeHeadZombie cqq = new ConeHeadZombie();\n\t\t\tif (r4 != r5 && r4 !=r6 && r5 != r6 ) {\n\t\t\t\tthis.board.addModel(cqq, r4, this.board.getLength() - 1);\n\t\t\t\tthis.board.addModel(cq, r5, this.board.getLength() - 1);\n\t\t\t\tthis.board.addModel(fq, r6, this.board.getLength() - 1);\n\t\t\t} \n\t\t\telse {\n\t\t\t\twhile(r4==r5 || r5==r6 || r4==r6) {\n\t\t\t\tr4 = (new Random()).nextInt(5);\n\t\t\t\tr5 = (new Random()).nextInt(5);\n\t\t\t\tr6 = (new Random()).nextInt(5);\n\t\t\t }\n\t\t\t this.board.addModel(cqq,r5, this.board.getLength() - 1);\n\t\t\t this.board.addModel(cq, r4, this.board.getLength() - 1);\n\t\t\t this.board.addModel(fq, r6, this.board.getLength() - 1);\n\t\t break;\n\t\t\t}\n\t\t}\n\t}", "private void fight()\n {\n boolean fighting = true;\n int turn = 1;\n while(fighting)\n {\n //System.out.println(\"Just started\");\n \n switch(turn)\n {\n case 1:\n Collections.shuffle(army1);\n Collections.shuffle(army2);\n if(army1.size() > 0 && army2.size() > 0)\n {\n army2.get(0).takeDamage(army1.get(0).damage());\n if(army2.get(0).isDead())\n {\n army2.remove(0);\n }\n turn = 2;\n }\n else\n {\n turn = 3;\n }\n \n break;\n case 2:\n Collections.shuffle(army1);\n Collections.shuffle(army2);\n if (army2.size() > 0 && army1.size() > 0)\n {\n army1.get(0).takeDamage(army2.get(0).damage());\n if(army1.get(0).isDead())\n {\n army1.remove(0);\n }\n turn = 1;\n }\n else\n {\n turn = 3;\n }\n \n break;\n default:\n fighting = false;\n if(army2.size() > 0 && army1.size() <= 0)\n System.out.println(\"army2 wins\");\n if(army2.size() <= 0 && army1.size() > 0)\n System.out.println(\"army1 wins\");\n break; \n }\n \n \n \n \n }\n \n }", "void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }", "static void red_fight() {\n monsterchoices_y_r = arenafight_r.nextInt(4);\n if(monsterchoices_y_r == 0){\n System.out.println(\"You encountered a gigantic ape...\");\n gigantic_ape();\n System.out.println(\"\\n\");\n }else if(monsterchoices_y_r == 1) {\n System.out.println(\"You encountered a hungry gorilla...\");\n gorilla();\n System.out.println(\"\\n\");\n }else if(monsterchoices_y_r == 2) {\n System.out.println(\"You encountered a bloodthristy pack of wolves...\");\n pack_of_wolves();\n System.out.println(\"\\n\");\n }else if (monsterchoices_y_r == 3) {\n System.out.println(\"You encountered a King Snake...\");\n rattle_snake();\n System.out.println(\"\\n\");\n }\n }", "public int dmg(){\r\n dmg = rand.nextInt(att);\r\n if(att == 1)\r\n dmg = 1;\r\n return dmg;\r\n }", "@Override\n public Card chooseCardtoPlay() {\n assert(card1 != null && card2 != null);\n if (card1.value == Card.PRINCESS) return playCard2();\n if (card2.value == Card.PRINCESS) return playCard1();\n return rand.nextBoolean() ? playCard1() : playCard2();\n }", "public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\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 }", "@Override\n public void performTrick()\n {\n Random random = new Random();\n int rnd = random.nextInt(2);\n if(rnd == 0)\n {\n setPerformText(\"rolls in the mud\");\n }\n else\n {\n setPerformText(\"runs in circles\");\n }\n System.out.println(getPerformText());\n }", "private Action selectRandomAction() {\n int fuel;\n String car, driver;\n Tire tire;\n TirePressure pressure;\n\n // Possible tire pressures\n List<TirePressure> tirePressures = Arrays.asList(\n TirePressure.FIFTY_PERCENT,\n TirePressure.SEVENTY_FIVE_PERCENT,\n TirePressure.ONE_HUNDRED_PERCENT\n );\n\n // Possible fuel levels (note that this is an arbitrary discretization)\n List<Integer> fuelLevels = new ArrayList<>();\n int fuelInterval = ProblemSpec.FUEL_MAX / FUEL_DISCRETE_INTERVALS;\n\n for (int i = 0; i < FUEL_DISCRETE_INTERVALS; i++) {\n fuelLevels.add(fuelInterval * i);\n }\n\n List<ActionType> validActionTypes = problemSpec.getLevel().getAvailableActions();\n ActionType actionType = getRandomElement(validActionTypes);\n Action action;\n\n // Pick a random action from A1-A8 and then randomize the parameters\n switch (actionType.getActionNo()) {\n case 1:\n action = new Action(actionType);\n break;\n case 2:\n car = getRandomElement(problemSpec.getCarOrder());\n action = new Action(actionType, car);\n break;\n case 3:\n driver = getRandomElement(problemSpec.getDriverOrder());\n action = new Action(actionType, driver);\n break;\n case 4:\n tire = getRandomElement(problemSpec.getTireOrder());\n action = new Action(actionType, tire);\n break;\n case 5:\n fuel = getRandomElement(fuelLevels);\n action = new Action(actionType, fuel);\n break;\n case 6:\n pressure = getRandomElement(tirePressures);\n action = new Action(actionType, pressure);\n break;\n case 7:\n car = getRandomElement(problemSpec.getCarOrder());\n driver = getRandomElement(problemSpec.getDriverOrder());\n action = new Action(actionType, car, driver);\n break;\n default:\n // A8\n tire = getRandomElement(problemSpec.getTireOrder());\n fuel = getRandomElement(fuelLevels);\n pressure = getRandomElement(tirePressures);\n action = new Action(actionType, tire, fuel, pressure);\n }\n\n return action;\n\n }", "public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }", "public Area GetNextAreaRandom(Area area)\n\n {\n\n Random rand = new Random();\n\n int i = 0;\n\n switch(area.paths)\n\n {\n\n case Constants.North:\n\n i = rand.nextInt(2);\n\n if(i==0)\n\n return area.areaMap.get(Constants.North);\n\n if(i==1)\n\n return area;\n\n case Constants.South:\n\n if(i==0)\n\n return area.areaMap.get(Constants.South);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.East:\n\n if(i==0)\n\n return area.areaMap.get(Constants.East);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.West:\n\n if(i==0)\n\n return area.areaMap.get(Constants.West);\n\n if(i==1)\n\n return area;\n\n \n\n \n\n case Constants.NorthAndSouth:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.EastAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthSouthAndEast:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthSouthAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.SouthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n i = rand.nextInt(5);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 3)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 4)\n\n return area;\n\n }\n\n \n\n return area;\n\n \n\n \n\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private void chooseSprite()\r\n\t{\r\n\t\t//Ensure pedestrian sprites exist\r\n\t\tif (sprites.isEmpty()) {\r\n\t\t\tSystem.err.println(\"ERROR: No pedestrian sprites have been loaded\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//Select a random sprite\r\n\t\tint index = (int) Math.floor( Math.random()*sprites.size() );\r\n\t\tspriteName = sprites.get(index);\r\n\t\tsetSprite(\"pedestrians/\"+spriteName);\r\n\t}", "public void play ()\r\n\t{\r\n\t\t// generates random numbers\r\n\t\tRandom generator = new Random();\r\n\t\tdouble randNum1 = generator.nextDouble();\r\n\t\tdouble randNum2 = generator.nextDouble();\r\n\t\t\r\n\t\tint type1 = randCompare(randNum1);\r\n\t\tint type2 = randCompare(randNum2);\r\n\t\t\r\n\t\tif (type1 == type2)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// type1 wins\r\n\t\telse if ((type1 == ROCK && type2 == SCISSORS) || (type1 == PAPER && type2 == ROCK) || (type1 == SCISSORS && type2 == PAPER))\r\n\t\t{\r\n\t\t\trpsSize[type2] = rpsSize[type2] - 1;\r\n\t\t\tsize = size -1;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\tsize = size -1;\r\n\t\t\trpsSize[type1] = rpsSize[type1] - 1;\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "@Test\r\n public void testPlayer_setRandomStrategy_2() {\r\n player2 = new Player(\"\", true);\r\n player2.setRandomStrategy();\r\n String firstStrategy = player2.getStrategy();\r\n boolean strategyReplaced = false;\r\n // generate 20 random strategies and assert at least one of them comes back different.\r\n for(int i = 0; i < 20; i++) {\r\n player2.setRandomStrategy();\r\n if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {\r\n strategyReplaced = true;\r\n }\r\n }\r\n assertTrue(strategyReplaced);\r\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 char compChoice ()\n {\n\tint num = (int) (Math.random () * 5) + 1;\n\tif (num == 1)\n\t return 's';\n\telse if (num == 2)\n\t return 'd';\n\telse if (num == 3)\n\t return 'p';\n\telse if (num == 4)\n\t return 'h';\n\telse\n\t return 'w';\n }", "private void computerTurn() {\r\n\t\tPoint index = randomIndex();\r\n\t\tSETslot((int)index.getX(), (int)index.getY(), randomValue());\r\n\t}", "private void generateRandomCombination() {\n Random num_generator = new Random();\n\n //First combo number should not be in range -5 to 5.\n int temp_combo_one;\n do {\n temp_combo_one = num_generator.nextInt(40);\n } while (temp_combo_one >= -5 && temp_combo_one <= 5);\n\n //Combo numbers should not repeat\n //Consecutive combo numbers should be separated by ~5 ticks in either direction\n int temp_combo_two;\n do {\n temp_combo_two = num_generator.nextInt(40);\n }\n while (temp_combo_two == temp_combo_one || (temp_combo_two >= temp_combo_one - 5 && temp_combo_two <= temp_combo_one + 5));\n\n //If second combo number is a 0, we don't want the third combo number to be in the 38 to 40 range\n int temp_combo_three;\n do {\n temp_combo_three = num_generator.nextInt(40);\n }\n while (temp_combo_three == temp_combo_one || temp_combo_three == temp_combo_two || (temp_combo_three >= temp_combo_two - 5 && temp_combo_three <= temp_combo_two + 5) || (temp_combo_two == 0 && temp_combo_three >= 38));\n\n current_combination[0] = temp_combo_one;\n current_combination[1] = temp_combo_two;\n current_combination[2] = temp_combo_three;\n\n //Display combination\n String combo_one = Integer.toString(current_combination[0]);\n String combo_two = Integer.toString(current_combination[1]);\n String combo_three = Integer.toString(current_combination[2]);\n\n combo_1.setText(combo_one);\n combo_2.setText(combo_two);\n combo_3.setText(combo_three);\n }", "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}", "public int performDuel(){\n Random rand = new Random();\n int intRand;\n intRand = rand(6);\n while(this.engine.getGameInformation().cards[intRand][intRand] == 0 ){\n intRand = rand(6);\n }\n return intRand;\n }", "public static int [] moveDecision (Species [][] map, int x , int y, int plantHealth) {\n \n // Directions: Up = 1, Down = 2, Left = 3, Right = 4\n // Last choice is random movement\n // Animals: sheep = 0, wolves = 1\n int [] directionChoice = new int [] {1 + (int)(Math.random() * 4), 1 + (int)(Math.random() * 4)};\n \n // Find any animals\n if ((map[y][x] != null) && (!(map[y][x] instanceof Plant))) {\n \n // Sheep decisions (sheep cannot decide whether or not to move away from wolves)\n if (map[y][x] instanceof Sheep) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Plant)) {\n directionChoice[0] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Plant)) {\n directionChoice[0] = 2;\n } else if ((x > 0) &&(map[y][x-1] instanceof Plant)) {\n directionChoice[0] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Plant)) {\n directionChoice[0] = 4;\n \n // Wolf decisions\n } else if (map[y][x] instanceof Wolf) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Sheep)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Sheep)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n directionChoice[1] = 4;\n \n // Second choice is to fight a weaker wolf\n } else if ((y > 0) && (map[y-1][x] instanceof Wolf)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Wolf)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n directionChoice[1] = 4;\n }\n }\n \n }\n }\n return directionChoice; // Return choice to allow animals to move\n }", "public void addRandomItem(double x, double y) {\r\n\r\n\t\tint choice = random.nextInt(3);\r\n\r\n\t\tString weaponchoices = Resources.getString(\"weaponchoices\");\r\n\t\tString delim = Resources.getString(\"delim\");\r\n\r\n\t\tString[] options = weaponchoices.split(delim);\r\n\t\tString option = options[choice];\r\n\r\n\t\tBufferedImage itemimage = Resources.getImage(option);\r\n\t\tSpriteGroup items = playField.getGroup(\"Items\");\r\n\t\tint healthOption = Resources.getInt(\"healthOption\");\r\n\r\n\t\tif (choice == healthOption) {\r\n\t\t\tgetHealthItem(x, y, option, itemimage, items);\r\n\t\t} else {\r\n\t\t\tgetWeaponItem(x, y, option, itemimage, items);\r\n\t\t}\r\n\r\n\t}", "public String tossWinner(String userChoice) {\n Random random = new Random();\n int rand = random.nextInt(2);\n String toss_val = \"\";\n String winner = \"\";\n\n if (rand == 0){\n toss_val = \"Heads\";\n }\n else {\n toss_val = \"Tails\";\n }\n\n if (userChoice.equals(toss_val)){\n winner = \"Human\";\n }\n else {\n winner = \"Computer\";\n }\n\n return winner;\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private void selectRandom() {\n\n\t\tRandom randomise;\n\n\t\t// Select random char from Spinner only if it is enabled\n\t\tif (solo.getCurrentSpinners().get(0).isEnabled()) {\n\t\t\trandomise = new Random();\n\t\t\trandomCharPos = randomise.nextInt(solo.getCurrentSpinners().get(1)\n\t\t\t\t\t.getCount());\n\n\t\t\tsolo.pressSpinnerItem(0, randomCharPos);\n\t\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\t\trandomChar = solo.getCurrentSpinners().get(0).getSelectedItem()\n\t\t\t\t\t.toString();\n\t\t}\n\n\t\t// Select random act from Spinner\n\t\trandomise = new Random();\n\t\trandomActPos = randomise.nextInt(solo.getCurrentSpinners().get(1)\n\t\t\t\t.getCount());\n\n\t\tsolo.pressSpinnerItem(1, randomActPos);\n\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\trandomAct = solo.getCurrentSpinners().get(1).getSelectedItem()\n\t\t\t\t.toString();\n\n\t\t// Select random page from Spinner\n\t\trandomise = new Random();\n\t\trandomPagePos = randomise.nextInt(solo.getCurrentSpinners().get(2)\n\t\t\t\t.getCount());\n\n\t\tsolo.pressSpinnerItem(2, randomPagePos);\n\t\tsolo.goBackToActivity(\"OptionsActivity\");\n\n\t\trandomPage = solo.getCurrentSpinners().get(2).getSelectedItem()\n\t\t\t\t.toString();\n\t}", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "public MotherRobot() {\n Random random = new Random();\n int sepInt = random.nextInt(3);\n if (sepInt == 1)\n setSeparate(true);\n }", "int tournament() {\r\n \tint ch1,ch2;\r\n\t\tch1 = (int)Math.floor(Math.random()*SIZE);\r\n\t\tdo {\r\n\t\t\tch2 = (int)Math.floor(Math.random()*SIZE);\r\n\t\t} while (ch1==ch2);\r\n\t\tif (fit[ch1]<fit[ch2]) return ch1;\r\n\t\telse return ch2;\r\n }", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\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}", "private void randomMove() {\n }", "private void initDouble()\r\n {\r\n int mark = rn.nextInt(2);\r\n if(mark == 0)\r\n {\r\n user.setMarker(Marker.cross);\r\n marker = user.getMarker();\r\n user2.setMarker(Marker.circle);\r\n user.makeMove(this);\r\n turn = 1;\r\n JOptionPane.showMessageDialog(null,\"Player 1's Turn\\n Your Marker: \" + marker);\r\n }\r\n else\r\n {\r\n user.setMarker(Marker.circle);\r\n user2.setMarker(Marker.cross);\r\n marker = user2.getMarker();\r\n user2.makeMove(this);\r\n turn = 2;\r\n JOptionPane.showMessageDialog(null,\"Player 2's Turn\\n Your Marker: \" + marker);\r\n }\r\n bh.setBoard(this);\r\n }", "private void nameturn1() {\n \tplayerturn = randplayerstart%2;\n \tSystem.out.println(\"random geneator:\"+randplayerstart);\n \tif (playerturn%2==0) {\n \t\tplayername=namePlayer1;\n \t}\n \telse { playername=namePlayer2;}\n }", "private void tournament_selection() {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n // pick 2 random ints to for indices of parents\r\n int parent1 = new Random().nextInt(this.pop_size);\r\n int parent2 = new Random().nextInt(this.pop_size);\r\n\r\n individual p1 = new individual(main_population.getPopulation()[parent1].getGenes(), solutions, output);\r\n individual p2 = new individual(main_population.getPopulation()[parent2].getGenes(), solutions, output);\r\n\r\n if (p1.getFitness() >= p2.getFitness()) {\r\n temp_pop[i] = p1;\r\n } else {\r\n temp_pop[i] = p2;\r\n }\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }", "private void cross(String[] pop) {\n\t\tString temp1, temp2;\n\t\tfor (int i = (int) (ChrNum*survial_fraction); i < ChrNum; i+=2) {\n\t\t\tif (Math.random() < 0.60) {\n\t\t\t\tint pos = (int)(Math.random()*GENE)+1; \n\t\t\t\ttemp1 = pop[i].substring(0, pos) + pop[i + 1].substring(pos); \n\t\t\t\ttemp2 = pop[i + 1].substring(0, pos) + pop[i].substring(pos);\n\t\t\t\tpop[i] = temp1;\n\t\t\t\tpop[i + 1] = temp2;\n\t\t\t}\n\t\t}\n\t}", "public Hazard selectRandom() {\r\n\t\tRandom gen = new Random();\r\n\t\treturn hazards.get(gen.nextInt(hazards.size()));\r\n\t}", "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 setMultChoices() {\r\n Random randomGenerator = new Random();\r\n int howManyAnswer = randomGenerator.nextInt(6) + 1;\r\n for (int i = 0; i < howManyAnswer; i++) {\r\n int multipleAnswer = randomGenerator.nextInt(6);\r\n checkDuplicate(studentAnswer, multipleAnswer);\r\n\r\n }\r\n }", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "public void mouseMovements() throws InterruptedException{\n\t\t\r\n\t\tint intMouseX = (int)random(10,700);\r\n\t\tint intMouseY = (int)random(10,400);\r\n\t\tint randomMouse = (int)random(0,1000);\r\n\t\t\r\n\t\t// small movements\r\n\t\tif (randomMouse <= 400) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 300) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 375) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// medium movements\r\n\t\telse if (randomMouse <= 800) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 600) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 675) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// large movements\r\n\t\telse if (randomMouse <= 1000) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 950) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 990) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban mouse movement\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void mouseMovements() throws InterruptedException{\n\t\t\r\n\t\tint intMouseX = (int)random(10,700);\r\n\t\tint intMouseY = (int)random(10,400);\r\n\t\tint randomMouse = (int)random(0,1000);\r\n\t\t\r\n\t\t// small movements\r\n\t\tif (randomMouse <= 400) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 300) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 375) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// medium movements\r\n\t\telse if (randomMouse <= 800) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 600) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 675) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// large movements\r\n\t\telse if (randomMouse <= 1000) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 950) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 990) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban mouse movement\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "private static ResourceLocation getRandomMonster(Random rand)\n\t{\n\t\tRandomCollection<ResourceLocation> monsters = new RandomCollection<ResourceLocation>();\n\t\t\n\t\tmonsters.add(10, EntityList.getKey(EntityZombie.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySkeleton.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySpider.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityGhost.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityBarbarian.class));\n\t\t//monsters.add(4, EntityList.getKey(EntityBandit.class));\n\t\tmonsters.add(3, EntityList.getKey(EntityBanshee.class));\n\t\tmonsters.add(1, EntityList.getKey(EntityGolem.class));\n\t\t\n\t\treturn monsters.next(rand);\n\t}", "public void scramble(){\r\n for (int i = 0; i < data.length / 2; i++){\r\n int randomIndex1 = (int)(Math.random()*(data.length - 1));\r\n int randomIndex2 = (int)(Math.random()*(data.length - 1));\r\n swap(randomIndex1, randomIndex2);\r\n }\r\n }", "public void chooseWord() {\n int length = words.size();\n int index = (int) ((length - 1) * Math.random());\n word = words.get(index);\n }", "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 }", "static String score(String agent1,String agent2)\n {\n int a1=random(s.length);\n int a2=random(s.length);\n if(a1==a2)\n a2++;\n if (a1 < a2)\n {\n allScores[in]=agent1+\" lose from \"+ agent2 + \" \" + a2 +\"-\"+ a1;\n JOptionPane.showMessageDialog(new JFrame(),allScores[in]);\n in++;\n return agent2;\n }\n else\n {\n allScores[in]=agent2+\" lose from \"+ agent1 +\" \" + a1 +\"-\"+ a2;\n JOptionPane.showMessageDialog(new JFrame(),allScores[in]);\n in++;\n return agent1;\n }\n\n }", "public CrossoverOrder() {\n\t\tthis.randomGenerator = new Random(System.currentTimeMillis());\n\t}", "private SocialPractice chooseOnIntentions(\n\t\t\tArrayList<SocialPractice> candidateSocialPractices) {\n\t\tSocialPractice chosenAction = null; //temp\n\t\tHashMap<SocialPractice, Double> needs=new HashMap<SocialPractice, Double>();\n\t\tfor(SocialPractice sp: candidateSocialPractices){\n\t\t\tneeds.put(sp, myValues.get(sp.getPurpose()).getNeed(myContext)); \n\t\t}\n\t\tdouble totalNeed = Helper.sumDouble(needs.values()); //satisfaction can get <0, so need as well, so maybe not getting in while loop\n\t\tdouble randomDeterminer = RandomHelper.nextDoubleFromTo(0, totalNeed);\n\t\t//System.out.println(myContext);\n\t\t//System.out.println(\"Needs:\" + needs);\n\t\t\n\t\tIterator it = needs.entrySet().iterator();\n\t\twhile(randomDeterminer > 0) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) it.next();\n\t\t\tchosenAction = (SocialPractice) pair.getKey();\n\t\t\trandomDeterminer = randomDeterminer - (double) pair.getValue();\n\t\t}\n\t\treturn chosenAction;\n\t}", "public void playGame () {\n int rank1 = team1.getSeed();\n int rank2 = team2.getSeed();\n double s1 = Math.random();\n System.out.println(s1);\n double s2 = Math.random();\n System.out.println(s2);\n \n if(rank1 < rank2){\n\t double one = (s1*10)+1;\n\t score1 = (int)one;//gives a slight advantage to the person with a higher seed\n\t double two = (s2*10); \n\t score2 = (int)two;\n\t if(score1 == score2){\n\t score1 = score1+1; //gives the game to the higher seed if there is a tie\n }\n else if(rank2 < rank1){\n\t double r = (s2*10)+1;\n\t score2 = (int)r;\n\t double t = (s1*10); \n\t score1 = (int)t;\n\t if(score1 == score2){\n\t score2 = score2+1;\n\t }}}}", "@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}", "private static void roll()\n {\n rand = (int)(((Math.random())*6)+1); // dice roll #1\n rand2 = (int)(((Math.random())*6)+1);// dice roll #2\n }", "public void random_sword() {\n\t\tint randomX = 1;\n\t\tint randomY = 1;\n\t\twhile (true) {\n\t\t\trandomX = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomY = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomX--;\n\t\t\trandomY--;\n\t\t\tif (labirinto.getLab()[randomX][randomY] == ' ')\n\t\t\t\tbreak;\n\t\t}\n\t\tespada.setX_coord(randomX);\n\t\tespada.setY_coord(randomY);\n\t\tchange_sword_pos();\n\t}", "public Pair getRandomPair() {\n Shirt shirt = getRandomShirt();\n Trouser trouser = getRandomTrouser();\n\n if (trouser != null && shirt != null)\n return new Pair(shirt, trouser);\n else {\n return null;\n }\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}", "@Test\n \tpublic void testTargetRandomSelection() {\n \tComputerPlayer player = new ComputerPlayer();\n \t// Pick a location with no rooms in target, just three targets\n \tboard.calcTargets(23, 7, 2);\n \tint loc_24_8Tot = 0;\n \tint loc_22_8Tot = 0;\n \tint loc_21_7Tot = 0;\n \t// Run the test 100 times\n \tfor (int i=0; i<100; i++) {\n \t\tBoardCell selected = player.pickLocation(board.getTargets());\n \t\tif (selected == board.getRoomCellAt(24, 8))\n \t\t\tloc_24_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(22, 8))\n \t\t\tloc_22_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(21, 7))\n \t\t\tloc_21_7Tot++;\n \t\telse\n \t\t\tfail(\"Invalid target selected\");\n \t}\n \t// Ensure we have 100 total selections (fail should also ensure)\n \tassertEquals(100, loc_24_8Tot + loc_22_8Tot + loc_21_7Tot);\n \t// Ensure each target was selected more than once\n \tassertTrue(loc_24_8Tot > 10);\n \tassertTrue(loc_22_8Tot > 10);\n \tassertTrue(loc_21_7Tot > 10);\t\t\t\t\t\t\t\n }", "public static void tossWhoIsFirst() \n\t{\n\t\t\n\t\tRandom randomHeadTail = new Random();\n\t\tint generatedHeadOrTail = randomHeadTail.nextInt(2);\n\t\tSystem.out.println(generatedHeadOrTail);\n\t\tSystem.out.println(\"Tossing a coin To decide who plays first.\\nEnter 1-for-Head or 0-for-Tail:\");\n\t\tscanner = new Scanner(System.in);\n\t\tint playerHeadOrTail = scanner.nextInt();\n\t\tif(playerHeadOrTail >= 0 && playerHeadOrTail <= 1)\n\t\t{\n\t\t\tif(playerHeadOrTail == generatedHeadOrTail)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Player won toss ! Make first move.\");\n\t\t\t\tbeforeMoveBoard();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tSystem.out.println(\"Computer won toss ! Make's first move.\");\n\t\t\t\tcomputerMove();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Invalid Coin choice: Make choice again.\");\n\t\t\ttossWhoIsFirst();\n\t\t}\n\t}", "private void chooseRandomTweet() {\n if (random.nextBoolean()) {\n realTweet = true;\n displayRandomTrumpTweet();\n } else {\n realTweet = false;\n displayRandomFakeTweet();\n }\n }", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public void play() {\n\t\tthis.initializeTurn();\n\t\twhile(this.getAction() > 0) {\n\t\t\tint choix = RandomInt.randomInt(1,6, this.rand);\n\t\t\tif(choix == 1) {\n\t\t\t\t//add building, preference of Machine\n\t\t\t\tint max = 0;\n\t\t\t\tint maxi = 0;\n\t\t\t\tboolean find = false;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveBuildingCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) instanceof Machine) {\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i).getPoint() > max && !find) {\n\t\t\t\t\t\t\tmax = this.getBoard().getFiveBuildingCards().get(i).getPoint();\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addBuilding(this.getBoard().getFiveBuildingCards().get(maxi));\n\t\t\t\tDesignString.printBorder(\"Ouverture d'un chantier\");\n\t\t\t}\n\t\t\telse if(choix == 2 || choix == 3) {\n\t\t\t\t//add worker, preference of the lowest one\n\t\t\t\tint min = 999;\n\t\t\t\tint mini = 0;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveWorkerCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i).getCost() < min && this.getBoard().getFiveWorkerCards().get(i).getCost() >= this.getCoin()) {\n\t\t\t\t\t\t\tmin = this.getBoard().getFiveWorkerCards().get(i).getCost();\n\t\t\t\t\t\t\tmini = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(mini).getCost() >= this.getCoin()) {\n\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tDesignString.printBorder(\"Recrutement d'un ouvrier\");\n\t\t\t\t\tthis.hireWorker(this.getBoard().getFiveWorkerCards().get(mini));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(choix == 4 || choix == 5 || choix == 6) {\n\t\t\t\t//worker to building. Preference to the started building. If it can't play, preference to action to coin\n\t\t\t\tIBuilding building = null;\n\t\t\t\tIWorker worker = null;\n\t\t\t\tif(this.getWorkerCards().size() > 0) {\n\t\t\t\t\tif(this.getStartedBuilding().size() > 0) {\n\t\t\t\t\t\tchoix = RandomInt.randomInt(0,2,this.rand);\n\t\t\t\t\t\tif(choix%2 == 0) {\n\t\t\t\t\t\t\tint max = 0;\n\t\t\t\t\t\t\tint maxi = 0;\n\t\t\t\t\t\t\tfor(int i = 0; i < this.getStartedBuilding().size(); i++) {\n\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i) != null) {\n\t\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i).getWorkerOn().size() > max) {\n\t\t\t\t\t\t\t\t\t\tmax = this.getStartedBuilding().get(i).getWorkerOn().size();\n\t\t\t\t\t\t\t\t\t\tmaxi = i;\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\tbuilding = this.getStartedBuilding().get(maxi);\n\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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} else if(this.getBuildingsCards().size() > 0) {\n\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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}", "public void simulation(){\n GameInformation gi = this.engine.getGameInformation();\n Point ball = gi.getBallPosition();\n Player playerSelected;\n int xTemp;\n team = gi.getTeam(ball.x , ball.y);\n\n //Attack\n if(team == gi.activeActor){\n selectAttackerPlayer(gi.getPlayerTeam(gi.activeActor));\n doAttackMoove(playerOne.getPosition(), gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectProtectPlayer(gi.getPlayerTeam(gi.activeActor));\n doProtectMoove(playerTwo.getPosition(), playerOne.getPosition() ,gi.cells[(int) playerTwo.getPosition().getX()][(int) playerTwo.getPosition().getY()].playerMoves);\n playerOne = null;\n playerTwo = null;\n this.engine.next();\n }\n else{//Defense\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n TacklAction tackl = new TacklAction();\n tackl.setSource(playerOne.getPosition());\n VisualArea[] area;\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n\n tackl.setSource(playerTwo.getPosition());\n\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n playerOne = null;\n playerTwo = null;\n }\n }" ]
[ "0.62511057", "0.608874", "0.6080011", "0.5981908", "0.594478", "0.590564", "0.5893112", "0.5878873", "0.587068", "0.5865225", "0.5814043", "0.5811785", "0.58023745", "0.5787018", "0.5767135", "0.576183", "0.575889", "0.5755644", "0.57537067", "0.5734662", "0.5727952", "0.57186794", "0.57073367", "0.57011414", "0.56670696", "0.5640794", "0.56359047", "0.5635038", "0.5632877", "0.5598106", "0.5594044", "0.5582691", "0.55794615", "0.55794233", "0.5556265", "0.55450094", "0.5540504", "0.5525295", "0.5506701", "0.5504172", "0.55017924", "0.54941094", "0.549359", "0.547655", "0.54729843", "0.54631954", "0.54614013", "0.5461351", "0.54532224", "0.54529375", "0.5447544", "0.5438195", "0.54369223", "0.5436281", "0.5432814", "0.5411738", "0.5408066", "0.54006475", "0.53992444", "0.5396969", "0.5394769", "0.53943163", "0.5391746", "0.53915566", "0.53862363", "0.5380212", "0.53730875", "0.53650814", "0.53646827", "0.53523767", "0.5351423", "0.5344723", "0.5342846", "0.5342638", "0.5339783", "0.53360903", "0.53344965", "0.53335565", "0.5331541", "0.5327492", "0.5321974", "0.5321974", "0.5312905", "0.53109246", "0.530916", "0.5306992", "0.53002125", "0.5297282", "0.52952194", "0.5285409", "0.52851707", "0.52835304", "0.52796215", "0.5276458", "0.5273361", "0.5271244", "0.52691215", "0.52613515", "0.52585363", "0.52487725", "0.52477133" ]
0.0
-1
Method which is responsible for file management and loading graphics from outside file.
protected BufferedImage loadImage(String nameOfFile) { BufferedImage img; try{ img= ImageIO.read(new File(""+nameOfFile)); return img; } catch(IOException e) { System.out.println(e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void openFile() throws FileNotFoundException {\n\t\t\tShapes.removeAll(Shapes);\r\n\t\t\tmyLine = null;\r\n\t\t\tmyOval = null;\r\n\t\t\trepaint();\r\n\t\t\t// End Remove all form shapes\r\n\t\t\t\r\n\t\t\t// JFileChooser\r\n\t\t\tString myFile = File.separator+\"txt\";\r\n\t\t\tJFileChooser fileChooser = new JFileChooser(new File(myFile));\r\n\t\t\tfileChooser.showOpenDialog(drawingPanel);\r\n\t\t\tFile aFile = fileChooser.getSelectedFile();\r\n\t\t\tScanner filePtr = new Scanner(aFile);\r\n\t\t\t\r\n\t\t\t// End JFileChooser\r\n\t\t\t\r\n\t\t\t// Variables\r\n\t\t\tint startX=0, startY=0; // Used to build the start point for both lines and ovals\r\n\t\t\tint endX=0, endY=0; // Used only in Lines. Used to build the end point of a line.\r\n\t\t\tint width=0, height=0; // Used only by Ovals. \r\n\t\t\tint outlineRed=0, outlineGreen=0, outlineBlue=0; // Used to determine the color of the outline.\r\n\t\t\tint fillRed=0, fillGreen=0, fillBlue=0;\r\n\t\t\t// End Variables\r\n\t\t\t\r\n\t\t\tstatusLabel.setText(\"Open Drawing...\");\r\n\t\t\t\r\n\t\t\twhile (filePtr.hasNextLine()) {\r\n\t\t\t\tString str = filePtr.nextLine();\r\n\t\t\t\tString[] st = str.split(\" \");\r\n\t\t\t\tString type = st[0];\r\n\t\t\t\t//int i = 0; // used to count the elements of each line so that each element is assigned to correct variable\r\n\t\t\t\tfor(int i = 1; i<st.length; i++){\r\n\t\t\t\t\tif(type.equals(\"L\")){\r\n\t\t\t\t\t\tif (i == 1) {\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t\tstartX = (int) Double.parseDouble(st[i]);\r\n\t\t\t\t\t\t} else if (i == 2) {\r\n\t\t\t\t\t\t\tstartY = (int) Double.parseDouble(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t} else if (i == 3) {\r\n\t\t\t\t\t\t\tendX = (int) Double.parseDouble(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t} else if (i == 4) {\r\n\t\t\t\t\t\t\tendY = (int) Double.parseDouble(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t} else if (i == 5) {\r\n\t\t\t\t\t\t\toutlineRed = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t} else if (i == 6) {\r\n\t\t\t\t\t\t\toutlineBlue = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t} else if (i == 7) {\r\n\t\t\t\t\t\t\toutlineGreen = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t\tSystem.out.println(st[i]);\r\n\t\t\t\t\t\t\tstartPoint = new Point(startX, startY);\r\n\t\t\t\t\t\t\tendPoint = new Point(endX, endY);\r\n\t\t\t\t\t\t\tColor outline = new Color(outlineRed, outlineBlue, outlineGreen);\r\n\t\t\t\t\t\t\tmyLine = new Line(startPoint, endPoint, outline);\r\n\t\t\t\t\t\t\tShapes.add(myLine);\r\n\t\t\t\t\t\t\tstartPoint = null;\r\n\t\t\t\t\t\t\tendPoint = null;\r\n\t\t\t\t\t\t\trepaint();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(type.equals(\"O\")){\r\n\t\t\t\t\t\tif (i == 0) {\r\n\t\t\t\t\t\t\tstartX = (int) Double.parseDouble(st[i]); // x pt of starting point\r\n\t\t\t\t\t\t} else if (i == 1) {\t\r\n\t\t\t\t\t\t\tstartY = (int) Double.parseDouble(st[i]); // y pt of starting point\r\n\t\t\t\t\t\t} else if (i == 2) {\r\n\t\t\t\t\t\t\twidth = (int) Double.parseDouble(st[i]); // y is width\r\n\t\t\t\t\t\t} else if (i == 3) {\r\n\t\t\t\t\t\t\theight = (int) Double.parseDouble(st[i]); // z is height\r\n\t\t\t\t\t\t} else if (i == 4) {\r\n\t\t\t\t\t\t\toutlineRed = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t} else if (i == 5) {\r\n\t\t\t\t\t\t\toutlineBlue = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t} else if (i == 6) {\r\n\t\t\t\t\t\t\tfillRed = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t} else if (i == 7) {\r\n\t\t\t\t\t\t\tfillBlue = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t} else if (i == 8) {\r\n\t\t\t\t\t\t\tfillGreen = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t} else if (i == 9) {\r\n\t\t\t\t\t\t\toutlineGreen = Integer.parseInt(st[i]);\r\n\t\t\t\t\t\t\tstartPoint = new Point(startX, startY);\r\n\t\t\t\t\t\t\tColor outline = new Color(outlineRed, outlineGreen, outlineBlue);\r\n\t\t\t\t\t\t\tColor fill = new Color(fillRed, fillGreen, fillBlue);\r\n\t\t\t\t\t\t\tmyOval = new Oval(startPoint, width, height, outline, fill);\r\n\t\t\t\t\t\t\tShapes.add(myOval);\r\n\t\t\t\t\t\t\tstartPoint = null;\r\n\t\t\t\t\t\t\tendPoint = null;\r\n\t\t\t\t\t\t\twidth = 0;\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\trepaint();\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}// End While Loop\r\n\t\t}", "public void read(File file, Drawing drawing) throws IOException;", "public void getGraphicsAttachmentContents() throws IOException\n\t{\n\t\tpictureAttachment = new ImageIcon(graphicsAttachment);\n\t\tpicLabel = new JLabel(pictureAttachment);\n\t}", "public void read(File file, Drawing drawing, boolean replace) throws IOException;", "public void importFileClick() {\n\n //Lets the user choose a file location\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open Resource File\");\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Run-length encoding\",\n \"*.rle\"));\n File file = fileChooser.showOpenDialog(new Stage());\n\n //If a file was chosen, will stop the game and set the generation to 0 and try to load the file.\n if (file != null) {\n timeline.stop();\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n try {\n fileHandler.readGameBoardFromDisk(file);\n } catch (IOException ie) {\n //Produces a warning if unsuccessful\n PopUpAlerts.ioAlertFromDisk();\n }\n }\n\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n ruleLabel.setText(gOL.getRuleString().toUpperCase());\n isMovable = true;\n canvasArea.requestFocus();\n setFocusTraversable(false);\n\n //Resets offset to accommodate for the new pattern and calls draw().\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }", "private void drawNotification(Graphics g, String fileName, int x, int y) throws IOException{\n\t\t ImageIcon bg;\n\t\t bg = new ImageIcon(ImageIO.read(new File(relativePath + fileName)));\n\t\t bg.paintIcon(this, g, x, y);\n\t }", "public static void load(){\r\n\t \ttry {\r\n\t \t\t// load and set all sprites\r\n\t\t\t\tsetBlueGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/blueGarbage.png\")));\r\n\t\t\t\tsetRank(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/rank.png\")));\r\n\t\t\t\tsetRedGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/redGarbage.png\")));\r\n\t\t\t\tsetYellowGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowGarbage.png\")));\r\n\t\t\t\tsetGreenGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/greenGarbage.png\")));\r\n\t\t\t\tsetBlueSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/blueSnakeBodyPart.png\")));\r\n\t\t\t\tsetRedSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/redSnakeBodyPart.png\")));\r\n\t\t\t\tsetYellowSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowSnakeBodyPart.png\")));\r\n\t\t\t\tsetGreenSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/greenSnakeBodyPart.png\")));\r\n\t\t\t\tsetHeart(ImageIO.read(classPath.getResourceAsStream(\"/images/heart.png\")));\r\n\t\t\t\tsetGameScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenBackground.png\")));\r\n\t\t\t\tsetGameScreenHeader(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenHeader.png\")));\r\n\t\t\t\tsetGameOver(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameOver.png\")));\r\n\t\t\t\tsetHitsOwnBody(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsOwnBody.png\")));\r\n\t\t\t\tsetHitsWall(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsWall.png\")));\r\n\t\t\t\tsetWrongColor(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/wrongColor.png\")));\r\n\t\t\t\tsetHelpScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpScreenBackground.png\")));\r\n\t\t\t \tsetWarningScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/warningScreenBackground.png\")));\r\n\t\t\t \tsetOkButton(ImageIO.read(classPath.getClass().getResource(\"/images/okButton.png\")));\r\n\t\t\t \tsetMenuScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/menuScreenBackground.png\")));\r\n\t\t\t\tsetStartButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/startButton.png\")));\r\n\t\t\t\tsetExitButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/exitButton.png\")));\r\n\t\t\t\tsetHelpButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpButton.png\")));\r\n\t\t\t\t\r\n\t \t} \r\n\t \tcatch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getStackTrace(), \"Erro ao carregar imagens\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\r\n\t\t\t}\t\r\n \t\r\n \t}", "private RShape loadNewShape() {\n // Get a list of all SVG files in the BUFFER_ACC_PATH folder\n File dir = new File(BUFFER_ACC_PATH);\n String[] listing = dir.list(new FilenameFilter() {\n public boolean accept(File file, String filename) {\n return filename.endsWith(\"svg\");\n }\n });\n \n availableFiles = listing.length;\n\n // Load the first SVG file from the list\n if (listing != null && listing.length > 0) {\n currentFileName = listing[currentFileIndex];\n System.out.println(\"loading \" + currentFileName);\n RShape shape = RG.loadShape(BUFFER_ACC_PATH + currentFileName);\n shape.scale(svgScale, shape.getCenter());\n print(shape, \"loaded: \");\n return shape;\n }\n\n return null;\n }", "private void LoadContent() {\n\t\ttry { // Récupération de la police d'écriture\n\t\t\tfont1 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/Coalition.ttf\"));\n\t\t\tfont2 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/13_Misa.ttf\"));\n\t\t} catch (final Exception err) {\n\t\t\tSystem.err.println(\"Police(s) d'écriture introuvable(s) !\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void loadDataFromFile() {\n startX = 0;\n startY = 540;\n\n }", "public void drawImage(GraphicsContext gc, String path, int xPos, int yPos)\n {\n gc.drawImage(new Image(getClass().getResourceAsStream(path)), xPos, yPos);\n }", "public void draw(){\n\t\tString filename = \"images/\" + this.imgFileName;\n\t\tStdDraw.picture(this.xxPos, this.yyPos, filename);\n\t}", "private void openFile(File file)\n {\n String imagePath = file.toURI().toString();\n Image image = new Image(imagePath);\n if ( image == null || image.isError())\n {\n showInvalidFileFormatError();\n } else\n {\n bufferImage = image;\n changeAvatarCircle.setFill(new ImagePattern(image));\n imagePathLabel.setText(imagePath);\n }\n }", "public void parseFile(String fileName) {\n Matrix m = new Matrix(); \n imp.doPaint(m);\n System.out.println(fileName + \", format is PNG.\");\n }", "void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}", "private void loadGameFiles(){\n\t}", "private void loadGame(String fileName){\n\n }", "public void showDraw(){\n\t\tdraw = new Document( drawFilePath);\n\t}", "public void readFromFile(String mapName, JTextField tR, JTextField oR) {\r\n\t\tint space1 = 0, space2 = 0;\r\n\t\tint count = 0;\r\n\r\n\t\ttry {\r\n\t\t\tFileInputStream fstream = new FileInputStream(mapName);\r\n\t\t\tDataInputStream in = new DataInputStream(fstream);\r\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n\t\t\tString strLine;\r\n\t\t\tsavingList.clear();\r\n\t\t\tdrawList.clear();\r\n\t\t\tdrawXList.clear();\r\n\t\t\tdrawYList.clear();\r\n\r\n\t\t\tstrLine = br.readLine();\r\n\t\t\tfor (int j = 0; j < strLine.length(); j++) {\r\n\t\t\t\tif (strLine.charAt(j) == ' ') {\r\n\t\t\t\t\ttR.setText(strLine.substring(0, j));\r\n\t\t\t\t\toR.setText(strLine.substring(j + 1, strLine.length()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\twhile ((strLine = br.readLine()) != null) {\r\n\t\t\t\tfor (int i = 0; i < strLine.length(); i++) {\r\n\t\t\t\t\tif (strLine.charAt(i) == ' ' && count == 0) {\r\n\t\t\t\t\t\tspace1 = i;\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (strLine.charAt(i) == ' ' && count == 1)\r\n\t\t\t\t\t\tspace2 = i;\r\n\t\t\t\t}\r\n\t\t\t\tiii = new ImageIcon(this.getClass().getResource(\r\n\t\t\t\t\t\tstrLine.substring(0, space1)));\r\n\t\t\t\tsavingList.add(strLine.substring(0, space1));\r\n\t\t\t\tImage im = iii.getImage();\r\n\t\t\t\tint x = Integer.parseInt(strLine.substring(space1 + 1, space2))\r\n\t\t\t\t\t\t- im.getWidth(null) / 2;\r\n\t\t\t\tint y = Integer.parseInt(strLine.substring(space2 + 1,\r\n\t\t\t\t\t\tstrLine.length()))\r\n\t\t\t\t\t\t- im.getHeight(null) / 2;\r\n\t\t\t\tdrawXList.add(x);\r\n\t\t\t\tdrawYList.add(y);\r\n\t\t\t\tdrawList.add(iii.getImage());\r\n\t\t\t\tcount = 0;\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\t\t\trepaint();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "public void loadFile()\n {\n\n FileDialog fd = null; //no value\n fd = new FileDialog(fd , \"Pick up a bubble file: \" , FileDialog.LOAD); //create popup menu \n fd.setVisible(true); // make visible manu\n String directory = fd.getDirectory(); // give the location of file\n String name = fd.getFile(); // give us what file is it\n String fullName = directory + name; //put together in one sting \n \n File rideNameFile = new File(fullName); //open new file with above directory and name\n \n Scanner nameReader = null;\n //when I try to pick up it read as scanner what I choose\n try\n {\n nameReader = new Scanner(rideNameFile);\n }\n catch (FileNotFoundException fnfe)//if dont find return this message below\n {\n return; // immedaitely exit from here\n }\n \n //if load button pressed, it remove all ride lines in the world\n if(load.getFound()){\n removeAllLines();\n } \n \n //read until is no more stings inside of file and until fullfill max rides\n while(nameReader.hasNextLine()&&currentRide<MAX_RIDES)\n {\n \n String rd= nameReader.nextLine();//hold and read string with name of ride\n RideLines nova =new RideLines(rd);\n rides[currentRide]=nova;\n \n //Create a RideLine with string given from file\n addObject(rides[currentRide++], 650, 20 + 40*currentRide);\n }\n \n //when is no more strings inside it close reader\n nameReader.close();\n }", "private void setImage() throws FileNotFoundException {\n\t\timage = new Image(new FileInputStream(path));\n\t}", "public void loadImage() {\n\t\ttry {\n\t\t\tcurrImage = ImageIO.read(new File(INPUT_DIR,fileNames.get(fileCounter)));\n\t\t\tcurrImageOrigDim = new Dimension(currImage.getWidth(), currImage.getHeight());\n\t\t\tlabel4.setText(\"Processing: \" + fileNames.get(fileCounter));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// Resize to Frame\n\t\tdouble imgHt = currImage.getHeight();\n\t\tdouble imgWt = currImage.getWidth();\n\t\tdouble wRatio = FRAME_SIZE/imgWt;\n\t\tdouble hRatio = FRAME_SIZE/imgHt;\n\t\taspectR = Math.min(wRatio,hRatio);\n\t\tcurrImage = getScaledInstance(currImage, (int)(aspectR*imgWt), (int)(aspectR*imgHt));\n\t\tcurrImageBounds = new Rectangle(0, 0, currImage.getWidth(), currImage.getHeight());\n\t\trepaint();\n\t}", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "public void createGraphFromFile() {\n\t\t//如果图未初始化\n\t\tif(graph==null)\n\t\t{\n\t\t\tFileGetter fileGetter= new FileGetter();\n\t\t\ttry(BufferedReader bufferedReader=new BufferedReader(new FileReader(fileGetter.readFileFromClasspath())))\n\t\t\t{\n\t\t\t\tString line = null;\n\t\t\t\twhile((line=bufferedReader.readLine())!=null)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t\t//create the graph from file\n\t\t\t\tgraph = new Graph();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "static void loadPgm() {\n String file;\n try {\n // Prompt for pgm\n System.out.print(\"Enter terrain file: \"); file = scan.nextLine();\n // Read pgm\n pgmInf = new PgmImageInfo( file );\n // More Interaction\n System.out.printf(\"Read terrain file: %d by %d, \", pgmInf.width, pgmInf.height );\n System.out.printf(\"height ranges from %d to %d.\\n\", 0, pgmInf.maxValue);\n }\n catch (Exception e) {\n System.out.println(\"readPgmFile: failed to read file! Error!: \" + e.getLocalizedMessage());\n loadPgm();\n }\n }", "public BufferedImage open() {\n\t\tJFileChooser choose = new JFileChooser(); //Removed path from the chooser!\n\n\t\tif (choose.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)\n\t\t\treturn null;\n\t\tString file = choose.getSelectedFile().getAbsolutePath();\n\t\ttry {\n\t\t\tthis.x = 0;\n\t\t\tthis.y = 0;\n\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\tString iden = \"\";\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\t\n\t\t\tif (iden.compareTo(\"PPL\") != 0)\treturn null;\n\t\t\tbyte by = ois.readByte();\n\t\t\tSystem.out.println(by);\n\t\t\t\n\t\t\tswitch (by) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.image = loadRGB(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.image = loadCMY(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.image = loadGS(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.image = loadBW(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.image = loadLT(ois);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tois.close();\n\t\t\t//int b = ois.readByte(); //lee 8 bits, lee -16, y no 240\n\t\t\t//si el bit mas significativo del byte antes de introducirse fue 1, el numero leido se interpreta como negativo\n\t\t\t//if(b < 0) b += 256; //para leer bytes sin signo\n\t\t\t//int i = ois.readInt(); //lee 32 bits, lee 3500\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn image;\n\t}", "private void setImage() {\r\n\t\ttry{\r\n\r\n\t\t\twinMessage = ImageIO.read(new File(\"obstacles/win.gif\"));\r\n\t\t\tcoin = ImageIO.read(new File(\"obstacles/Coin.gif\"));\r\n\t\t\toverMessage = ImageIO.read(new File(\"obstacles/over.gif\"));\r\n\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.err.println(\"Image file not found\");\r\n\t\t}\r\n\r\n\t}", "private void initLowLevelGraphics(RandomAccessStream out, int width,\n\t\t\tint height) throws IOException {\n\t\tout.setLength(0);\n\t\tobjects = new ArrayList();\n\t\tmeta = new PlaceableMetaHeader();\n\t\thead = new WindowsMetaHeader();\n\t\t/* unsigned char s[]= { 0xD7, 0xCD, 0xC6, 0x9A}; */\n\t\t/* Aldus Placeable file data */\n\t\tmeta.Key = (0x9AC6CDD7); /* Always this value */\n\t\tmeta.Handle = (0); /* always 0 */\n\t\tmeta.Left = 0; /* coordinate in twips (1/1440 inc) */\n\t\tmeta.Top = 0;\n\t\tmeta.Right = width;\n\t\tmeta.Bottom = height;\n\t\tmeta.Inch = (1440); /* metafile units per inch */\n\t\tmeta.Reserved = (0);\n\t\tmeta.Checksum = (0);\n\t\t/* Plain Metafile part */\n\t\thead.FileType = (1);\n\t\thead.HeaderSize = (9);\n\t\thead.Version = (0x0300);\n\t\thead.FileSize = (9);\n\t\thead.NumOfObjects = (0);\n\t\thead.MaxRecordSize = (0);\n\t\thead.NumOfParams = (0);\n\t\t/* administrative part */\n\t\tthis.out = out;\n\t\t// NOTE : create the object table.\n\n\t\t/* Ok. Now, we write the header */\n\t\twriteHEADER();\n\t\t/* Good. Now, commands can be written to the file */\n\t}", "public void openFile()\n { \n JFileChooser chooser = new JFileChooser();\n chooser.setCurrentDirectory(new File(\".\"));\n \n chooser.setFileFilter(new\n javax.swing.filechooser.FileFilter()\n { \n public boolean accept(File f)\n { \n String name = f.getName().toLowerCase();\n return name.endsWith(\".gif\") || name.endsWith(\".jpg\") || name.endsWith(\".jpeg\")\n || f.isDirectory();\n }\n public String getDescription() { return \"Image files\"; }\n });\n\n int r = chooser.showOpenDialog(this);\n if(r != JFileChooser.APPROVE_OPTION) return;\n\n try\n {\n image = ImageIO.read(chooser.getSelectedFile());\n }\n catch (IOException e)\n {\n JOptionPane.showMessageDialog(this, e);\n }\n repaint();\n }", "public void draw(){\n\t\t/* Stamps a copy of the planet at the position. the file of the planet image is under folder of \"images\".\n\t\t * a mistake easily to be ignored here..*/\n\t\tString imageToDraw = \"images/\" + imgFileName;\n\t\tStdDraw.picture(xxPos, yyPos, imageToDraw);\n\n\t}", "public void paintComponent(Graphics g)\n{\n \n int X1,Y1,X2,Y2,X3,Y3,X4,Y4;\n\n int peso=1; // fattore di moltiplicazione per la dimensione delle aule\n int d; // distanza del bordo interno al rettangolo\n int dx; // distanza dal bordo asse x\n int dy; // distanza dal bordo asse y\n Color myColor;\n String strPiano;\n \n super.paintComponent(g);\n \n System.out.println(\"--------------------------\");\n System.out.println(\"AulaPanel: Entro in paintCompoment() \");\n \n /* \n *** disegna l'immagine di background con la planimetria dell'aula scelta\n */\n String strFilePlan = \"plan/\" + this.myAula.getNome()+ \".jpg\";\n System.out.println(\"leggo il file \"+ strFilePlan);\n \n //ClassLoader classloader = Thread.currentThread().getContextClassLoader();\n // ClassLoader classloader = Thread.currentThread().getContextClassLoader(); \n \n // File filePlan = new File (classloader.getResource(strFilePlan).getFile()); \n ClassLoader classloader = Thread.currentThread().getContextClassLoader(); \n \n InputStream filePlan = classloader.getResourceAsStream(strFilePlan);\n \n // File filePlan = new File (getClass().getClassLoader().getResource (strFilePlan).getFile()); \n \n // File filePlan = new File(strFilePlan);\n \n System.out.println(\"leggo il file della planimetria \"+ strFilePlan);\n \n \n /* \n *** disegna l'immagine di background con la immagine dell'aula scelta\n */\n String strFileImg = \"img/\" + this.myAula.getNome()+ \".jpg\";\n System.out.println(\"leggo il file \"+ strFileImg);\n \n\n // File fileImg = new File (getClass().getClassLoader().getResource (strFileImg).getFile());\n // File fileImg = new File (classloader.getResource(strFileImg).getFile()); \n InputStream fileImg = classloader.getResourceAsStream(strFileImg);\n \n // File fileImg = new File(strFileImg);\n \n System.out.println(\"leggo il file della immagine \"+ strFileImg);\n \n /* \n *** disegna l'immagine di background con la immagine dell'aula scelta\n */\n String strFileDati = \"dati/\" + this.myAula.getNome()+ \".jpg\";\n System.out.println(\"leggo il file \"+ strFileDati);\n \n // File fileDati = new File (classloader.getResource(strFileDati).getFile()); \n \n // File fileDati = new File (getClass().getClassLoader().getResource (strFileDati).getFile());\n \n // File fileDati = new File(strFileDati);\n \n InputStream fileDati = classloader.getResourceAsStream(strFileDati);\n \n System.out.println(\"leggo il file dati \"+ strFileDati);\n \n try\n { \n imgPlan=ImageIO.read(filePlan); \n imgImg=ImageIO.read(fileImg);\n imgDati=ImageIO.read(fileDati);\n \n int imgWPlan = imgPlan.getWidth(this);\n int imgHPlan = imgPlan .getHeight(this);\n \n int imgWImg = imgImg.getWidth(this);\n int imgHImg = imgImg.getHeight(this);\n \n int imgWDati = imgDati.getWidth(this);\n int imgHDati = imgDati.getHeight(this);\n \n System.out.println(\"image Plan Width= \"+ imgWPlan + \" Heigth=\"+imgHPlan);\n System.out.println(\"image Img Width= \"+ imgWImg + \" Heigth=\"+imgHImg);\n System.out.println(\"image Dati Width= \"+ imgWDati + \" Heigth=\"+imgHDati);\n \n this.setLayout(new BorderLayout());\n \n // g.drawImage(img, x, y, width, heigth, this); \n g.drawImage(imgPlan, 100, 0, 300, 300, this); \n g.drawImage(imgImg, 500, 0, 300, 300, this); \n g.drawImage(imgDati, 500, 400, 300, 300, this); \n System.out.println(\"dopo draw image\");\n }\n catch(IOException e)\n {\n imgPlan = null;\n imgImg = null;\n System.out.println(\"exception image\");\n }\n\n// disegna e colora l'aula indicata con i dati sonori\n \n g.setColor(Color.black); \n \n Polygon po = new Polygon();\n Polygon pc = new Polygon();\n \n dx = 200;\n dy = 200;\n int x1 = 100;\n int y1 = 400;\n \n X1 = x1;\n Y1 = y1;\n X2 = x1 + dx;\n Y2 = Y1;\n X3 = X2;\n Y3 = Y1+dy;\n X4 = X1;\n Y4 = Y3;\n \n po.addPoint(X1, Y1);\n po.addPoint(X2, Y2);\n po.addPoint(X3, Y3);\n po.addPoint(X4, Y4);\n \n // scrive il nome dell'aula\n g.setColor(Color.black);\n g.drawString(\"Aula:\"+this.myAula.getNome(),X1,Y1-5);\n String sPiano = \"piano:\" + Integer.valueOf(this.myAula.getPiano());\n g.drawString(sPiano,X1+150,Y1-5);\n \n// disegna il rettangolo esterno \n\n /* \n *** settaggio colore in base al tempo di riverbero\n */\n myColor = this.myAula.getColoreTr();\n g.setColor(myColor);\n g.fillPolygon(po);\n \n // disegna il rettangolo centrale \n \n d= (X2-X1) * 20 /100; // bordo interno del 20% \n \n if (X1 == X4) // aula dritta \n { \n pc.addPoint(X1+d, Y1+d);\n pc.addPoint(X2-d, Y2+d);\n pc.addPoint(X3-d, Y3-d);\n pc.addPoint(X4+d, Y4-d);\n }\n else // aula storta\n { \n pc.addPoint(X1+d/4, Y1+d+d/3);\n pc.addPoint(X2-d, Y2+d/2);\n pc.addPoint(X3, Y3-d);\n pc.addPoint(X4+d, Y4-d/2);\n }\n \n /* \n *** settaggio colore in base ai decibel\n */ \n myColor = this.myAula.getColoreDb();\n \n g.setColor(myColor);\n g.fillPolygon(pc);\n \n // disegna i bordi esterni dell'aula\n g.setColor(Color.black);\n g.drawPolygon(po);\n \n // disegna i bordi interni dell'aula\n \n g.setColor(Color.black);\n g.drawPolygon(pc);\n // scrive i dati sui decibel sonori al centro\n g.drawString(\"Decibel:\" + this.myAula.getDb(),X1+40,Y1+40);\n \n // scrive i dati sul tempo di riverbero al bordo\n g.drawString(\"T.Riverbero:\" + this.myAula.getTr(),X1+10,Y1+15); \n \n \n System.out.println(\"Esco da paintCompoment() \"); \n System.out.println(\"--------------------------\");\n }", "public void openGraph(String dirName, String fileName) {\r\n try {\r\n ObjectInputStream in = new ObjectInputStream(new FileInputStream(dirName + fileName));\r\n\r\n /* Type of the graph */\r\n int type = in.readInt();\r\n\r\n /* Graph */\r\n switch (type) {\r\n case GRAPH_UNORIENTED:\r\n this.graph = (GraphUnoriented) in.readObject();\r\n break;\r\n case GRAPH_ORIENTED:\r\n this.graph = (GraphOriented) in.readObject();\r\n break;\r\n }\r\n this.graphX = (GraphX) in.readObject();\r\n\r\n /* Scroll Rectangle */\r\n this.scrollRectangle = (Rectangle) in.readObject();\r\n\r\n in.close();\r\n\r\n repaintGraph();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n } catch (ClassNotFoundException e) {\r\n System.out.println(e);\r\n }\r\n\r\n indexTool = SELECT_TOOL;\r\n }", "private void loadGraphics() {\n\t\ttopAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024);\r\n\t\ttopRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(topAtlas, activity, \"pizza_top.png\", 0, 0);\r\n\t\ttopAtlas.load();\r\n\t\t\r\n\t\t\r\n\t\tbottomAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024);\r\n\t\tbottomRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(bottomAtlas, activity, \"pizza_bottom.png\", 0, 0);\r\n\t\tbottomAtlas.load();\t\r\n\t\t\t\t\t\t\r\n\t\t\r\n\t\tbalanceAtlas = new BuildableBitmapTextureAtlas(engine.getTextureManager(), 1024, 512);\r\n\t\trod = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"baserod.png\");\r\n\t\tbase = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"balancebase.png\");\r\n\t\tbalanceRod = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"balancerod.png\");\r\n\t\tchain = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"chain.png\");\r\n\t\tpan = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"pan.png\");\r\n\t\tok = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"OK.png\");\r\n\t\twinner = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"winner.png\");\r\n\t\ticon = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"icon.png\");\r\n\t\t\r\n\t\tweight = BitmapTextureAtlasTextureRegionFactory.createFromAsset(balanceAtlas, activity, \"w.png\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tbalanceAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 1));\r\n\t\t} catch (TextureAtlasBuilderException e) {\r\n\t\t\tLog.e(\"PLAYSCENE\", \"ERROR BUILDING BALANCEATLAS\");\r\n\t\t}\r\n\t\tbalanceAtlas.load();\r\n\t\t\r\n\t}", "public Bitmap LoadFromFile(String _fullFilename) {\n\t //if (bmp != null) { bmp.recycle(); }\n\t BitmapFactory.Options bo = new BitmapFactory.Options();\t\t\n\t\t\n\t if( bo == null ) return null;\n\t \n\t if( controls.GetDensityAssets() > 0 )\n\t bo.inDensity = controls.GetDensityAssets();\n\t \n\t return BitmapFactory.decodeFile(_fullFilename, bo);\n }", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException 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}\n\t}", "public void loadFile(File file1){\n\n\t\ttry{\n\t\t\tFileReader reader = new FileReader(file1);\n\t\t\tBufferedReader BR = new BufferedReader(reader);\n\n fname = file1.getName();\n pathname = file1.getParent();\n\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"error\");\n\t\t}\n\n\n repaint();\n\n\t}", "private void drawImages() {\n\t\t\r\n\t}", "private void graphicsLoader() {\n\t\tff2Logo = new Texture(Gdx.files.internal(uiName + \"/ff2logo.png\"));\n\t\tff2LogoHit = new Texture(Gdx.files.internal(uiName + \"/ff2logohit.png\"));\n\t\tplayerword = new Texture(Gdx.files.internal(uiName + \"/playerword.png\"));\n\t\tplayerwordHit = new Texture(Gdx.files.internal(uiName + \"/playerwordhit.png\"));\n\t\tturretword = new Texture(Gdx.files.internal(uiName + \"/turretword.png\"));\n\t\tturretwordHit = new Texture(Gdx.files.internal(uiName + \"/turretwordhit.png\"));\n\t\tfenceword = new Texture(Gdx.files.internal(uiName + \"/fenceword.png\"));\n\t\tfencewordHit = new Texture(Gdx.files.internal(uiName + \"/fencewordhit.png\"));\n\t\tbarrierword = new Texture(Gdx.files.internal(uiName + \"/barrierword.png\"));\n\t\tbarrierwordHit = new Texture(Gdx.files.internal(uiName + \"/barrierwordhit.png\"));\n\t\tgatewayword = new Texture(Gdx.files.internal(uiName + \"/gatewayword.png\"));\n\t\tgatewaywordHit = new Texture(Gdx.files.internal(uiName + \"/gatewaywordhit.png\"));\n\t\tpowerupword = new Texture(Gdx.files.internal(uiName + \"/powerupword.png\"));\n\t\tpowerupwordHit = new Texture(Gdx.files.internal(uiName + \"/powerupwordhit.png\"));\n\t\tswitchword = new Texture(Gdx.files.internal(uiName + \"/switchword.png\"));\n\t\tswitchwordHit = new Texture(Gdx.files.internal(uiName + \"/switchwordhit.png\"));\n\t\tenemyfighterword = new Texture(Gdx.files.internal(uiName + \"/enemyfighterword.png\"));\n\t\tenemyfighterwordHit = new Texture(Gdx.files.internal(uiName + \"/enemyfighterwordhit.png\"));\n\t\tmineword = new Texture(Gdx.files.internal(uiName + \"/mineword.png\"));\n\t\tminewordHit = new Texture(Gdx.files.internal(uiName + \"/minewordhit.png\"));\n\t\tpushblockword = new Texture(Gdx.files.internal(uiName + \"/pushblockword.png\"));\n\t\tpushblockwordHit = new Texture(Gdx.files.internal(uiName + \"/pushblockwordhit.png\"));\n\t\tbombupword = new Texture(Gdx.files.internal(uiName + \"/bombupword.png\"));\n\t\tbombupwordHit = new Texture(Gdx.files.internal(uiName + \"/bombupwordhit.png\"));\n\t\t\n\t\t// ui\n\t\tsoundonbutton = new Texture(Gdx.files.internal(uiName + \"/soundon.png\"));\n\t\tsoundoffbutton = new Texture(Gdx.files.internal(uiName + \"/soundoff.png\"));\n\t\tcreatebutton = new Texture(Gdx.files.internal(uiName + \"/createbutton.png\"));\n\t\tnocreatebutton = new Texture(Gdx.files.internal(uiName + \"/nocreatebutton.png\"));\n\t\tloaderTexture = new Texture(Gdx.files.internal(uiName + \"/ff2loader.png\"));\n\t\tgameOverTexture = new Texture(Gdx.files.internal(uiName + \"/gameover.png\"));\n\t\tnextFieldTexture = new Texture(Gdx.files.internal(uiName + \"/nextfield.png\"));\n\t\t\n\t\tmenubutton = new Texture(Gdx.files.internal(uiName + \"/menubutton.png\"));\n\t\tnomenubutton = new Texture(Gdx.files.internal(uiName + \"/nomenubutton.png\"));\n\t\tdiffEasyButton = new Texture(Gdx.files.internal(uiName + \"/diffeasybutton.png\"));\n\t\tdiffNormButton = new Texture(Gdx.files.internal(uiName + \"/diffnormbutton.png\"));\n\t\tdiffHardButton = new Texture(Gdx.files.internal(uiName + \"/diffhardbutton.png\"));\n\t\tosdButton = new Texture(Gdx.files.internal(uiName + \"/osdbutton.png\"));\n\t\t\n\t\texoFFfont = new BitmapFont(Gdx.files.internal(uiName + \"/font/exo-ff.fnt\"), true);\n\t\t\n\t\t// creator\n\t\texitbutton = new Texture(Gdx.files.internal(creatorName + \"/exitbutton.png\"));\n\t\tfilebutton = new Texture(Gdx.files.internal(creatorName + \"/filebutton.png\"));\n\t\ttoolsbutton = new Texture(Gdx.files.internal(creatorName + \"/toolsbutton.png\"));\n\t\tnextbutton = new Texture(Gdx.files.internal(creatorName + \"/nextbutton.png\"));\n\t\tprevbutton = new Texture(Gdx.files.internal(creatorName + \"/prevbutton.png\"));\n\t\tdeletebutton = new Texture(Gdx.files.internal(creatorName + \"/deletebutton.png\"));\n\t\tyesbutton = new Texture(Gdx.files.internal(creatorName + \"/yesbutton.png\"));\n\t\tnobutton = new Texture(Gdx.files.internal(creatorName + \"/nobutton.png\"));\n\t\tbuildbutton = new Texture(Gdx.files.internal(creatorName + \"/buildbutton.png\"));\n\t\tprocbutton = new Texture(Gdx.files.internal(creatorName + \"/procbutton.png\"));\n\t\trandbutton = new Texture(Gdx.files.internal(creatorName + \"/randbutton.png\"));\n\t\tgroupsbutton = new Texture(Gdx.files.internal(creatorName + \"/groupsbutton.png\"));\n\t\tarenabutton = new Texture(Gdx.files.internal(creatorName + \"/arenabutton.png\"));\n\t\tfileExitButton = new Texture(Gdx.files.internal(creatorName + \"/fileexitbutton.png\"));\n\t\tfileLoadButton = new Texture(Gdx.files.internal(creatorName + \"/loadbutton.png\"));\n\t\tfileSaveButton = new Texture(Gdx.files.internal(creatorName + \"/savebutton.png\"));\n\t\tfilePlayButton = new Texture(Gdx.files.internal(creatorName + \"/playbutton.png\"));\n\t\tfileNoPlayButton = new Texture(Gdx.files.internal(creatorName + \"/noplaybutton.png\"));\n\t\tfileSendButton = new Texture(Gdx.files.internal(creatorName + \"/sendbutton.png\"));\n\t\ttoasterBack = new Texture(Gdx.files.internal(creatorName + \"/toasterback.png\"));\n\t\twindowBack = new Texture(Gdx.files.internal(creatorName + \"/windowback.png\"));\n\t\temptyCellTexture = new Texture(Gdx.files.internal(creatorName + \"/emptycell.png\"));\n\t\tcreateSplashTexture = new Texture(Gdx.files.internal(creatorName + \"/createsplash.png\"));\n\t\t\n\t\tplayerDef = new Texture(Gdx.files.internal(creatorName + \"/player_def.png\"));\n\t\tgatewayDef = new Texture(Gdx.files.internal(creatorName + \"/gateway_def.png\"));\n\t\tpowerupDef = new Texture(Gdx.files.internal(creatorName + \"/powerup_def.png\"));\n\t\tbombupDef = new Texture(Gdx.files.internal(creatorName + \"/bombup_def.png\"));\n\t\tswitchDef = new Texture(Gdx.files.internal(creatorName + \"/switch_def.png\"));\n\t\tscaffoldDef = new Texture(Gdx.files.internal(creatorName + \"/scaffold_def.png\"));\n\t\tbarrierDef = new Texture(Gdx.files.internal(creatorName + \"/barrier_def.png\"));\n\t\tfenceDef = new Texture(Gdx.files.internal(creatorName + \"/fence_def.png\"));\n\t\tturretDef = new Texture(Gdx.files.internal(creatorName + \"/turret_def.png\"));\n\t\tenemyDef = new Texture(Gdx.files.internal(creatorName + \"/enemy_def.png\"));\n\t\tmineDef = new Texture(Gdx.files.internal(creatorName + \"/mine_def.png\"));\n\t\tpushblockDef = new Texture(Gdx.files.internal(creatorName + \"/pushblock_def.png\"));\n\t\thangerDef = new Texture(Gdx.files.internal(creatorName + \"/hanger_def.png\"));\n\t\t\n\t\tdeleteDef = new Texture(Gdx.files.internal(creatorName + \"/delete_def.png\"));\n\t\tdeleteSel = new Texture(Gdx.files.internal(creatorName + \"/delete_sel.png\"));\n\t\tlockUnlock = new Texture(Gdx.files.internal(creatorName + \"/lock_unlock.png\"));\n\t\tlockLock = new Texture(Gdx.files.internal(creatorName + \"/lock_lock.png\"));\n\t\ttoolSelect = new Texture(Gdx.files.internal(creatorName + \"/toolselect.png\"));\n\t\t\n\t\t// game stuff\n\t\tplayerShipTexture = new Texture(Gdx.files.internal(gameName + \"/player2ship.png\"));\n\t\tplayerShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shippowerup.png\"));\n\t\tplayerShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/player2shipbombup.png\"));\n\t\tenemyShipTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2ship.png\"));\n\t\tenemyShipPowerupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shippowerup.png\"));\n\t\tenemyShipBombupTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipbombup.png\"));\n\t\tenemyShipOrderedTexture = new Texture(Gdx.files.internal(gameName + \"/enemy2shipordered.png\"));\n\t\tplayerBulletTexture = new Texture(Gdx.files.internal(gameName + \"/playerlaser.png\"));\n\t\tplayerCableTexture = new Texture(Gdx.files.internal(gameName + \"/playercable.png\"));\n\t\tenemyBulletTexture = new Texture(Gdx.files.internal(gameName + \"/enemylaser.png\"));\n\t\tenemyCableTexture = new Texture(Gdx.files.internal(gameName + \"/enemycable.png\"));\n\t\tbombCableTexture = new Texture(Gdx.files.internal(gameName + \"/bombcable.png\"));\n\t\tturretTexture = new Texture(Gdx.files.internal(gameName + \"/turret.png\"));\n\t\tturrethitTexture = new Texture(Gdx.files.internal(gameName + \"/turrethit.png\"));\t\n\t\tfenceTexture = new Texture(Gdx.files.internal(gameName + \"/fence.png\"));\n\t\tfencehitTexture = new Texture(Gdx.files.internal(gameName + \"/fencehit.png\"));\n\t\tbarrierTexture = new Texture(Gdx.files.internal(gameName + \"/barrier.png\"));\n\t\tbarrierhitTexture = new Texture(Gdx.files.internal(gameName + \"/barrierhit.png\"));\n\t\tgatewayonTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayon.png\"));\n\t\tgatewayoffTexture = new Texture(Gdx.files.internal(gameName + \"/gatewayoff.png\"));\n\t\tpowerupTexture = new Texture(Gdx.files.internal(gameName + \"/powerup.png\"));\n\t\tbombupTexture = new Texture(Gdx.files.internal(gameName + \"/bombup.png\"));\n\t\tbombupCharge = new Texture(Gdx.files.internal(gameName + \"/bombupcharge.png\"));\n\t\texplosion = new Texture(Gdx.files.internal(gameName + \"/explosion.png\"));\n\t\tdeath = new Texture(Gdx.files.internal(gameName + \"/death.png\"));\n\t\tpowerupCharge = new Texture(Gdx.files.internal(gameName + \"/powerupcharge.png\"));\n\t\tswitchonTexture = new Texture(Gdx.files.internal(gameName + \"/switchon.png\"));\n\t\tswitchoffTexture = new Texture(Gdx.files.internal(gameName + \"/switchoff.png\"));\n\t\tscaffoldTexture = new Texture(Gdx.files.internal(gameName + \"/scaffold.png\"));\n\t\tmineTexture = new Texture(Gdx.files.internal(gameName + \"/mine.png\"));\n\t\tminehitTexture = new Texture(Gdx.files.internal(gameName + \"/minehit.png\"));\n\t\tmineDebrisTexture = new Texture(Gdx.files.internal(gameName + \"/minedebris.png\"));\n\t\tpushblockTexture = new Texture(Gdx.files.internal(gameName + \"/pushblock.png\"));\n\t\thangerTexture = new Texture(Gdx.files.internal(gameName + \"/hanger.png\"));\n\t\thangerhitTexture = new Texture(Gdx.files.internal(gameName + \"/hangerhit.png\"));\n\t\t// have a catch here for the loaded=true?\n\t\tloaded = true;\n\t}", "public void loadContent(){\n\t\tspriteBatch = new SpriteBatch(getGraphicsDevice());\n\t\t//TODO: put content loading code here\n\t\t\n\t}", "public static void load(FileIO fileIO) \r\n\t{\n\t\t\r\n\t}", "public void loadShow(File f) {\n \n }", "public abstract void createSprites() throws FileNotFoundException;", "public void loadGraph() {\n System.out.println(\"The overlay graph will be loaded from an external file\");\n try(FileInputStream fis = new FileInputStream(graphPath + OVERLAY_GRAPH);\n ObjectInputStream ois = new ObjectInputStream(fis))\n {\n graph = (MatrixOverlayGraph) ois.readObject();\n System.out.println(\"Overlay graph loaded\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n loadSupporters();\n }", "private void renderUI()\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile image = new File(BASE_DIREC + \"foreground.png\");\n\t\t\tforeground = ImageResizer.resizeImage(ImageIO.read(image), scale * BASE_SCALE);\n\t\t}\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t// System.err.println(ioe);\n\t\t\t// Oh well\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\tFile image = new File(BASE_DIREC + \"continue.png\");\n\t\t\tcontinueImage = ImageResizer.resizeImage(ImageIO.read(image), scale * BASE_SCALE);\n\t\t}\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t// System.err.println(ioe);\n\t\t\t// Oh well\n\t\t}\n\t}", "public static void load() {\n\t\tspritesheet = new Spritesheet(\"src/de/kaffeeliebhaber/assets/pyxel/voland_spritesheet_new.png\", 32, 32);\n\t\tspritesheet.load();\n\t\t\n\t\t// load player\n\t\tAssetsLoader.loadPlayerAssets();\n\t\t\n\t\t// load crate\n\t\tAssetsLoader.loadCrates();\n\t\t\n\t\t// load item spritesheet \n\t\tspritesheetInventory = new Spritesheet(Config.ITEM_SPRITESHEET, Config.ITEM_SIZE, Config.ITEM_SIZE);\n\t\tspritesheetInventory.load();\n\t\t\n\t\t// load font \n\t\tloadFonts();\n\t\t\n\t\t// ui\n\t\timageUI = ImageLoader.loadImage(\"src/de/kaffeeliebhaber/assets/ui/ui.png\");\n\t\t\n\t\tAssetsLoader.loadInfoPaneAssets();\n\t\t\n\t\t// npc\n\t\tspritesheetNPC = new Spritesheet(\"src/de/kaffeeliebhaber/assets/AH_SpriteSheet_People1.png\", 16, 16);\n\t\tspritesheetNPC.load();\n\t\t\n\t\t// fox\n\t\tspritesheetNPCFox = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/72c68863962b7a6b5a9f5f5bcc5afb16.png\", 32, 32);\n\t\tspritesheetNPCFox.load();\n\n\t\t// *** LOAD NPCs\n\t\tAssetsLoader.loadFoxAssets();\n\t\t\n\t\tAssetsLoader.loadNPCs();\n\t\t\n\t\tspritesheetFemale = new Spritesheet(\"src/de/kaffeeliebhaber/assets/imgs/Female 01-1.png\", 32, 32);\n\t\tspritesheetFemale.load();\n\t}", "public static void loadImages(){\n\t\tsetPath(main.getShop().inventory.getEquipID());\n\t\ttry {\n\t\t\tbackground = ImageIO.read(new File(\"res/world/bg.png\"));\n\t\t\tterrain = ImageIO.read(new File(\"res/world/solids.png\"));\n\t\t\t// Character and Armour\n\t\t\tcharacters = ImageIO.read(new File(\"res/world/char3.png\"));\n\t\t\tcharactersHead =ImageIO.read(new File(\"res/world/charhead\"+path[0]+\".png\"));\n\t\t\tcharactersTop = ImageIO.read(new File(\"res/world/chartop\"+path[2]+\".png\"));\n\t\t\tcharactersShoulder = ImageIO.read(new File(\"res/world/charshoulders\"+path[3]+\".png\"));\n\t\t\tcharactersHand = ImageIO.read(new File(\"res/world/charhands\"+path[5]+\".png\"));\n\t\t\tcharactersBottom = ImageIO.read(new File(\"res/world/charbottom\"+path[8]+\".png\"));\n\t\t\tcharactersShoes = ImageIO.read(new File(\"res/world/charshoes\"+path[9]+\".png\"));\n\t\t\tcharactersBelt = ImageIO.read(new File(\"res/world/charBelt\"+path[4]+\".png\"));\n\n\t\t\tweaponBow = ImageIO.read(new File(\"res/world/bow.png\"));\n\t\t\tweaponArrow = ImageIO.read(new File(\"res/world/arrow.png\"));\n\t\t\tweaponSword = ImageIO.read(new File(\"res/world/sword.png\"));\n\t\t\titems = ImageIO.read(new File(\"res/world/items.png\"));\n\t\t\tnpc = ImageIO.read(new File(\"res/world/npc.png\"));\n\t\t\thealth = ImageIO.read(new File(\"res/world/health.png\"));\n\t\t\tenemies = ImageIO.read(new File(\"res/world/enemies.png\"));\n\t\t\tcoin = ImageIO.read(new File(\"res/world/coin.png\"));\n\t\t\tmana = ImageIO.read(new File(\"res/world/mana.gif\"));\n\t\t\tarrowP = ImageIO.read(new File(\"res/world/arrowP.png\"));\n\t\t\tbutton = ImageIO.read(new File(\"res/world/button.png\"));\n\t\t\tblood = ImageIO.read(new File(\"res/world/blood.png\"));\n\t\t\tarrowDisp = ImageIO.read(new File(\"res/world/arrowDisp.png\"));\n\t\t\tboss1 = ImageIO.read(new File(\"res/world/boss1.png\"));\n\t\t\tmagic = ImageIO.read(new File(\"res/world/magic.png\"));\n\t\t\tmainMenu = ImageIO.read(new File(\"res/world/MainMenu.png\"));\n\t\t\tinstructions = ImageIO.read(new File(\"res/world/instructions.png\"));\n\t\t\trespawn = ImageIO.read(new File(\"res/world/respawn.png\"));\n\t\t\tinventory = ImageIO.read(new File(\"res/world/inventory.png\"));\n shop = ImageIO.read(new File(\"res/world/shop.png\"));\n dizzy = ImageIO.read(new File(\"res/world/dizzy.png\"));\n pet = ImageIO.read(new File(\"res/world/pet.png\"));\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error Loading Images\");\n\t\t}\n\t}", "public void loadFile() {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tString filename = JOptionPane.showInputDialog(null,\"Enter the filename.\");\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\n\t\t\tMinLFile nminl = new MinLFile(filename);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\n\t\t\t\t\n\t\t\t\tnminl.CodeArea.setText(\"\");\n\t\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tDocument doc = nminl.CodeArea.getDocument();\n\t\t\t\t\ttry {\n\t\t\t\t\tdoc.insertString(doc.getLength(), str, null);\n\t\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\n\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t\t\t\n\t\t\tJComponent panel = nminl;\n\t\t\t\n\t\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\t\tfilename);\t\t\n\t\t\ttabbedPane.setMnemonicAt(0, 0);\n\t\t}\t\n\t}", "public void OpenActionPerformed(ActionEvent evt) { \r\n\r\n //open file from file browser and display the image in the drawing panel\r\n if (jfcOpen.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){\r\n //get selected image file\r\n File fileOpen = jfcOpen.getSelectedFile();\r\n \r\n //get image file path\r\n String fileName = fileOpen.toString();\r\n \r\n //set image path and display image\r\n drawingPanel.setPath(fileName); \r\n }\r\n }", "public void load() {\n\t\tif (jfc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)\n\t\t\tload(jfc.getSelectedFile().getAbsolutePath());\n\t}", "public void processAddImageOverlay() {\n PropertiesManager props = PropertiesManager.getPropertiesManager();\n\n // AND NOW ASK THE USER FOR THE FILE TO OPEN\n FileChooser fc = new FileChooser();\n fc.setInitialDirectory(new File(PATH_WORK));\n fc.setTitle(props.getProperty(LOAD_WORK_TITLE));\n File imageOverlayFile = fc.showOpenDialog(app.getGUI().getWindow());\n \n // SEND THE IMAGE FILE TO DATA MANAGER\n dataManager.setImageOverlayFile(imageOverlayFile);\n \n // CHANGE THE CURSOR\n Scene scene = app.getGUI().getPrimaryScene();\n scene.setCursor(Cursor.CROSSHAIR);\n \n // CHANGE THE STATE\n dataManager.setState(mmmState.ADD_IMAGE_MODE);\n }", "public void loadImage() {\r\n // creates a new image icon with the characters array and the count as a file path\r\n ImageIcon ii = new ImageIcon(game.characters[count]);\r\n // load the image\r\n image = ii.getImage(); \r\n \r\n // sets width\r\n w = image.getWidth(null);\r\n // sets height\r\n h = image.getHeight(null);\r\n }", "public FilePanel(){ \n\n String fileName;\n fileName = \"LongBadData.txt\";\n // try loop to scan file, initialise variables and fill constructor for rectangle\n try { \n Scanner fileScan = new Scanner(new File(fileName));\n boolean bool;\n Color color;\n int fill;\n int colorNum;\n int x1;\n int y1;\n int x2;\n int y2;\n int num;\n // while there are other lines and there are less than the length of Rectangle array, this will execute\n while (fileScan.hasNextLine() && count < drawObjects.length) {\n // initialised variables for format loop\n String inputLine = fileScan.nextLine();\n color = Color.red;\n bool = false;\n // if loop to see if file lines match correct format\n if (inputLine.matches(\"\\\\d+ \\\\d+ \\\\d+ \\\\d+ \\\\d+ \\\\d+\")){\n Scanner scan = new Scanner(inputLine);\n fill = scan.nextInt();\n colorNum = scan.nextInt();\n x1 = scan.nextInt();\n y1 = scan.nextInt();\n x2 = scan.nextInt();\n y2 = scan.nextInt();\n // if loop to check to see if object needs to be filled \n if (fill == 1){\n bool = true;\n } else {\n bool = false;\n }\n // if loop to decide color depending upon colorNum variable\n if (colorNum == 1) {\n color = Color.red;\n } else if (colorNum == 2) {\n color = Color.blue;\n } else if (colorNum == 3) {\n color = Color.green;\n }\n drawObjects[count] = new Rectangle(bool,color, x1, y1,x2,y2);\n count++;\n } \n }\n // catch exception if file isnt fount \n } catch (FileNotFoundException e) {\n System.out.println(\"File not found. Check file name and location.\");\n System.exit(1);\n } \n setPreferredSize(new Dimension(300,300));\n setBackground(Color.yellow); \n }", "protected abstract void loader() throws IOException;", "public void fontLoader(){\n try {\n //create the font to use. Specify the size!\n customFont = Font.createFont(Font.TRUETYPE_FONT, new File(\".\\\\resources\\\\DS-DIGI.ttf\")).deriveFont(40f);\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n ge.registerFont(customFont);\n } catch (IOException e) {\n e.printStackTrace();\n } catch(FontFormatException e) {\n e.printStackTrace();\n }\n }", "public void load()\r\n {\r\n \tfc.setAcceptAllFileFilterUsed(false);\r\n\t\tfc.setDialogTitle(\"Select the text file representing your organism!\");\r\n\t\tfc.setFileFilter(new FileNameExtensionFilter(\"Text Files (Organism)\", new String[]{\"txt\"}));\r\n\t\tif(fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t\t\t//Try-Catch Block\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tbr=new BufferedReader(new FileReader(fc.getSelectedFile()));\r\n\t\t\t\tArrayList<Organism> treeTemp=new ArrayList<Organism>();\r\n\t\t \tString line=br.readLine();\r\n\t\t \tint x=0;\r\n\t\t \twhile(line!=null)\r\n\t\t \t{\r\n\t\t \t\t\tString[] genesSt=line.split(\" \");\r\n\t\t \t\t\tint[] genes=new int[genesSt.length];\r\n\t\t \t\t\tfor(int y=0; y<genesSt.length; y++)\r\n\t\t \t\t\t\tgenes[y]=Integer.parseInt(genesSt[y]);\r\n\t\t \t\t\t\t\r\n\t\t \t\t\ttreeTemp.add(new Organism(genes,x));\r\n\t\t \t\tline=br.readLine();\r\n\t\t \t\tx++;\r\n\t\t \t}\r\n\t\t \tbr.close();\r\n\t\t \te.setTree(treeTemp);\r\n\t\t \te.setParent(treeTemp.get(treeTemp.size()-1));\r\n\t\t\t\trepaint();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(Exception ex)\r\n\t\t\t{\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n }", "protected abstract Image loadImage();", "private void load(File toLoad) {\n\t\tif (toLoad.getName().endsWith(\".ics\")) {\n\t\t\ttry {\n\t\t\t\tthis.calendar = new TCalendar(toLoad);\n\t\t\t\tthis.showWeek(new GregorianCalendar());\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t} catch (CorruptedCalendarFileException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tnew JErrorFrame(\n\t\t\t\t\t\"The file type is incorrect, only .ics files are accepted\");\n\t\t}\n\t}", "public static void loadGraph_File(String filename) {\n // Graph aus Datei laden\n Application.graph = null;\n double time_graph = System.currentTimeMillis();\n filename = filename + \".DAT\";\n Application.println(\"============================================================\");\n Application.println(\"Fetching Data from \" + filename + \" and building graph\");\n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream obj_in = new ObjectInputStream(fis);\n Object obj = obj_in.readObject();\n if (obj instanceof NavGraph) {\n Application.graph = (NavGraph) obj;\n } else {\n throw new Exception(\"Saved Data != NavGraph\");\n }\n obj_in.close();\n fis.close();\n time_graph = (System.currentTimeMillis() - time_graph) / 1000;\n double time_init = System.currentTimeMillis();\n Application.println(\"Init Graph\");\n graph.initGraph();\n time_init = (System.currentTimeMillis() - time_init) / 1000;\n Application.println(\"Init Graph took \" + time_init + \" Secs\");\n Application.println(\"Fetching Data and building graph took: \" + time_graph + \"sec\");\n Application.println(\"============================================================\");\n } catch (Exception e) {\n Application.println(\"Error: \" + e.toString());\n }\n }", "void loadFromFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile source = new File(directory, FILE_NAME);\n\t\t\tMap<String, Scoreboard> scoreboards = new HashMap<String, Scoreboard>();\n\t\t\tif (source.exists()) {\n\t\t\t\tJsonReader reader = new JsonReader(new FileReader(source));\n\t\t\t\treader.beginArray();\n\t\t\t\twhile (reader.hasNext()) {\n\t\t\t\t\tScoreboard scoreboard = readScoreboard(reader);\n\t\t\t\t\tscoreboards.put(scoreboard.getName(), scoreboard);\n\t\t\t\t}\n\t\t\t\treader.endArray();\n\t\t\t\treader.close();\n\t\t\t} else {\n\t\t\t\tsource.createNewFile();\n\t\t\t}\n\t\t\tthis.scoreboards = scoreboards;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void paintComponent(Graphics g) {\r\n\r\n\t\t// Gets the image\r\n\t\tBufferedImage image = null;\r\n\t\ttry {\r\n\t\t\timage = ImageIO.read(new File(logoFileName));\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif (image == null)\r\n\t\t\treturn;\r\n\r\n\t\t// Draws the image with auto-scaling\r\n\t\tg.drawImage(image, imageXCordinate, imageYCordinate, imageX2Cordinate,\r\n\t\t\t\timageY2Cordinage, 0, 0, image.getWidth(), image.getHeight(),\r\n\t\t\t\tnull);\r\n\t}", "protected void graphicProgramation(Graphics2D g2) throws InterruptedException, IOException {\n double yPosition = this.getSize().getHeight();\n // se cambian las propiedades de los graficos\n this.setOpaque(true);\n // si no ha cambiado de programacion y no hay canales, se crea la nueva programacion\n if (!alreadyChange && channelGraphics.size() == 0) {\n // carga la programacion del dia\n programation = new Programacion(getFileOftheDay());\n // recargando imagenes\n for (int channel = 0; channel < programation.getCantCanalesProg(); channel++) {\n // se crea una imagen del canal grafico\n BufferedImage bufferedImage = new BufferedImage(this.getSize().width,\n (int) SIBAConst.CHANNEL_GRAPHIC_HEIGHT, BufferedImage.TYPE_INT_RGB);\n Graphics2D big = bufferedImage.createGraphics();\n // se crea una instancia de un canal grafico\n ChannelGraphic channelGraphic = new ChannelGraphic(big, programation.getCanalInd(channel));\n // referencia la posicion donde quedara el grafico cuando sea graficado\n channelGraphic.setyPosition(yPosition);\n // se setea la altura del canal\n channelGraphic.setHeight(SIBAConst.CHANNEL_GRAPHIC_HEIGHT);\n // el ancho del canal grafico es el ancho del componente\n channelGraphic.setWidthComponent(this.getSize().getWidth());\n // se referencia la imagen\n channelGraphic.setBufferedImage(bufferedImage);\n // grafica el canal\n \n if ( this.qtyBackgounds < 0){\n \t\n \tSystem.out.println(\"Vá a operar con categorias fondos\");\n \tchannelGraphic.paintChannel(-1,ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n \t\n }\n else if (this.qtyBackgounds == 0)\t\n {\n \tSystem.out.println(\"No vá a operar con múltiples fondos\");\n \tchannelGraphic.paintChannel(ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n }\t\n else\n {\n \tSystem.out.println(\"Si vá a operar con múltiples fondos\");\n \tchannelGraphic.paintChannel(this.bkgActivo,ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n \tthis.moveToNextInd();\n }\n \n \n \n // se adjunta el canal grafico a la coleccion\n channelGraphics.add(channelGraphic);\n bufferedImage.flush();\n yPosition += SIBAConst.CHANNEL_GRAPHIC_HEIGHT;\n System.out.println(channelGraphic.getyPosition());\n }\n alreadyChange = true;\n }\n if (activatedScheduleChange) {\n // recargando imagenes\n for (ChannelGraphic channelGraphic : channelGraphics) {\n // grafica el canal\n channelGraphic.paintChannel(ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n }\n activatedScheduleChange = false;\n }\n \n //System.out.println(\"Already Change: \"+alreadyChange+\" / Remove Last Programation: \"+removeLastProgramation);\n for (Iterator<ChannelGraphic> iteratorChannel = channelGraphics.iterator(); iteratorChannel.hasNext();) {\n ChannelGraphic channelGraphicScroll = iteratorChannel.next();\n \n // si el componente ya fue visualizado, pasa a la cordenada del canal grafico que contiene la\n // cordenada \"Y\" mas alta\n if (channelGraphicScroll.getyPosition() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT < 0) {\n channelGraphicScroll.setyPosition(getChannelYPositionLast() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT);\n }\n channelGraphicScroll.setyPosition(channelGraphicScroll.getyPosition() - 1.0);\n // borrar anterior imagen\n g2.clearRect(0, (int) channelGraphicScroll.getyPosition(), (int) channelGraphicScroll.getWidthComponent(),\n (int) channelGraphicScroll.getHeight() + 1);\n // animar la imagen\n g2.drawImage(channelGraphicScroll.getBufferedImage(), 0, (int) channelGraphicScroll.getyPosition(), this);\n // Cada canal que sobrepase los limites de la pantalla en el sentido Norte, sera eliminara\n // de la programacion del dia, (debido a que se hara cambio a una nueva programacion de otro dia)\n // si el componente ya fue visualizado, pasa a la cordenada del canal grafico que contiene la\n // cordenada \"Y\" mas alta\n if (channelGraphicScroll.getyPosition() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT < 0) {\n // verifica si se van a eliminar los programas a medida que se hayan visto\n if (!alreadyChange && removeLastProgramation) {\n \tSystem.out.println(\"Se ha definido iteratorChannel.remove()\");\n iteratorChannel.remove();\n }\n }\n }\n \n }", "public ImageVisualizer(String fileName, boolean hex, int start, int end)\n {\n oFile = new File(fileName);\n this.hex = hex;\n this.startingPos = start;\n this.endingPos = end;\n try{\n oReader = new BufferedReader(new FileReader(oFile));\n } catch(Exception e)\n {\n e.printStackTrace();\n }\n }", "public void draw(File imageFile) {\n try {\n setImageSource(imageFile);\n } catch (IOException ex) {\n Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public MakeProfile(){\r\n try{\r\n i = ImageIO.read(new File(\"../images/New Profile.png\"));\r\n repaint();\r\n }\r\n catch(IOException e){\r\n }\r\n \r\n }", "public void load() {\n World loadGame;\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n int fileOpened = fileChooser.showOpenDialog(GameFrame.this);\n\n if (fileOpened == JFileChooser.APPROVE_OPTION) {\n FileInputStream fileInput =\n new FileInputStream(fileChooser.getSelectedFile());\n ObjectInputStream objInput = new ObjectInputStream(fileInput);\n loadGame = (World) objInput.readObject();\n objInput.close();\n fileInput.close();\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException x) {\n x.printStackTrace();\n return;\n }\n\n world = loadGame;\n gridPanel.removeAll();\n fillGamePanel();\n world.reinit();\n setWorld(world);\n GameFrame.this.repaint();\n System.out.println(\"Game loaded.\");\n }", "public TilePanel(String filePath){\r\n\t\twidth = 80;\r\n\t\theight = 80;\r\n\t\tthis.fileString = filePath;\r\n\t\tFile fileImg = new File(filePath);\r\n\t\ttry {\r\n\t\t\tbufferedImage = ImageIO.read(fileImg);\r\n\t\t} catch (IOException e) {\r\n\t\t\tbufferedImage = null;\r\n\t\t}\r\n\t\tsetVisible(true);\r\n\t}", "private void parseXmlFile(InputStream file)\n {\n\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\n\ttry\n\t{\n\t // Using factory get an instance of document builder\n\t //Log.d(Constants.TAG, \"XMLReader::parseXmlFile - Creating a new Document Builder.\");\n\t DocumentBuilder db = dbf.newDocumentBuilder();\n\n\t // parse using builder to get DOM representation of the XML file\n\t //Log.d(Constants.TAG, \"XMLReader::parseXmlFile - Attempting to parse the file.\");\n\t // This line causes the program to crash when attempting to read the SVG file, which is in XML format.\n\t dom = db.parse(file);\n\t //Log.d(Constants.TAG, \"XMLReader::parseXmlFile - Finished parsing the file.\");\n\t}\n\tcatch (ParserConfigurationException pce)\n\t{\n\t Log.d(Constants.TAG, \"ParserConfigurationException MSG: \" + pce.getMessage());\n\n\t pce.printStackTrace();\n\t}\n\tcatch (SAXException se)\n\t{\n\t Log.d(Constants.TAG, \"SAXException MSG: \" + se.getMessage());\n\n\t se.printStackTrace();\n\t}\n\tcatch (IOException ioe)\n\t{\n\t Log.d(Constants.TAG, \"IOException MSG: \" + ioe.getMessage());\n\n\t ioe.printStackTrace();\n\t}\n\tcatch (Exception e)\n\t{\n\t Log.d(Constants.TAG, \"Exception MSG: \" + e.getMessage());\n\t e.printStackTrace();\n\t}\n\n\t//Log.d(Constants.TAG, \"XMLReader::parseXmlFile() Exiting!\");\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tJFileChooser chooser;\n\t\t\tif (currentPath == null) {\n\t\t\t\tchooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\t\t} else {\n\t\t\t\tchooser = new JFileChooser(currentPath);\n\t\t\t}\n\t\t\tchooser.setFileFilter(new SvgFileFilter());\n\t\t\tint retval = chooser.showOpenDialog(canvas);\n\t\t\tif (retval == JFileChooser.APPROVE_OPTION) {\n\t\t\t\tFile f = chooser.getSelectedFile();\n\t\t\t\tcurrentPath = f.getPath();\n\t\t\t\tSystem.out.println(f.getAbsolutePath());\n\t\t\t\tloadNewDocument(f.getAbsolutePath());\n\t\t\t}\n\t\t}", "public void open() {\r\n\t\tFile f = getOpenFile(\"Map Files\", \"tilemap\");\r\n\t\tif (f == null) return;\r\n\t\tfile = f;\r\n\t\tframe.setTitle(\"Tile Mapper - \"+file.getName());\r\n\t\tSystem.out.println(\"Opening \"+file.getAbsolutePath());\r\n\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(\"tilemapper/Map.xsd\");\r\n\t\t\tfactory.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(is)));\r\n\r\n\t\t\tDocument dom = factory.newDocumentBuilder().parse(file);\r\n\r\n\t\t\t// we have a valid document\r\n\t\t\t//printNode(dom, \"\");\r\n\t\t\tNode mapNode = null;\r\n\t\t\tNodeList nodes = dom.getChildNodes();\r\n\t\t\tfor (int i=0; i<nodes.getLength(); i++) {\r\n\t\t\t\tNode node = nodes.item(i);\r\n\t\t\t\tif (node.getNodeName() == \"Map\") mapNode = node;\r\n\t\t\t}\r\n\t\t\tif (mapNode == null) return;\r\n\t\t\tmapPanel.parseDOM((Element)mapNode);\r\n\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\tSystem.out.println(\"The underlying parser does not support the requested features.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (FactoryConfigurationError e) {\r\n\t\t\tSystem.out.println(\"Error occurred obtaining Document Builder Factory.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void loadFile(){\n\tint returnVal = fileChooser.showOpenDialog(this);\n\n\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t File file = fileChooser.getSelectedFile();\n\t SAXParserFactory spf = SAXParserFactory.newInstance();\n\t try {\n\t\tInputStream xmlInput = new FileInputStream(file);\n\t\tSAXParser saxParser = spf.newSAXParser();\n\t\tRoomXMLParser rxp = new RoomXMLParser();\n\t\tsaxParser.parse(xmlInput, rxp);\n\n\t\trooms = rxp.getRooms();\n\t\tnumPlayers = rxp.getPlayers();\n\t\tnumNPCs = rxp.getNPCs();\n\t\trevalidate();\n\t }\n\t catch(SAXException|ParserConfigurationException|IOException e){\n\t\te.printStackTrace();\n\t }\n\t}\n }", "private void importImages() {\n\n\t\t// Create array of the images. Each image pixel map contains\n\t\t// multiple images of the animate at different time steps\n\n\t\t// Eclipse will look for <path/to/project>/bin/<relative path specified>\n\t\tString img_file_base = \"Game_Sprites/\";\n\t\tString ext = \".png\";\n\n\t\t// Load background\n\t\tbackground = createImage(img_file_base + \"Underwater\" + ext);\n\t}", "private void readFile() {\n\t\tint newPlayerScore = level.animal.getPoints();\n\t\t\n\t\tlevel.worDim = 30;\n\t\tlevel.wordShift = 25;\n\t\tlevel.digDim = 30;\n\t\tlevel.digShift = 25;\n\t\t\n\t\tfor( int y =0; y<10; y++ ) { //display placeholder numbers\n\t\t\tfor( int x=0; x<4; x++ ) {\n\t\t\t\tbackground.add(new Digit( 0, 30, 470 - (25*x), 200 + (35*y) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry { //display highscores from highscores.txt\n\t\t\tScanner fileReader = new Scanner(new File( System.getProperty(\"user.dir\") + \"\\\\highscores.txt\"));\n\t\t\t\n\t\t\tint loopCount = 0;\n\t\t\twhile( loopCount < 10 ) {\n\t\t\t\tString playerName = fileReader.next() ;\n\t\t\t\tString playerScore = fileReader.next() ;\n\t\t\t\tint score=Integer.parseInt(playerScore);\n\t\t\t\t\n\t\t\t\tif( newPlayerScore >= score && newHighScore == false ) {\n\t\t\t\t\tstopAt = loopCount;\n\t\t\t\t\tnewHighScore = true;\n\t\t\t\t\tlevel.wordY = 200 + (35*loopCount);\n\t\t\t\t\t\n\t\t\t\t\tpointer = new Icon(\"pointer.png\", 30, 75, 200 + (35*loopCount) );// add pointer indicator\n\t\t\t\t\tbackground.add( pointer ); \n\t\t\t\t\tlevel.setNumber(newPlayerScore, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t\tlevel.setWord(playerName, 10, 100, 200 + (35*loopCount));\n\t\t\t\t\tlevel.setNumber(score, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t}else {\n\t\t\t\t\tlevel.setWord(playerName, 10, 100, 200 + (35*loopCount));\n\t\t\t\t\tlevel.setNumber(score, 470, 200 + (35*loopCount));\n\t\t\t\t\tloopCount += 1;\n\t\t\t\t}\n\t\t\t}//end while\n\t\t\tfileReader.close();\n\t\t\tif( newHighScore ) {\n\t\t\t\tnewHighScoreAlert();\n\t\t\t}else {\n\t\t\t\tgameOverAlert();\n\t\t\t}\n } catch (Exception e) {\n \tSystem.out.print(\"ERROR: Line 168: Unable to read file\");\n //e.printStackTrace();\n }\n\t}", "public void readFromFile() {\n\n\t}", "private void loadData(String fileName, String cobrandPath)\n throws ParserConfigurationException, SAXException, IOException {\n\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n Document doc = db.parse(cobrandPath);\n\n Element root = doc.getDocumentElement();\n\n Element updateElement = doc.createElement(IConstants.IMAGE_FILE);\n Node updateText = doc.createTextNode(fileName);\n\n updateElement.appendChild(updateText);\n root.appendChild(updateElement);\n\n try {\n\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(new FileOutputStream(\n cobrandPath));\n\n TransformerFactory transFactory = TransformerFactory.newInstance();\n Transformer transformer = transFactory.newTransformer();\n\n transformer.transform(source, result);\n\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "private void loadResource() {\n\t\ttry {\n\t\t\ttarmacTexture = scaleResourceImagePaint(\"/textures/tarmac2.jpg\", 300, 300);\n\t\t\tgrassTexture = scaleResourceImagePaint(\"/textures/grass.jpg\", 300, 300);\n\t\t\tstopwayTexture = scaleResourceImagePaint(\"/textures/stopway.jpg\", 300, 300);\n\t\t} catch (IOException e) {\n\t\t\tsetUsingTextures(false);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void readFromFile() throws IOException, ClassNotFoundException {\n\t\ttry {\n\t\t\tInputStream file = new FileInputStream(pathName);\n\n\t\t\tInputStream buffer = new BufferedInputStream(file);\n\n\t\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t\ttagToImg = (Map<String, HashSet<String>>) input.readObject();\n\n\t\t\tinput.close();\n\t\t\tfile.close();\n\t\t} catch (EOFException e) {\n\t\t\ttagToImg = new HashMap<String, HashSet<String>>();\n\t\t} catch (InvalidClassException e) {\n\t\t\tSystem.out.println(\"file doesnt match the type\");\n\t\t}\n\t}", "public Graph loadFile(){\r\n String path = \"\";\r\n JFileChooser choix = new JFileChooser();\r\n choix.setAcceptAllFileFilterUsed(false);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Only xml files\", \"xml\");\r\n choix.addChoosableFileFilter(filter);\r\n if (choix.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){\r\n path = choix.getSelectedFile().getAbsolutePath();\r\n }\r\n Graph g = new Graph();\r\n boolean quit = false;\r\n int max = 0;\r\n try{\r\n BufferedReader br = new BufferedReader(new FileReader(path));\r\n do {\r\n String line = br.readLine();\r\n if (line.indexOf(\"<node\") != -1){\r\n String[] node_xml = line.split(\"\\\"\");\r\n Node node = new Node(Integer.parseInt(node_xml[1]),(int)Double.parseDouble(node_xml[3]),(int)Double.parseDouble(node_xml[5]),TypeNode.valueOf(node_xml[7]));\r\n max = Math.max(max, node.getId());\r\n if (node.getType() == TypeNode.INCENDIE){\r\n node.kindleFire((int)Double.parseDouble(node_xml[9]));\r\n }\r\n g.getListNodes().add(node);\r\n }\r\n if (line.indexOf(\"<edge\") != -1){\r\n String[] edge_xml = line.split(\"\\\"\");\r\n Edge edge = new Edge(findNode(g,Integer.parseInt(edge_xml[1])),findNode(g,Integer.parseInt(edge_xml[3])),TypeEdge.valueOf(edge_xml[5]));\r\n g.getListEdges().add(edge);\r\n }\r\n if (line.startsWith(\"</osm>\")){\r\n quit = true;\r\n } \r\n Node.setNb_node(max+1);\r\n } while (!quit);\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"File not found : \"+e.getMessage());\r\n } catch (IOException e) {\r\n System.out.println(\"Listening file error : \"+e.getMessage());\r\n }\r\n return g;\r\n }", "public void loadDocument(String docName) {\n\t\tif (svgfile != null && docName.indexOf(\"#\") == 0) {\n\t\t\tif (svgfile.indexOf(\"#\") == -1) {\n\t\t\t\t// append the docName to the current svgfile name\n\t\t\t\tsvgfile += docName;\n\t\t\t} else {\n\t\t\t\t// replace the bit after the #\n\t\t\t\tsvgfile = svgfile.substring(0, svgfile.indexOf(\"#\")) + docName;\n\t\t\t}\n\t\t} else {\n\t\t\tsvgfile = docName;\n\t\t}\n\t\tdocumentUrlField.setText(svgfile);\n\n\t\tcurrentPath = \"\";\n\t\tif (svgfile.indexOf('/') != -1 || svgfile.indexOf('\\\\') != -1) {\n\t\t\tint index = svgfile.lastIndexOf('/');\n\t\t\tif (index == -1) {\n\t\t\t\tindex = svgfile.lastIndexOf('\\\\');\n\t\t\t}\n\t\t\tcurrentPath = svgfile.substring(0, index + 1);\n\t\t}\n\n\t\tint hashIndex = svgfile.indexOf(\"#\");\n\t\tif (hashIndex != -1) {\n\t\t\tString fileName = svgfile.substring(0, hashIndex);\n\t\t\tString fragment = svgfile.substring(hashIndex + 1);\n\t\t\tSvgLoader svgLoader = new SvgLoader(fileName, fragment, this);\n\t\t\tsvgLoader.start();\n\t\t} else {\n\t\t\tSvgLoader svgLoader = new SvgLoader(svgfile, this);\n\t\t\tsvgLoader.start();\n\t\t}\n\t}", "public void loadOrCreateGraph() {\n if(new File(graphPath + OVERLAY_GRAPH).exists())\n loadGraph();\n else {\n System.out.println(\"No file with the graph exists\");\n createGraph();\n }\n //graph.print();\n }", "public abstract void load() throws IOException;", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tJFileChooser jc=new JFileChooser();\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".xml\", \".xml\"));\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".json\", \".json\"));\n\t\t\t\t\tint resp=jc.showOpenDialog(null);\n\t\t\t\t\tString url=\"\";\n\t\t\t\t\tString name=\"\";\n\t\t\t\t\tif(resp==jc.APPROVE_OPTION){\n\t\t\t\t\t\tHistory.forRedo.clear();\n\t\t\t\t\t\tHistory.forUndo.clear();\n\t\t\t\t\t\tFile file=jc.getSelectedFile();\n\t\t\t\t\t\turl=file.getPath();\n\t\t\t\t\t\tname=file.getName();\n\t\t\t\n\t\t\t\t\tif(name.charAt(name.length()-1)=='l'){\n\t\t\t\t\t\tnew SaveAndLoadXml().loadList(file);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tMyShape.his=new LinkedList<MyShape>();\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tnew JasonSave().load(url);\n\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"wrong in file\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tMyShape.his.removeLast();\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tMyShape.mark.setFlag(false);\n\t\t\t\t\tarea.repaint();\n\t\t\t\t}", "public interface Graphics {\n\t\n\t\n\t // encoding for different pixel formats\n\t public static enum PixmapFormat {\n\t ARGB8888, ARGB4444, RGB565\n\t }\n\n\t \t/**\n\t \t * Loads an image from a file and transforms it into a Pixmap\n\t \t * @param fileName\n\t \t * @param format\n\t \t * @return\n\t \t */\n\t public Pixmap newPixmap(String fileName, PixmapFormat format);\n\t \n\t /**\n\t * clears framebuffer with the given color\n\t * @param color\n\t */\n\t public void clear(int color);\n\t /**\n\t * Sets the pixel with the given color\n\t * @param x\n\t * @param y\n\t * @param color\n\t */\n\t public void drawPixel(int x, int y, int color);\n\t /**\n\t * Draws a line between two given pixels with the given color\n\t * @param x\n\t * @param y\n\t * @param x2\n\t * @param y2\n\t * @param color\n\t */\n\t public void drawLine(int x, int y, int x2, int y2, int color);\n\t \n\t /**\n\t * Draws a rectangle that starts at top-left at the given pixel and extends to\n\t * the specified height and width. Fills it up with given color\n\t * @param x\n\t * @param y\n\t * @param width\n\t * @param height\n\t * @param color\n\t */\n\t public void drawRect(int x, int y, int width, int height, int color);\n\n\t /**\n\t * Draws rectangle for the Pixmap at the specified coordinate which is \n\t * the top-left corner. \n\t * @param pixmap\n\t * @param x\n\t * @param y\n\t * @param srcX - pixmaps own coordinate system\n\t * @param srcY - pixmaps own coordinate system\n\t * @param srcWidth\n\t * @param srcHeight\n\t */\n\t public void drawPixmap(Pixmap pixmap, int x, int y, int srcX, int srcY,\n\t int srcWidth, int srcHeight);\n\n\t /**\n\t * Draws rectangle for the Pixmap at the specified coordinate which is \n\t * the top-left corner. \n\t * @param pixmap\n\t * @param x\n\t * @param y\n\t * @param srcWidth\n\t * @param srcHeight\n\t */\n\t public void drawPixmap(Pixmap pixmap, int x, int y);\n\t /**\n\t * returns width of framebuffer in pixels\n\t * @return\n\t */\n\t public int getWidth();\n\t /**\n\t * returns height of framebuffer in pixels\n\t * @return\n\t */\n\t public int getHeight();\n\n}", "public void loadImage(String str) {\r\n\t\t// sets file into BufferedImage\r\n\t\ttry {\r\n\r\n\t\t\t// if type == 1: draw the first type of tree\r\n\t\t\tif (type == 1) {\r\n\t\t\t\tBufferedImage imgOne = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg1 = imageResize(imgOne, 130, 170);\r\n\r\n\t\t\t}\r\n\t\t\t// if type == 2: draw the second type of tree\r\n\t\t\tif (type == 2) {\r\n\t\t\t\tBufferedImage imgTwo = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg2 = imageResize(imgTwo, 130, 170);\r\n\t\t\t}\r\n\t\t\t// if type == 3: draw bush\r\n\t\t\tif (type == 3) {\r\n\t\t\t\tBufferedImage imgThree = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg3 = imageResize(imgThree, 100, 140);\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}", "public static void load() {\n\t\t// manager.load(camp_fire);\r\n\t\t// manager.load(camp_fire_burntout);\r\n\t\t//\r\n\t\t// manager.load(fire_stick);\r\n\t\t// manager.load(fire_stick_burntout);\r\n\t\t//\r\n\t\t// manager.load(stockpile);\r\n\t\t// manager.load(worker);\r\n\t\t//\r\n\t\t// manager.load(icon_wood);\r\n\t\t//\r\n\t\tmanager.load(worker_ant);\r\n\t\tmanager.setLoader(FreeTypeFontGenerator.class,\r\n\t\t\t\tnew FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));\r\n\t\tmanager.load(dialog);\r\n\t}", "void massiveModeLoading( File dataPath );", "@Override\n\tpublic void loadData() throws FileNotFoundException {\n\t\tthis.getPromoShare();\n\t}", "public void loadDWIListFile() {\r\n\r\n final JFileChooser chooser = new JFileChooser(new File(Preferences.getProperty(Preferences.PREF_IMAGE_DIR)));\r\n chooser.addChoosableFileFilter(new ViewImageFileFilter(ViewImageFileFilter.ALL));\r\n chooser.setDialogTitle(\"Choose Diffusion Weighted Images .list file\");\r\n final int returnValue = chooser.showOpenDialog(this);\r\n if (returnValue == JFileChooser.APPROVE_OPTION) {\r\n final File kFile = new File(chooser.getSelectedFile().getAbsolutePath());\r\n if ( !kFile.exists() || !kFile.canRead()) {\r\n return;\r\n }\r\n final int iLength = (int) kFile.length();\r\n if (iLength <= 0) {\r\n return;\r\n }\r\n textListFile.setText(chooser.getSelectedFile().getAbsolutePath());\r\n Preferences.setProperty(Preferences.PREF_IMAGE_DIR, chooser.getCurrentDirectory().toString());\r\n\r\n String kParentDir = chooser.getCurrentDirectory().toString();\r\n final File kListFile = new File(chooser.getSelectedFile().getAbsolutePath());\r\n String pathFilename = null;\r\n String pathFileAbsPath = null;\r\n\r\n String bMatrixFilename = null;\r\n String bMatrixFileAbsPath = null;\r\n \r\n try {\r\n BufferedReader kReader = new BufferedReader(new FileReader(kListFile));\r\n String lineString = null;\r\n while ( (lineString = kReader.readLine()) != null) {\r\n if (lineString.startsWith(\"<original_columns>\")) {\r\n final String columnsStr = lineString.substring(lineString.indexOf(\"<original_columns>\") + 18,\r\n lineString.indexOf(\"</original_columns>\")).trim();\r\n m_iDimX = Integer.parseInt(columnsStr);\r\n } else if (lineString.startsWith(\"<original_rows>\")) {\r\n final String rowsStr = lineString.substring(lineString.indexOf(\"<original_rows>\") + 15,\r\n lineString.indexOf(\"</original_rows>\")).trim();\r\n m_iDimY = Integer.parseInt(rowsStr);\r\n } else if (lineString.startsWith(\"<slice>\")) {\r\n final String sliceStr = lineString.substring(lineString.indexOf(\"<slice>\") + 7,\r\n lineString.indexOf(\"</slice>\")).trim();\r\n m_iSlices = Integer.parseInt(sliceStr);\r\n } else if (lineString.startsWith(\"<nim>\")) {\r\n final String nimStr = lineString.substring(lineString.indexOf(\"<nim>\") + 5,\r\n lineString.indexOf(\"</nim>\")).trim();\r\n m_iWeights = Integer.parseInt(nimStr);\r\n } else if (lineString.startsWith(\"<rawimageformat>\")) {\r\n m_kRawFormat = lineString.substring(lineString.indexOf(\"<rawimageformat>\") + 16,\r\n lineString.indexOf(\"</rawimageformat>\")).trim();\r\n } else if (lineString.startsWith(\"<raw_image_path_filename>\")) {\r\n pathFilename = lineString.substring(lineString.indexOf(\"<raw_image_path_filename>\") + 25,\r\n lineString.indexOf(\"</raw_image_path_filename>\")).trim();\r\n pathFileAbsPath = kParentDir + File.separator + pathFilename;\r\n // studyName = pathFilename.substring(0, pathFilename.indexOf(\".path\"));\r\n } else if (lineString.startsWith(\"<bmatrixfile>\")) {\r\n bMatrixFilename = lineString.substring(lineString.indexOf(\"<bmatrixfile>\") + 13,\r\n lineString.indexOf(\"</bmatrixfile>\")).trim();\r\n bMatrixFileAbsPath = kParentDir + File.separator + bMatrixFilename;\r\n // studyName = pathFilename.substring(0, pathFilename.indexOf(\".path\"));\r\n } else if (lineString.startsWith(\"<x_field_of_view>\")) {\r\n final String xFOVStr = lineString.substring(lineString.indexOf(\"<x_field_of_view>\") + 17,\r\n lineString.indexOf(\"</x_field_of_view>\")).trim();\r\n final float xFOV = Float.parseFloat(xFOVStr);\r\n m_fResX = xFOV;\r\n m_bUseXRes = true;\r\n } else if (lineString.startsWith(\"<y_field_of_view>\")) {\r\n final String yFOVStr = lineString.substring(lineString.indexOf(\"<y_field_of_view>\") + 17,\r\n lineString.indexOf(\"</y_field_of_view>\")).trim();\r\n final float yFOV = Float.parseFloat(yFOVStr);\r\n m_fResY = yFOV;\r\n m_bUseYRes = true;\r\n } else if (lineString.startsWith(\"<slice_thickness>\")) {\r\n final String zResStr = lineString.substring(lineString.indexOf(\"<slice_thickness>\") + 17,\r\n lineString.indexOf(\"</slice_thickness>\")).trim();\r\n m_fResZ = Float.parseFloat(zResStr);\r\n m_bUseZRes = true;\r\n } else if (lineString.startsWith(\"<noise_mean_ori>\")) {\r\n final String noiseStr = lineString.substring(lineString.indexOf(\"<noise_mean_ori>\") + 16,\r\n lineString.indexOf(\"</noise_mean_ori>\")).trim();\r\n m_fMeanNoise = Float.parseFloat(noiseStr);\r\n }\r\n }\r\n kReader.close();\r\n kReader = null;\r\n } catch (final Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n if ( (pathFilename != null) && (bMatrixFileAbsPath != null) ) {\r\n loadPathFile(pathFileAbsPath, kParentDir);\r\n loadBMatrixFile(bMatrixFileAbsPath);\r\n \r\n\r\n AlgorithmDWI2DTI calcDTI = new AlgorithmDWI2DTI(maskImage, false, m_iSlices,\r\n m_iDimX, m_iDimY, m_iBOrig, m_iWeights, m_fMeanNoise, m_aakDWIList, m_aiMatrixEntries, m_kBMatrix,\r\n m_kRawFormat);\r\n m_kDWIImage = calcDTI.getDWI();\r\n\t\t\t\tnew ViewJFrameImage( m_kDWIImage );\r\n }\r\n m_fResX /= m_iDimX;\r\n m_fResY /= m_iDimY;\r\n }\r\n }", "public void loadimage(File file) {\n\t\tthis.transformedImageIcon = new ImageIcon(file.getAbsolutePath()); //Here we are fetching the Image from the File into an ImageIcon \n\t\tImage image = transformedImageIcon.getImage(); //Here we are getting the Actual Concrete Image from the ImageIcon which fetched the Image from the File \n\t\tupdateImage(image); //Here it will Set the Image to the JLabel after calling the Scaling Method \n\t}", "@Override\n\tpublic void load(String fileName) throws IOException\n\t{\n\t\tBufferedImage i;\n\t\t\n\t\tFile f = new File(fileName);\n\t\ti = ImageIO.read(f);\n\t\t\n\t\ttry {\n\t\t\tmethodRGBA(f,fileName);\n//\t\t\tmethodRGB(f,fileName);\n\t\t} catch (Exception e) {}\n\t\t\n\t\tgl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);\n\t\tgl.glGenTextures(1, id);\n\t\tgl.glBindTexture(GL.GL_TEXTURE_2D, id.get(0));\n\n\t\tw = i.getWidth();\n\t\th = i.getHeight();\n\t\tIntBuffer buf = getData(i);\n\t\tgl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, w, h, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, buf);\t\t\t\n\t}", "void writeGraphics() throws Exception;", "public ImageManip(String file) {\n\t\tthis.image = new Picture(file, false);\n\t\tthis.canvas = new Picture(this.image.getWidth(), this.image.getHeight(), false);\n\t\tthis.random = new Random();\n\t\tthis.rotateOffset = 0;\n\t}", "public void load (File file) throws Exception;", "public void load( File file )\n {\n try\n {\n if ( _core.getImageFile() != null )\n _core.reset( true );\n\n _core.setImageFile(\n file );\n\n setDirectoryEntries(\n _core.getImageFileDirectory() );\n }\n catch ( Exception e )\n {\n throw new RuntimeException( e );\n }\n }", "public static void load(File file) throws IOException {\n while (LogicManager.isUpdating()) {} // wait until current update has finished\n\n LogicManager.setPaused(true);\n\n // clear current scene\n GridManager.clearScene();\n\n // open input stream\n ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)));\n\n try {\n // load viewport data\n Point viewport = (Point) in.readObject();\n int scaling = (Integer) in.readObject();\n Window.getCurrentInstance()\n .getGameDisplay()\n .setViewport(viewport);\n Window.getCurrentInstance()\n .getGameDisplay()\n .setScaling(scaling);\n SwingUtilities.invokeLater(() -> {\n Window.getCurrentInstance()\n .getGameDisplay()\n .revalidate();\n Window.getCurrentInstance()\n .getGameDisplay()\n .repaint();\n });\n\n // load point data\n Point[] data;\n data = (Point[]) in.readObject();\n GridManager.loadScene(data);\n } catch (ClassNotFoundException e) {\n in.close();\n throw new IOException(\"File contains illegal data\");\n }\n in.close();\n }", "public void loadResources();", "void load(File file);", "private void loadSpritesheet() {\n\t\tobjects = new SpriteSheet(\"res\\\\pong.png\");\n\t\tobjects_hires = new SpriteSheet(\"res\\\\ponghires.png\",\n\t\t\t\tSpriteSheet.LINEAR);\n\t}", "void load() {\n String path = ModuleSettings.getConfigSetting(ReportBranding.MODULE_NAME, ReportBranding.AGENCY_LOGO_PATH_PROP);\n boolean useDefault = (path == null || path.isEmpty());\n defaultLogoRB.setSelected(useDefault);\n specifyLogoRB.setSelected(!useDefault);\n agencyLogoPathField.setEnabled(!useDefault);\n browseLogosButton.setEnabled(!useDefault);\n logFileCount.setText(String.valueOf(UserPreferences.getLogFileCount()));\n solrMaxHeapSpinner.setValue(UserPreferences.getMaxSolrVMSize());\n try {\n updateAgencyLogo(path);\n } catch (IOException ex) {\n logger.log(Level.WARNING, \"Error loading image from previously saved agency logo path\", ex);\n }\n if (memField.isEnabled()) {\n try {\n initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB());\n } catch (IOException ex) {\n logger.log(Level.SEVERE, \"Can't read current Jvm max memory setting from file\", ex);\n memField.setEnabled(false);\n }\n memField.setText(initialMemValue);\n }\n \n valid(); //ensure the error messages are up to date\n }" ]
[ "0.6370224", "0.6322635", "0.63057715", "0.6131121", "0.6110875", "0.6072407", "0.60684085", "0.60612524", "0.6044519", "0.6016654", "0.6010059", "0.60037684", "0.60003877", "0.59724647", "0.5943927", "0.59279054", "0.5887019", "0.5875044", "0.5847072", "0.58255965", "0.58237827", "0.5773789", "0.57418275", "0.5734969", "0.5733148", "0.5724459", "0.57164437", "0.5710181", "0.5708826", "0.5708739", "0.5688589", "0.56873155", "0.56637424", "0.56544167", "0.5647145", "0.5643734", "0.5635818", "0.56354815", "0.56352246", "0.5632573", "0.56261724", "0.5626001", "0.5624865", "0.56128067", "0.5611654", "0.55980605", "0.5585622", "0.5584548", "0.5583278", "0.5581483", "0.5579756", "0.55772936", "0.55754405", "0.55629003", "0.55609775", "0.5542362", "0.5532599", "0.55241346", "0.5522668", "0.55207574", "0.55194736", "0.5514106", "0.5504551", "0.55035716", "0.549954", "0.54935336", "0.5470369", "0.5467848", "0.54636717", "0.54573035", "0.5453857", "0.54475296", "0.54465127", "0.54462296", "0.54430586", "0.54355365", "0.543514", "0.5433802", "0.5433012", "0.54311216", "0.5411749", "0.540869", "0.5408423", "0.54019064", "0.5392918", "0.53845525", "0.5381112", "0.5379544", "0.5373757", "0.53649676", "0.53611284", "0.5348671", "0.5344516", "0.5342162", "0.53391296", "0.53377134", "0.5327612", "0.5323509", "0.53199565", "0.5310807" ]
0.5401529
84
Method which will check, if clicked cords, are the cords of monster. If that's true, monster will be selected.
public void checkClickedArea(int xMouse,int yMouse) { isSelected=false; if(targetable==true&&(xMouse>=xBeginMap+15&&xMouse<=xEndMap-15 &&yMouse>=yBeginMap+15&&yMouse<=yEndMap-15)) { isSelected=true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isClicked() {\n\n// Cycles through all menu cursors\n for (MenuCursor cursor : Main.cursors) {\n\n// If the cursor has a controller and the select button is clicked, return true\n if (cursor.controller != null) {\n if (Main.contains(Main.recentButtons.get(cursor.controller), ControllerButtons.A)) {\n if (isCursorOver(cursor)) {\n this.cursor = cursor;\n return true;\n }\n }\n\n// Otherwise, if the cursor is using a keyboard and the select button is pressed, return true\n } else {\n if (Gdx.input.isKeyJustPressed(Keys.MENU_SELECT)) {\n if (isCursorOver(cursor)) {\n this.cursor = cursor;\n return true;\n }\n }\n }\n }\n// If none of these events occur, return false\n return false;\n }", "public boolean isDoorSelected(int i) {\n return chosen_door == doors.get(i);\n }", "public boolean isSelectable(){\n\t\treturn (type != MONSTER_GOAL && type != MONSTER_ENTRANCE);\n\t}", "boolean isSelected();", "boolean isSelected();", "boolean isSelected();", "private void geselecteerdSymbool()\n {\n /**\n * selecteren van vak\n */\n vulKeuzeBordIn();\n GraphicsContext gc = canvasKeuzeveld[0][keuzeID].getGraphicsContext2D();\n tekenRechtHoek(gc, 0, 0, 30, 30, Color.RED);\n }", "public final boolean select(Vector2 dodlePoint) {\n DodlesActor previouslySelectedActor = getSelectedActor();\n\n selectedActors.clear();\n\n DodlesActor actor = findActiveActor(dodlePoint);\n\n if (actor != null && (previouslySelectedActor == null || previouslySelectedActor == actor)) {\n selectActor(actor);\n return true;\n }\n\n updateStateUiAfterSelection();\n\n return false;\n }", "public boolean mouseClicked(MouseEvent e)\r\n {\r\n double x = e.getX();\r\n double y = e.getY();\r\n \r\n //find if coordinates are in a \"button\"\r\n for (int i = 0; i < towerButtons.length; i++)\r\n {\r\n if (towerButtons[i].contains(x,y))\r\n {\r\n display.setUnit(dummyList.get(i));\r\n selectedIndex = i;\r\n }\r\n }\r\n \r\n //within bounds\r\n if ((new Rectangle2D.Double(initX, 0, width, height)).contains(x,y))\r\n return true;\r\n return false;\r\n }", "public boolean raceSelected(){\n\t\tif(btnDwarf.isEnabled() && btnElf.isEnabled() && btnHuman.isEnabled())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public boolean isSelected();", "public boolean isSelected();", "public boolean canSelect(int x, int y){\n\t\tif(!(pieceAt(x,y)==null)){\n\t\tSystem.out.println(fireplaying);\n\t\tif(fireplaying){\n\t\t\tif(!moved){\n\t\t\t\tif(pieceAt(x,y).isFire()){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// else if (moved)\n\t\t\t// {\n\t\t\t// \tif (pieceAt(x, y) == selected)\n\t\t\t// \t{\n\t\t\t// \t\treturn true;\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn false;\n\t\t}\n\t\telse if(!fireplaying){\n\t\t\tif(!moved){\n\t\t\t\tif(!pieceAt(x,y).isFire()){\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// else if (moved)\n\t\t\t// {\n\t\t\t// \tif (pieceAt(x, y) == selected)\n\t\t\t// \t{\n\t\t\t// \t\treturn true;\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn false;\n\t\t}\n\t}\n\telse if((pieceAt(x,y))==null){\n\t\tif(selected==null){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(validMove(xpos,ypos,x,y)){\n\t\t\t\t\tif(moved&&selected.hasCaptured()){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse if(moved){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n\t}", "@Override\n\t\t\t\tpublic void onTouchDown() {\n\t\t\t\t\tint i=0;\n\t\t\t\t\t\n\t\t\t\t\tcolMonster = player.getAllMonster().values();\n\t\t\t\t\t\n\t\t\t\t\tIterator<Monster> it = colMonster.iterator();\n\t\t\t\t\tmonsters = new String[colMonster.size()];\n\t\t\t\t\tmonstersName = new String[colMonster.size()];\n\t\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\t\tMonster mb = it.next();\n\t\t\t\t\t\tLog.d(\"name monsterbaru\",mb.getName().toString());\n\t\t\t\t\t\tLog.d(\"Species monsterbaru\",mb.getSpecies().getName().toString());\n\t\t\t\t\t\tLog.d(\"level monsterbaru\",\"\"+mb.getLevel());\n\t\t\t\t\t\tmonsters[i] = mb.getName().toString()+\" (\"+mb.getSpecies().getName().toString()+\" Lv.\"+mb.getLevel()+\")\";\n\t\t\t\t\t\tmonstersName[i] = mb.getName().toString();\n\t\t\t\t\t\t//Log.d(\"Monster\",mb.getName().toString());\n\t\t\t\t\t\t//Log.d(\"Monster\", mb.getSpecies().getName().toString());\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tMessageManager.multiChoice(\"Choose two monsters to be combined!\", monsters, new Action() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void proceed(Object o) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tboolean[] arrMonster = (boolean[]) o;\n\t\t\t\t\t\t\tint count = 0;\n\t\t\t\t\t\t\tint firstMonster = -1, secondMonster = -1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int i=0; i<arrMonster.length;i++){\n\t\t\t\t\t\t\t\tif(arrMonster[i]){\n\t\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t\t\tif(count == 1){\n\t\t\t\t\t\t\t\t\t\tfirstMonster = i;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(count == 2){\n\t\t\t\t\t\t\t\t\t\tsecondMonster = i;\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\tif(secondMonster != -1 && count==2){\n\t\t\t\t\t\t\t\t//benar\n\t\t\t\t\t\t\t\t//MessageManager.alert(monsters[firstMonster]+ \" \" + monsters[secondMonster]);\n\t\t\t\t\t\t\t\tMonster newMonster = null;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tnewMonster = Monster.combineMonster(player,monstersName[firstMonster], monstersName[secondMonster]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Log.d(\"test\" , newMonster.getSpecies().getName().toString());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfinal Integer oldMonster1, oldMonster2;\n\t\t\t\t\t\t\t\toldMonster1 = firstMonster; \n\t\t\t\t\t\t\t\toldMonster2 = secondMonster;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(newMonster == null){\n\t\t\t\t\t\t\t\t\tLog.d(\"hehe\",\"null new monster\");\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\tLog.d(\"monsterbaru Species jadi\", newMonster.getSpecies().getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twhile(newMonster == null){\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tnewMonster = Monster.combineMonster(player,monstersName[firstMonster], monstersName[secondMonster]);\n\t\t\t\t\t\t\t\t\t\tLog.d(\"heheloop\",\"loops\");\n\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfinal Monster newMonster1 = newMonster;\n\t\t\t\t\t\t\t\tfinal Integer firstMonster1 = firstMonster;\n\t\t\t\t\t\t\t\tfinal Integer secondMonster1 = secondMonster;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tMessageManager.prompt(\"Congratulation! You get \"+ newMonster.getSpecies().getName() +\"! Give a name to your new lovely monster!\", new Action() {\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void proceed(Object o) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\t//addNewMonster(o.toString(), oldMonster1, oldMonster2);\n\t\t\t\t\t\t\t\t\t\tif(o.toString().length()!=0){\n\t\t\t\t\t\t\t\t\t\t\t//checking Monster name exists\n\t\t\t\t\t\t\t\t\t\t\tMonster mm = player.getMonster(o.toString());\n\t\t\t\t\t\t\t\t\t\t\tif(mm != null){\n\t\t\t\t\t\t\t\t\t\t\t\tMessageManager.alert(\"The name is already exist. Please retry the combine process\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\tnewMonster1.setName(o.toString());\n\t\t\t\t\t\t\t\t\t\t\t\tplayer.addMonster(newMonster1);\n\t\t\t\t\t\t\t\t\t\t\t\t//Log.d(\"check2\", newMonster1.getSpecies().getName().toString());\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\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(player.getCurrentMonster().getName().equals(monstersName[firstMonster1]) || player.getCurrentMonster().getName().equals(monstersName[secondMonster1])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.setCurrentMonster(newMonster1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.delMonster(monstersName[firstMonster1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\tplayer.delMonster(monstersName[secondMonster1]);\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\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}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tMessageManager.alert(\"Your input is invalid. Please retry the combine process\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t//salah\n\t\t\t\t\t\t\t\tMessageManager.alert(\"Only 2 Monsters are accepted\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tLog.d(\"poke\", arrMonster[0] +\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\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}", "private boolean selectCondition2(int x, int y) {\n \n if (pieceAt(x, y) != null) {\n if (rightTurn(x, y)) {\n if (selectedPiece == null) {\n return true;\n } else if (!hasMoved) {\n return true; \n } else {\n return false;\n }\n \n } \n else {\n return false;\n }\n } else {\n return false;\n }\n \n \n }", "boolean hasStablesSelected();", "public boolean classSelected(){\n\t\tif(btnMage.isEnabled() && btnWarrior.isEnabled() && btnRanger.isEnabled())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public void selected(Guy g)\n {\n guy.pickingLocation = !guy.pickingLocation;\n }", "@Override\n public boolean onTouch(View v, MotionEvent event) {\n if (!gameOn) return false;\n\n if (selectedObject != null) {\n // We clicked while having a piece already chosen, check if we can move here\n CharacterSprite newSelectedObject = null;\n for (CharacterSprite sprite : pieces) {\n if (sprite.isColliding((int) event.getX(), (int) event.getY())) {\n // Newly selected object is another piece\n newSelectedObject = sprite;\n break;\n }\n }\n if (newSelectedObject == null) {\n for (CharacterSprite sprite : board) {\n if (sprite.isColliding((int) event.getX(), (int) event.getY())) {\n // Newly selected object is a field\n newSelectedObject = sprite;\n break;\n }\n }\n }\n if (newSelectedObject == null) {\n for (CharacterSprite field : selected) {\n if (field.isColliding(selectedObject.getX(), selectedObject.getY())) {\n // User touched outside the board, deselecting previous field and quitting\n field.setVisible(false);\n selectedObject = null;\n break;\n }\n }\n return false;\n }\n\n // position && destination == [x,y] coordinates list in range <1-8>\n int[] position = {selectedObject.getX() / CharacterSprite.size, selectedObject.getY() / CharacterSprite.size};\n int[] destination = {newSelectedObject.getX() / CharacterSprite.size, newSelectedObject.getY() / CharacterSprite.size};\n boolean moved = false; // if true then a correct move was performed\n boolean isSomethingInTheWay = false;\n\n // board positions, xy\n // 11 21 31 41 51 61 71 81\n // 12 22 32 42 52 62 72 82\n // 13 23 33 43 53 63 73 83\n // 14 24 34 44 54 64 74 84\n // 15 25 35 45 55 65 75 85\n // 16 26 36 46 56 66 76 86\n // 17 27 37 47 57 67 77 87\n // 18 28 38 48 58 68 78 88\n\n // pieces logic\n switch (selectedObject.getType()) {\n case PAWN_BLACK: {\n // move forward\n if (destination[0] == position[0] && destination[1] == position[1] + 1) {\n if (!anyObstacles(pieces, position, destination, moveMode.Y_AXIS, true)) {\n selectedObject.setY(selectedObject.getY() + CharacterSprite.size);\n sendMoveToDB(position, destination);\n\n // user can move black pawn one field\n moved = true;\n selectedObject.setMoved();\n }\n }\n\n // move forward two spaces\n else if (!selectedObject.didMove() && destination[0] == position[0]\n && destination[1] == position[1] + 2) {\n if (!anyObstacles(pieces, position, destination, moveMode.Y_AXIS, true)) {\n selectedObject.setY(selectedObject.getY() + CharacterSprite.size * 2);\n sendMoveToDB(position, destination);\n // user can move black pawn two fields\n moved = true;\n selectedObject.setMoved();\n }\n }\n\n // capture\n else if ((destination[0] == position[0] - 1 && destination[1] == position[1] + 1)\n || (destination[0] == position[0] + 1 && destination[1] == position[1] + 1)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n\n // promote to queen if reached the end of the board\n if (selectedObject.getY() == CharacterSprite.size * 8) {\n BitmapFactory.Options o = new BitmapFactory.Options();\n o.inScaled = false;\n pieces.add(new CharacterSprite(BitmapFactory.decodeResource(getResources(),\n R.drawable.queen_black, o), selectedObject.getX(), 880, objType.QUEEN_BLACK, 1));\n pieces.remove(selectedObject);\n }\n break;\n }\n\n case PAWN_WHITE: {\n // move forward\n if (destination[0] == position[0] && destination[1] == position[1] - 1) {\n if (!anyObstacles(pieces, position, destination, moveMode.Y_AXIS, true)) {\n selectedObject.setY(selectedObject.getY() - CharacterSprite.size);\n //int[] origin = new int[]{selectedObject.getX(), selectedObject.getY()};\n //int[] destinationDB= new int[]{selectedObject.getX() / CharacterSprite.size, selectedObject.getY() / CharacterSprite.size};\n sendMoveToDB(position, destination);\n\n // user can move white pawn one field\n moved = true;\n selectedObject.setMoved();\n }\n }\n\n // move forward two spaces\n else if (!selectedObject.didMove() && destination[0] == position[0]\n && destination[1] == position[1] - 2) {\n if (!anyObstacles(pieces, position, destination, moveMode.Y_AXIS, true)) {\n selectedObject.setY(selectedObject.getY() - CharacterSprite.size * 2);\n sendMoveToDB(position, destination);\n // user can move white pawn two fields\n moved = true;\n selectedObject.setMoved();\n }\n }\n\n // capture\n else if ((destination[0] == position[0] - 1 && destination[1] == position[1] - 1)\n || (destination[0] == position[0] + 1 && destination[1] == position[1] - 1)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n\n // promote to queen if reached the end of the board\n if (selectedObject.getY() == CharacterSprite.size) {\n BitmapFactory.Options o = new BitmapFactory.Options();\n o.inScaled = false;\n pieces.add(new CharacterSprite(BitmapFactory.decodeResource(getResources(),\n R.drawable.queen_white, o), selectedObject.getX(), 110, objType.QUEEN_WHITE, 1));\n pieces.remove(selectedObject);\n }\n break;\n }\n\n case ROOK_WHITE:\n case ROOK_BLACK: {\n // move on Y axis (up/down)\n if (destination[0] == position[0] && destination[1] != position[1]) {\n if (!anyObstacles(pieces, position, destination, moveMode.Y_AXIS, false)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n\n }\n // move on X axis (left/right)\n else if (destination[1] == position[1] && destination[0] != position[0]) {\n if (!anyObstacles(pieces, position, destination, moveMode.X_AXIS, false)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n }\n break;\n }\n\n case KNIGHT_BLACK:\n case KNIGHT_WHITE: {\n if ((destination[0] == position[0] - 2 && destination[1] == position[1] - 1)\n || (destination[0] == position[0] - 2 && destination[1] == position[1] + 1)\n || (destination[0] == position[0] - 1 && destination[1] == position[1] + 2)\n || (destination[0] == position[0] - 1 && destination[1] == position[1] - 2)\n || (destination[0] == position[0] + 1 && destination[1] == position[1] - 2)\n || (destination[0] == position[0] + 1 && destination[1] == position[1] + 2)\n || (destination[0] == position[0] + 2 && destination[1] == position[1] - 1)\n || (destination[0] == position[0] + 2 && destination[1] == position[1] + 1)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n break;\n }\n\n case BISHOP_BLACK:\n case BISHOP_WHITE: {\n if (abs(destination[0] - position[0]) == abs(destination[1] - position[1])) {\n if (!anyObstacles(pieces, position, destination, moveMode.DIAGONAL, false)) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n }\n break;\n }\n\n case KING_BLACK:\n case KING_WHITE: {\n // castle\n if (!selectedObject.didMove() && (destination[0] == position[0] - 4 && destination[1] == position[1])\n || (destination[0] == position[0] + 3 && destination[1] == position[1])) {\n int o;\n // o-o-o\n if (destination[0] == position[0] - 4) {\n o = -1;\n }\n // o-o\n else {\n o = 1;\n }\n\n for (int i = position[0] + o; i > destination[0]; i += o) {\n for (CharacterSprite sprite : pieces) {\n if (sprite.isColliding(i * CharacterSprite.size, destination[1] * CharacterSprite.size)) {\n isSomethingInTheWay = true;\n break;\n }\n }\n if (isSomethingInTheWay) {\n break;\n }\n }\n\n if (!isSomethingInTheWay) {\n for (CharacterSprite sprite : pieces) {\n if (sprite.isColliding(destination[0] * CharacterSprite.size,\n destination[1] * CharacterSprite.size)) {\n if (whiteTurn) {\n if (sprite.getType() != objType.ROOK_WHITE || sprite.didMove()) {\n break;\n }\n } else {\n if (sprite.getType() != objType.ROOK_BLACK || sprite.didMove()) {\n break;\n }\n }\n selectedObject.setMoved();\n moved = true;\n sprite.setMoved();\n if (o == -1) {\n selectedObject.setX(3 * CharacterSprite.size);\n sprite.setX(4 * CharacterSprite.size);\n } else {\n selectedObject.setX(7 * CharacterSprite.size);\n sprite.setX(6 * CharacterSprite.size);\n }\n\n }\n }\n }\n } else if (abs(destination[0] - position[0]) == 1 || abs(destination[1] - position[1]) == 1) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n break;\n }\n\n case QUEEN_BLACK:\n case QUEEN_WHITE: {\n // move on Y axis\n if (destination[0] == position[0] && destination[1] != position[1]) {\n isSomethingInTheWay = anyObstacles(pieces, position, destination, moveMode.Y_AXIS,\n false);\n }\n // move on X axis\n else if (destination[0] != position[0] && destination[1] == position[1]) {\n isSomethingInTheWay = anyObstacles(pieces, position, destination, moveMode.X_AXIS,\n false);\n }\n // move diagonally\n else if (abs(destination[0] - position[0]) == abs(destination[1] - position[1])) {\n isSomethingInTheWay = anyObstacles(pieces, position, destination, moveMode.DIAGONAL,\n false);\n }\n\n if (!isSomethingInTheWay) {\n int[] result = moveIfPossible(pieces, selectedObject, whiteTurn, destination);\n moved = result[0] == 1;\n points[whiteTurn ? 0 : 1] += result[1];\n sendMoveToDB(position, destination);\n }\n break;\n }\n }\n\n // Uncheck previous field\n for (CharacterSprite field : selected) {\n field.setVisible(false);\n }\n // Switch players if the correct move was performed\n if (moved) {\n whiteTurn = !whiteTurn;\n // end game if mate\n if (isMate(pieces, whiteTurn)) {\n gameOn = false;\n }\n }\n // Deselect object\n selectedObject = null;\n } else {\n // We clicked and we DO NOT have a piece already chosen\n for (CharacterSprite sprite : pieces) {\n if (sprite.isWhite() == whiteTurn && sprite.isColliding((int) event.getX(), (int) event.getY())) {\n selectedObject = sprite;\n for (CharacterSprite field : selected) {\n if (field.isColliding((int) event.getX(), (int) event.getY())) {\n field.setVisible(true);\n break;\n }\n }\n }\n }\n }\n return false;\n }", "public void mousePressed(MouseEvent event) { \n\t\t\t\t\n\t\tswitch(imgName) // Exécute une action différente en fonction du nom du bouton\n\t\t{\n\t\t\tcase \"endTurn\":\n\t\t\t\tGUI.getPlayer().setRoundCompleted(true);\n\t\t\t\tbreak;\n\t\t\tcase \"roads\":\n\t\t\t\tif(GUI.getPlayer().getNbRoad() > 0)\n\t\t\t\t{\n\t\t\t\t\tif(!this.isSelected) \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\t\tBoardView.setAction(6);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t\t\tBoardView.setAction(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"bonusTools\":\n\t\t\tcase \"bonusDefense\":\n\t\t\t\tif(GUI.getPlayer().getDiceBonus() == 5)\n\t\t\t\t{\n\t\t\t\t\tif(imgName == \"bonusTools\")\n\t\t\t\t\t\tGUI.getPlayer().setNbBonus(0, GUI.getPlayer().getNbBonus(0) + 1);\n\t\t\t\t\telse\n\t\t\t\t\t\tGUI.getPlayer().setNbBonus(1, GUI.getPlayer().getNbBonus(1) + 1);\n\t\t\t\t\t\n\t\t\t\t\tGUI.getPlayer().setDiceBonus(0);\n\t\t\t\t}\n\t\t\t\telse if(GUI.getPlayer().getNbBonus((imgName == \"bonusTools\") ? 0 : 1) > 0)\n\t\t\t\t{\n\t\t\t\t\tif(!this.isSelected) \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(true);\n\t\t\t\t\t\tif(imgName == \"bonusTools\")\n\t\t\t\t\t\t\tBoardView.setAction(7);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tBoardView.setAction(8);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t\t\tBoardView.setAction(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"hand\":\n\t\t\t\tif(!this.isSelected) \n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\tGUI.getDrawHandView().display();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(GUI.getPlayer().getActions().size() >= GUI.getPlayer().getNbActionsAllowed() && !GameManager.devMode)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif(!this.isSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\t\n\t\t\t\t\tswitch(imgName)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"tile\":\n\t\t\t\t\t\t\tGUI.getDrawTileView().display();\n\t\t\t\t\t\t\tBoardView.setAction(1);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"road\":\n\t\t\t\t\t\t\tGUI.getPlayer().setNbRoad(GUI.getPlayer().getNbRoad() + 1);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"monster\":\n\t\t\t\t\t\t\tBoardView.setAction(3);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(3);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"architect\":\n\t\t\t\t\t\t\tBoardView.setAction(4);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(4);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"goal\":\n\t\t\t\t\t\t\tGUI.getDrawGoalView().display();\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!GameManager.devMode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(GUI.getPlayer().getDiceBonus() != 3)\n\t\t\t\t\t\t\tthis.setVisible(false);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif(GUI.getPlayer().getActions().size() > 1)\n\t\t\t\t\t\t\t\tthis.setVisible(false);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.setSelected(false);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public boolean onDoor(){\n\t\tint yp = 0; int xp = 0;//coordinates to hold player position\n\t\tint yd = 1; int xd = 1;//coordinates to hold door position\n\t\tfor(int i = 0; i < this.position.length; i ++){//looks though arrays to gather position\n\t\t\tfor(int p = 0 ; p < this.position.length; p++){\n\t\t\t\tif(this.position[i][p] == 1 && this.Door[i][p] == 1){\n\t\t\t\t\typ = i; xp = p;\n\t\t\t\t\tyd = i; xd = p;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\tif(yp==yd && xp==xd){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;//if they are not in the same location, return false\n\t}", "private void checkMouseClick()\n {\n MouseInfo userClick = Greenfoot.getMouseInfo();\n \n int columnNum;\n int rowNum;\n \n if( Greenfoot.mouseClicked(this) )\n {\n columnNum = userClick.getX() / ( getWidth() / 3 );\n rowNum = userClick.getY() / ( getHeight() / 3 );\n \n if( board[rowNum][columnNum] == \"\" )\n {\n if( PlayerOneTurn == true )\n {\n board[rowNum][columnNum] = \"X\";\n \n PlayerOneTurn = false;\n messageShown = false;\n }\n else\n {\n board[rowNum][columnNum] = \"O\";\n \n PlayerOneTurn = true;\n messageShown = false;\n }\n }\n else\n {\n JOptionPane.showMessageDialog( null, \"you should select a different spot.\", \"Wrong step\", JOptionPane.PLAIN_MESSAGE );\n }\n }\n \n }", "@Override\n public void doClick(){\n if(checkBounds())\n {\n mealselect.setDessert(this.type);\n }\n }", "public abstract boolean isSelected();", "protected boolean select(int x, int y) {\r\n\t\tanchor = new Point (x, y);\r\n\t\t\t\r\n\t\t// pieces are returned in order of Z coordinate\r\n\t\tShape s = model.getBoard().findShape(anchor.x, anchor.y);\r\n\t\tif (s == null) { return false; }\r\n\t\t\r\n\t\t// no longer in the board since we are moving it around...\r\n\t\tmodel.getBoard().remove(s);\r\n\t\tmodel.setSelected(s);\r\n\t\tpanel.paintBackground(s);\r\n\t\toriginalx = s.getX();\r\n\t\toriginaly = s.getY();\r\n\t\t\r\n\t\t// set drawer to highlight\r\n\t\tShapeDrawer sd = s.getDrawer();\r\n\t\tsd.setState(ShapeDrawer.StateSelected);\r\n\t\t\t\r\n\t\t// set anchor for smooth moving\r\n\t\tdeltaX = anchor.x - originalx;\r\n\t\tdeltaY = anchor.y - originaly;\r\n\t\t\r\n\t\t// paint will happen once moves. This redraws state to prepare for paint\r\n\t\tpanel.redraw();\r\n\t\treturn true;\r\n\t}", "boolean onInteracted(GameCharacter source);", "public boolean isClicked() { return clicked; }", "boolean hasIronSelected();", "@Override\n public boolean touchDown(int screenX, int screenY, int pointer, int button) {\n if(DialogSystem.isDialogOn){\n return true;\n }\n if(isMoving){\n return true;\n }\n\n ClickPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n if(ghostHouse.mainUI.gameison) {\n if (isIntersected()) {\n if (ghostHouse.mainUI.numberItem <= 14) {\n\n for (int i = 0; i < rooms.get(cameraSystem.target).items.size; i++) {\n\n pos = rooms.get(cameraSystem.target).items.get(i).getComponent(PositionComponent.class);\n size = rooms.get(cameraSystem.target).items.get(i).getComponent(SizeComponent.class);\n\n //which particular item is intersected\n if (isInside(new Vector3(pos.getX(), pos.getY(), pos.getZ()), new Vector2(size.width, size.height), targetPosition)) {\n t = 0;\n\n\n if (pos.getZ() >= indexAndMax[0]) { //If the items are overlapping\n indexAndMax[0] = pos.getZ();\n indexAndMax[1] = rooms.get(cameraSystem.target).items.get(i).getComponent(ItemIdComponent.class).getItemID();\n\n }\n }\n }\n prevPosition = new Vector2(ghostHouse.mainGame.ghost.getComponent(PositionComponent.class).getX(),\n ghostHouse.mainGame.ghost.getComponent(PositionComponent.class).getY());\n takeItem = true;\n\n moveCharacter();\n }\n }\n\n //If click on the building\n else if (Intersector.intersectRayTriangles(ray, mesh.buildingVertices, mesh.buildingIndices, mesh.ATTRIBUTE_COUNT, targetPosition)) {\n\n t = 0;\n prevPosition = new Vector2(ghostHouse.mainGame.ghost.getComponent(PositionComponent.class).getX(),\n ghostHouse.mainGame.ghost.getComponent(PositionComponent.class).getY());\n moveCharacter();\n }\n\n }\n return true;\n }", "public boolean isSelectionChanged();", "private boolean tappedOpponentTruck(float x, float y) {\n ArrayList<Truck> trucks_ = tapHandler_.gameMaster_.getOpponentTrucks();\n\n for (Truck truck: trucks_) {\n if (truck.tryToTap(x, y)) {\n Gdx.app.log(\"TruckTag\", \"Tapped Truck\");\n Gdx.app.log(\"TruckTag\", truck.getX() + \" \" + truck.getY() + \" \" + x + \" \" + y + \"\\n\");\n selectedActor_.setTargetTruck(truck);\n return true;\n }\n }\n\n return false;\n }", "public boolean canHandle(Object selection);", "public boolean selectSquare(int[] coords) {\n // If it is the first click, get the first Square.\n if (clickCount == 1) {\n square1 = squares[coords[0]][coords[1]];\n // If there is a Piece in the Square, and the current Player is the owner of this Piece,\n // click process continues to the second click.\n if (!square1.isEmpty() && square1.getPiece().getPlayer() == turn) {\n clickCount++;\n return false;\n // If there is no Piece in the Square, click process does not progress\n } else {\n return false;\n }\n // If this is the second click, checks if the path to the destination Square is clear.\n // If it is, move the Piece to the destination Square if the Square is empty.\n // If the destination Square is not empty, the Piece there must be owned by the opposing\n // Player in order to capture it. Otherwise, the move is not valid.\n } else {\n square2 = squares[coords[0]][coords[1]];\n clickCount = 1;\n // If the Piece is a Knight, don't check for a clear path\n if (square1.getPiece() instanceof Knight) {\n if (square1.getPiece().isValidMove(square2)) {\n move(square1, square2);\n return true;\n }\n } else {\n // If the Piece is not a Knight, check for a clear path\n if (clearPath(square1, square2)) {\n if (square1.getPiece().isValidMove(square2)) {\n move(square1, square2);\n return true;\n }\n }\n }\n }\n return false;\n }", "public boolean isSomethingSelected() {\r\n \t\treturn graph.getSelectionCell() != null;\r\n \t}", "public boolean isPressed() {\r\n List<Entity> entities = dungeon.getEntities();\r\n for (Entity e: entities) {\r\n if (e != null && e.getY() == getY() && e.getX() == getX()) {\r\n if (\"Boulder\".equals(e.getClass().getSimpleName()))\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\n\tboolean isClicked(double x, double y) {\n\n\t\tif (segment.ptLineDist(x, y) < 10 && segment.ptLineDist(x, y) > -10) {\n\t\t\tthis.setColor(Color.BLUE);\n\t\t\tAssignment.frame.repaint();\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.setColor(Color.BLACK);\n\t\t\tAssignment.frame.repaint();\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean canSelect(int x, int y) {\n\t\tPiece nextSquare = pieceAt(x, y);\n\t\tif (nextSquare != null) {\n\t\t\tif (hasCaptured){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse if (hasSelected && nextSquare.isKing()) {\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t} else if (!hasCaptured && whoseTurn == nextSquare.side()) {\t\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t} else if (whoseTurn != nextSquare.side()) {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t} else if (hasSelected && !hasMoved) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tif (hasSelected && !hasMoved &&\n\t\t\t\tvalidMove(prevSelectedX, prevSelectedY, x, y)) {\n\t\t\t\treturn true;\n\t\t\t} else if (hasSelected && prevSelected != null && prevSelected.hasCaptured() &&\n\t\t\t\tvalidMove(prevSelectedX, prevSelectedY, x, y)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public void characterSelected(CharacterSelectionEvent e);", "public boolean isWin() {\n if (chosen_door.getContains() == Contains.CAR) {\n return true;\n }\n return false;\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e)\n\t{\n\t\tDisplayThree.getInstance().addBox.changeContents(\"CREATURE\", true);\n\t\t\n\t\tif (e.getSource() == upArrowButton)\n\t\t{\n\t\t\tscrollUp();\n\t\t\t\n\t\t} else if (e.getSource() == downArrowButton)\n\t\t{\n\t\t\tscrollDown();\n\t\t\t\n\t\t} else if (e.getSource() == middleButtons[0])\n\t\t{\n\t\t\tselectedCreature = thingsInColumn.get(itemsVisible[0]);\n\t\t\t\n\t\t} else if (e.getSource() == middleButtons[1])\n\t\t{\n\t\t\tselectedCreature = thingsInColumn.get(itemsVisible[1]);\n\t\t\t\n\t\t} else if (e.getSource() == middleButtons[2])\n\t\t{\n\t\t\tselectedCreature = thingsInColumn.get(itemsVisible[2]);\n\t\t\t\n\t\t} else if (e.getSource() == middleButtons[3])\n\t\t{\n\t\t\tselectedCreature = thingsInColumn.get(itemsVisible[3]);\n\t\t}\n\t}", "public boolean isSelected() { \n \treturn selection != null; \n }", "public abstract boolean hasSelection();", "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}", "public boolean isAccessibleSelected(int r, int c) {\n try {\n return unoAccessibleTable.isAccessibleSelected(r,c);\n } catch (com.sun.star.lang.IndexOutOfBoundsException e) {\n return false;\n } catch (com.sun.star.uno.RuntimeException e) {\n return false;\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\tplayerSelectNum++;\n\t\tfor (int i = 0; i<charButtons.size(); i++){\n\t\t\tif (e.getSource() == charButtons.get(i)){\n\t\t\t\tcharButtons.get(i).setEnabled(false);\n\t\t\t\tselection = new PlayerInfo(name, characters.get(i));\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\tif (playerSelectNum == 1){\n\t\t\tCLOGameClient c = new CLOGameClient(selection);\n\t\t\tdispose();\n\t\t}\n\t}", "public void interactionOneTouch(int x, int y){\n if(this.getBotones().getBotonRecHorizLeft().contains(x,y)){\n Log.d(TAG,\"boton Left\");\n this.getJugadora().setDireccio(1);\n this.getJugadora().setPosicion(this.getJugadora().getPosicion().x - this.getJugadora().getSpeed(),this.getJugadora().getPosicion().y);\n }else if(this.getBotones().getBotonRecHorizRigth().contains(x,y)) {\n Log.d(TAG, \"boton Right\");\n this.getJugadora().setDireccio(0);\n this.getJugadora().setPosicion(this.getJugadora().getPosicion().x + this.getJugadora().getSpeed(),this.getJugadora().getPosicion().y);\n } else if (this.getBotones().getBotonRecVertArriba().contains(x,y)){\n Log.d(TAG, \"boton Arriba\");\n this.getJugadora().setDireccio(2);\n this.getJugadora().setPosicion(this.getJugadora().getPosicion().x,this.getJugadora().getPosicion().y - this.getJugadora().getSpeed());\n } else if (this.getBotones().getBotonRecVertBajo().contains(x,y)){\n Log.d(TAG, \"boton Abajo\");\n this.getJugadora().setDireccio(3);\n this.getJugadora().setPosicion(this.getJugadora().getPosicion().x,this.getJugadora().getPosicion().y + this.getJugadora().getSpeed());\n }\n if(this.getBotones().getBotonCercleA().contains(x,y)){\n Log.d(TAG, \"boton A\");\n }\n if(this.getBotones().getBotonCercleB().contains(x,y)){\n Log.d(TAG, \"boton B\");\n }\n\n // mover player , interaccion de una sola respuesta por cada click\n\n\n\n }", "public static boolean checkDefeat(){\n\t\tboolean found = false;\n\t\t\n\t\tfor (int i = gui.getCurUnitSelected() ; i < heroList.length && !found; i++){\n\t\t\tif (heroList[i].isAlive()){\n\t\t\t\tgui.setCurSelectedUnit(i);\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < gui.getCurUnitSelected() && !found; i++){\n\t\t\tif (heroList[i].isAlive()){\n\t\t\t\tgui.setCurSelectedUnit(i);\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn found;\n\t}", "public void mouseClicked(MouseEvent e)\n \t\t{\n \t\t\tif(cardIdSelected!=-1){\n \t\t\t\tif(!isRightSide(getFakePos(e.getX(), e.getY()).x)){\n \t\t\t\t\tlisteMissiles.add(getFakePos(e.getX(), e.getY()));\n \t\t\t\t\tcardIdSelected = -1;\n \t\t\t\t\trepaint();\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(isRightSide(getFakePos(e.getX(), e.getY()).x))\n \t\t\t\tFill(e.getX(), e.getY(),(e.getX()+1*caseDim.x),(e.getY()+1*caseDim.y));\n\n \t\t}", "boolean isChildSelectable(int groupPosition, int childPosition);", "public void mouseIsOver(int mX, int mY) {\n\t\tif (mX >= this.xPos - this.diameter/2 && mX <= this.xPos + this.diameter/2 \n\t\t\t\t&& mY >= this.yPos - this.diameter/2 && mY <= this.yPos + this.diameter/2) {\n\t\t\tthis.isSelected = true;\n\t\t} else {\n\t\t\tthis.isSelected = false;\n\t\t}\n\t}", "public void chooseSeat(ActionEvent actionEvent) {\n for (int i = 0; i < 20; i++) {\n if (actionEvent.getSource().toString().trim().equals(seatsArray.get(i).toString().trim())) {\n if (chosenBtn != null)\n chosenBtn.setStyle(\"\"); //For changing the colour back to clear if they choose another seat\n this.chosenBtn = seatsArray.get(i);\n seatNum = this.chosenBtn.getId();\n seatsArray.get(i).setStyle(\"-fx-background-color: LIGHTBLUE\");\n }\n }\n }", "public void selectedDoor(int i) {\n if (stage != Stage.BEGINNING) {\n throw new RuntimeException(\"Invalid Stage\");\n }\n chosen_door = doors.get(i);\n if (doors.get(i).getContains() == Contains.CAR) {\n if (chosen_door == doors.get(2)) {\n doors.get(i - 1).open();\n } else {\n doors.get(i + 1).open();\n }\n } else {\n for (Door extraDoor : doors) {\n if (extraDoor == chosen_door) {\n continue;\n }\n if (extraDoor.getContains() == Contains.CAR) {\n continue;\n }\n extraDoor.open();\n }\n }\n for (\n Door door : doors)\n\n {\n if (door == chosen_door) {\n continue;\n\n }\n if (door.getState() == State.OPEN) {\n continue;\n }\n\n switch_door = door;\n }\n\n stage = Stage.DOOR_CHOSEN;\n }", "public boolean select() {\n\n // The applet declines to be selected\n // if the pin is blocked.\n if ( pin.getTriesRemaining() == 0 )\n return false;\n\n return true;\n\n }", "public boolean isGoal(Coordinate c) {\n\t\tRecordTile recordTile = ExploreMap.getInstance().getExploredMap().get(c);\n\t\tif (!recordTile.getExplored()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public void clicked() {\n\n // for loops that checks each icons coordinats\n for (int i = 0; i < sceneAmount; i++) {\n if ( mousePressed == true && // if the mouse has been pressed\n // if the mouse's X coordinates is within the icons\n mouseX >= 0 &&\n mouseX <= sidebarWidth &&\n\n // checks if the mouses Y coordinates is within the icons\n mouseY >= (i * height / sceneAmount ) &&\n mouseY <= (i * height / sceneAmount ) + height / sceneAmount) {\n\n\n\n // Draws a white rectancle ontop of the clicked icon\n push();\n noStroke();\n fill(clickedColor);\n rect(0, (i * height / sceneAmount ), sidebarWidth, height / sceneAmount);\n pop();\n\n //changes scene to the clicked scene\n scene = i;\n\n //resets everything to prepare for scene change\n scrolled = 0;\n scenes.transparency = 255;\n scenes.slideCounter = 0;\n scenes.slider = 0;\n scenes.fade = false;\n movie.stop();\n playing = false;\n }\n }\n }", "public boolean isSelected_click_Fuel_Rewards_Link(){\r\n\t\tif(click_Fuel_Rewards_Link.isSelected()) { return true; } else { return false;} \r\n\t}", "public boolean canMove(Character c, DirectionFactory d){\n int x = c.getPosX() ;\n int y = c.getPosY();\n\n try {\n Cell nextCell = labyrinth.getNextCell(x, y, d);\n for(int i =0; i < monsters.size(); i++){\n if(nextCell.getX()==monsters.get(i).getPosX() && nextCell.getY()==monsters.get(i).getPosY()){\n return false;\n }\n }\n if(!c.isThroughWall() && nextCell.isSolid()){\n return false;\n }\n\n return true;\n }catch (NullPointerException e){\n\n }\n return false;\n }", "public boolean checkDiagonal() {\n\t\t// conditions fo player X\n\t\tif ((bt[0].getText().equals(\"X\") && bt[4].getText().equals(\"X\") && bt[8].getText().equals(\"X\"))\n\t\t\t\t|| (bt[2].getText().equals(\"X\") && bt[4].getText().equals(\"X\") && bt[6].getText().equals(\"X\"))) {\n\t\t\tjtf.setText(\" PLAYER X WON!\");\n\t\t\tjtf.setForeground(Color.red);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// conditions fo player O\n\t\tif ((bt[0].getText().equals(\"O\") && bt[4].getText().equals(\"O\") && bt[8].getText().equals(\"O\"))\n\t\t\t\t|| (bt[2].getText().equals(\"O\") && bt[4].getText().equals(\"O\") && bt[6].getText().equals(\"O\"))) {\n\t\t\tjtf.setText(\" PLAYER O WON!\");\n\t\t\tjtf.setForeground(Color.blue);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean testSelected() {\n // test if set\n boolean set = Card.isSet(\n selectedCards.get(0).getCard(),\n selectedCards.get(1).getCard(),\n selectedCards.get(2).getCard()\n );\n\n // set currentlySelected to false and replace with new Cards (if applicable)\n for (BoardSquare bs : selectedCards)\n bs.setCurrentlySelected(false);\n\n // handle if set\n if (set) {\n if (!deck.isEmpty() && this.numCardsOnBoard() == 12) {\n for (BoardSquare bs : selectedCards)\n bs.setCard(deck.getTopCard());\n }\n else if (!deck.isEmpty() && this.numCardsOnBoard() < 12) {\n board.compressBoard(selectedCards);\n this.add3();\n }\n else {\n board.compressBoard(selectedCards);\n }\n }\n\n // clear ArrayList\n selectedCards.clear();\n\n // return bool\n return set;\n }", "@Override\n public boolean select() {\n cell.setState(cell.getRevealedState());\n return true;\n }", "@FXML\n private void selectSeat(MouseEvent e) {\n if (((Node) e.getSource()).getStyle()\n .equals(\"-fx-fill:#c9b3b3; -fx-font-family: 'Material Icons'; -fx-font-size: 40.0;\")) {\n Alert alert = new Alert(AlertType.WARNING,\n \"The seat \" + ((Node) e.getSource()).getId() + \" is already booked!\", ButtonType.OK);\n alert.showAndWait();\n if (alert.getResult() == ButtonType.OK) {\n alert.close();\n }\n } else {\n // turning seat back to black if it is red - unselecting it\n if (((Node) e.getSource()).getStyle()\n .equals(\"-fx-fill:red; -fx-font-family: 'Material Icons'; -fx-font-size: 40.0;\")) {\n ((Node) e.getSource())\n .setStyle(\"-fx-fill:black; -fx-font-family: 'Material Icons'; -fx-font-size: 40.0;\");\n Main.getSelectedSeats().remove(((Node) e.getSource()).getId());\n }\n // turning seat red if it is black - selecting it\n else {\n ((Node) e.getSource())\n .setStyle(\"-fx-fill:red; -fx-font-family: 'Material Icons'; -fx-font-size: 40.0;\");\n Main.getSelectedSeats().add(((Node) e.getSource()).getId());\n }\n }\n }", "@Override\n\tpublic void optionSelected(AbstractPlayer arg0, AbstractMonster arg1, int arg2) {\n\t\t\n\t}", "public boolean isAccessibleColumnSelected(int c) {\n try {\n return unoAccessibleTable.isAccessibleColumnSelected(c);\n } catch (com.sun.star.lang.IndexOutOfBoundsException e) {\n return false;\n } catch (com.sun.star.uno.RuntimeException e) {\n return false;\n }\n }", "@Override // a.b.g.d0\n public boolean c() {\n boolean z;\n ActionMenuView actionMenuView = this.f179a.f683b;\n if (actionMenuView != null) {\n c cVar = actionMenuView.u;\n if (cVar != null) {\n if (cVar.w != null || cVar.m()) {\n z = true;\n if (z) {\n return true;\n }\n }\n }\n z = false;\n if (z) {\n }\n }\n return false;\n }", "public int AddCarButtonClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked\n \n if(sE.isSelected() && dW.isSelected()) return 0;\n if(sE.isSelected() && dS.isSelected()) return 1;\n if(sW.isSelected() && dS.isSelected()) return 2;\n if(sW.isSelected() && dE.isSelected()) return 3;\n if(sS.isSelected() && dE.isSelected()) return 4;\n if(sS.isSelected() && dW.isSelected()) return 5;\n return -1;\n \n }", "public boolean isTileSelected() {\n return selectedTile != null;\n }", "public boolean isSelected_click_Digital_coupons_button(){\r\n\t\tif(click_Digital_coupons_button.isSelected()) { return true; } else { return false;} \r\n\t}", "protected abstract boolean takeAction (Shape selected, int x, int y);", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString colorString = flowerColorHorizontalSelector.getSelected();\n\t\t\t\tString leafShapeString = leafShapeHorizontalSelector.getSelected();\n\t\t\t\tString leafMarginString = leafMarginHorizontalSelector.getSelected();\n\t\t\t\tString leafArrangementString = leafArrangementHorizontalSelector.getSelected();\n\t\t\t\t//Uncomfortable putting this here ////messy\n\t\t\t\tif (colorString!=null | leafShapeString!=null | leafMarginString!=null | leafArrangementString!=null){\n\t\t\t\t\tCursor cursor = ((MainActivity) getActivity()).getLeaves(colorString, leafShapeString,leafMarginString,leafArrangementString);\n\t\t\t mListener.fragmentToActivity(2, cursor);\n\t\t\t\t}else{\n\t\t\t\t\tshowText(\"Please select at least one option from one category.\");\n\t\t\t\t}\n\t\t\t}", "private void checkTouchTouch() {\n ArrayList<TuioCursor> cursors = GameManager.getInstance().getTouchHandler().getTuioCursors();\n for (int z = 0; z < cursors.size(); z++){\n try{\n Point2D pixelPoint = new Point2D.Double(cursors.get(z).getX()*Game.WIDTH, cursors.get(z).getY()*Game.HEIGHT);\n int pixelX = (int) pixelPoint.getX();\n int pixelY = (int) pixelPoint.getY();\n\n //Combine the lists with actors to one big list\n List<UsableActor> combinedList = getAllUsableObjects();\n\n //Check for every actor if this touchpoint touches this actor\n for (UsableActor actor : combinedList){\n double actorPixelX = actor.getLocationInsideActorContainer().getX();\n double actorPixelY = actor.getLocationInsideActorContainer().getY();\n\n int actorWidth = actor.getWidth();\n int actorHeight = actor.getHeight();\n\n actorPixelX -= actorWidth/2; \n actorPixelY -= actorWidth/2;\n\n if (( pixelX >= actorPixelX && pixelX <= actorPixelX + actorWidth) && ( pixelY >= actorPixelY && pixelY <= actorPixelY + actorHeight) ){\n pickObject(actor);\n break;\n }\n }\n }\n catch(Exception e)\n {\n \n }\n }\n }", "public boolean select(float x, float y) {\n \tpointer.x = x-pointer.width/2.0f;\n \tpointer.y = y-pointer.height/2.0f;\n\t\tworld.QueryAABB(this, pointer.x,pointer.y,pointer.x+pointer.width,pointer.y+pointer.height);\n\t\tif (selection != null) {\n\t\t\tBody body = selection.getBody();\n\t\t\tmouseJointDef.bodyA = ground;\n\t\t\tmouseJointDef.bodyB = body;\n\t\t\tmouseJointDef.target.set(x,y);\n\t\t\tmouseJointDef.frequencyHz = 5.0f;\n\t\t\tmouseJointDef.dampingRatio = 0.7f;\n\t\t\tmouseJointDef.maxForce = 1000 * body.getMass();\n\t\t\tmouseJoint = (MouseJoint)world.createJoint(mouseJointDef);\n\t\t\tbody.setAwake(true);\n\t\t}\n\t return selection != null; \n }", "@Override\n \t\t\tpublic void onItemClick(AdapterView<?> parent, View v, int position, long id) {\n \t\t\t\tif (isPieceSelected)\n \t\t\t\t\tmakeMove(position);\n \t\t\t\telse\n \t\t\t\t\tcheckMovesOnSelectedPiece(position);\n \t\t\t}", "public void enemyAttack() {\n Log.i(\"enemyAttack\", \"Begins\");\n AIisAttacking = true;\n setHit(false);\n\n // Loop until A.I. selects a cell it has not chosen before.\n int counter = 0;\n int myRow = 0, myCol = 0;\n boolean selectionFound = false;\n String aiSelectedHit = \"Empty\";\n Random newRow, newCol;\n\n while (selectionFound || counter < aiAttacks.size()) {\n selectionFound = false;\n // Select random row and col\n newRow = new Random();\n myRow = newRow.nextInt(maxN);\n newCol = new Random();\n myCol = newCol.nextInt(maxN);\n\n aiSelectedHit = myRow + \", \" + myCol;\n\n while (counter < aiAttacks.size()) {\n // Check if grid has been selected before\n if (aiAttacks.get(counter).equals(aiSelectedHit)) {\n selectionFound = true;\n counter = 0;\n break;\n }\n counter++;\n }\n }\n aiAttacks.add(aiSelectedHit);\n\n checkIfOccupied(myRow, myCol);\n\n if (getHit()) {\n ivCell[myRow][myCol].setImageResource(R.drawable.mushroom);\n Log.i(\"AI getHit\", \"\" + getHit() + \", (\" + myRow + \", \" + myCol + \")\");\n } else {\n ivCell[myRow][myCol].setImageResource(R.drawable.crater);\n Log.i(\"AI getHit\", \"\" + getHit() + \", (\" + myRow + \", \" + myCol + \")\");\n }\n AIisAttacking = false;\n Log.i(\"enemyAttack\", \"Ends\");\n }", "public boolean isSelectingAttackTarget() {\n return false;\n }", "public boolean select(int selectedShip){\n for(int i = 0; i < 5; i++) {\n playerShips[i].selected = false;\n }\n playerShips[selectedShip].selected = true;\n return true;\n }", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Pantalla Instrucciones\n\t\tcase 1:\n\t\t\t//si hace click adentro de la pantalla\n\t\t\tscreen = 2;\n\t\t\tbreak;\n\t\t}\n\t}", "public boolean cellOpen( int selectCell, char playerLetter ){\r\n char test = boardCells[ selectCell ].getData();\r\n if( (test == ' ') && (test != playerLetter)){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public boolean canSelect (int x, int y){\n\t\tif (x < 0 || x > N || y < 0 || y > N) return false;\t//must select on the board\n\n\t\tif (pieceAt(x,y) != null){\t\t\t\t\t\t\t//occupied square\n\t\t\tif (pieceAt(x,y).isFire() == isFireTurn){\t\t//piece must belong to player\n\t\t\t\tif (!hasSelected || !hasMoved) return true;\n\t\t\t\telse return false;\n\t\t\t}\n\t\t\telse return false;\n\t\t}\n\t\t\n\t\telse{\t\t\t\t\t\t\t\t\t\t\t\t//empty square\n\t\t\t//System.out.println(\"CanSelect empty square: hasSelected: \" + hasSelected);\n\t\t\t//System.out.println(\"hasMoved: \" + hasMoved);\n\t\t\tif (hasSelected && !hasMoved){\n\t\t\t\t//System.out.println(\"hasSelected && !hasMoved, reached here\");\n\t\t\t\treturn validMove(currentX, currentY, x, y);\n\t\t\t}\n\t\t\telse if (hasMoved){\n\t\t\t\t//System.out.println(\"not (hasSelected && !hasMoved), ( \" + currentX + \",\" + currentY + \" )\");\n\t\t\t\t//System.out.println(pieceAt(currentX,currentY) == null);\n\t\t\t\tif (pieceAt(currentX,currentY) != null && \n\t\t\t\tpieceAt(currentX, currentY).hasCaptured()){\t\t\t//check if potential double capture\n\t\t\t\t\tif (canCaptureSomewhere(currentX, currentY)){\t//still check for no adjacent moves\n\t\t\t\t\t\treturn validMove(currentX, currentY, x, y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//System.out.println(\"can't return true for canSelect\");\n\t\t\t\treturn false;\t\t\t\t\t\t\t\t\t\t//return false if capturer can't double capture\n\t\t\t}\n\t\t\treturn false;\t\t\t\t\t\t\t\t//can't select empty squares unless moving\n\t\t}\n\t\t\n\t}", "protected boolean isSelectedControlPoint(Point p) {\n\t\tif (p != null)\n\t\t\tfor (int j = 0; j < selectedPoints.size(); ++j)\n\t\t\t\tif (selectedPoints.elementAt(j).X() == p.X()\n\t\t\t\t\t\t&& selectedPoints.elementAt(j).Y() == p.Y())\n\t\t\t\t\treturn true;\n\t\treturn false;\n\t}", "private boolean canArcherHarrasing(Creature a) {\n return heroC.getX() == a.getX() || heroC.getY() == a.getY();\n }", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n currentMazeChoice = \"Simple\";\n }", "public void highlight(){\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\n\t\t\t//if(!clicked){\t\n\t\t\t\t\n\t\t\t\tfirsttime=true;\n\t\t\t\tclicked=true;\n\t\t\t\tif(piece!=null){\n\t\t\t\t\txyMovment=piece.xyPossibleMovments(xPosition, yPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t}", "boolean canPickup(int x, int y) {\n return ((posX == x) && (posY == y));\n }", "@Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n switch (motionEvent.getAction()) {\n case MotionEvent.ACTION_DOWN:\n case MotionEvent.ACTION_MOVE:\n int x = (int) motionEvent.getX();\n int y = (int) motionEvent.getY();\n Rect hitRect = new Rect();\n View v;\n\n for (int i = 0; i < getChildCount(); i++) {\n v = getChildAt(i);\n v.getHitRect(hitRect);\n if (hitRect.contains(x, y)) {\n selectChild(i);\n break;\n }\n }\n break;\n default:\n break;\n }\n\n return true;\n }", "public void changeActiveMonster(){\n //todo\n }", "public void mousePressed(MouseEvent e)\r\n\t{\r\n\t\tboolean hit = false;\r\n\t\tif(cars[fastIndex].contains(e.getX(), e.getY()))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"You caught the fastest car!\");\r\n\t\t\thit = true;\r\n\t\t}\r\n\t\tfor(int i=cars.length-1; i>=0; i--)\r\n\t\t{\r\n\t\t\tif(cars[i].contains(e.getX(), e.getY()) && i!=fastIndex && !hit)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Wrong car. Try again.\");\r\n\t\t\t\thit = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i=0; i<roads.length; i++)\r\n\t\t{\r\n\t\t\tif(roads[i].contains(e.getX(),e.getY()) && !hit)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"You hit the road. Try again.\");\r\n\t\t\t\thit = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "private void actionSwitchSelect()\r\n\t{\r\n\t\tif (FormMainMouse.isSampleSelectOn)\r\n\t\t{\r\n\t\t\thelperSwitchSelectOff();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\thelperSwitchSelectOn();\r\n\r\n\t\t\t//---- If we can select sample, we can not move it\r\n\t\t\thelperSwitchMoveOff();\r\n\t\t}\r\n\t}", "public boolean interact(Character c, World w){\n\t\treturn false;\n\t}", "public boolean isSelectingAction() {\n return false;\n }", "private void rdnamActionPerformed(java.awt.event.ActionEvent evt) {\n if( rdnam.isSelected())\n { \n gt= true;\n }\n \n \n }", "public boolean isClicked(int x, int y) {\n boolean in_flag = false ;\n int i ;\n int j=0 ;\n for (i=1; i<4; i++) {\n j=i-1 ;\n if ((((ypoints[i] <= y) && (y < ypoints[j])) || ((ypoints[j] <= y) && (y < ypoints[i]))) \n && (x < (xpoints[j] - xpoints[i]) * (y - ypoints[i]) / (ypoints[j] - ypoints[i]) + xpoints[i])) {\n in_flag = !in_flag ;\n }\n } // end for\n return in_flag ;\n //System.out.println(\"IN_FLAG=\"+in_flag+VIDStr(100)) ;\n /*\n int dx = x - pos.x ;\n int dy = y - pos.y ;\n double dist = Math.sqrt(dx*dx+dy*dy) ;\n if (dist<=length) {\n return true ;\n } else {\n return false ; \n }\n */\n }", "public void actionPerformed(ActionEvent e){\r\n if(r4.isSelected() || r3.isSelected() || r2.isSelected()){\r\n JOptionPane.showMessageDialog(f,\"Your answer is wrong.\");\r\n }\r\n if(r1.isSelected()){\r\n JOptionPane.showMessageDialog(f,\"Your answer is correct.\");\r\n }\r\n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent evt){\r\n\t\tMain client = Starter.getClient();\r\n\t\tif(!client.isInMenus() && \r\n\t\t\t\t!client.isMouselookActive() && \r\n\t\t\t\tclient.getActiveCam().equals(Main.CAM_MODE.FLY) &&\r\n\t\t\t\tclient.getWorkingScenario() != null && \r\n\t\t\t\tclient.getWorkingScenario().isEditingMode()){//if mouse look == false && activeCam == CAM_MODE.FLY && !inMenues && editMode\r\n\t\t\tScenarioBuilderScreenController.selecting = true;\r\n\t\t\tCollisionResults results = new CollisionResults();\r\n\t\t\tInputManager inputManager = client.getInputManager();\r\n\t\t\tVector2f click2d = inputManager.getCursorPosition();\r\n\t\t\t\r\n\t\t\tCamera cam = client.getCamera();\r\n\t\t\tVector3f click3d = cam.getWorldCoordinates(new Vector2f(click2d.x, click2d.y), 0f).clone();\r\n\t\t\tVector3f dir = cam.getWorldCoordinates(new Vector2f(click2d.x, click2d.y), 1f).subtractLocal(click3d).normalizeLocal();\r\n\t\t\tRay ray = new Ray(click3d, dir);\r\n\t\t\t\r\n\t\t\tNode entityNode = client.getWorkingScenario().getEntityNode();\r\n\t\t\tentityNode.collideWith(ray, results);\r\n\t\t\r\n \tif(results.size() > 0){\r\n \t\tCollisionResult closest = results.getClosestCollision();\r\n \t\tString selected = closest.getGeometry().getName();\r\n \t\tScenario scenario = client.getWorkingScenario();\r\n \t\tEntity selectedEntity = scenario.getEntity(selected);//get selected entity from scene\r\n \t\tif(selectedEntity != null){\r\n \t\t\tif(!client.isCTRLDown()){\r\n \t\t\t\tscenario.selectEntity(selectedEntity);\r\n \t\t\t\tthis.selectedEntity = selectedEntity;\r\n \t\t\t}\r\n \t\t\telse{\r\n \t\t\t\tscenario.deselectEntity(selectedEntity);\r\n \t\t\t\tthis.selectedEntity = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\tnotifyObservers();\r\n \t}\r\n\t\t\tScenarioBuilderScreenController.selecting = false;\r\n\t\t}\r\n\t}", "@Override\n public void onClickRecyclerItem(View v, PassengerArray passengerSelectedThis) {\n if(passengerSelectedThis.isAllowedToSelectSeat())\n {\n //make passenger editable\n Log.i(\" Passenger Selected >> \", passengerSelectedThis.getPaxFullName());\n\n //set selected passenger for seat summary\n if(passengerSelectedThis.isSeatSelectionDone())\n {\n passengerSelectedData = passengerSelectedThis;\n lay_summary_done_button.setVisibility(View.VISIBLE);\n }else\n {\n lay_summary_done_button.setVisibility(View.GONE);\n }\n\n designSeatView(numberOfColumn, classType, seatMapData.getSeatdetailarr(), passengerSelectedThis, hmap);\n }\n else\n {\n\n }\n\n }", "@Override\n public void mouseClicked(MouseEvent e) {\n System.out.println(\"MouseClicked\");\n //kwadrat.clicked();\n trojkat.clicked();\n //kolo.clicked();\n //square.clicked();\n }", "private void PLAYERS_ComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {\n if(PLAYERS_ComboBox1.getSelectedIndex() == 1)\n Machin_playin = true;\n else\n Machin_playin = false;\n \n }", "private void checkClicked()\n {\n if (Greenfoot.mouseClicked(this))\n {\n if (musicPlaying == true)\n {\n setImage(\"volumeOn.png\");\n GreenfootImage volumeOn = getImage();\n volumeOn.scale(70,70);\n setImage(volumeOn); \n soundtrack.playLoop();\n musicPlaying = false;\n }\n else if (musicPlaying == false)\n {\n setImage(\"volumeOff.png\");\n GreenfootImage volumeOff = getImage();\n volumeOff.scale(70,70);\n soundtrack.stop();\n musicPlaying = true;\n }\n }\n }", "public boolean isCat() {\r\n\t\tboolean isCat = false;\r\n\r\n\t\tif (numOfLeg == 4 && mammal == true && sound.equals(\"meow\")) {\r\n\r\n\t\t\tisCat = true;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tisCat = false;\r\n\t\t}\r\n\r\n\t\treturn isCat;\r\n\t}", "@Override\r\n public void onClick(View view) {\n mSoundPool.play(mSoundClick, mVolume, mVolume, 1, 0, 1f);\r\n\r\n // get tile coordinates\r\n int largeI = smallTile.getLargeTileNo();\r\n // Log.e(\"large tile no\", String.valueOf(largeI));\r\n int smallI = smallTile.getSmallTileNo();\r\n // Log.e(\"small tile no\", String.valueOf(smallI));\r\n // change background color\r\n inner.setSelected(!inner.isSelected());\r\n if (phase == 1) {\r\n if (inner.isSelected()) {\r\n // selected state change\r\n inner.setBackgroundResource(R.drawable.tile_blue); // selected background turns blue\r\n String letter = (inner.getText()).toString();\r\n // Log.e(\"letter\", String.valueOf(letter));\r\n allTiles[largeI].append(letter); // add new letter selected to current string\r\n // Log.e(\"character appended\", String.valueOf(letter));\r\n allTilesInt[largeI][smallI] = 1; // set background highlighted\r\n } else {\r\n // de-selected state change\r\n inner.setBackgroundResource(R.drawable.tile_gray); // deselected background is grey\r\n String letter = (inner.getText()).toString(); // get letter from inner tile clicked\r\n // Log.e(\"letter\", String.valueOf(letter));\r\n allTiles[largeI].deleteCharAt(allTiles[largeI].length() - 1); // remove most recently selected\r\n allTilesInt[largeI][smallI] = 0; // deselect background highlighted\r\n }\r\n } else {\r\n // selected state change\r\n if (phaseTwoString.length() != 9) {\r\n if (phaseTwoIsSelected[largeI] == 0) {\r\n inner.setBackgroundResource(R.drawable.tile_purple); // selected background turns blue\r\n String letter = (inner.getText()).toString();\r\n // Log.e(\"letter\", String.valueOf(letter));\r\n phaseTwoString.append(letter); // add new letter selected to current string\r\n // Log.e(\"character appended\", String.valueOf(letter));\r\n phaseTwoIsSelected[largeI] = 1; // set background highlighted\r\n }\r\n }\r\n }\r\n }", "@Override\n\t\tpublic boolean onTouch(View arg0, MotionEvent event) {\n\t\t\t\n\t\t\tswitch(event.getAction()){\n\t\t case MotionEvent.ACTION_DOWN: {\n\t\t \tfor(int i=0;i<maxcount;i++)\n\t\t \t{\n\t\t \t\t\n\t\t if (inCircle(event.getX(), event.getY(), xar[i], yar[i], radius))\n\t\t {\n\t\t \t\n\t\t \n\t\t Dialog dialog = new Dialog(this.getContext());\n\t // Include dialog.xml file\n\t dialog.setContentView(R.layout.dialog);\n\t // Set dialog title\n\t dialog.setTitle(\"Prayer Up\");\n\t \n\t Typeface font = Typeface.createFromAsset(this.getContext().getAssets(), \"Limelight.otf\");\n\t // set values for custom dialog components - text, image and button\n\t TextView text = (TextView) dialog.findViewById(R.id.collegename);\n\t text.setText(AllVar.cname[i]);\n\t text.setPadding(20, 0, 0,0);\n\t text.setTypeface(font);\n\t TextView text1 = (TextView) dialog.findViewById(R.id.collegesub);\n\t text1.setText(\"SubRegion: \"+AllVar.ccord1[i]);\n\t text1.setTypeface(font);\n\t text1.setPadding(10, 0, 0,0);\n\t TextView text2 = (TextView) dialog.findViewById(R.id.collegdate);\n\t text2.setText(AllVar.cdate[i]);\n\t text2.setPadding(10, 0, 0,0);\n\t text2.setTypeface(font);\n\t dialog.setCancelable(true);\n\t \n\t \n\t dialog.show();\n\t \n\t \n\t\t \n\t\t \n\t\t \n\t\t break;\n\t\t }\n\t\t \t}\n\t\t return true;\n\t\t }\n\n\t\t}\n\t\treturn false;\n\t\t}" ]
[ "0.6170247", "0.60937154", "0.606571", "0.5707941", "0.5707941", "0.5707941", "0.5675685", "0.5592867", "0.55659866", "0.55487174", "0.55263454", "0.55263454", "0.55094695", "0.548818", "0.5434085", "0.54299086", "0.53963435", "0.5387931", "0.5386476", "0.53736246", "0.5355506", "0.534336", "0.5341804", "0.5330748", "0.5316218", "0.5315554", "0.5310533", "0.53063923", "0.53026867", "0.5282352", "0.5263838", "0.526097", "0.52510387", "0.5247008", "0.5235008", "0.5230253", "0.5208151", "0.52064174", "0.52022445", "0.51811683", "0.5173323", "0.51568115", "0.51268464", "0.50577116", "0.5050267", "0.5043638", "0.5024934", "0.5023022", "0.5016706", "0.5015205", "0.50107914", "0.49933335", "0.49931183", "0.49873468", "0.49839142", "0.49812064", "0.49807993", "0.49759337", "0.4972872", "0.49716637", "0.4971496", "0.496805", "0.4967462", "0.49627027", "0.49555558", "0.49545097", "0.49460486", "0.4938914", "0.4937284", "0.49294353", "0.4928899", "0.4924053", "0.4921848", "0.49213672", "0.49147674", "0.49124768", "0.49044377", "0.49027535", "0.4898675", "0.48975587", "0.48933417", "0.4892523", "0.48923564", "0.4891917", "0.4885701", "0.4885108", "0.48841602", "0.48840287", "0.4881351", "0.4877387", "0.48762295", "0.4866217", "0.48640904", "0.48637927", "0.48610735", "0.48493215", "0.48483992", "0.48401293", "0.48393226", "0.4836893" ]
0.5566829
8
Method is responsible for drawing all screen content. It's called each time, whenever changes on board are made.
public void paintComponent(Graphics g, int xBeginMap, int yBeginMap, int xEndMap, int yEndMap, int xBeginSrc, int yBeginSrc, int xEndSrc, int yEndSrc) { if(isSelected==true) { g.setColor(new Color(0,255,0,125)); Graphics2D g2d = (Graphics2D)g; Ellipse2D.Double circle = new Ellipse2D.Double(xBeginMap+15,yBeginMap+35, abs(xEndMap - xBeginMap)-30, abs(yEndMap - yBeginMap)-30); g2d.fill(circle); } g.drawImage(mainTexture,xBeginMap,yBeginMap,xEndMap,yEndMap, xBeginSrc,yBeginSrc,xEndSrc,yEndSrc,null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "public void draw() {\n mGameBoard.draw();\n }", "public void draw() { \n\t\tbackground(255); // Clear the screen with a white background\n\t\tfill(0);\n\t\ttextAlign(LEFT);\n\t\ttextSize(12);\n\t\t\n\t\tif (runCount == 0) {\n\t\t\tboard.onClick();\n\t\t} else if (runCount > 0) {\n\t\t\trunCount--;\n\t\t}\n\t\t\n\t\tif (board != null) {\n\t\t\tboard.draw(this, 0, 0, height, height);\n\t\t}\n\t\t\n\t}", "public void updateGraphics() {\n\t\t// Draw the background. DO NOT REMOVE!\n\t\tthis.clear();\n\t\t\n\t\t// Draw the title\n\t\tthis.displayTitle();\n\n\t\t// Draw the board and snake\n\t\t// TODO: Add your code here :)\n\t\tfor(int i = 0; i < this.theData.getNumRows(); i++) {\n\t\t\tfor (int j = 0; j < this.theData.getNumColumns(); j++) {\n\t\t\t\tthis.drawSquare(j * Preferences.CELL_SIZE, i * Preferences.CELL_SIZE,\n\t\t\t\t\t\tthis.theData.getCellColor(i, j));\n\t\t\t}\n\t\t}\n\t\t// The method drawSquare (below) will likely be helpful :)\n\n\t\t\n\t\t// Draw the game-over message, if appropriate.\n\t\tif (this.theData.getGameOver())\n\t\t\tthis.displayGameOver();\n\t}", "public void drawBoard() {\n\n\t\t// Create Observable variable\n\t\tgameObserver = new GameObservable(0);\n\n\t\t// Add panel with buttons Start/Stop, Pause/Resume, Undo and Replay\n\t\tJPanel buttonPanel = new JPanel();\n\n\t\tstartStopButton = new JButton();\n\t\tstartStopButton.setText(\"Start\");\n\t\tstartStopButton.addMouseListener(new customMouseListener());\n\t\tstartStopButton.setFocusable(false);\n\n\t\tpauseResumeButton = new JButton();\n\t\tpauseResumeButton.setText(\"Pause\");\n\t\tpauseResumeButton.addMouseListener(new customMouseListener());\n\t\tpauseResumeButton.setFocusable(false);\n\t\tpauseResumeButton.setEnabled(false);\n\n\t\tundoButton = new JButton();\n\t\tundoButton.setText(\"Undo\");\n\t\tundoButton.addMouseListener(new customMouseListener());\n\t\tundoButton.setFocusable(false);\n\t\tundoButton.setEnabled(false);\n\n\t\treplayButton = new JButton();\n\t\treplayButton.setText(\"Replay\");\n\t\treplayButton.addMouseListener(new customMouseListener());\n\t\treplayButton.setFocusable(false);\n\t\treplayButton.setEnabled(false);\n\n\t\t// Add buttons to the panel\n\t\tbuttonPanel.add(startStopButton);\n\t\tbuttonPanel.add(pauseResumeButton);\n\t\tbuttonPanel.add(undoButton);\n\t\tbuttonPanel.add(replayButton);\n\n\t\t// Add Panels\n\t\tsetLayout(new BorderLayout());\n\t\tclock = new Clock(gameObserver);\n\t\tadd(clock, BorderLayout.NORTH);\n\t\tadd(buttonPanel, BorderLayout.SOUTH);\n\t\tboard = new Board(gameObserver);\n\t\tboard.setBackground(Color.white);\n\t\tadd(board);\n\n\t\t// Register to observer\n\t\tgameObserver.addObserver(board);\n\t\tgameObserver.addObserver(clock);\n\n\t\t// JFrame Properties\n\t\tsetTitle(\"Breakout\");\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tsetSize(Constants.WIDTH, Constants.HEIGTH);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tsetVisible(true);\n\n\t}", "private void draw() {\n GraphicsContext gc = canvas.getGraphicsContext2D();\n\n double size = getCellSize();\n Point2D boardPosition = getBoardPosition();\n\n // Clear the canvas\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the grid\n gc.setStroke(Color.LIGHTGRAY);\n for (int i = 0; i <= board.getWidth(); i++) {\n gc.strokeLine(boardPosition.getX() + i * size, boardPosition.getY(),\n boardPosition.getX() + i * size, boardPosition.getY() + board.getHeight() * size);\n }\n\n for (int i = 0; i <= board.getHeight(); i++) {\n gc.strokeLine(boardPosition.getX(), boardPosition.getY() + i * size,\n boardPosition.getX() + board.getWidth() * size, boardPosition.getY() + i * size);\n }\n\n // Draw cells\n gc.setFill(Color.ORANGE);\n for (int i = 0; i < board.getWidth(); i++) {\n for (int j = 0; j < board.getHeight(); j++) {\n if (board.isAlive(i, j)) {\n gc.fillRect(boardPosition.getX() + i * size, boardPosition.getY() + j * size, size, size);\n }\n }\n }\n }", "private void refreshDisplay(){\n // The ArrayList bricks gets all the bricks currently on the board.\n bricks.addAll(board.getBoardBricks());\n bricks.addAll(board.getCurrentBlock().getBricks());\n g.clearRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n\n setupGhostBoard();\n for (Brick brick : ghostBoard.getCurrentBlock().getBricks()){\n g.setFill(Color.rgb(61, 61, 61));\n g.fillRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n g.setStroke(Color.WHITE);\n g.setLineWidth(2.0);\n g.strokeRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n }\n\n for (Brick brick : bricks) {\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 2, brick.getY() * BRICK_SIZE + 2, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n if(board.getHeldBlock() != null){\n for(Brick brick : board.getHeldBlock().getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 44, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n }\n\n for(Brick brick : board.getBlockQueue().get(0).getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 184, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n score.setText(\"\" + board.getScore());\n highScore.setText(\"\" + Math.max(FileHandler.readHighScore(), board.getScore()));\n level.setText(\"\" + board.getLevel());\n lines.setText(\"\" + board.getTotalLinesCleared());\n // All the elements of bricks must be removed, otherwise they stack up.\n bricks.removeAll(bricks);\n\n if(board.isGameOver()){\n g.setFill(Color.rgb(31, 31, 31, 0.5));\n g.fillRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+1), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n g.setTextAlign(TextAlignment.CENTER);\n g.setTextBaseline(VPos.CENTER);\n g.setFill(Color.WHITE);\n g.setFont(new Font(\"Impact\", 50));\n g.fillText(\n \"GAME OVER\",\n 160, 352\n );\n g.setFill(Color.rgb(190, 190, 190));\n g.setFont(new Font(\"Impact\", 20));\n g.fillText(\n \"Press 'Esc' to exit.\",\n 160, 392\n );\n\n int oldHighScore = FileHandler.readHighScore(), newHighScore = board.getScore();\n if(oldHighScore < newHighScore){\n highScoreSurpassed = true;\n }\n if(highScoreSurpassed){\n g.setFill(Color.WHITESMOKE);\n g.setFont(new Font(\"Impact\", 24));\n g.fillText(\n \"New High Score: \" + newHighScore + \"!\\nOld High Score: \" + oldHighScore + \".\",\n 160, 502\n );\n }\n }\n }", "private void draw() {\n\n // Current generation (y-position on canvas)\n int generation = 0;\n\n // Looping while still on canvas\n while (generation < canvasHeight / CELL_SIZE) {\n\n // Next generation\n cells = generate(cells);\n\n // Drawing\n for (int i = 0; i < cells.length; i++) {\n gc.setFill(colors[cells[i]]);\n gc.fillRect(i * CELL_SIZE, generation * CELL_SIZE, CELL_SIZE, CELL_SIZE);\n }\n\n // Next line..\n generation++;\n }\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 init() {\n this.screen = new Rectangle(PADDING, PADDING, Game.TOTAL_COLUMNS * CELL_SIZE, Game.TOTAL_ROWS * CELL_SIZE);\n\n // display the background\n this.screen.setColor(Color.LIGHT_GRAY);//board edge color\n this.screen.fill();\n\n }", "public void DrawScreen() {\r\n DrawScreen(0, false, null);\r\n }", "private void redraw() {\r\n for (int row = 0; row < maxRows; row++) {\r\n for (int column = 0; column < maxColumns; column++) {\r\n grid[row][column].setBackground(SQUARE_COLOR);\r\n }\r\n }\r\n grid[snake[HEAD].row][snake[HEAD].column].setBackground(\r\n SNAKE_HEAD_COLOR);\r\n for (int i = 1; i < length; i++) {\r\n grid[snake[i].row][snake[i].column].setBackground(SNAKE_BODY_COLOR);\r\n }\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }", "public void draw() {\n \n // TODO\n }", "public void draw() {\n\t\tsuper.repaint();\n\t}", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "public void draw() {\r\n if(isVisible()) {\r\n Canvas canvas = Canvas.getCanvas();\r\n canvas.draw(this,getColor(),\r\n new Rectangle(\r\n (int)round(getXposition()),\r\n (int)round(getYposition()),\r\n (int)round(size),\r\n (int)round(size)));\r\n canvas.wait(10);\r\n }\r\n }", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }", "public void draw() {\n draw(root, false);\n }", "public static void draw() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[0][0] + \" | \" + board[0][1] + \" | \"\n\t\t\t\t+ board[0][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[1][0] + \" | \" + board[1][1] + \" | \"\n\t\t\t\t+ board[1][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[2][0] + \" | \" + board[2][1] + \" | \"\n\t\t\t\t+ board[2][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println();\n\t}", "public void draw() \r\n\t{\r\n\t\tdraw(root, new RectHV(0,0,1,1) );\r\n\t}", "public void draw() {\n draw(this.root, new RectHV(0.0, 0.0, 1.0, 1.0));\n }", "public void refreshDisplay(){\r\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n switch (boardRep[i][j]) { //maybe not best style to have default red but whatever (change board\r\n case 0:\r\n boardSquares[i][j].setBackground(Color.WHITE);\r\n break;\r\n case 1:\r\n boardSquares[i][j].setBackground(Color.BLACK);\r\n break;\r\n default:\r\n boardSquares[i][j].setBackground(Color.RED);\r\n break;\r\n }\r\n }\r\n }\r\n \r\n if (blackToPlay){ //change to move squares\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n } else{\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n }\r\n \r\n \r\n }", "private void drawGameBoard(){\n boardView.setVisibility(View.VISIBLE);\n Bitmap bitmap = Bitmap.createBitmap(getWindowManager().getDefaultDisplay().getWidth(),getWindowManager().getDefaultDisplay().getHeight(),Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n boardView.setImageBitmap(bitmap);\n\n Paint paint = new Paint();\n paint.setColor(Color.WHITE);\n paint.setStrokeWidth(20);\n paint.setStyle(Paint.Style.STROKE);\n\n int sx,sy,ex,ey,x,y;\n Point size = new Point();\n Display display = getWindowManager().getDefaultDisplay();\n\n display.getSize(size);\n int width = size.x;\n int height = size.y;\n\n sx = 0;\n sy = (int) (height * .42);\n ex = width;\n ey = (int) (height * .42);\n\n canvas.drawLine(sx,sy,ex,ey,paint);\n\n sx = 0;\n sy = (int) (height * .65);\n ex = width;\n ey = (int) (height * .65);\n\n canvas.drawLine(sx,sy,ex,ey,paint);\n\n sx = (int) (width * .32);\n sy = (int) (height * .18);\n ex = (int) (width * .32);\n ey = (int) (height * .89);\n\n canvas.drawLine(sx,sy,ex,ey,paint);\n\n sx = (int) (width * .68);\n sy = (int) (height * .18);\n ex = (int) (width * .68);\n ey = (int) (height * .89);\n\n canvas.drawLine(sx,sy,ex,ey,paint);\n\n x = (int) (width * .07);\n y = (int) (height * .22);\n\n buttonGame1.setX(x);\n buttonGame1.setY(y);\n\n x = (int) (width * .38);\n y = (int) (height * .22);\n\n buttonGame2.setX(x);\n buttonGame2.setY(y);\n\n x = (int) (width * .69);\n y = (int) (height * .22);\n\n buttonGame3.setX(x);\n buttonGame3.setY(y);\n\n x = (int) (width * .07);\n y = (int) (height * .43);\n\n buttonGame4.setX(x);\n buttonGame4.setY(y);\n\n x = (int) (width * .38);\n y = (int) (height * .43);\n\n buttonGame5.setX(x);\n buttonGame5.setY(y);\n\n x = (int) (width * .69);\n y = (int) (height * .43);\n\n buttonGame6.setX(x);\n buttonGame6.setY(y);\n\n x = (int) (width * .07);\n y = (int) (height * .64);\n\n buttonGame7.setX(x);\n buttonGame7.setY(y);\n\n x = (int) (width * .38);\n y = (int) (height * .64);\n\n buttonGame8.setX(x);\n buttonGame8.setY(y);\n\n x = (int) (width * .69);\n y = (int) (height * .64);\n\n buttonGame9.setX(x);\n buttonGame9.setY(y);\n\n }", "private void updateCanvas()\r\n\t{\r\n\t\tboardCanvas.repaint();\r\n\t\tdiceCanvas.repaint();\r\n\t}", "public void render()\n\t{\n\t\t// Get or create the BufferStrategy to plan rendering\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the graphics that can be drawn to\n\t\tg = bs.getDrawGraphics();\n\t\t\n\t\t// Set the Graphics2D\n\t\tg2d = (Graphics2D)g;\n\t\t\n\t\t// Create a black rectangle to fill the canvas as a base background\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\tif (screenLoaded)\n\t\t{\n\t\t\t// Draw the static background\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawStaticBackground(g);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(game.getCamera().getxPos(), \n\t\t\t\t\t\t \t game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the background layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawBackground(g);\n\t\t\t\n\t\t\t// Render all of the Tiles\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesWorld())\n\t\t\t\tgame.getWorldHandler().renderTiles(g);\n\t\t\t\n\t\t\t// Render all of the GameObjects\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesGameObjects())\n\t\t\t\tgame.getObjectHandler().renderGameObjects(g);\n\t\t\t\n\t\t\t// Draw the foreground layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawForeground(g);\n\t\t\t\n\t\t\t// Draw the lighting\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesLighting())\n\t\t\tg.drawImage(game.getLightHandler().getLightmap(), -1500, -3100, null);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(-game.getCamera().getxPos(), \n\t\t\t\t\t\t \t -game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the gui layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawGui(g);\n\t\t\t\n\t\t\t// Draw the debug layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null\n\t\t\t\t&& game.getDebugScreen() != null\n\t\t\t\t&& game.isDebugShown())\n\t\t\t\tgame.getDebugScreen().showDebug(g);\n\t\t\t\n\t\t\t// Draw the loading \"curtain\" if the screen is still loading\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null &&\n\t\t\t\t!screenLoaded)\n\t\t\t{\n\t\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dispose of all graphics\n\t\t\tg.dispose();\n\t\t\t// Show all graphics prepared on the BufferStrategy\n\t\t\tbs.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGraphics2D g2 = (Graphics2D)g;\n\t\t\tg2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\t\n\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Dispose of all graphics\n\t\tg.dispose();\n\t\t// Show all graphics prepared on the BufferStrategy\n\t\tbs.show();\n\t}", "private void paintGrid() {\n\n g2d.setColor(_BOARDCOLOR); //Set the color to specific color of the board.\n\n for(int i = 0; i < grids.size(); i++) { //Iterating the 16 grids while drawing each on JComponent.\n\n g2d.draw(grids.get(i));\n }\n }", "@Override\n public void onDraw(Canvas canvas) {\n\n canvas.drawBitmap(background, 0, 0, paint);\n\n drawScoreText(canvas);\n\n if (!game.isActive() && !game.aGrid.isAnimationActive()) {\n drawNewGameButton(canvas, true);\n }\n\n drawCells(canvas);\n\n if (!game.isActive()) {\n drawEndGameState(canvas);\n }\n\n if (!game.canContinue()) {\n drawEndlessText(canvas);\n }\n\n //Refresh the screen if there is still an animation running\n if (game.aGrid.isAnimationActive()) {\n invalidate(startingX, startingY, endingX, endingY);\n tick();\n //Refresh one last time on game end.\n } else if (!game.isActive() && refreshLastTime) {\n invalidate();\n refreshLastTime = false;\n }\n }", "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 }", "public void draw() {\r\n\t\tthis.sprite.draw(this.col * MainApp.getGridSize(), this.row * MainApp.getGridSize());\r\n\t}", "private void displayBoard()\n {\n GreenfootImage toDisplay;\n \n for( int r = 0; r < board.length; r ++ )\n {\n for( int c = 0; c < board[r].length; c ++ )\n {\n toDisplay = new GreenfootImage( board[r][c], 100, Color.BLACK, new Color(0,0,0,0) ); \n getBackground().drawImage( toDisplay, c * getWidth()/3 + (getWidth()/3 - toDisplay.getWidth() )/2 , r * getHeight()/3 + (getHeight()/3 - toDisplay.getHeight() )/2 );\n }\n }\n }", "private void setupBoard() {\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension(myWidth, myHeight));\n myBoard.addObserver(this);\n enableStartupKeys();\n }", "public void draw() {\n draw(root, true);\n }", "public final void drawChildren() {\n // Set my clipping rectangle\n assert (window != null);\n assert (getScreen() != null);\n Screen screen = getScreen();\n\n // Special case: TStatusBar is drawn by TApplication, not anything\n // else.\n if (this instanceof TStatusBar) {\n return;\n }\n\n screen.setClipRight(width);\n screen.setClipBottom(height);\n\n int absoluteRightEdge = window.getAbsoluteX() + window.getWidth();\n int absoluteBottomEdge = window.getAbsoluteY() + window.getHeight();\n if (!(this instanceof TWindow) && !(this instanceof TVScroller)) {\n absoluteRightEdge -= 1;\n }\n if (!(this instanceof TWindow) && !(this instanceof THScroller)) {\n absoluteBottomEdge -= 1;\n }\n int myRightEdge = getAbsoluteX() + width;\n int myBottomEdge = getAbsoluteY() + height;\n if (getAbsoluteX() > absoluteRightEdge) {\n // I am offscreen\n screen.setClipRight(0);\n } else if (myRightEdge > absoluteRightEdge) {\n screen.setClipRight(screen.getClipRight()\n - (myRightEdge - absoluteRightEdge));\n }\n if (getAbsoluteY() > absoluteBottomEdge) {\n // I am offscreen\n screen.setClipBottom(0);\n } else if (myBottomEdge > absoluteBottomEdge) {\n screen.setClipBottom(screen.getClipBottom()\n - (myBottomEdge - absoluteBottomEdge));\n }\n\n // Set my offset\n screen.setOffsetX(getAbsoluteX());\n screen.setOffsetY(getAbsoluteY());\n\n // Draw me\n draw();\n\n // Continue down the chain\n for (TWidget widget: children) {\n widget.drawChildren();\n }\n }", "public void draw() {\n\t //FrameRate should only 5 when there is no activity. Otherwise, 60\n if (!EventQueue.getInstance().isTiccing() && System.currentTimeMillis() - lastActive >= 300) {\n noLoop();\n setFrameRate(5);\n println(\"no draw activity\");\n } else{\n \t setFrameRate(60);\n }\n background(255);\n //Process menu data at the beginning\n // Menu menuSing = Menu.getInstance();\n // if ((boolean) menuSing.getControllerValue(\"Button0\")) {\n // KeyMap.getInstance().run('q');\n // }\n\n pushMatrix();\n //Enable scrolling\n translate(0, verticalScroll);\n StringManager.getInstance().draw();\n\n popMatrix();\n\n //if (frameCount % 10 == 0)System.out.println(frameRate);\n\n //Draw menu after\n Menu.getInstance().draw();\n }", "public void updateScreen(){}", "private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}", "public void start(){\n getBoard();\n prepareBoard();\n renderBoard();\n }", "public void drawScreen(int par1, int par2, float par3)\n {\n \tStringTranslate var1 = StringTranslate.getInstance();\n this.drawDefaultBackground();\n this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);\n int var4 = this.func_73907_g();\n int var5 = 0;\n\n while (var5 < this.options.keyBindings.length)\n {\n boolean var6 = false;\n int var7 = 0;\n\n while (true)\n {\n if (var7 < this.options.keyBindings.length) // checking for collisions in the minimap's bindings, and the game's bindings from 0 to the size of the minimap's bindings\n {\n if (this.options.keyBindings[var5].keyCode == Keyboard.KEY_NONE || (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode) && (this.options.keyBindings[var5].keyCode != this.options.game.gameSettings.keyBindings[var7].keyCode))\n {\n ++var7;\n continue;\n }\n\n var6 = true; // collision\n }\n \n if (var7 < this.options.game.gameSettings.keyBindings.length) // continue checking for collisions only among the standard game's keybindings - an array larger than that of the minimap.\n {\n if (this.options.keyBindings[var5].keyCode == Keyboard.KEY_NONE || this.options.keyBindings[var5].keyCode != this.options.game.gameSettings.keyBindings[var7].keyCode)\n {\n ++var7;\n continue;\n }\n\n var6 = true; // collision\n }\n\n if (this.buttonId == var5) // buttonId is currently being edited button. Draw > ??? <\n {\n ((GuiButton)this.controlList.get(var5)).displayString = \"\\u00a7f> \\u00a7e??? \\u00a7f<\";\n }\n else if (var6) // key collision, draw red\n {\n ((GuiButton)this.controlList.get(var5)).displayString = \"\\u00a7c\" + this.options.getOptionDisplayString(var5);\n }\n else // just show current binding\n {\n ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);\n }\n\n this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);\n ++var5;\n break;\n }\n }\n \n this.drawCenteredString(this.fontRenderer, var1.translateKey(\"controls.minimap.unbind1\"), this.width / 2, this.height / 6 + 115, 16777215);\n this.drawCenteredString(this.fontRenderer, var1.translateKey(\"controls.minimap.unbind2\"), this.width / 2, this.height / 6 + 129, 16777215);\n\n\n super.drawScreen(par1, par2, par3);\n }", "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "public void redraw(int [][] board)\n\t{\n\t\tfor(int i = 0; i < 20; ++i)\n\t\t{\n\t\t\tfor( int j = 0; j < 10; ++j)\n\t\t\t{\n\t\t\t\tswitch (board[i][j])\n\t\t\t\t{\n\t\t\t\t\t//empty\n\t\t\t\t\tcase 0:\tcolors[i][j] = Color.GRAY; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//J - shape\n\t\t\t\t\tcase 1:\tcolors[i][j] = Color.BLUE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//Z shape\n\t\t\t\t\tcase 2:\tcolors[i][j] = Color.RED; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//L shape\n\t\t\t\t\tcase 3:\tcolors[i][j] = Color.ORANGE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//S shape\n\t\t\t\t\tcase 4:\tcolors[i][j] = new Color(102,255,102); ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//I shape\n\t\t\t\t\tcase 5:\tcolors[i][j] = Color.CYAN; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//O shape\n\t\t\t\t\tcase 6:\tcolors[i][j] = Color.YELLOW; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//T shape\n\t\t\t\t\tcase 7:\tcolors[i][j] = Color.PINK; \n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tview.getInGamePanel().getBoardGamePanel().redraw(colors);\t\n\t}", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "public void draw() {\n\t\t\r\n\t\tSystem.out.println(\"drawing...\");\r\n\t\t\r\n\t}", "public void renderBoard(){\n for (int k = 0; k < grid.length; k++)\n for (int m = 0; m < grid[k].length; m++)\n grid[k][m] = 0;\n\n // fill the 2D array using information for non-empty tiles\n for (Cell c : game.getNonEmptyTiles())\n grid[c.getRow()][c.getCol()] = c.getValue();\n }", "public Display() {\r\n\t\t//Fills the board with invalid positions\r\n\t\tboard = new int[17][17];\r\n\t\tfor (int i = 0; i < 17; i++)\r\n\t\t\tfor (int j = 0; j < 17; j++)\r\n\t\t\t\tboard[i][j] = -1;\r\n\r\n\t\t//Fills the center of the board with valid positions\r\n\t\tfor (int i = 4; i <= 12; i++)\r\n\t\t\tfor (int j = 4; j <= 12; j++)\r\n\t\t\t\tboard[i][j] = 0;\r\n\t\t\r\n\t\t//Fills the rest of the board with valid positions\r\n\t\tfillTriangle(-1, board, 0, 16, 12);\r\n\t\tfillTriangle(1, board, 0, 9, 13);\r\n\t\tfillTriangle(-1, board, 0, 7, 12);\r\n\t\tfillTriangle(1, board, 0, 0, 4);\r\n\t\tfillTriangle(-1, board, 0, 7, 3);\r\n\t\tfillTriangle(1, board, 0, 9, 4);\r\n\t\t\r\n\t\tthis.setPreferredSize(SIZE);\r\n\t}", "public void draw()\n\t{\n\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t\n\t\tfor (int i = 0; i < board_size; i++)\n\t\t{\n\t\t\tSystem.out.print(board_size - i + \" |\");\n\t\t\t\n\t\t\tfor (int j = 0; j < board_size; j++)\n\t\t\t{\n\t\t\t\tif (getPiece(i,j) == null) {System.out.print(\" |\");}\n\t\t\t\telse {System.out.print(\" \" + getPiece(i,j).getSymbol().toChar() + \" |\");}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" A B C D E F G H \\n\");\n\t}", "void updateScreen() {\n\t\tZone possibleNewZone = currentZone.getSpace(playerY, playerX).getNextZone();\n\t\tif (possibleNewZone != null) {\n\t\t\tString oldBGMusic = currentZone.getBackgroundMusic();\n\t\t\tcurrentZone = possibleNewZone;\n\t\t\tcurrentZone.enableZoneWarpSpaces();\n\t\t\tplayerX = currentZone.getPlayerStartX();\n\t\t\tplayerY = currentZone.getPlayerStartY();\n\t\t\t\n\n\t\t\tif (!oldBGMusic.equals(currentZone.getBackgroundMusic())) {\n\t\t\t\tmusicPlayer.stop();\n\t\t\t\tmusicPlayer.play(currentZone.getBackgroundMusic(), 100);\n\t\t\t}\n\t\t}\n\n\t\t// Update Panel Colors\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\t\t\t\tpanels[i][a].setBackground(currentZone.getSpace(i, a).getColor());\n\t\t\t}\n\t\t}\n\n\t\t// Update Labels\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\n\t\t\t\tlabels[i][a].setIcon(currentZone.getSpace(i, a).getPic());\n\t\t\t}\n\t\t}\n\t\t// Shows player in the new space\n\t\tlabels[playerY][playerX].setIcon(playerPic);\n\n\t\t// Shows enemy in the new space\n\t\t// labels[enemyY][enemyX].setIcon(enemyPic);\n\t}", "private void draw() {\n gsm.draw(g);\n }", "public void paint () {\n\t\tPaint.clear();\n\t\t\n\t\tPaint.setColor(Color.WHITE);\n\t\tPaint.fillRect(0,0,numcols_ * cellsize_,numrows_ * cellsize_);\n\t\tPaint.setColor(Color.GRAY);\n\t\tPaint.drawRect(0,0,numcols_ * cellsize_ - 1,numrows_ * cellsize_ - 1);\n\n\t\tfor ( int row = 0 ; row < numrows_ ; row++ ) {\n\t\t\tfor ( int col = 0 ; col < numcols_ ; col++ ) {\n\t\t\t\tint x = col * cellsize_;\n\t\t\t\tint y = row * cellsize_;\n\n\t\t\t\tThing thing = at(row,col);\n\t\t\t\tif ( thing != null ) {\n\t\t\t\t\tthing.paint(x,y,cellsize_,cellsize_);\n\t\t\t\t}\n\t\t\t\tPaint.setColor(Color.GRAY);\n\t\t\t\tPaint.drawRect(x,y,cellsize_,cellsize_);\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\n\tpublic void run() {\n\n\t\ttheBoard.repaint();\n\n\t}", "public void display_game_screen() {\n\n myScreen.screenMode = myScreen.DISPLAY_GAME_SCREEN;\n\n pushMatrix();\n\n calc_screen_translation();\n\n imageMode(CORNER);\n image(backgroundImage, 0, 0);\n\n // draw_grid();\n\n draw_game_assets();\n\n pacman.update(isPacmanUp, isPacmanDown, isPacmanLeft, isPacmanRight);\n ghost.update(isGhostUp, isGhostDown, isGhostLeft, isGhostRight);\n\n pacman.display();\n ghost.display();\n\n score.run(pacman.xTile, pacman.yTile, ghost.xTile, ghost.yTile);\n\n popMatrix();\n }", "private void drawView(Canvas canvas){\n //long start = System.currentTimeMillis();\n\n getCursor().updateCache(getFirstVisibleLine());\n\n ColorScheme color = mColors;\n drawColor(canvas, color.getColor(ColorScheme.WHOLE_BACKGROUND), mViewRect);\n\n float lineNumberWidth = measureLineNumber();\n float offsetX = - getOffsetX();\n\n drawLineNumberBackground(canvas, offsetX, lineNumberWidth + mDividerMargin, color.getColor(ColorScheme.LINE_NUMBER_BACKGROUND));\n\n drawCurrentLineBackground(canvas, color.getColor(ColorScheme.CURRENT_LINE));\n drawCurrentCodeBlockLabelBg(canvas);\n\n drawDivider(canvas, offsetX + lineNumberWidth + mDividerMargin, color.getColor(ColorScheme.LINE_DIVIDER));\n\n drawLineNumbers(canvas, offsetX, lineNumberWidth, color.getColor(ColorScheme.LINE_NUMBER));\n offsetX += lineNumberWidth + mDividerMargin * 2 + mDividerWidth;\n\n if(mCursor.isSelected()){\n drawSelectedTextBackground(canvas,offsetX, color.getColor(ColorScheme.SELECTED_TEXT_BACKGROUND));\n }\n\n drawText(canvas, offsetX, color.getColor(ColorScheme.TEXT_NORMAL));\n drawComposingTextUnderline(canvas,offsetX, color.getColor(ColorScheme.UNDERLINE));\n\n if(!mCursor.isSelected()){\n drawSelectionInsert(canvas, offsetX, color.getColor(ColorScheme.SELECTION_INSERT));\n if(mEventHandler.shouldDrawInsertHandle()) {\n drawHandle(canvas,mCursor.getLeftLine(),mCursor.getLeftColumn(),mInsertHandle);\n }\n }else if(!mTextActionPanel.isShowing()){\n drawHandle(canvas,mCursor.getLeftLine(),mCursor.getLeftColumn(),mLeftHandle);\n drawHandle(canvas,mCursor.getRightLine(),mCursor.getRightColumn(),mRightHandle);\n }else{\n mLeftHandle.setEmpty();\n mRightHandle.setEmpty();\n }\n\n drawBlockLines(canvas,offsetX);\n drawScrollBars(canvas);\n\n //These are for debug\n //long end = System.currentTimeMillis();\n //canvas.drawText(\"Draw:\" + (end - start) + \"ms\" + \"Last highlight:\" + m + \"ms\", 0, getLineBaseLine(11), mPaint);\n }", "public void draw(){\n\t\t\tint x = getPreferredSize().width/2;\n\t\t\tint y = 10;\n\t\t\tif (root() != null)\n\t\t\t\tpreOrderCell(root(), x, y, root().getColor());\n\t\t\tjgraph.getGraphLayoutCache().insert(cells.values().toArray());\n\t\t\tjgraph.getGraphLayoutCache().insert(nullnodes.toArray());\n\t\t}", "public void updateScreen()\n {\n super.updateScreen();\n }", "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 }", "private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }", "public static void setBoard() {\n\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\tStdDraw.filledRectangle(500, 500, 1000, 1000);\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\tStdDraw.filledCircle(200, 800, 35);\n\t\tStdDraw.filledCircle(500, 800, 35);\n\t\tStdDraw.filledCircle(800, 800, 35);\n\t\tStdDraw.filledCircle(200, 200, 35);\n\t\tStdDraw.filledCircle(500, 200, 35);\n\t\tStdDraw.filledCircle(800, 200, 35);\n\t\tStdDraw.filledCircle(200, 500, 35);\n\t\tStdDraw.filledCircle(800, 500, 35);\n\t\tStdDraw.filledCircle(350, 650, 35);\n\t\tStdDraw.filledCircle(500, 650, 35);\n\t\tStdDraw.filledCircle(650, 650, 35);\n\t\tStdDraw.filledCircle(350, 350, 35);\n\t\tStdDraw.filledCircle(500, 350, 35);\n\t\tStdDraw.filledCircle(650, 350, 35);\n\t\tStdDraw.filledCircle(350, 500, 35);\n\t\tStdDraw.filledCircle(650, 500, 35);\n\n\t\tStdDraw.setPenRadius(0.01);\n\t\tStdDraw.line(200, 200, 800, 200);\n\t\tStdDraw.line(200, 800, 800, 800);\n\t\tStdDraw.line(350, 350, 650, 350);\n\t\tStdDraw.line(350, 650, 650, 650);\n\t\tStdDraw.line(200, 500, 350, 500);\n\t\tStdDraw.line(650, 500, 800, 500);\n\t\tStdDraw.line(200, 800, 200, 200);\n\t\tStdDraw.line(800, 800, 800, 200);\n\t\tStdDraw.line(350, 650, 350, 350);\n\t\tStdDraw.line(650, 650, 650, 350);\n\t\tStdDraw.line(500, 800, 500, 650);\n\t\tStdDraw.line(500, 200, 500, 350);\n\n\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\tStdDraw.filledCircle(80, 200, 35);\n\t\tStdDraw.filledCircle(80, 300, 35);\n\t\tStdDraw.filledCircle(80, 400, 35);\n\t\tStdDraw.filledCircle(80, 500, 35);\n\t\tStdDraw.filledCircle(80, 600, 35);\n\t\tStdDraw.filledCircle(80, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\tStdDraw.filledCircle(920, 200, 35);\n\t\tStdDraw.filledCircle(920, 300, 35);\n\t\tStdDraw.filledCircle(920, 400, 35);\n\t\tStdDraw.filledCircle(920, 500, 35);\n\t\tStdDraw.filledCircle(920, 600, 35);\n\t\tStdDraw.filledCircle(920, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\n\t}", "void drawBoard(Board board);", "private void drawBoard(final Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n g2.setColor(Color.black);\n g2.fill(new Rectangle2D.Double(0, 0, DRAWING_AREA_SIZE_IN_PIXELS, DRAWING_AREA_SIZE_IN_PIXELS));\n // Render the board, each gadget renders onto the canvas\n board.render(g2); \n }", "protected void drawGUI() {\n batch.draw(background, 0, 0);\n }", "public void draw() {\n // Default widget draws nothing.\n }", "private void draw()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition, \n diameter, diameter));\n canvas.wait(10);\n }", "private void refreshScreen() {\n app.getMainMenu().getTextField().clear();\n for (int key = 0; key < 96; key++) {\n app.getWorkSpace().getGridCell(key).unhighlightGridCell();\n app.getWorkSpace().getGridCell(key).updateState(app);\n }\n Storage.getInstance().writeObject(\"workspace\", app.getWorkSpace().getWorkSpaceMap());\n app.show();\n }", "public void render() {\n this.canvas.repaint();\n }", "private void draw() {\n if (surfaceHolder.getSurface().isValid()) {\n //lock the canvas\n canvas = surfaceHolder.lockCanvas();\n //set background colour\n canvas.drawColor(Color.BLACK);\n //draw stars\n paint.setColor(Color.WHITE);\n starManager.draw(this.canvas, this.paint);\n //draw player\n player.draw(this.canvas, this.paint);\n //draw enemies\n enemyManager.draw(this.canvas, this.paint);\n //draw asteroids\n asteroidManager.draw(this.canvas, this.paint);\n\n //draw the score as well\n paint.setTextSize(100);\n paint.setColor(Color.WHITE);\n canvas.drawText(\"\" + Constants.SCORE, 50, paint.descent() - paint.ascent(), paint);\n\n //if game is over\n if (Constants.GAME_OVER) {\n paint.setTextSize(100);\n paint.setTextAlign(Paint.Align.CENTER);\n paint.setColor(Color.WHITE);\n\n //tell the player\n int yPos = (int) ((canvas.getHeight() / 2) - ((paint.descent() + paint.ascent()) / 2));\n canvas.drawText(\"Game over\", canvas.getWidth() / 2, yPos, paint);\n\n paint.setTextSize(50);\n yPos = (int) ((canvas.getHeight() - 2 * paint.descent()) - ((paint.descent() + paint.ascent()) / 2));\n canvas.drawText(\"Tap anywhere to return to main menu...\", canvas.getWidth() / 2, yPos, paint);\n }\n //unlock canvas\n surfaceHolder.unlockCanvasAndPost(canvas);\n }\n }", "@Override\n protected void onDraw(Canvas canvas) {\n\n // Draw the board\n backgCalculating.draw(canvas, displayArea, centralBall);\n\n // Delay\n try {\n Thread.sleep(30);\n } catch (InterruptedException e) {}\n\n invalidate(); // Force a re-draw\n }", "private void draw() {\n\t\tCanvas c = null;\n\t\ttry {\n\t\t\t// NOTE: in the LunarLander they don't have any synchronization here,\n\t\t\t// so I guess this is OK. It will return null if the holder is not ready\n\t\t\tc = mHolder.lockCanvas();\n\t\t\t\n\t\t\t// TODO this needs to synchronize on something\n\t\t\tif (c != null) {\n\t\t\t\tdoDraw(c);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (c != null) {\n\t\t\t\tmHolder.unlockCanvasAndPost(c);\n\t\t\t}\n\t\t}\n\t}", "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 }", "public void paint() {\n BufferStrategy bs;\n bs = this.getBufferStrategy();\n\n Graphics g = bs.getDrawGraphics();\n g.drawImage(background, 0, 0, this.getWidth(), this.getHeight(), null);\n if (this.blackHoles != null) {\n for (BlackHole blackHole : this.blackHoles) {\n blackHole.paint(g);\n }\n }\n if (this.balls != null) {\n for (int i = 0; i <this.balls.size() ; i++) {\n this.balls.get(i).paint(g);\n }\n\n }\n\n bs.show();\n g.dispose();\n\n }", "public void drawAllGraphics(){\r\n\t\t \r\n\t}", "public void paintFinalScreen() {\n\t\tapp.image(end, 0, 0);\n\t}", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }", "public void draw() {\n if (r.isVisible()) {\n Canvas canvas = Canvas.getCanvas();\n canvas.draw(r, new java.awt.Rectangle(r.getX(), r.getY(), \n width, height));\n canvas.wait(10);\n }\n }", "public void draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public void draw( Canvas canvas) {\n this.canvas = canvas;\n if (selected)\n canvas.drawRect(tileRect, highlightColor);\n else\n canvas.drawRect(tileRect, defaultColor);\n }", "public void newDrawing()\n {\n //clear the current canvas\n canvas.drawColor(0, PorterDuff.Mode.CLEAR);\n //reprint the screen\n invalidate();\n }", "public void renderTileManager()\n {\n background(background);\n tiles[activeTile].drawGrid();\n tiles[activeTile].drawCellHover();\n createPreview(tiles[activeTile]);\n drawPreviewHover();\n drawPreviews();\n }", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "public void update() {\n System.out.println(\"\\n\\n Board: \\n\");\n System.out.println(\" \" + pos1 + \" | \" + pos2 + \" | \" + pos3 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos4 + \" | \" + pos5 + \" | \" + pos6 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos7 + \" | \" + pos8 + \" | \" + pos9 + \" \");\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}", "private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }", "@Override\n\tpublic void updateScreen() {\n\t\tfield_154330_a.tick();\n\t\tsuper.updateScreen();\n\t}", "private void draw()\n\t{\n\t\n\t\t//Size of Window\n\t\tfinal int FRAME_WIDTH = 1000; \n\t\tfinal int FRAME_HEIGHT = 1000; \n\t\n\t\t\n\t\t//Make Connect four frame\n\t\tJFrame container = new JFrame(\"Connect 4\");\n\t\tcontainer.setLayout(new GridLayout(dimension + 1, dimension, 5, 5));\n\t\t\n\t\t//Create the number of buttons equal to the size of the board\n\t\tfor (int i = 0; i < buttons.length; i++)\n\t\t{\n\t\t\tbuttons[i] = new JButton();\n\t\t\t//Tell the buttons what number they are\n\t\t\tbuttons[i].setActionCommand(\"\" + i);\n\t\t\t\n\t\t\tclass ButtonListener implements ActionListener\n\t\t\t{\n\t\t\t\tpublic void actionPerformed(ActionEvent event)\n\t\t\t\t{\n\t\t\t\t\tint xposition = Integer.parseInt(event.getActionCommand());\n\t\t\t\t\tint[][] board = m.getTable();\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Add the spot to the board\n\t\t\t\t\tint winCondition = m.insertBoard(xposition, m.getPlayer());\n\t\t\t\t\t\n\t\t\t\t\t//Check the current column and check to see which spots to change\n\t\t\t\t\tfor(int i = 0; i < m.getSize(); i ++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(board[xposition][i] == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timages[m.getSize() - 1 - i][xposition].setIcon(BLUE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(board[xposition][i] == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timages[m.getSize() - 1 - i][xposition].setIcon(RED);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Change the current turn counter\t\t\t\t\t\n\t\t\t\t\t//Options depending on whether a player has won, the game is a draw, or the column is full.\n\t\t\t\t\tif(winCondition == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Asks for a new game. Closes if no.\n\t\t\t\t\t\tint selectedOption = JOptionPane.showConfirmDialog(null, \"Player \" + m.getPlayer() + \" Wins! \\n\" + \"Play again?\", \"Congratulations\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\t\tif(selectedOption == JOptionPane.YES_OPTION)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tm = new Model(dimension, winningSize);\n\t\t\t\t\t\t\tredraw(container);\n\t\t\t\t\t\t\tm.turn();\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\tcontainer.dispose();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(winCondition == 2) \n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(container, \"Column is full please choose again\");\n\t\t\t\t\t\tm.turn();\n\t\t\t\t\t}\n\t\t\t\t\tif(m.isDraw())\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(container, \"Game is a draw\");\n\t\t\t\t\t}\n\t\t\t\t\tm.turn();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tbuttons[i].addActionListener(new ButtonListener());\t\t\t\n\t\t}\n\t\t\n\t\t//Sets the color for all of the labels\n\t\tfor (int i = 0; i < images.length; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < images.length; j++)\n\t\t\t{\n\t\t\t\timages[i][j] = new JLabel(UNSET);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Adds the labels to the frame\n\t\tfor (int i = 0; i < images.length; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < images.length; j++)\n\t\t\t{\n\t\t\t\tcontainer.add(images[i][j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add the buttons to the frame\n\t\tfor (JButton x: buttons)\n\t\t{\n\t\t\tcontainer.add(x);\n\t\t}\n\t\t\n\t\t\n\t\t//Generic JFrame Options setting the visibility, dimensions, and close options\n\t\tcontainer.setSize(FRAME_WIDTH, FRAME_HEIGHT);\n\t\tcontainer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tcontainer.setVisible(true);\n\t\t\n\t}", "public void refreshAll() {\n\t\tdrawingPanel.repaint();\n\t}", "public void draw(GraphicsContext gc) {\n // draw the base grid\n gc.setFill(Color.LIGHTGREY);\n for (int i = 0; i < board.side(); i++)\n for (int j = (i % 2 == 0) ? 1 : 0; j < board.side(); j += 2)\n gc.fillRect(startX + j * unitLength, startY + i * unitLength,\n unitLength, unitLength);\n\n // draw boundaries\n gc.setStroke(Color.BLACK);\n gc.strokeRect(startX, startY, sideLength, sideLength);\n\n // highlight legal positions\n for (BoardPos pos : legalPos) {\n gc.setFill(Color.ORANGE);\n gc.fillRect(startX + pos.getX() * unitLength,\n startY + pos.getY() * unitLength, unitLength, unitLength);\n gc.setFill(Color.LIGHTYELLOW);\n if (pos.route != null)\n for (BoardPos step : pos.route)\n gc.fillRect(startX + step.getX() * unitLength,\n startY + step.getY() * unitLength, unitLength, unitLength);\n }\n\n // draw pieces\n for (int i = 0; i < board.side(); i++)\n for (int j = 0; j < board.side(); j++)\n board.get(i, j).draw(gc, startX + i * unitLength,\n startY + j * unitLength, pieceMargin, unitLength);\n }", "@Override\n protected void onDraw(Canvas canvas) {\n canvas.drawColor(Color.WHITE);\n\n if (noOfColumns == 0 || noOfRows == 0) {\n return;\n }\n\n int width = getWidth();\n int height = getWidth();\n\n for (int i = 0; i < noOfColumns; i++) {\n for (int j = 0; j < noOfRows; j++) {\n if (cards[i][j].getCardState() == CardState.FACE_UP) {\n canvas.drawRect(i * cardWidth, j * cardHeight,\n (i + 1) * cardWidth, (j + 1) * cardHeight,\n cards[i][j].getColor());\n }\n else if (cards[i][j].getCardState() == CardState.MATCHED) {\n canvas.drawRect(i * cardWidth, j * cardHeight,\n (i + 1) * cardWidth, (j + 1) * cardHeight,\n freezeCardPaint);\n }\n }\n }\n\n for (int i = 1; i < noOfColumns; i++) {\n canvas.drawLine(i * cardWidth, 0, i * cardWidth, height, linePaint);\n }\n\n for (int i = 1; i <= noOfRows; i++) {\n canvas.drawLine(0, i * cardHeight, width, i * cardHeight, linePaint);\n }\n }", "@Override\n\tpublic void redraw() {\n\t\t\n\t}", "public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "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() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) { //if the buffer strategy doesnt get created, then you create it\n\t\t\tcreateBufferStrategy(3); //the number 3 means it creates triple buffering\n\t\t\treturn;\t\t\t\t\t//, so when you backup frame gets displayed (2) it will also have a backup\t\n\t\t}\n\t\t\n\t\t//apply data to the buffer \"bs\"\n\t\t//this is creating a link to graphics to drawing graphics to the screen.\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t/**\n\t\t * You input all of your graphics inbetween the g object and g.dispose();\n\t\t */\n\t\t//###################\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t//###################\n\t\tg.dispose(); //this dispose of all the graphics\n\t\tbs.show(); //this will make the next available buffer visible\n\t}", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "void draw() {\n canvas.drawColor(Color.BLACK);\n insertSort(vstar);\n for( int i=0; i<NUMSTARS; i++){\n vstar[i].draw();\n }\n }", "public void repaint() {\n setBackground(Color.white);\n super.repaint();\n setVisible(true);\n\n }", "public void draw()\n {\n canvas.setForegroundColor(color);\n canvas.fillCircle(xPosition, yPosition, diameter);\n }", "private void setupBoardViews(){ //This resets the view for use by the UI. Forces out of Design mode\n Log.d(TAG, \"setupBoardViews: Started\");\n view_stage_map = VIEW_MAP_START;\n cycleMapView();\n }", "public void draw() {\r\n\t\tbackground(255); // Clear the screen with a white background\r\n\r\n\t\ttextSize(12);\r\n\t\tfill(0);\r\n\r\n\t\tstroke(0);\r\n\t\tcurve.draw(this);\r\n\t}", "public void display() {\n shadow.display();\r\n strokeWeight(strokeWeight);\r\n fill(boxColour);\r\n rect(x, y, w, h, 7);\r\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}" ]
[ "0.78157777", "0.77373415", "0.76288843", "0.73059833", "0.7144769", "0.7119336", "0.6989851", "0.6986787", "0.6976136", "0.69708", "0.6935234", "0.69208324", "0.68826836", "0.68643373", "0.6857509", "0.68512535", "0.6846477", "0.6832434", "0.68035525", "0.67741", "0.67354155", "0.67307323", "0.6724089", "0.6715615", "0.6706266", "0.6702237", "0.66640955", "0.664111", "0.6631243", "0.66249794", "0.66172385", "0.6611607", "0.6594441", "0.6564036", "0.65578467", "0.6557695", "0.65523595", "0.6552062", "0.65491015", "0.65266204", "0.65025723", "0.6487192", "0.6484895", "0.64752704", "0.64727014", "0.6468197", "0.64677846", "0.6462141", "0.64495665", "0.64493376", "0.6448388", "0.6447652", "0.6444274", "0.6438513", "0.6434816", "0.6434092", "0.6428585", "0.64281565", "0.6423628", "0.6421143", "0.64209116", "0.64204746", "0.64127403", "0.6412616", "0.64004403", "0.63958067", "0.6395129", "0.63917685", "0.6390945", "0.63900906", "0.6387297", "0.63754016", "0.6374817", "0.63718486", "0.6358935", "0.635886", "0.63476336", "0.63463014", "0.6345506", "0.63427687", "0.6337183", "0.63206613", "0.6319935", "0.630523", "0.63014466", "0.629747", "0.62932384", "0.629267", "0.62921613", "0.6291982", "0.629176", "0.6291596", "0.6283999", "0.62817186", "0.6278861", "0.6275923", "0.62739956", "0.6262885", "0.6261805", "0.6256491", "0.6253615" ]
0.0
-1
Method checks if monster is alive and treats them in compliance with their status.
public void checkIfAlive() { if(this.health<=0) { targetable=false; monstersWalkDistanceX=0; monstersWalkDistanceY=0; this.health=0; new TextureChanger(this,0); isSelected=false; if(monsterType==1) { visible=false; } if(gaveResource==false) { int gameResource = Board.gameResources.getGameResources(); Board.gameResources.setGameResources(gameResource + resourceReward); gaveResource=true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public static boolean monsterDeathCheck(){\n if (currentMonster.currentHp <= 0){\n return true;\n }\n return false;\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 checkHealth()\n {\n if(player.getHealth() <= 0)\n {\n System.out.println(\"\\n\" + \"You are dead :(\" + \"\\n\");\n alive = false;\n }\n }", "@Override\n public boolean isAlive() {\n return health > 0f;\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}", "public boolean isAlive(){\n if(this.hp <= 0){\n return false;\n }\n else{\n return true;\n }\n }", "public boolean isAlive() {\n return health > 0;\n }", "public boolean isAlive(){\r\n if (currHP > 0){\r\n return true;\r\n }\r\n return false;\r\n }", "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 boolean isAlive()\n {\n return alive;\n }", "protected boolean isAlive()\n {\n return alive;\n }", "public boolean alive() {\r\n\t\treturn myHP > 0;\r\n\t}", "public boolean isAlive() {\r\n\t\treturn hp > 0;\r\n\t}", "public void setAlive(boolean alive){\n // make sure the enemy can be alive'nt\n this.alive = alive; \n }", "public boolean avengersAlive() {\n\t\tif (avengersHp <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean isAlive(Unit unit);", "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 boolean isAlive(Entity entity ) {\r\n\t\tboolean charIsAlive = false; \t\r\n\t\twhile (entity.getHealth()>0) {\r\n\t\t\t\tif(entity.getHealth() >0) {\r\n\t\t\t\t\tcharIsAlive = true; \r\n\t\t\t\t\t} \r\n\t\t\t}\r\n\t\treturn charIsAlive; \r\n\t}", "public boolean isAlive() {\n return this.getHealthPower().hasSomeHealth();\n }", "@Test\n\tpublic void testIsDead() {\n\t\tnpc.setLevel(1);\n\t\tnpc.setHealth(23);\n\t\tnpc.calHealth();\n\t\tassertFalse(npc.isDead());\n\t\tnpc.changeHealth(-23);\n\t\tassertTrue(npc.isDead());\n\t\tnpc.changeHealth(-100);\n\t\tassertTrue(npc.isDead());\n\t}", "public void deadMonster() {\r\n\t\tthis.nbMonster --;\r\n\t}", "boolean isAlive() { return alive; }", "public void checkDeath()\n {\n if (player.getY() >= 549)\n {\n gameOver();\n }\n }", "public boolean isAlive() { return alive; }", "public boolean isAlive(){\n \t\treturn alive;\n \t}", "public boolean isAlive(){\n \treturn alive;\r\n }", "public void attackMonster(World world){\n\t\tif ((UnitManager.unitNearPlayer(world.getPlayer(),this,PLAYER_RANGE) == true \n\t\t\t\t\t&& RPG.isAttacking()) && world.getPlayer().isAttack()) {\n\t\t\tthis.getUnitStats().reduceHP(world.getPlayer().damageAmount());\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t}\n\t}", "private boolean applyRules(boolean isAlive, int aliveNeighbours) {\n if (isAlive && aliveNeighbours < 2) {\n //Underpopulation\n return false;\n } else if (isAlive && aliveNeighbours > 3) {\n //Overcrowding\n return false;\n } else if (!isAlive && aliveNeighbours == 3) {\n //Creation of life\n return true;\n } else {\n // Stays the same\n return isAlive;\n }\n }", "@Override\n public boolean isDead() {\n return (this.getLife() <= 0);\n }", "public static boolean characterDeathCheck(){\n if (MainCharacter.hpNow <= 0){\n return true;\n }\n return false;\n }", "public boolean isBattleOver(){\n\n if(battleEnemies.size() == 0) {\n System.out.println(\"Battle over all enemies dead\");\n findDefeated();\n cleanStatuses();\n result = true;\n\n return true;\n }\n if(character.getCurrHP() <= 0){\n System.out.println(\"Battle over character has died\");\n //findDefeated();\n cleanStatuses();\n result = false;\n\n return true;\n }\n //System.out.printf(\"remaining enemies: %s\\n\", battleEnemies.size());\n return false;\n }", "public boolean vulnerableToMonsterAttack(Monster aMonster)\n\t{\n\t\t//System.out.println(\"Tree.vulnerableToMonsterAttack(Monster)\");\n\t\treturn false;\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}", "public boolean runBattle() {\n // loop the battles here\n\n //battleAllies.addAll(structures);\n\n battle();\n \n findDefeated();\n cleanStatuses();\n \n // End condition of battle is: all enemies die, or character dies\n if(character.getCurrHP() <= 0){\n return false;\n } else {\n result = true;\n return true;\n }\n }", "public boolean vulnerableToMonsterRangedAttack(Monster aMonster)\n\t{\n\t\t//System.out.println(\"Tree.vulnerableToMonsterRangedAttack(Monster)\");\n\t\treturn false;\n\t}", "public boolean isAlive() {\n\t\treturn aliveStatus;\n\t}", "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 void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "boolean getHealthy();", "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}", "public boolean isAlive() {\r\n\t\treturn life > 0;\r\n\t}", "private static void checkForEnemies() throws GameActionException {\n //No need to hijack code for structure\n if (rc.isWeaponReady()) {\n // basicAttack(enemies);\n HQPriorityAttack(enemies, attackPriorities);\n }\n \n //Old splash damage code\n //Preserve because can use to improve current splash damage code\n //But not so simple like just checking directions, since there are many more \n //locations to consider hitting.\n /*if (numberOfTowers > 4) {\n //can do splash damage\n RobotInfo[] enemiesInSplashRange = rc.senseNearbyRobots(37, enemyTeam);\n if (enemiesInSplashRange.length > 0) {\n int[] enemiesInDir = new int[8];\n for (RobotInfo info: enemiesInSplashRange) {\n enemiesInDir[myLocation.directionTo(info.location).ordinal()]++;\n }\n int maxDirScore = 0;\n int maxIndex = 0;\n for (int i = 0; i < 8; i++) {\n if (enemiesInDir[i] >= maxDirScore) {\n maxDirScore = enemiesInDir[i];\n maxIndex = i;\n }\n }\n MapLocation attackLoc = myLocation.add(directions[maxIndex],5);\n if (rc.isWeaponReady() && rc.canAttackLocation(attackLoc)) {\n rc.attackLocation(attackLoc);\n }\n }\n }//*/\n \n }", "boolean getAlive();", "@EventHandler(priority = EventPriority.MONITOR)\n\tvoid onMonsterDeath(EntityDeathEvent event)\n\t{\n\t\tEntity entity = event.getEntity();\n\t\tEntityDamageByEntityEvent dEvent;\n\t\tPlayer player;\n\t\tSet<String> list;\n\n\t\t//Check that it was killed by another entity\t\t\n\t\tif(!(entity.getLastDamageCause() instanceof EntityDamageByEntityEvent))\n\t\t\treturn;\n\t\t\n\t\tdEvent = (EntityDamageByEntityEvent) entity.getLastDamageCause();\n\t\t\n\t\t//Check that it was killed by a player\n\t\tif(dEvent.getDamager() instanceof Player)\n\t\t{\n\t\t\tplayer = (Player) dEvent.getDamager();\n\t\t\t\n\t\t\t//Check if the monster is contained within the config\n\t\t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t\t\t\n\t\t\tfor (String p: prof.getProfessions())\n\t\t\t{\n\t\t\t\t//If there's no configuration for that profession, skip it.\n\t\t\t\ttry {list = config.getConfigurationSection(\"slaying.\" + p).getKeys(false);}\n\t\t\t\tcatch (NullPointerException e)\n\t\t\t\t{ continue; }\n\t\t\t\t\n\t\t\t\tfor (String monster: list)\n\t\t\t\t\t//If found, award experience for it.\n\t\t\t\t\tif (entity.getType().toString().equalsIgnoreCase(monster))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!prof.isPracticeFatigued(p))\n\t\t\t\t\t\t\taddExperience(player, p, config.getInt(\"slaying.\" + p + \".\" + monster));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (dEvent.getDamager() instanceof Arrow)\n\t\t{\t\n\t\t\tArrow arrow = (Arrow) dEvent.getDamager();\n\t if (!(arrow.getShooter() instanceof Player))\n\t \treturn;\n\t \n\t player = (Player) arrow.getShooter();\n\t\t\t\n\t\t\t//Check if the monster is contained within the config\n\t\t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t\t\t\n\t\t\tfor (String p: prof.getProfessions())\n\t\t\t{\n\t\t\t\t//If there's no configuration for that profession, skip it.\n\t\t\t\ttry {list = config.getConfigurationSection(\"slaying.\" + p).getKeys(false);}\n\t\t\t\tcatch (NullPointerException e)\n\t\t\t\t{ continue; }\n\t\t\t\t\n\t\t\t\tfor (String monster: list)\n\t\t\t\t\t//If found, award experience for it.\n\t\t\t\t\tif (entity.getType().toString().equalsIgnoreCase(monster))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!prof.isPracticeFatigued(p))\n\t\t\t\t\t\t\taddExperience(player, p, config.getInt(\"slaying.\" + p + \".\" + monster));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public boolean isHealthy() {\r\n boolean healthy = true;\r\n\r\n for (Meter m: meters) {\r\n if (!m.isHealthy()) healthy = false;\r\n }\r\n\r\n return healthy;\r\n }", "static void goblin_fights() {\n enter = next.nextLine();\n System.out.println( username + \" defeat this goblin to advance into the next level \");\n System.out.println(\"Remember, don't fool around - or else you will regret it later.\");\n enter = next.nextLine();\n System.out.println(\"'We can do this master \" + username + \". Just hang on a little longer!\");\n playerhealth = 310; // player leveled up to level 5 with 500 HP\n goblinshealth = 170; //this is the goblin's health.\n monsterisalive = true;\n while(monsterisalive){//#while-while loop that will allow the player fight the goblin\n if(monsterisalive){\n System.out.println(\" The goblin's HP is \" + goblinshealth + \".\");\n enter = next.nextLine();\n System.out.println(\"You have recently leveled up and now can use up to six different types of attacks:\");\n enter = next.nextLine();\n System.out.println(username + \", you can cast fire, ice, lightning spells, throw rocks at the enemy,\");\n System.out.println(\"throw in multiple wind storms, run, or heal up to 80 health points\");\n attack = next.nextLine(); //attack response\n if(attack.contains(\"fire\")){\n System.out.println(\"Alright, I'm fired up...FOOSH!!!\");\n goblinshealth = goblinshealth-30;\n System.out.println(\"The goblin lost 30 HP. The goblin now has \" + goblinshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n goblinshealth = goblinshealth-20;\n System.out.println(\"The goblin lost 20 HP. The goblin currently has \" + goblinshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"lightning\")) {\n System.out.println(\"Someone's getting fried today...BAAAAAMMMM!!!\");\n goblinshealth = goblinshealth-40;\n System.out.println(\"OUCH!!! The goblin lost 40 HP. It now has \" + goblinshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n goblinshealth = goblinshealth-30;\n System.out.println(\"The goblin lost 30 HP. It now has \" + goblinshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\"); \n }else if (attack.contains(\"wind\")) {\n System.out.println(\"Alright...let's finish this up...WHIRL!!!\");\n goblinshealth = goblinshealth-10;\n System.out.println(\"The goblin lost 10 HP. It now has \" + goblinshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"run\")) {\n System.out.println(\"Coward...there's no running. You lost a turn and don't have enough time to check your health.\");\n }else if (attack.contains(\"heal\")) { //player heals\n healing_challenge2();\n System.out.println(\"\\n\");\n System.out.println(\"The goblin still has \" + goblinshealth + \" HP.\");\n System.out.println(username + \"'s HP increased to \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n }\n }//check to see if adding an if(monsterisalive) will prevent\n if(goblinshealth <= zero) {\n System.out.println(\"You defeated the goblin!\");//#hero defeats the enemy, which affects the enemies health\n System.out.println(\"You win!\"); //and is able to gain a potion left behind as a reward\n enter = next.nextLine();\n System.out.println(\"\\n\");\n System.out.println(username + \" found a rag left behind by the goblin...\");\n System.out.println(\"Shall we check it: yes or no?\");\n answer = responses.nextLine();\n if(answer.contains(\"y\")) {\n System.out.println(username + \" lifts up the rag to see that there is a potion.\");\n potions = potions+1;\n System.out.println(username + \" puts the potion inside the bag which already contains \" + potions + \" potions.\");\n //player gets a potion if they won\n enter = next.nextLine();\n }else{\n System.out.println(username + \" kicks the rag to the side and continues on.\");\n System.out.println(\"\\n\");\n }\n monsterisalive = false;\n }else if (goblinshealth > zero) {\n enter = next.nextLine();\n System.out.println(\"Now it is the goblin's turn... Brace Yourself\");\n enter = next.nextLine();\n System.out.println(\"The goblin throws multiple knives that pierced your skin...\");\n playerhealth = playerhealth-60;\n System.out.println(\"OUCH! \" + username + \" lost 60 HP...You now have \" + playerhealth + \".\");\n enter = next.nextLine();\n }\n if(playerhealth <= zero) {\n System.out.println(\"OH NO!!! You lost all your HP.\");\n monsterisalive = false;\n play_yellowportal();\n }\n }\n }", "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 static boolean checkVictory(){\n\t\tboolean victory = true;\n\t\t\n\t\tfor (int i = 0; i < enemyList.length && victory; i++) {\n\t\t\tif (enemyList[i].isAlive()) {\n\t\t\t\tvictory = false;\n\t\t\t}\n\t\t}\n\t\treturn victory;\n\t}", "static void golbat_fights() {\n enter = next.nextLine();\n System.out.println( username + \" defeat this Golbat to advance into the next level \");\n System.out.println(\"Don't let the Golbat fly near you... It's part vampire. You wouldn't want that to be near you.\");\n enter = next.nextLine();\n System.out.println(\"'We can do this master \" + username + \". Just hang on!\");\n playerhealth = 310; // player leveled up to level 5 with 500 HP\n golbathealth = 190; //this is the Golbat's health.\n monsterisalive = true;\n while(monsterisalive){//#while-while loop that will allow the player fight the golbat\n if(monsterisalive){\n System.out.println(\" The Golbat's HP is \" + golbathealth + \".\");\n enter = next.nextLine();\n System.out.println(\"You have recently leveled up and now can use up to six different types of attacks:\");\n enter = next.nextLine();\n System.out.println(username + \", you can cast fire, ice, lightning spells, throw rocks at the enemy,\");\n System.out.println(\"throw in multiple wind storms, heal, or run\");\n attack = next.nextLine(); //attack response\n if(attack.contains(\"fire\")){\n System.out.println(\"Alright, I'm fired up...FOOSH!!!\");\n golbathealth = golbathealth-30;\n System.out.println(\"The Golbat lost 30 HP. The Golbat now has \" + golbathealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n golbathealth = golbathealth-20;\n System.out.println(\"The Golbat lost 20 HP. The Golbat currently has \" + golbathealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"lightning\")) {\n System.out.println(\"Someone's getting fried today...BAAAAAMMMM!!!\");\n golbathealth = golbathealth-40;\n System.out.println(\"OUCH!!! The Golbat lost 40 HP. It now has \" + golbathealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n golbathealth = golbathealth-30;\n System.out.println(\"The Golbat lost 30 HP. It now has \" + golbathealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\"); \n }else if (attack.contains(\"wind\")) {\n System.out.println(\"Alright...let's finish this up...WHIRL!!!\");\n golbathealth = golbathealth-10;\n System.out.println(\"The Golbat lost 10 HP. It now has \" + golbathealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (attack.contains(\"run\")) {\n System.out.println(\"Coward...there's no running. You lost a turn and don't have enough time to check your health.\");\n }else if (attack.contains(\"heal\")) { //player will be given an opportunity to heal\n healing_challenge2();\n System.out.println(\"\\n\");\n System.out.println(\"The golbat still has \" + golbathealth + \" HP.\");\n System.out.println(username + \"'s HP increased to \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n }\n }//check to see if adding an if(monsterisalive) will prevent\n if(golbathealth <= zero) {\n System.out.println(\"You defeated the golbat.\");\n System.out.println(\"You win!\");\n System.out.println(\"The Golbat left a drooping that seems to glimmer...\");\n System.out.println(\"Do you want to check it out: yes or no?\");\n if(answer.contains(\"y\")) {\n System.out.println(username + \" clears the droopings and finds a small bottle of potion.\");\n potions = potions+1;\n System.out.println(username + \" puts the healing potion into the bag, which now contains \" + potions + \" potions.\");\n System.out.println(\"\\n\");\n }else{\n System.out.println(username + \" casts a fire spell and burned the droopings...\");\n System.out.println(\"\\n\");\n }\n monsterisalive = false;\n }else if (golbathealth > zero) {\n enter = next.nextLine();\n System.out.println(\"Now it is the Golbat's turn... Brace Yourself\");\n enter = next.nextLine();\n System.out.println(\"The Golbat swooped down and cutted \" + username + \" with its wings and bit \");\n System.out.println(username + \"'s neck... \"); \n playerhealth = playerhealth-40;\n System.out.println(\"OUCH! \" + username + \" lost 40 HP...You now have \" + playerhealth + \".\");\n enter = next.nextLine();\n }\n if(playerhealth <= zero) {\n System.out.println(\"OH NO!!! You lost all your HP.\");\n monsterisalive = false;\n play_yellowportal();\n }\n }\n }", "private boolean checkStatus() {\r\n //\tSystem.out.println(\"Left \" + Left.getX() + \",\" + Left.getY());\r\n \t//System.out.println(\"Head \" + head.getX() + \",\" + head.getY());\r\n \tboolean result = false;\r\n \tif(Left.getX() >= -4 && Left.getX() <= -3.5f) {\r\n \t\t\r\n \t\tresult = true;\r\n \t}\r\n \tif(Left.getX() >= -2 && Left.getX() <= -0.5f) {\r\n \t\tthis.die = 1;\r\n \t\tresult = true;\r\n \t}\r\n \tif(Left.getX() >= 0 && Left.getX() <= 1.5f) {\r\n \t\tthis.die = 2;\r\n \t\tresult = true;\r\n \t}\r\n \tif(Left.getX() >= 2 && Left.getX() <= 3.5f) {\r\n \t\tthis.die = 3;\r\n \t\tresult = true;\r\n \t}\r\n \treturn result;\r\n }", "private void deathRoom()\n {\n if(currentRoom.equals(deathRoom4))\n {\n alive = false;\n }\n }", "public boolean[] isFightWinning() {\n RobotInfo[] nearbyEnemies = Cache.getEngagementEnemies();\n if (nearbyEnemies.length == 0) {\n return new boolean[] {true};\n }\n \n RobotInfo closestEngageable = null;\n double closestDist = Double.MAX_VALUE;\n double tempDist = 0;\n for (RobotInfo bot : nearbyEnemies) {\n switch (bot.type) {\n case HQ:\n case TOWER:\n // TODO figure out how to deal with towers that turn up...\n return new boolean[] {false, false};\n case BEAVER:\n case DRONE:\n case SOLDIER:\n case TANK:\n case COMMANDER:\n case MINER:\n case BASHER:\n case MISSILE:\n tempDist = curLoc.distanceSquaredTo(bot.location);\n if (tempDist < closestDist) {\n closestDist = tempDist;\n closestEngageable = bot;\n }\n break;\n default:\n break;\n }\n }\n \n if (closestEngageable == null) {\n return new boolean[] {true};\n }\n \n RobotInfo[] allies = rc.senseNearbyRobots(closestEngageable.location, ALLY_INLCUDE_RADIUS_SQ, myTeam);\n double allyScore = Util.getDangerScore(allies);\n double enemyScore = Util.getDangerScore(rc.senseNearbyRobots(closestEngageable.location, ENEMY_INCLUDE_RADIUS_SQ, theirTeam));\n // rc.setIndicatorString(2, \"Ally score: \" + allyScore + \", Enemy score: \" + enemyScore);\n if (allyScore > enemyScore) {\n return new boolean[] {true};\n } else {\n // Check if we are definitely going to die.\n double myHealth = rc.getHealth();\n int myID = rc.getID();\n boolean isAlone = true;\n for (int i = allies.length; i-- > 0;) {\n if (allies[i].ID != myID) {\n isAlone = false;\n if(allies[i].health < myHealth) {\n return new boolean[] {false, false};\n }\n }\n }\n // We didn't find any bots with lower health, so we are the lowest.\n // If we are alone, we should retreat anyways...\n return new boolean[] {false, !isAlone};\n }\n }", "public boolean isAlive()\n\t{\n\t\treturn alive;\n\t}", "public boolean isAlive()\n\t{\n\t\treturn alive;\n\t}", "public void isStillInCombat() {\n isInCombat = enemiesInCombat.size() > 0;\n }", "boolean hasMonsterID();", "boolean hasMonsterID();", "public void playerAttack() {\n if (playerTurn==true) {\n myMonster.enemHealth=myMonster.enemHealth-battlePlayer.str;\n }\n playerTurn=false;\n enemyMove();\n }", "private void checkDeath() {\n\t\tif (player.getLives() == 0) {\n shooty.setIv(new Image(\"/img/shipdeath.png\"));\n\t\t\tdie();\n\t\t}\n\t\t// another way to die: the blocks hit you\n\t\tif(btnList.get(0).getLayoutY() >= FATAL_BUTTON_DIST) {\n\t\t\tendGame.play();\n\t\t\tdie();\n\t\t}\n\t}", "public void checkGameStatus() {\n everyTenthGoalCongrats();\n randomPopUpBecauseICan();\n }", "public boolean checkPet() {\r\n return this.player.pet.getIsAlive();\r\n }", "private boolean roomShouldHaveMonsters() {\n return contents.contains(roomContents.MONSTERS)\n || contents.contains(roomContents.EXPLORATION)\n || contents.contains(roomContents.KEY)\n || contents.contains(roomContents.FINAL_KEY);\n }", "public boolean isAlive()\n {\n return alive;\n }", "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 }", "public boolean isAlive() {\r\n\t\treturn alive;\r\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 }", "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 boolean isDead() {\r\n\t\treturn health <= 0;\r\n\t}", "public void checkHealth() {\n if (health == 0) {\n this.texture = new Texture (\"soggy-\" + tex + \".png\");\n }\n }", "public boolean isAlive();", "public boolean isDead() {\r\n\t\tif (health <= 0.0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public boolean damage(Item weapon) {\n\t\tif (weapon instanceof assets.Sword) {\n\t\t\tSystem.out.println(\"The jubjub bird falls to the ground, dead.\");\n\t\t\tisAlive = false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\t/**\n\t * This method will update the state of the defender. It will check to see if any \n\t * millipede elements are next to it, if they are it is dead (returns false)\n\t * @param scape Landscape being played on\n\t * @return true if the defender is still alive, false if it is dead\n\t */\n\tpublic boolean updateState(Landscape scape) {\n\t\tif(!this.isAlive){\n\t\t\treturn false;\n\t\t}\n\t\t// check to see if there is a millipede within killing distance of it\n\t\tArrayList<SimObjectList> millipedes = scape.getResources();\n\t\t// for each millipede segment\n\t\tfor (int i = 0 ; i < millipedes.size() ; i++){\n\t\t\t// for each segment in each millipede segment\n\t\t\tfor ( int j = 0; j < millipedes.get(i).size() ; j++){\n\t\t\t\tSimObject temp = millipedes.get(i).get(j);\n\t\t\t\t// check to see if it is within +/- in both the x and y directions, if it is than we have a hit\n\t\t\t\tif( temp.getX() >= (this.x-1) && temp.getX() <= (this.x+1) &&\n\t\t\t\t\t\ttemp.getY() >= (this.y-1) && temp.getY() <= (this.y+1)){\n\t\t\t\t\t// set isAlive to dead\n\t\t\t\t\tthis.isAlive = false;\n\t\t\t\t\treturn this.isAlive;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return the alive status\n\t\treturn this.isAlive;\n\t}", "public boolean isAlive() {\n return alive;\n }", "public boolean isAlive() {\n return alive;\n }", "public void changeActiveMonster(){\n //todo\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}", "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 boolean isAlive(){\n\t\treturn lifeForce > 0;\n\t}", "boolean isAlive();", "boolean isAlive();", "public void deadcheck()\n\t{\n\t\tif (this.shield <= 0)\n\t\t{\n\t\t\tthis.drawMissile = false;\n\t\t}\n\t\telse \n\t\t\tthis.drawMissile = true;\n\t}", "public void setAlive(boolean aliveStatus) {\n\t\t\n\t\tthis.aliveStatus = aliveStatus;\n\t}", "boolean hasMonsterIndex();", "boolean hasMonsterIndex();", "public boolean isDead() {\n\t\tif (_currentHealth <= 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isAlive() {\n\t\treturn alive;\n\t}", "public boolean isAlive() {\n\t\treturn alive;\n\t}", "public boolean isAlive() {\n\t\treturn alive;\n\t}", "public void setAlive(boolean alive) {\r\n\t\tthis.alive = alive;\r\n\t}", "public boolean hasMonsterID() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private boolean isCheckMate() {\n if (whitePlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"BLACK PLAYER WINS\");\n return true;\n }\n else if (blackPlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"WHITE PLAYER WINS\");\n return true;\n }\n else return false;\n }", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "public MonsterStatus()\n {\n mMonster = null;\n mStatus = \"\";\n mInitial = -1;\n mIncrease = -1;\n mMax = -1;\n mDamage = -1;\n mDuration = -1;\n }", "public boolean hasMonsterID() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isDead();", "public void battleEnemyAttack() {\n if(battleEnemy != null){ // If all enemies have attacked, they cannot attack anymore for this round\n\n MovingEntity target = battleEnemy.getAttackPreference(targetAllies);\n if(target == null){\n target = targetAlly;\n }\n\n battleEnemy.attack(target, targetEnemies, targetAllies);\n //System.out.println(battleEnemy.getID() + \" is attacking \" + target.getID() + \" remaining hp: \" + target.getCurrHP());\n if (updateTarget(target) == false) {\n // if target still alive, check if its still friendly incase of zombify\n targetAlly = checkSideSwap(targetAlly, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n\n battleEnemy = nextAttacker(battleEnemy, battleEnemies);\n\n }\n }", "private void bringToLife(){\n this.dead = false;\n }", "public void setAlive(boolean alive) {\n\t\tthis.alive = alive;\n\t}" ]
[ "0.6867172", "0.6795494", "0.6616685", "0.6606687", "0.6570721", "0.6505377", "0.64443034", "0.63779074", "0.63521343", "0.6263424", "0.61657757", "0.61657757", "0.6163995", "0.6138515", "0.6125377", "0.6098523", "0.6094445", "0.6094378", "0.6089929", "0.60858333", "0.5998921", "0.5996523", "0.5983619", "0.5981328", "0.5969558", "0.59406435", "0.5934804", "0.59059155", "0.5890814", "0.5874407", "0.5860235", "0.5858527", "0.58485687", "0.5847557", "0.5837754", "0.58309364", "0.58187586", "0.58030045", "0.5791787", "0.57868004", "0.5782323", "0.57590425", "0.57424545", "0.5724911", "0.57219684", "0.57186085", "0.5715629", "0.57028735", "0.5697822", "0.5694274", "0.5690104", "0.56849694", "0.5682368", "0.5681915", "0.5681915", "0.5674013", "0.56700915", "0.56700915", "0.56684905", "0.5666457", "0.5665665", "0.56654614", "0.56587464", "0.5652602", "0.5647505", "0.5643698", "0.5639208", "0.5634567", "0.56212485", "0.5611242", "0.5602493", "0.5602368", "0.5600645", "0.5599202", "0.5592417", "0.5592417", "0.5592292", "0.5591768", "0.5590606", "0.55869704", "0.5584537", "0.5584537", "0.55836356", "0.5571866", "0.55647504", "0.55647504", "0.5563596", "0.5561823", "0.5561823", "0.5561823", "0.5556656", "0.55565363", "0.55560005", "0.5554226", "0.5547518", "0.5532775", "0.5523491", "0.5521674", "0.55214345", "0.55214274" ]
0.7212016
0
Eternal loop of message queue until quit() method call
@Override public void run() { while(isAlive.get()) { Runnable task = queue.poll(); if (task != null) { task.run(); } } Log.d(TAG, "Simple worker terminated"); // method quit() called }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loop() {\n try {\n Mail<T> mail = mailBox.remove();\n\n actor.setSender(mail.getSender());\n actor.receive(mail.getMessage());\n } catch (InterruptedException e) {\n }\n }", "public void run() {\r\n while(true) { // outer loop\r\n if(first) // we already have the queue CAS acquired\r\n first=false;\r\n else {\r\n if(!queue.acquire())\r\n return;\r\n }\r\n\r\n try {\r\n Message msg_to_deliver;\r\n while((msg_to_deliver=queue.remove()) != null) { // inner loop\r\n try {\r\n up_prot.up(new Event(Event.MSG, msg_to_deliver));\r\n }\r\n catch(Throwable t) {\r\n log.error(\"couldn't deliver message \" + msg_to_deliver, t);\r\n }\r\n }\r\n }\r\n finally {\r\n queue.release();\r\n }\r\n\r\n // although ConcurrentLinkedQueue.size() iterates through the list, this is not costly,\r\n // as at this point, the queue is almost always empty, or has only a few elements\r\n if(queue.size() == 0) // prevents a concurrent add() (which returned) to leave a dangling message in the queue\r\n break;\r\n }\r\n }", "@Override\n\t\tpublic void run() {\n\n\t\t\twhile (isRun) {\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(500);\n\n\t\t\t\t\tisRun = false;\n\t\t\t\t\thandler.sendEmptyMessage(2);\n\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}\n\t\t}", "private void dequeueMessages()\n\t{\n\t\twhile (_msg_queue.size() > 0)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_ml.messageReceived( (Serializable) _msg_queue.removeFirst());\n\t\t\t}\n\t\t\tcatch (RuntimeException rte)\n\t\t\t{\n\t\t\t\trte.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n while(true)\n {\n try {\n Thread.sleep(1000);\n handler.sendEmptyMessage(0);\n\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }\n\n }", "@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }", "@Override\n public void run() {\n while (isRun) {\n count--;\n handler.sendEmptyMessage(10);\n try {\n Thread.sleep(1000);\n } catch (Exception e) {\n }\n }\n }", "protected abstract long waitOnQueue();", "public void run() {\n\t\tString line = null;\n\t\tMessage message;\n\t\tBufferQueueElement<Message> messageList = new BufferQueueElement<Message>();\n\t\tlong t1 = System.nanoTime();\n\t long t2 = 0;\n\t\ttry {\n\t\t\twhile ((line = messageIO.readMessage()) != null) {\n\t\t\t\tt2 = System.nanoTime();\n\t\t\t\t/* Ok, we can close the stream. But process the last message list. */\n\t\t\t\tif (CLOSE_STREAM.equals(line)) {\n\t\t\t\t\tmessageList.setStreamClosed(true);\n\t\t\t\t\tqueue.put(messageList);\n\t\t\t\t\tbreak;\n\t\t\t\t} else if((t2 - t1) < ONE_SECOND) {\n\t\t\t\t\tmessage = new Message(line);\n\t\t\t\t\tmessageList.setMessageElement(message);\n\t\t\t\t} else {\n\t\t\t\t\tqueue.put(messageList);\n\t\t\t\t\tmessageList = new BufferQueueElement<Message>();\n\t\t\t\t\tt1 = System.nanoTime();\n\t\t\t\t\tmessage = new Message(line);\n\t\t\t\t\tmessageList.setMessageElement(message);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void run() {\n\t\twhile (!isFinished) {\n\t\t\tString msg;\n\t\t\ttry {\n\t\t\t\tmsg = messages.take();\n\t\t\t\tSystem.out.println(serverId + \" says: \" + msg);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run()\n {\n while (true) {\n if (isReadyToStop && (buffer.poll() == null)) {\n System.out.println(\"Thread stop\");\n producerClient.close();\n return;\n }\n try {\n Message msg = buffer.poll(config.getBufferPollTimeout());\n if (msg == null) {\n // ignore it\n continue;\n }\n System.out.println(\"Sent out: [\" + msg + \"]\");\n if (msg.getTopic().isPresent()) {\n String topic = msg.getTopic().get();\n Optional<Function<String, Integer>> function = funcMapBuffer.get(topic);\n function.ifPresent(stringLongFunction -> {\n int fiberId = stringLongFunction.apply(msg.getKey());\n msg.setFiberId(fiberId);\n producerClient.send(topic, fiberId, msg);\n });\n // else ignore this message\n }\n // else ignore this message\n }\n catch (InterruptedException ignored) {\n // if poll nothing, enter next loop\n }\n }\n }", "@Override\n public void run() {\n while (!bShutDown || !messageCache.isEmpty()) {\n try {\n while (!messageCache.isEmpty()) {\n HttpMessage httpMessage = messageCache.poll();\n if (httpMessage != null) {\n SendResult result = sendMessageWithHostInfo(\n httpMessage.getBodies(), httpMessage.getGroupId(),\n httpMessage.getStreamId(), httpMessage.getDt(),\n httpMessage.getTimeout(), httpMessage.getTimeUnit());\n httpMessage.getCallback().onMessageAck(result);\n }\n }\n TimeUnit.MILLISECONDS.sleep(proxyClientConfig.getAsyncWorkerInterval());\n } catch (Exception exception) {\n logger.error(\"exception caught\", exception);\n }\n }\n }", "@Override\n public void run() {\n while (connected) {\n Message message = getMessage();\n if (!connected)\n break;\n Executors.newCachedThreadPool().execute(() -> {\n try {\n message.handle(messageHandler);\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treMsg = withClient.getInputStream();\r\n\t\t\t\t\t\tbyte[] reBuffer = new byte[500];\r\n\t\t\t\t\t\treMsg.read(reBuffer);\r\n\t\t\t\t\t\tString msg = new String(reBuffer);\r\n\t\t\t\t\t\tmsg = msg.trim();\r\n\t\t\t\t\t\tif (msg.indexOf(\"/bye\") == 0) {\r\n\t\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAnalysis.ckMsg(mySin, msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\twhile(true) {\n\t\t\tqueue.get();\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Waiting for input\");\n\t\t// Handle reading data until we exit\n\t\tByteBuffer buf = ByteBuffer.allocate(2048);\n\t\twhile (!stopper && socketChannel.isOpen()) {\n\t\t\tSystem.out.println(\"Reading the socket\");\n\t\t\ttry {\n\t\t\t\t// No input from the user in 60 seconds results in kicking them\n\t\t\t\t// out\n\t\t\t\tint bytesRead = socketChannel.read(buf).get(60, TimeUnit.SECONDS);\n\t\t\t\t// ByteBuffer dst = ByteBuffer.allocate(bytesRead);\n\t\t\t\t// engine.unwrap(buf, dst);\n\t\t\t\tSystem.out.println(\"Got data of size: \" + bytesRead);\n\t\t\t\t// convert to proto\n\t\t\t\tcommonUIElements.MessageProtos.Message msg = commonUIElements.MessageProtos.Message\n\t\t\t\t\t\t.parseFrom(Arrays.copyOf(buf.array(), bytesRead));\n\t\t\t\tSystem.out.println(\"RXed: \" + msg.toString());\n\t\t\t\tif (!msg.getName().equals(name)) {\n\t\t\t\t\tname = msg.getName();\n\t\t\t\t}\n\t\t\t\t// add data to the message queue\n\t\t\t\tif (SignatureSystem.verifySignature(msg.getSignature(), msg.getMessage(), msg.getName(), trustStore)) {\n\t\t\t\t\tmessages.put(\n\t\t\t\t\t\t\tnew Message(msg.getSender(), msg.getMessage(), msg.getSignature(), msg.getClearance()));\n\t\t\t\t} else {\n\t\t\t\t\tMessage error = new Message(msg.getSender(), \"Error: signture is invalid\", msg.getSignature(),\n\t\t\t\t\t\t\tmsg.getClearance());\n\t\t\t\t\terror.error = true;\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t}\n\t\t\t\t// clear the buffer for the next message\n\t\t\t\tbuf.clear();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"Failed to add message to the queue: \" + e.getMessage());\n\t\t\t\tMessage error = new Message(this.name, \"Disconnected\", \"\", 1);\n\t\t\t\terror.error = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (TimeoutException e) {\n\t\t\t\tSystem.err.println(\"Timeout hit, waiting again\");\n\t\t\t\tMessage error = new Message(this.name, \"Client: \" + this.name + \" has timed out\", \"\", 1);\n\t\t\t\terror.kill = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tSystem.err.println(\"Execution error, breaking out of loop\");\n\t\t\t\tbreak;\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\tSystem.err.println(\"Invalid protobuf received: \" + e.getMessage());\n\t\t\t\t// } catch(SSLException e) {\n\t\t\t\t// System.err.println(\"SSL Failed: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tsocketChannel.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to close socket while exiting\");\n\t\t}\n\t\tSystem.out.println(\"Exiting thread...\");\n\t}", "final public void run() {\n connectionEstablished();\n\n // The message from the server\n int msg;\n\n // Loop waiting for data\n\n try {\n // messageTimer.schedule(new TimerTask() {\n // @Override\n // public void run() {\n // try {\n // sendFromMessageQueue();\n // } catch (IOException e) {}\n // }\n // }, 0, 100);\n while (!readyToStop) {\n // Get data from Server and send it to the handler\n // The thread waits indefinitely at the following\n // statement until something is received from the server\n\n try { // added in version 2.31\n\n // String cur = input.readLine();\n // handleBig5String(cur + \"\\n\");\n readByte();\n\n } catch (RuntimeException ex) { // thrown by handleMessageFromServer\n\n connectionException(ex);\n }\n }\n } catch (Exception exception) {\n if (!readyToStop) {\n try {\n closeAll();\n } catch (Exception ex) {\n }\n\n clientReader = null;\n connectionException(exception);\n }\n } finally {\n\n clientReader = null;\n connectionClosed(); // moved here in version 2.31\n }\n }", "public final void run() {\n while (isrunning) {\n try {\n LDAPMessage response = null;\n\n while ((isrunning)\n && (!searchqueue.isResponseReceived(messageid))) {\n try {\n sleep(sleepTime);\n } catch (InterruptedException e) {\n ///CLOVER:OFF\n // ignore exception, just log it\n if (Debug.LDAP_DEBUG) {\n Debug.trace(\n Debug.EventsCalls,\n \"Interrupt Exception\"\n + e.getMessage());\n }\n ///CLOVER:ON\n }\n }\n\n if (isrunning) {\n response = searchqueue.getResponse(messageid);\n }\n\n if (response != null) {\n processmessage(response);\n }\n } catch (LDAPException e) {\n ///CLOVER:OFF\n LDAPExceptionEvent exceptionevent =\n new LDAPExceptionEvent(eventsource, e, null);\n eventlistener.ldapExceptionNotification(\n exceptionevent);\n ///CLOVER:ON\n }\n }\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1000);// 线程暂停2秒,单位毫秒\n\t\t\t\t\tMessage message = new Message();\n\t\t\t\t\tmessage.arg1 = 1;\n\t\t\t\t\thandler.sendMessage(message);// 发送消息\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}\n\t\t}", "@Override public void run() {\n waitUntil(\"message\", new Condition() {\n @Override public boolean isMet() {\n return false;\n }\n }, 0);\n }", "public void run() {\r\n String message;\r\n try {\r\n while (keepGoing && in != null && (message = in.readLine()) != null) {\r\n println(message);\r\n }\r\n } catch (IOException e) {\r\n finalize();\r\n }\r\n }", "@Override\r\n\tpublic void run() {\n\t\tint i=0;\r\n\t\twhile(i<1000) {\r\n\t\t\tq.get();\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public void run ()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThread.sleep (ageLimit);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tsynchronized (this)\n\t\t\t{\n\t\t\t\tif (threads.size () > threadMinimum)\n\t\t\t\t{\n\t\t\t\t\tint theThreadCount = threads.size ();\n\t\t\t\t\tthreads.filteredRemoval (new I_QueueFilter ()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpublic boolean filter (Object aPayload)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tboolean retVal = false;\n\t\t\t\t\t\t\t\tif (threadCount > threadMinimum &&\n\t\t\t\t\t\t\t\t\taPayload != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tA_MessageThread theThread = (A_MessageThread) aPayload;\n\t\t\t\t\t\t\t\t\tretVal = theThread.tryThreadShutdown (ageLimit);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn retVal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\tif (theThreadCount != threads.size ())\n\t\t\t\t\t{\n\t\t\t\t\t\tnotifyThreadListeners (threadCount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void run()\r\n {\r\n while (flag)\r\n {\r\n try\r\n {\r\n obj = event_q.poll();\r\n if (obj != null)\r\n {\r\n processEvent(obj);\r\n }\r\n } catch (InterruptedException ex)\r\n {\r\n Logger.getLogger(Application.class.getName()).\r\n log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\twhile(isrun&&handler!=null){\n\t\t\ttry {\n\t\t\t\tMessage msg=handler.obtainMessage(timeupdate, new Date());\n\t\t\t\thandler.sendMessage(msg);\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void run() {\n\t\twhile(true) {\r\n\t\t\tfor(String data:queueData) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n while (isRun) {\n try {\n Thread.sleep(1000); // sleep 1000ms\n Message message = Message.obtain();\n message.what = 1;\n handler.sendMessage(message);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "void runQueue();", "public void run() {\n\n\t\t// produce messages\n\t\twhile (isConnected) {\n\n\t\t\ttry {\n\t\t\t\t// receive message\n\t\t\t\tMessage m = qreceiver.receive();\n\t\t\t\t// process message -- add message to the data holder\n\t\t\t\tprocessMessage(m);\n\t\t\t\t// check if the commit flag is set in the message property\n\t\t\t\tif (shouldCommit(m)) {\n\t\t\t\t\t// commit the transaction\n\t\t\t\t\tcommit(m);\n\t\t\t\t}\n\t\t\t\tThread.sleep(1000);\n\t\t\t\t\n\t\t\t} catch (TransactionRolledBackException trbe) {\n\t\t\t\tlog(\"transaction rolled back by MQ ...\");\n\t\t\t\t// rollback application data\n\t\t\t\trollBackApplication();\n\t\t\t} catch (JMSException jmse) {\n\t\t\t\t// The exception can happen when receiving messages\n\t\t\t\t// and the connected broker is killed.\n\t\t\t\tif (isConnected == true) {\n\t\t\t\t\t// rollback MQ and application data\n\t\t\t\t\trollBackAll();\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog(e);\n\n\t\t\t\t// application may decide NOT to close the connection\n\t\t\t\t// when an unexpected Exception occurred.\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n int eventseen = 0;\n int looptry = 0;\n int wait = 100;\n while(! isInterrupted()) {\n Iterable<byte[]> stream = new Iterable<byte[]>() {\n @Override\n public Iterator<byte[]> iterator() {\n Iterator<byte[]> i = Receiver.this.getIterator();\n if(i == null) {\n return new Iterator<byte[]>() {\n\n @Override\n public boolean hasNext() {\n return false;\n }\n\n @Override\n public byte[] next() {\n return null;\n }\n\n };\n } else {\n return i;\n }\n }\n };\n try {\n for(byte[] e: stream) {\n logger.trace(\"new message received: {}\", e);\n if(e != null) {\n eventseen++;\n //Wrap, but not a problem, just count as 1\n if(eventseen < 0) {\n eventseen = 1;\n }\n Event event = new Event();\n decode(event, e);\n send(event);\n }\n }\n } catch (Exception e) {\n eventseen = 0;\n logger.error(e.getMessage());\n logger.catching(e);\n }\n // The previous loop didn't catch anything\n // So try some recovery\n if(eventseen == 0) {\n looptry++;\n logger.debug(\"event seen = 0, try = {}\", looptry);\n // A little magic, give the CPU to other threads\n Thread.yield();\n if(looptry > 3) {\n try {\n Thread.sleep(wait);\n wait = wait * 2;\n looptry = 0;\n } catch (InterruptedException ex) {\n break;\n }\n }\n } else {\n looptry = 0;\n wait = 0;\n }\n }\n }", "public void run()\n {\n myMark = \"Z\";\n myTurn = false;\n displayMessage( \"Entered message loop\\n\");\n while( !gameover )\n {\n if( input.hasNextLine() )\n processMessage( input.nextLine() );\n } // end while\n displayMessage( \"Left message loop\\n\" );\n\n try {\n if( connection != null && !connection.isClosed() )\n connection.close();\n } catch( IOException e ) {\n e.printStackTrace();\n }\n displayMessage( \"Client terminated\\n\" );\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (Message message : pending) {\n\t\t\t\t\t\tif (canLCBdeliver(message)) {\n\t\t\t\t\t\t\tfifoBC.canDeliver(message);\n\t\t\t\t\t\t\tp.Pendinglock.lock();\n\t\t\t\t\t\t\tpending.remove(message);\n\t\t\t\t\t\t\tp.Pendinglock.unlock();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tSystem.out.println(\"Failed to sleep in deliver thread.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "void runningLoop() throws NoResponseException, NotConnectedException\n\t{\n\t\tint update = propertyGet(UPDATE_DELAY);\n\t\tboolean nowait = (propertyGet(NO_WAITING) == 1) ? true : false; // DEBUG ONLY; do not document\n\t\tboolean stop = false;\n\n\t\t// not there, not connected or already halted and no pending resume requests => we are done\n\t\tif (!haveConnection() || (m_session.isSuspended() && !m_requestResume) )\n\t\t{\n\t\t\tprocessEvents();\n\t\t\tstop = true;\n\t\t}\n\n\t while(!stop)\n\t\t{\n\t\t\t// allow keyboard input\n\t\t\tif (!nowait)\n\t\t\t\tm_keyboardReadRequest = true;\n\n\t\t\tif (m_requestResume)\n\t\t\t{\n\t\t\t\t// resume execution (request fulfilled) and look for keyboard input\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (m_stepResume)\n\t\t\t\t\t\tm_session.stepContinue();\n\t\t\t\t\telse\n\t\t\t\t\t\tm_session.resume();\n\t\t\t\t}\n\t\t\t\tcatch(NotSuspendedException nse)\n\t\t\t\t{\n\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"playerAlreadyRunning\")); //$NON-NLS-1$\n\t\t\t\t}\n\n\t\t\t\tm_requestResume = false;\n\t\t\t\tm_requestHalt = false;\n\t\t\t\tm_stepResume = false;\n\t\t\t}\n\n\t\t\t// sleep for a bit, then process our events.\n\t\t\ttry { Thread.sleep(update); } catch(InterruptedException ie) {}\n\t\t\tprocessEvents();\n\n\t\t\t// lost connection?\n\t\t\tif (!haveConnection())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t\tdumpHaltState(false);\n\t\t\t}\n\t\t\telse if (m_session.isSuspended())\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * We have stopped for some reason. Now for all cases, but conditional\n\t\t\t\t * breakpoints, we should be done. For conditional breakpoints it\n\t\t\t\t * may be that the condition has turned out to be false and thus\n\t\t\t\t * we need to continue\n\t\t\t\t */\n\n\t\t\t\t/**\n\t\t\t\t * Now before we do this see, if we have a valid break reason, since\n\t\t\t\t * we could be still receiving incoming messages, even though we have halted.\n\t\t\t\t * This is definately the case with loading of multiple SWFs. After the load\n\t\t\t\t * we get info on the swf.\n\t\t\t\t */\n\t\t\t\tint tries = 3;\n\t\t\t\twhile (tries-- > 0 && m_session.suspendReason() == SuspendReason.Unknown)\n\t\t\t\t\ttry { Thread.sleep(100); processEvents(); } catch(InterruptedException ie) {}\n\n\t\t\t\tdumpHaltState(false);\n\t\t\t\tif (!m_requestResume)\n\t\t\t\t\tstop = true;\n\t\t\t}\n\t\t\telse if (nowait)\n\t\t\t{\n\t\t\t\tstop = true; // for DEBUG only\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * We are still running which is fine. But let's see if the user has\n\t\t\t\t * tried to enter something on the keyboard. If so, then we need to\n\t\t\t\t * stop\n\t\t\t\t */\n\t\t\t\tif (!m_keyboardInput.isEmpty() && System.getProperty(\"fdbunit\")==null) //$NON-NLS-1$\n\t\t\t\t{\n\t\t\t\t\t// flush the queue and prompt the user if they want us to halt\n\t\t\t\t\tm_keyboardInput.clear();\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif (yesNoQuery(getLocalizationManager().getLocalizedTextString(\"doYouWantToHalt\"))) //$NON-NLS-1$\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"attemptingToHalt\")); //$NON-NLS-1$\n\t\t\t\t\t\t\tm_session.suspend();\n\t\t\t\t\t\t\tm_requestHalt = true;\n\n\t\t\t\t\t\t\t// no connection => dump state and end\n\t\t\t\t\t\t\tif (!haveConnection())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdumpHaltState(false);\n\t\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (!m_session.isSuspended())\n\t\t\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"couldNotHalt\")); //$NON-NLS-1$\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"escapingFromDebuggerPendingLoop\")); //$NON-NLS-1$\n\t\t\t\t\t\tpropertyPut(NO_WAITING, 1);\n\t\t\t\t\t\tstop = true;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IOException io)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"error\", io.getMessage()); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"continuingDueToError\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t\tcatch(SuspendedException se)\n\t\t\t\t\t{\n\t\t\t\t\t\t// lucky us, already stopped\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n//\t\tSystem.out.println(\"doContinue resume=\"+m_requestResume+\",isSuspended=\"+m_session.isSuspended());\n\t\t}\n\n\t\t// DEBUG ONLY: if we are not waiting then process some events\n\t\tif (nowait)\n\t\t\tprocessEvents();\n\t}", "@Override\r\n\tpublic void run() {\n\t\twhile (true) {\r\n\t\t\tsynchronized (this.queue) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\t\tqObj = queue.getQueue().peek();\r\n\t\t\t\t\tif (qObj != null && qObj instanceof String) {\r\n\t\t\t\t\t\tString t = (String) queue.getQueue().poll();\r\n\t\t\t\t\t\tSystem.out.println(\"TextProcessor:\" + t + \"\\tsize: \" + queue.getQueue().size());\r\n\t\t\t\t\t\tqueue.notifyAll();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tqueue.wait();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n reprocessPendingMessage();\n }", "public void endMessage()\n\t{\n\t}", "private void run()\n\t\t{\n\t\tObjectItemBuf<JobSchedulerMessage> buf =\n\t\t\tObjectBuf.buffer ((JobSchedulerMessage) null);\n\t\tStatus status = null;\n\t\tJobSchedulerMessage message = null;\n\t\tJobFrontendRef frontend = null;\n\n\t\treceiveloop : for (;;)\n\t\t\t{\n\t\t\t// Receive a message from any channel.\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tstatus = myChannelGroup.receive (null, null, buf);\n\t\t\t\t}\n\t\t\tcatch (ChannelGroupClosedException exc)\n\t\t\t\t{\n\t\t\t\t// Normal termination.\n\t\t\t\tbreak receiveloop;\n\t\t\t\t}\n\t\t\tcatch (Throwable exc)\n\t\t\t\t{\n\t\t\t\tmyLog.log (\"Exception while receiving message\", exc);\n\t\t\t\tbreak receiveloop;\n\t\t\t\t}\n\t\t\tmessage = buf.item;\n\n\t\t\t// Get job frontend proxy associated with channel.\n\t\t\tfrontend = (JobFrontendRef) status.channel.info();\n\n\t\t\t// Process message.\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tmessage.invoke (this, frontend);\n\t\t\t\t}\n\t\t\tcatch (Throwable exc)\n\t\t\t\t{\n\t\t\t\tmyLog.log (\"Exception while processing message\", exc);\n\t\t\t\t}\n\n\t\t\t// Enable garbage collection of no-longer-needed objects while\n\t\t\t// waiting to receive next message.\n\t\t\tbuf.item = null;\n\t\t\tstatus = null;\n\t\t\tmessage = null;\n\t\t\tfrontend = null;\n\t\t\t}\n\t\t}", "public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "@Override\n public boolean queueIdle() {\n mThread.getLooper().quit();\n nativeOnLooperStopped(nativeThread);\n return false;\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(true){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\thandler.sendEmptyMessage(0);\n\t\t\t}", "void blockUntilFreeSlotForMessage() throws InterruptedException {\n lock.lockInterruptibly();\n try {\n while (messageQueue.size() == messageCapacity) {\n messageQueueNotFull.await();\n }\n } finally {\n lock.unlock();\n }\n }", "private void workOnQueue() {\n }", "public void run() {\n String nextLine;\n try {\n while ((nextLine = in.readLine()) != null && !stopped) {\n game.HandleIncommingMesg(this, nextLine);\n }\n System.out.println(\"Connection with: \" + playername + \" is lost!\");\n shutdown();\n } catch (IOException e) {\n shutdown();\n }\n }", "@Override\n\tpublic void run() {\n\t\twhile(!exit) {\n\t\t\t//Do something\n\t\t\tgetInput();\n\t\t}\n\t}", "public void run() {\n\t\twhile (true) {\n\t\t\tif (queue.size() > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tconsume();\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} else {\n\t\t\t\tqueueEfficency.set(0);\n\t\t\t\temptyQueueTime = 0;\n\t\t\t}\n\t\t}\n\t}", "public void shutdown() {\r\n ThreadLocalEventLoop.INSTANCE.resetEventLoop$kotlinx_coroutines_core();\r\n this.isCompleted = true;\r\n closeQueue();\r\n do {\r\n } while (processNextEvent() <= 0);\r\n rescheduleAllDelayed();\r\n }", "boolean awaitMessages(long timeout) throws InterruptedException;", "@Override\n public void run() {\n while (queue.num < 100) {\n try {\n queue.producer();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n }", "public void run()\n {\n TTL_CIL_Message msg;\n Command cmd;\n\n while( shutdown == false )\n {\n msg = null;\n cmd = null;\n try\n {\n\tmsg = (TTL_CIL_Message)cil.receiveMessage();\n\n\t// add Mesasge to a Hashtable(?) of mesages being dealt\n\t// with for reply with correct headers\n }\n catch( java.io.IOException ioe )\n {\n\tlogger.log( 1, logName, ioe );\n }\n\n if( msg == null )\n {\n\tlogger.log( 1, logName, \"null CIL_Message received\" );\n\t// reply with error\n }\n else if( msg.getMessageClass() ==\n\t TTL_CIL_MessageClass.E_CIL_ERR_CLASS )\n {\n\tlogger.log( 1, logName,\n\t\t \"ERROR message class received\" );\n\t// reply with error\n }\n //else if ( ( cmd = translator.translate( msg ) ) == null ) \n else if( cmd == null )\n {\n\tlogger.log( 1, logName,\n\t\t \"no translation available for message\" );\n\t// translate failed - send correct TTL_CIL_Message\n }\n\n new ExecutionThread( telescope, this, cmd ).start();\n }\n }", "public void run() {\n\n\t\tQueueObject qO = null;\n\t\tQueueRUNNING = true;\n\t\tint iNext = -1;\n\t\t// if not RUNNING, then check queue\n\t\t// get next object\n\t\t// set to running\n\n\t\twhile (TRUE) {\n\n\t\t\tif (QueueRUNNING) {\n\t\t\t\t//date = new Date();\n\n\t\t\t\t// don't get next job until free in run queue, except for\n\t\t\t\t// standard jobs\n\t\t\t\tif (!bRunning)\n\t\t\t\t\tiNext = Queue.getNextJobToRun();\n\n\t\t\t\tif ((!bRunning) && (iNext != Globals.NOT_FOUND)) {\n\t\t\t\t\tqO = Queue.get(iNext);\n\n\t\t\t\t\tint id = qO.getID();\n\t\t\t\t\tqO.setStart(); // update the object\n\t\t\t\t\tQueue.set(iNext, qO); // update the object in the queue\n\n\t\t\t\t\tif (id == SITEMAP) {\n\t\t\t\t\t\tbRunning = true;\n\t\t\t\t\t\tsiteMap = new SiteMapThread(qO.getJobID());\n\t\t\t\t\t\tsiteMap.start();\n\t\t\t\t\t}\n//\t\t\t\t\tif (id == CHECK_NEW_PHOTOS) {\n//\t\t\t\t\t\tcheck = new CheckDirectoryStructure(qO.getJobID());\n//\t\t\t\t\t\tcheck.start();\n//\t\t\t\t\t}\n//\t\t\t\t\tif (id == RASTERIZE) {\n//\t\t\t\t\t\trasterize = new WatchRastQueue(qO.getJobID());\n//\t\t\t\t\t\trasterize.start();\n//\t\t\t\t\t}\n\n//\t\t\t\t\tif (id == XMLUPDATE) {\n//\t\t\t\t\t\txmlUpdate = new WatchXMLQueue(qO.getJobID());\n//\t\t\t\t\t\txmlUpdate.start();\n//\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLogging.info(this.getClass().getName(), \"Queue is not running.\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(10000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tLogging.error(e);\n\t\t\t}\n\n\t\t\tif (ABORT_ID != -100) {\n\t\t\t\tQueueObject qTemp = Queue.get(ABORT_ID);\n\t\t\t\tif (qTemp.getJobID() == ABORT_ID) {\n\t\t\t\t\tLogging.info(this.getClass().getName(), \"Aborting: \" + ABORT_ID);\n\t\t\t\t\tLogging.info(this.getClass().getName(), \"Type: \" + qO.getID());\n\t\t\t\t\tswitch (qTemp.getID()) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tsiteMap.Abort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n//\t\t\t\t\t\tcheck.interrupt();\n//\t\t\t\t\t\tcheck.Abort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n//\t\t\t\t\t\trasterize.interrupt();\n//\t\t\t\t\t\trasterize.Abort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n//\t\t\t\t\t\txmlUpdate.interrupt();\n//\t\t\t\t\t\txmlUpdate.Abort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tABORT_ID = -100; // reset ID\n\t\t\t}\n\n\t\t}\n\n\t}", "public void run() {\n // Check if the specified connector is null\n //\n if(this.connector == null) {\n System.out.println(\"[ERROR] connector is null aborting\");\n return;\n }\n\n //\n // Keep reading messages\n //\n while (true) {\n AeMessage inMsg = connector.read();\n if(inMsg == null) {\n System.out.println(\"[ERROR] Received an invalid message\");\n connector.reconnect();\n try {\n Thread.sleep(10000);\n }\n catch(Exception e) {\n }\n }\n else {\n //\n // Reject messages over two minutes old\n //\n if(inMsg.checkMessageOlderThan(120) == 1) {\n System.out.println(\"[INFO] Message has expired: \" + inMsg.toString());\n }\n else if(inMsg.getMessageType().equals(\"22\")) {\n System.out.println(\"[INFO] Received message:\" + inMsg.toString());\n if(messageStore.reportMessage(inMsg)) {\n System.out.println(\"[INFO] Successfully added message to the store\");\n }\n else {\n System.out.println(\"[ERROR] Failed to add message to the store\");\n }\n }\n }\n }\n }", "public void run(){\r\n TaggedData d;\r\n try{\r\n dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));\r\n while(true){\r\n synchronized(sendLock){\r\n if(queue.size() <= 0) sendLock.wait();\r\n try{ d = queue.removeLast(); }\r\n catch(NoSuchElementException e){ d = null; }\r\n }\r\n if(quit){\r\n cleanup();\r\n break;\r\n }\r\n if(d != null) send(d);\r\n }\r\n }\r\n catch(InterruptedException ie){ ie.printStackTrace(); cleanup(false); } // for now\r\n catch(IOException ioe){ ioe.printStackTrace(); cleanup(false); }\r\n finally{ cleanup(false); }\r\n \r\n if(dos != null){\r\n try{ dos.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dos = null;\r\n }\r\n }", "@Override\n public void run() {\n ICBlock currentBlock = null;\n\n while (running) {\n try {\n currentBlock = mQueue.take();\n currentBlock.doAction();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n\n }\n\n\n }", "@Override\n\tpublic void run() {\n\t\twhile(true){\n\t\t\t\n\t\t}\n\t}", "@Override\n public void run() {\n\n while(true) {\n String incomingMessage = getSocketController().receive();\n getMessages().lock();\n System.out.println(incomingMessage);\n getMessages().addElement(incomingMessage);\n getMessages().unlock();\n try {\n Thread.sleep(10);\n }catch(InterruptedException e) {\n throw new RuntimeException(e);\n }\n }\n }", "@Override\n\tpublic void run(){\n\t\twhile(keepGoing){\n\t\t\ttry {\n\t\t\t\tString data = input.readUTF();\n\t\t\t\tStringTokenizer st = new StringTokenizer(data);\n\t\t\t\tString cmd = st.nextToken();\n\t\t\t\tswitch(cmd){\n\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Receive a File Sharing request\n\t\t\t\t\t */\n\t\t\t\t\tcase \"cmd_receiverequest_file\": // format: ([cmd_receiverequest_file] [from] [filename] [size]) \n\t\t\t\t\t\tgetReceiveFileRequest(st);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tJOptionPane.showMessageDialog(main, \"Unknown Command '\"+ cmd +\"' in MainThread\", \"Unknown\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tJOptionPane.showMessageDialog(main, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tkeepGoing = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"MainThread was closed.!\");\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(bLinked &&!isExit()){\r\n\t\t\t\tLog.d(\"123\", \"set heart beat threadid:\"+Thread.currentThread().getId());\r\n\t\t\t\tjni.talkSetHeartBeat();\r\n\t\t\t\tif(jni.talkGetRegisterState()!=1 ){\r\n\t\t\t\t\tLog.e(\"123\", \"心跳停止了\");\r\n\t\t\t\t\tbLinked = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbLinked = true;\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(interval*1000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!bLinked){\r\n\t\t\t\thandler.sendEmptyMessage(MSG_NOT_LINK);\r\n\t\t\t}\r\n\t\t\theartThread = null;\r\n\t\t\tsuper.run();\r\n\t\t}", "public void loop(){\n\t}", "protected void doWork() {\n\t\ttry {\n\t\t\twhile ((_cli != null) && _cli.hasNext()) {\n\t\t\t\tConversationMessage cm = _cli.next2();\n\t\t\t\t_messages.add(cm);\n\t\t\t}\n\t\t\tThread.sleep(_DOWORK_WAIT);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void receive() {\n\t\tMQGetMessageOptions gmo = new MQGetMessageOptions();\n\t\tif (keepMessages) {\n\t\t\tgmo.options = gmo.options | MQConstants.MQGMO_CONVERT | MQConstants.MQGMO_PROPERTIES_FORCE_MQRFH2\n\t\t\t\t\t| MQConstants.MQGMO_BROWSE_FIRST;\n\t\t} else {\n\t\t\tgmo.options = gmo.options | MQConstants.MQGMO_CONVERT | MQConstants.MQGMO_PROPERTIES_FORCE_MQRFH2;\n\t\t\tif (syncPoint) {\n\t\t\t\tgmo.options = gmo.options | MQConstants.MQGMO_SYNCPOINT;\n\t\t\t}\n\t\t}\n\t\tgmo.matchOptions = MQConstants.MQMO_NONE;\n\t\tgmo.waitInterval = this.waitInterval;\n\n\t\ttry {\n\t\t\tint lastSeqNo = 0;\n\t\t\tlong lastTs = 0;\n\t\t\tint messagecounter = 0;\n\t\t\twhile (true) {\n\t\t\t\tif (!(qmgr.isConnected())) {\n\t\t\t\t\treconnectMq();\n\t\t\t\t}\n\t\t\t\tif (!(queue.isOpen())) {\n\t\t\t\t\treconnectMq();\n\t\t\t\t}\n\t\t\t\thaltFileExists();\n\t\t\t\tif (haltStatus) {\n\t\t\t\t\treadQueue = false;\n\t\t\t\t} else {\n\t\t\t\t\treadQueue = true;\n\t\t\t\t}\n\t\t\t\tint queueNotInhibited = queue.getInhibitGet();\n\t\t\t\tif (queueNotInhibited == MQConstants.MQQA_GET_INHIBITED) {\n\t\t\t\t\treadQueue = false;\n\t\t\t\t}\n\t\t\t\tproduceCounts();\n\t\t\t\tif (readQueue) {\n\t\t\t\t\tqueueDepth = queue.getCurrentDepth();\n\t\t\t\t\tif (queueDepth != 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trcvMessage = new MQMessage();\n\t\t\t\t\t\t\tif (mqccsid != 0) {\n\t\t\t\t\t\t\t\trcvMessage.characterSet = mqccsid;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tqueue.get(rcvMessage, gmo);\n\t\t\t\t\t\t\trecordCountsRcvd++;\n\t\t\t\t\t\t\tstrLen = rcvMessage.getMessageLength();\n\t\t\t\t\t\t\tstrData = new byte[strLen];\n\t\t\t\t\t\t\trcvMessage.readFully(strData);\n\t\t\t\t\t\t\tmessagePutMs = rcvMessage.putDateTime.getTimeInMillis();\n\t\t\t\t\t\t\tseqNo = rcvMessage.messageSequenceNumber;\n\t\t\t\t\t\t\tif (lastTs == messagePutMs && seqNo == 1) {\n\t\t\t\t\t\t\t\tseqNo = lastSeqNo + seqNo;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmsgText = new String(strData);\n\t\t\t\t\t\t\tjsonOut = new JSONArray();\n\t\t\t\t\t\t\tjsonKey = new JSONObject();\n\t\t\t\t\t\t\tjsonValue = new JSONObject();\n\t\t\t\t\t\t\tjsonKey.put(\"key\", Long.toString(messagePutMs) + \"_\" + seqNo);\n\t\t\t\t\t\t\tjsonValue.put(\"value\", msgText);\n\t\t\t\t\t\t\tLOG.debug(\"MQ MsgKey: \" + Long.toString(messagePutMs) + \"_\" + seqNo);\n\t\t\t\t\t\t\tLOG.debug(\"MQ MsgValue: \" + msgText);\n\t\t\t\t\t\t\tjsonOut.put(jsonKey);\n\t\t\t\t\t\t\tjsonOut.put(jsonValue);\n\t\t\t\t\t\t\tmsgList.add(jsonOut.toString());\n\t\t\t\t\t\t\tlastTs = messagePutMs;\n\t\t\t\t\t\t\tlastSeqNo = seqNo;\n\t\t\t\t\t\t\tmessagecounter++;\n\t\t\t\t\t\t\t// move cursor to next message\n\t\t\t\t\t\t\tif (msgList.size() > maxUMsg / 2) {\n\t\t\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (msgList.size() > queueDepth) {\n\t\t\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keepMessages) {\n\t\t\t\t\t\t\t\tgmo.options = MQConstants.MQGMO_CONVERT | MQConstants.MQGMO_PROPERTIES_FORCE_MQRFH2\n\t\t\t\t\t\t\t\t\t\t| MQConstants.MQGMO_WAIT | MQConstants.MQGMO_BROWSE_NEXT;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgmo.options = MQConstants.MQGMO_CONVERT | MQConstants.MQGMO_PROPERTIES_FORCE_MQRFH2\n\t\t\t\t\t\t\t\t\t\t| MQConstants.MQGMO_WAIT;\n\t\t\t\t\t\t\t\tif (syncPoint) {\n\t\t\t\t\t\t\t\t\tgmo.options = gmo.options | MQConstants.MQGMO_SYNCPOINT;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (MQException e) {\n\t\t\t\t\t\t\tif (e.reasonCode == MQConstants.MQRC_NO_MSG_AVAILABLE) {\n\t\t\t\t\t\t\t\tif (msgList.size() > 0) {\n\t\t\t\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnoMessagesCounter++;\n\t\t\t\t\t\t\t\tthreadWait();\n\t\t\t\t\t\t\t} else if (e.reasonCode == MQConstants.MQRC_SYNCPOINT_LIMIT_REACHED) {\n\t\t\t\t\t\t\t\tif (msgList.size() > 0) {\n\t\t\t\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnoMessagesCounter++;\n\t\t\t\t\t\t\t\tthreadWait();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\tCalendar.getInstance().getTime() + \" - MQ Reason Code: \" + e.reasonCode);\n\t\t\t\t\t\t\t\treconnectMq();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (IOException ioe) {\n\t\t\t\t\t\t\tSystem.out.println(Calendar.getInstance().getTime() + \" - Error: \" + ioe.getMessage());\n\t\t\t\t\t\t\treconnectMq();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (msgList.size() > 0) {\n\t\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthreadWait();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (msgList.size() > 0) {\n\t\t\t\t\t\tcommitMessages();\n\t\t\t\t\t}\n\t\t\t\t\tthreadWait();\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Throwable t) {\n\t\t\t// restart if there is any other error\n\t\t\trestart(Calendar.getInstance().getTime() + \" - Error receiving data from Queue or QMGR\", t);\n\t\t}\n\n\t}", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\n\t\twhile (onWork) {\n\n\t\t\tswitch (state) {\n\t\t\tcase connect:\n\t\t\t\tconnect();\n\t\t\t\tbreak;\n\t\t\tcase running:\n\t\t\t\treceiveMsg();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n public void run() {\n while (count > 0) {\n count++;\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if (count == 10)\n customHandler.sendEmptyMessage(COUNT_10);\n if (count == 15)\n customHandler.sendEmptyMessage(COUNT_15);\n\n if (count > 30) {\n customHandler.sendEmptyMessage(COUNT_COMPLETE);\n break;\n }\n\n System.out.println(tag + \":: count =\" + count);\n if (!run)\n break;\n }\n }", "boolean endLoop();", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\twhile(runFlg){\n\t\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t\twhile(mQueue.getSize() >0 ){\n\t\t\t\t\t\tbyte[] data = getData();\n\t\t\t\t\t\tmOut.write(data);\n\t\t\t\t\t}\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\tLog.e(TAG,e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\r\n\tpublic boolean end() {\r\n\t\tif (closed.compareAndSet(false, true)) {\r\n\t\t\taddToQueueAndSend(new byte[0]);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean sendAndWait(Message m){\r\n\t\tif (!sendMessage(m))\r\n\t\t\treturn false;\r\n\t\t// Wait for the reply\r\n\t\twhile(!messageList.containsKey(m.get(\"id\"))) {\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(50);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t}\r\n\r\n\t\t\t// Quit if the game window has closed\r\n\t\t\tif (!GameState.getRunningState()){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\tsuper.run();\r\n\t\t\twhile(bPlayAudioQueue){\r\n\t\t\t\tplayFromAudioQueue();\r\n\t\t\t}\r\n\t\t}", "public void run() {\n\t\twhile (frontIsClear()) {\n\t\t\tmove();\n\n\t\t\tif (noBeepersPresent()) {\n\t\t\t\tremoveChad();\n\t\t\t}\n\t\t //if (beepersPresent()){\n\t\t\t\t// collectBeeper();\n\t\t\t//}\t\n\t\t \n\t\t\tmove();\n\t\t}}", "public void run() {\n\t\tThread t = Thread.currentThread();\n\t\twhile (!t.isInterrupted()) {\n\t\t\ttry {\n\t\t\t\t//boolean status = process();\n\t\t\t\tMessage message = receive();\n\t\t\t\tif (t.isInterrupted())\n\t\t\t\t\treturn;\n\t\t\t\t//if (!status)\n\t\t\t\t//\treturn;\n\t\t\t\tif (socket == null)\n\t\t\t\t\treturn;\n\t\t\t\tThread.yield();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//_monitor.log(e);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "protected void syncConsumeLoop(MessageConsumer requestConsumer) {\n try {\n Message message = requestConsumer.receive(5000);\n if (message != null) {\n onMessage(message);\n } else {\n System.err.println(\"No message received\");\n }\n } catch (JMSException e) {\n onException(e);\n }\n }", "private void consume()\r\n\t{\r\n\t\twhile (true)\r\n\t\t{\r\n\t\t\tSubscriberMessage sifMsg = queue.blockingPull();\t\t\t\t\r\n\t\t\tif (sifMsg != null)\r\n\t\t\t{\r\n\t\t\t\tlogger.debug(consumerID+\" has receive a message from its SubscriberQueue.\");\r\n\t\t\t\tif (sifMsg.isEvent())\r\n\t\t\t\t{\r\n\t\t\t\t\tSIFEvent sifEvent = new SIFEvent(sifMsg.getSIFObject(), sifMsg.getEventAction());\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsubscriber.processEvent(sifEvent, sifMsg.getZone(), sifMsg.getMappingInfo(), consumerID);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception ex)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlogger.error(\"Failed processing SIF Event for subscriber \"+subscriber.getId()+\": \"+ex.getMessage()+\"\\nEvent Data:\\n\"+sifEvent, ex);\t\t\t\t\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{\r\n\t\t\t\t\tSIFDataObject sifObj = sifMsg.getSIFObject();\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsubscriber.processResponse(sifObj, sifMsg.getZone(), sifMsg.getMappingInfo(), consumerID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception ex)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlogger.error(\"Failed processing SIF Object for subscriber \"+subscriber.getId()+\": \"+ex.getMessage()+\"\\nSIF Object Data:\\n\"+((sifObj == null) ? \"null\" : sifObj.toXML()), ex);\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\telse\r\n\t\t\t{\r\n\t\t\t\tlogger.error(consumerID+\" has encountered a problem receiving a message from its SubscriberQueue.\");\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "void shutdown()\n {\n run = false;\n try\n {\n join();\n }\n catch (InterruptedException ex)\n {\n Activator.getLogger().log(Level.WARNING, \"JCACommandThread shutdown\", ex);\n }\n Activator.getLogger().log(Level.FINE, \"JCACommandThread queue reached up to {0} entries\", max_size_reached);\n }", "private void writeNextMessageInQueue() {\n // This should not happen in practice since this method is private and should only be called\n // for a non-empty queue.\n if (mMessageQueue.isEmpty()) {\n Log.e(TAG, \"Call to write next message in queue, but the message queue is empty.\");\n return;\n }\n\n if (mMessageQueue.size() == 1) {\n writeValueAndNotify(mMessageQueue.remove().toByteArray());\n return;\n }\n\n mHandler.post(mSendMessageWithTimeoutRunnable);\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\n\t\t\t while ( !bFinished ) {\n\t\t\t \ttry {\n\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t }\n\t\t\t System.exit(0);\n\t\t\t\t}", "public void loop(){\n\t\t\n\t}", "private void loop() throws InterruptedException\n\t{\n\t\tMessage message;\n\t\ttry\n\t\t{\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\t/* Checking a queue */\n\t\t\t\t\tmessage = controllerToViewQueue.take();\n\t\t\t\t\tif(message == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tswitch(message.getValveResponse())\n\t\t\t\t\t{\n\t\t\t\t\t\tcase REDRAW:\n\t\t\t\t\t\t\tredraw(message.getData());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\tcase CHANGE_NEXT: \n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setNext(message.getAdd());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase SCORES_UPDATE:\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setScores(message.getAdd());\n\t\t\t\t\t\t\tview.getInGamePanel().setScoreLabel(Integer.toString(message.getAdd()));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase LEVEL_UPDATE:\n\t\t\t\t\t\t\tview.getInGamePanel().setLevelLabel(Integer.toString(message.getAdd()));\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLevel(message.getLevel());\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase LOST:\n\t\t\t\t\t\t\tlost = true;\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLost(lost);\n\t\t\t\t\t\t\tview.getInGamePanel().setGameStart(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase WIN:\n\t\t\t\t\t\t\twinLevel = true;\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setWinLevel(winLevel);\n\t\t\t\t\t\t\tview.getInGamePanel().setGameStart(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase GET_NEWGAME:\n\t\t\t\t\t\t\tlost = true;\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLost(lost);\n\t\t\t\t\t\t\tview.getInGamePanel().setGameStart(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase INFO_UPDATE:\n\t\t\t\t\t\t\tlost = false;\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLost(lost);\n\t\t\t\t\t\t\tview.getInGamePanel().setGameStart(true);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setScores(message.getAdd());\n\t\t\t\t\t\t\tview.getInGamePanel().getBoardGamePanel().setLevel(message.getLevel());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tview.getInGamePanel().setScoreLabel(Integer.toString(message.getAdd()));\n\t\t\t\t\t\t\tview.getInGamePanel().setLevelLabel(Integer.toString(message.getLevel()));\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault: \n\t\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\t\t\tcatch (InterruptedException e) \n\t\t\t\t{\n\t\t\t\t}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (((LBSManager)PushServiceManager.getService(ServiceType.LBS_MANAGER))\n\t\t\t\t\t\t.isLBS()) {\n\t\t\t\t\t((LBSManager)PushServiceManager.getService(ServiceType.LBS_MANAGER))\n\t\t\t\t\t.closeLBSPush();\n\t\t\t\t\tSystem.out.println(\"关闭LBS服务: …………&&***((\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(2000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void run()\r\n {\r\n\t\tconsume();\r\n }", "public void run() {\t\t\t\n\t\tItem item = null;\n\t\twhile (isAlive) {\n\t\t\ttry {\n\t\t\t\titem = queue.take();\n\t\t\t\tif (item == null) {\n\t\t\t\t\t_logger.error(\"Item is null.\");\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tlastAction = 1;\n\t\t\t\t\tlastAccess = System.currentTimeMillis();\n\t\t\t\t\titemsConsumed++;\n\t\t\t\t\t\n\t\t\t\t\tprocess(item);\n\t\t\t\t}\n\t\t\t} catch(IOException e) {\n\t\t\t\t_logger.error(e);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t_logger.error(e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//empty queue before exit \n\t\twhile ((item = queue.poll()) != null) {\n\t\t\ttry {\n\t\t\t\tprocess(item);\n\t\t\t} catch (IOException e) {\n\t\t\t\t_logger.error(e);\n\t\t\t}\n\t\t}\n\t}", "private void sendMessage()\n\t{\n\t\tfinal String message = messageTextArea.getText(); \n\t\tif(message.length() == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tmessageTextArea.setText(\"\");\n\t\ttry\n\t\t{\n\t\t\teventsBlockingQueue.put(new MessageEvent(message));\n\t\t}\n\t\tcatch (final InterruptedException e1)\n\t\t{\n\t\t}\n\t}", "public void eventLoop() {\n while (looping) {\n try {\n int c = Util.keyPress(String.format(format, num_threads, time, timeout, print_details, print_incrementers));\n switch (c) {\n case '1':\n startBenchmark();\n break;\n case '2':\n printView();\n break;\n case '4':\n changeFieldAcrossCluster(NUM_THREADS, Util.readIntFromStdin(\"Number of incrementer threads: \"));\n break;\n case '6':\n changeFieldAcrossCluster(TIME, Util.readIntFromStdin(\"Time (secs): \"));\n break;\n case 'd':\n changeFieldAcrossCluster(PRINT_DETAILS, !print_details);\n break;\n case 'i':\n changeFieldAcrossCluster(PRINT_INVOKERS, !print_incrementers);\n break;\n case 't':\n changeFieldAcrossCluster(TIMEOUT, Util.readIntFromStdin(\"incr timeout (ms): \"));\n break;\n case 'v':\n System.out.printf(\"Version: %s, Java version: %s\\n\", Version.printVersion(),\n System.getProperty(\"java.vm.version\", \"n/a\"));\n break;\n case 'x':\n case -1:\n looping = false;\n break;\n case 'X':\n try {\n RequestOptions options = new RequestOptions(ResponseMode.GET_NONE, 0)\n .flags(Message.Flag.OOB, Message.Flag.DONT_BUNDLE, Message.Flag.NO_FC);\n disp.callRemoteMethods(null, new MethodCall(QUIT_ALL), options);\n break;\n } catch (Throwable t) {\n System.err.println(\"Calling quitAll() failed: \" + t);\n }\n break;\n default:\n break;\n }\n } catch (Throwable t) {\n t.printStackTrace();\n }\n }\n stop();\n }", "Message sendAndWait();", "@Override\n public void run() {\n try {\n while (true) {\n\n FIXMessageBlock executionReport = executionReportQueue.take();\n\n processExecutionReport(executionReport);\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void run() {\r\n\t\twhile(true){\r\n\t\t\ttry {\r\n\t\t\tLiftEvent event = connection.receive();\r\n\t\t\tLiftAction liftAction = eventActionMap.get(event.getClass());\r\n\r\n\t\t\tliftAction.execute(event);\r\n\t\t\t} catch(Exception e) {\r\n\t\t e.printStackTrace();\r\n\t\t throw new RuntimeException(e);\r\n\t\t } \r\n\t\t}\t\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t while ( !bFinished ) {\n\t\t \tif(scan.hasNextLine()){\n\t\t\t String message = scan.nextLine();\n\t\t\t if ( message.equals( \"stop\" ) ) {\n\t\t\t \tscan.close();\n\t\t\t \tSystem.exit(0);\n\t\t\t break;\n\t\t\t }\n\t\t \t} \t\n\t\t }\n\t\t scan.close();\t\n\t\t\t}", "@Override\r\n\tpublic void run() {\n\t\tbyte[] buffer = new byte[YapttaConstants.Network.DEFAULT_PACKET_BUFFER_SIZE];\r\n\t\tDatagramPacket packet = new DatagramPacket(buffer, buffer.length);\r\n\t\t\r\n\t\t// Loop until we're disconnected/stopped/etc\r\n\t\twhile(!haltRequested && socket != null && socket.isBound() && !socket.isClosed())\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t// Block the socket until data is received\r\n\t\t\t\tsocket.receive(packet);\r\n\t\t\t\t\r\n\t\t\t\t// Deserialize the data\r\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(packet.getData(), 0, packet.getLength());\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(bais);\r\n\t\t\t\tAbstractMessage am = (AbstractMessage) ois.readObject();\r\n\t\t\t\t\r\n\t\t\t\t// Save who the sender was\r\n\t\t\t\tam.setSender(packet.getAddress());\r\n\t\t\t\t\r\n\t\t\t\t// Call the data received handler as appropriate\r\n\t\t\t\tif(callback != null) callback.messageReceived(am);\r\n\t\t\t\t\r\n\t\t\t\t// Clean-up\r\n\t\t\t\tois.close();\r\n\t\t\t\tbais.close();\r\n\t\t\t\t\r\n\t\t\t\t// ... then do it again!\r\n\t\t\t\t\r\n\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t// just try to roll with the error (but at least log it)... it's likely due to\r\n\t\t\t\t// disconnection and will end the thread when it checks the condition of the loop\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// if something other than timeout occurred, give more info\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n while (this.isAlive()) {\n try {\n this.semaphoreHashMap.get(\"lock\").acquire();\n this.guestNo = -1;\n this.bellhopGuestHashMap = null;\n this.semaphoreHashMap.get(\"bellhops\").release();\n this.helper.addToBellhopQueue(this);\n this.semaphoreHashMap.get(\"lock\").release();\n\n printStringToConsole(toStringId, \"is ready to help a guest\");\n\n this.mutex.acquire();\n\n printStringToConsole(toStringId, \"has obtained the bags of [Guest \", guestNo + \"\", \"]\");\n this.bellhopGuestHashMap.get(\"hasBags\").release();\n\n this.bellhopGuestHashMap.get(\"guestNeedsBags\").acquire();\n\n this.bellhopGuestHashMap.get(\"inRoom\").acquire();\n printStringToConsole(toStringId, \"has entered the room of [Guest \", guestNo + \"\", \"]\");\n\n printStringToConsole(toStringId, \"has given the bags to [Guest \", guestNo + \"\", \"]\");\n this.bellhopGuestHashMap.get(\"giveBags\").release();\n\n this.bellhopGuestHashMap.get(\"giveTip\").acquire();\n printStringToConsole(toStringId, \"has gotten their tip and leaves from [Guest \", guestNo + \"\", \"]\");\n\n this.bellhopGuestHashMap.get(\"gotTip\").release();\n\n printStringToConsole(toStringId, \"is ready to help a guest\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "private void whileShouldRun(PrintWriter out, BufferedReader in) throws IOException, InterruptedException {\n\t\tLog.fine(secondsSinceLastLog());\n\t\twhile ((Nex.SHOULD_RUN || (emptyNow && !messageQueue.isEmpty())) && secondsSinceLastLog() < 180) {\n\t\t\tlogToServer(out, in);\n\t\t\t//\tcheckIfBanned(out, in);\n\t\t\tif (!messageQueue.isEmpty()) {\n\t\t\t\thandleMessageQueue(out, in);\n\t\t\t\tif(emptyNow) continue;\n\t\t\t}\n\t\t\tcheckStuck();\n\t\t\temptyNow = false;\n\t\t\tThread.sleep(1000);\n\t\t}\n\t\t//Nex.SHOULD_RUN = false;\n\t\t\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException 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}", "@Override\r\n\t\tpublic void run() {\n\t\t\tStaticString.information = null;// 判断回复信息之间清空之前信息\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\t\tSocketConnet.getInstance().communication(888,new String[]{mLogsIndexNumber});\r\n\t\t\t\tif (ReplyParser.waitReply()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private void eventLoop() {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n while (true) {\n try {\n System.out.println(\">\");\n // Before readLine(), clear the in stream.\n System.out.flush();\n String line = in.readLine().toLowerCase();\n if (line.startsWith(\"quit\") || line.startsWith(\"exit\")) {\n break;\n }\n line = \"[\" + \"Node1\" + \"]\" + line;\n // destination address is null, send msg to everyone in the cluster.\n Message msg = new ObjectMessage(null, line);\n channel.send(msg);\n } catch (Exception e) {\n // TODO: handle exception.\n }\n }\n\n }", "@Override\r\n\tpublic void run() {\n\t\tint i=0;\r\n\t\twhile(i<1000) {\r\n\t\t\tq.put(i++);\r\n\t\t}\r\n\t}", "public void run()\r\n {\n \tm_Handler.sendEmptyMessage(JMSG_TIMER);\r\n }", "public void run() {\n\t\twhile (!isShutdown()) {\n\t\t\tlong threadId = Thread.currentThread().getId(); \n\t\t\tSystem.out.println(\"Thread \" + threadId + \" is trying to dequeue from queue of size \" + taskQueue.size());\n\t\t\tRunnable task = taskQueue.dequeue();\n\t\t\ttask.run(); \n\t\t}\n\t}", "public synchronized void quit() {\n\t\tif(alive) {\n\t\t\talive = false;\n\t\t\t// thread might be waiting for commands so give it an interrupt.\n\t\t\tthread.interrupt();\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tTask t = bq.take();\n\n\t\t\t\t\n\t\t\t\tThread.sleep(t.getProcessTime() * 1000);\n\t\t\t\twaitingTime.addAndGet((-1) * t.getProcessTime());\n\t\t\t\tSimulator.getFrame().displayData(\"Client \"+t.getNr()+\" left. \\n\");\n\t\t\t\tsize--;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n jobDescriptor j = null;\n\n while (!exit) {\n try {\n // wait for work\n syncObject.acquire();\n\n // get next job descriptor\n j = jobQueue.poll();\n if (j == null)\n continue;\n\n j.outputObject.started();\n\n if (!executor.executeTask(new MyRunnable(j.codeToBeExecuted, j.outputObject))) {\n j.outputObject.error(\"... cancelled!\");\n }\n } catch (Throwable e) {\n logger.error(e.getMessage());\n }\n }\n }", "@Override\n \t public void run() {\n \t while (true) {\n \t try {\n \t Thread.sleep(3000);\n \t mHandler.post(new Runnable() {\n\n \t @Override\n \t public void run() {\n \t // TODO Auto-generated method stub\n \t // Write your code here to update the UI.\n \t \tGetMessageUnreadFunc();\n \t }\n \t });\n \t } catch (Exception e) {\n \t // TODO: handle exception\n \t }\n \t }\n \t }", "public Serializable asyncPop() {//can move on to another task before it finishes.\n Serializable temp = null;\n boolean finished = false;\n while(!finished){\n if(taskQueue.isEmpty()){\n try {\n Thread.sleep(1000);//1 second\n } catch (InterruptedException ex) {\n Logger.getLogger(BasicMsgQ.class.getName()).log(Level.SEVERE, null, ex);\n }\n }else{\n temp = taskQueue.removeFirst();\n finished = true;\n } \n }\n return temp;\n }" ]
[ "0.70939386", "0.6942166", "0.68836224", "0.67503023", "0.6744185", "0.6736632", "0.67308414", "0.6715854", "0.6699057", "0.6682073", "0.6674164", "0.66301095", "0.66276586", "0.6596121", "0.6507075", "0.64954346", "0.6456006", "0.64439124", "0.64397967", "0.64386344", "0.6423021", "0.6393168", "0.63845867", "0.63693607", "0.63612396", "0.6352837", "0.63423795", "0.63204384", "0.6302133", "0.629377", "0.62637496", "0.62125355", "0.6209088", "0.6198999", "0.6194488", "0.61926776", "0.61777925", "0.615619", "0.61490333", "0.6132543", "0.61277187", "0.6122995", "0.6114315", "0.61136353", "0.6112991", "0.611245", "0.6106779", "0.6095427", "0.6095375", "0.6085489", "0.6073887", "0.6067625", "0.60674834", "0.60624677", "0.606077", "0.605669", "0.6050055", "0.60499316", "0.6037918", "0.6034309", "0.6034114", "0.60340697", "0.6030994", "0.60289", "0.60242474", "0.6010434", "0.6009356", "0.6003145", "0.6000725", "0.5997137", "0.59878606", "0.59756804", "0.59670377", "0.5955471", "0.59548914", "0.5948704", "0.5948066", "0.5941727", "0.5938656", "0.5936622", "0.593644", "0.5936191", "0.59327036", "0.5930217", "0.592433", "0.59235024", "0.59108984", "0.5905349", "0.59049654", "0.59033954", "0.589702", "0.58879536", "0.58857197", "0.58716315", "0.5870838", "0.58668226", "0.5865609", "0.5857166", "0.5845031", "0.58433574" ]
0.60434055
58
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_movie_image_list, container, false); movieListCompositeDisposable = new CompositeDisposable(); mPager = (ViewPager) view.findViewById(R.id.pager); indicator = (CircleIndicator) view.findViewById(R.id.indicator); getMovieImageList(); return view; }
{ "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
Toast.makeText(getActivity(), "Success ", Toast.LENGTH_SHORT).show();
private void handleResponse(MoviePosterResponse moviePosterResponse) { moviePosterList.addAll(moviePosterResponse.getPosters()); init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void displayMessage(String message) {\n Toast.makeText(getActivity(),message,Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(getApplicationContext(), \"Success!\",\n Toast.LENGTH_LONG).show();\n }", "private void displayToast() {\n if(getActivity() != null && toast != null) {\n Toast.makeText(getActivity(), toast, Toast.LENGTH_LONG).show();\n toast = null;\n }\n }", "@Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(getContext(), \"המוצר נמחק בהצלחה!\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View view) {\n Toast.makeText( getActivity(), \"Fragment Second's\", Toast.LENGTH_SHORT ).show();\n\n\n }", "@Override\n public void onClick(View v) {\n\n Toast toast = Toast.makeText(getApplicationContext(), \"Coming soon.\", Toast.LENGTH_SHORT);\n toast.show();\n\n }", "void showToast(String message);", "void showToast(String message);", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(getActivity(), \"clicked okay\", Toast.LENGTH_SHORT).show();\n }", "public void onClick(DialogInterface dialog, int id) {\n\r\n Context context = getApplicationContext();\r\n CharSequence text = \"Welcome \" + name + \"! Signing up...\";\r\n int duration = Toast.LENGTH_SHORT;\r\n\r\n Toast toast = Toast.makeText(context, text, duration);\r\n toast.show();\r\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(),\"hey uuuu clicked me \",Toast.LENGTH_SHORT).show();\n }", "private void showToast(String message){\n\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n\n String msg = fragmentCallback.getMsgFromActivity(\"null\");\n Toast.makeText(BlankFragment1.this.getContext(), msg, Toast.LENGTH_SHORT).show();\n }", "private void showToast(final String message, final int toastLength) {\n post(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getActivity(), message, toastLength).show();\n }\n });\n }", "@Override\n public void onClick(View v) {\n String toastText = \"Hello World\";\n\n // This is how long we want to show the toast\n int duration = Toast.LENGTH_SHORT;\n\n // Get the context\n Context context = getApplicationContext();\n\n // Create the toast\n Toast toast = Toast.makeText(context, toastText, duration);\n\n // Show the toast\n toast.show();\n }", "public void toastMsg(View v){\n String msg = \"Message Sent!\";\n Toast toast = Toast.makeText(this,msg,Toast.LENGTH_SHORT);\n toast.show();\n }", "void showSuccess();", "@Override\n public void onDialogPositiveClick(DialogFragment dialog) {\n // User touched the dialog's positive button\n Toast.makeText(this, \"OK\", Toast.LENGTH_LONG).show();\n\n }", "protected void showToast(String message) {\n\tToast.makeText(this, message, Toast.LENGTH_SHORT).show();\n}", "private void displayToast(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "public void success() {\n Toast.makeText(ui.getApplicationContext(),\"Account successfully created!\",Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n Toast tst = Toast.makeText(MainActivity.this, \"test\", Toast.LENGTH_SHORT);\n tst.show();\n Test();\n }", "protected void onPostExecute(String message) {\n\n pDialog.dismiss();\n if (message != null) {\n\n\n Toast.makeText(TabLayout.this, message, Toast.LENGTH_LONG).show();\n }\n }", "public void showToast(String msg){\n Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n CustomToast.show(getContext(),\"Service will be available Soon\");\n }", "@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n\n String s = v.getTag().toString();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, s, duration);\n toast.show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Hello World\", Toast.LENGTH_LONG).show();\n }", "public void showToast(String text){\n Toast.makeText(this,text,Toast.LENGTH_SHORT).show();\n }", "public void showMessage(String msg){\n Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Goodbye!\", Toast.LENGTH_SHORT).show();\n }", "public void onSuccess() {\n Toast.makeText(StoneSDK.this.cordova.getActivity(), \"Ativado com sucesso, iniciando o aplicativo\", Toast.LENGTH_SHORT).show();\n callbackContext.success(\"Ativado com sucesso\");\n }", "void toast(int resId);", "public void onClick(View v) {\n Toast.makeText( getActivity(),\"Voice Recognition\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(v.getContext(), \"Registration success\", Toast.LENGTH_LONG).show();\n finish();\n }", "private void showToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_LONG).show();\n }", "void showToast(String value);", "public void showErrorMessage(){\n Toast.makeText(context, R.string.generic_error_message, Toast.LENGTH_LONG).show();\n }", "private void displayToast(String message) {\n Toast.makeText(getLayoutInflater().getContext(), message, Toast.LENGTH_SHORT).show();\n }", "private void showMessage(String message) {\n Toast.makeText(getApplicationContext(),message, Toast.LENGTH_LONG).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, \"\" + msg, Toast.LENGTH_LONG).show();\n\n }", "public static void displayToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onComplete(@NonNull Task<Void> task)\n {\n FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.fragment_container, new Fragment_VacatureOmschrijving()).addToBackStack(\"tag\").commit();\n Toast.makeText(getActivity(), \"Uw sollicitatie is succesvol verzonden\", Toast.LENGTH_LONG).show();\n }", "public void showMessage(String message){\n Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(), \"Not Ready Yet :(\", Toast.LENGTH_SHORT).show();\n }", "public void run() {\n Toast.makeText(context, toast, Toast.LENGTH_SHORT).show(); // toast for whatever reason\n }", "@Override\n public void onSuccess() {\n Toast.makeText(context, \"Successfully ordered\", Toast.LENGTH_SHORT).show();\n\n }", "private void displayToast(String message) {\n Toast.makeText(OptionActivity.this, message, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, CharSequence message) {\n Toast.makeText(context, message, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void run() {\n Constant.showToast(getActivity().getResources().getString(R.string.internet), getActivity());\n }", "@Override\n public void run() {\n Constant.showToast(getActivity().getResources().getString(R.string.internet), getActivity());\n }", "@JavascriptInterface\r\n\t public void showToast(String toast) {\r\n\t Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\r\n\t }", "private void toastmessage(String message){\n Toast.makeText(Accountinfo.this,message,Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "public void displayToast(String message) {\n Toast.makeText(getApplicationContext(), message,\n Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_LONG).show();\n }", "Activity getActivity();", "Activity getActivity();", "public void DisplayToast(String msg) {\n Toast.makeText(getBaseContext(), msg, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n\n\n Toast.makeText( LoginActivity.this, \"Saved\", Toast.LENGTH_SHORT ).show();\n }", "private void toastMessage (String message){\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "private void showToast(String msg) {\r\n Toast.makeText(Imprimir.this, msg, Toast.LENGTH_LONG).show();\r\n }", "public static void showAlert(String message, Activity context) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(context);\n builder.setMessage(message).setCancelable(false)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n\n }\n });\n try {\n builder.show();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "@JavascriptInterface\n public void showToast(String toast) {\n Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();\n }", "public void showMessage(String text)\n {\n Toast.makeText(this, text, Toast.LENGTH_SHORT).show();\n }", "protected void onPostExecute(String message) {\n\n pDialog.dismiss();\n if (message != null){\n Toast.makeText(TabLayout.this, message, Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(LogInActivity.this, \"Email is send\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void run() {\n Toast.makeText(getApplicationContext(), \"I'm a toast!\", Toast.LENGTH_SHORT).show();\n }", "private void showAlert(){\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())\n .setTitle(\"Your further details please:\")\n .setView(view);\n builder.setPositiveButton(\"Proceed\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n Intent it = new Intent(getActivity(), StudentFurtherDetails.class);\n getActivity().startActivity(it);\n }\n\n });\n //call api for insertion\n builder.setNegativeButton(\"Later\", null)\n .setCancelable(false);\n AlertDialog alert = builder.create();\n alert.show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(getActivity(), \"An error occured\", Toast.LENGTH_SHORT).show();\n }", "public void onClick(View v) {\n getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyContactFragment()).commit();\n\n // Replace\n Toast.makeText( getActivity(),\"Emergency contact\", Toast.LENGTH_SHORT).show();\n }", "void showDialog() {\n DialogFragment newFragment = MyAlertDialogFragment.newInstance(R.string.alert_dialog_two_buttons_title);\n newFragment.show(getFragmentManager(), \"dialog\");\n }", "void showSuccess(String message);", "@Override\n protected void onPrepareDialog(int id, Dialog dialog) {\n \tToast.makeText(this, dialog.toString(), Toast.LENGTH_SHORT).show();\n }", "protected void onPostExecute(Void aVoid) {\n progressDialog.dismiss();\n //Showing a success message\n Toast.makeText(context, R.string.toast_complete, Toast.LENGTH_SHORT).show();\n act.finish();\n }", "@Override\n public void onSuccess(Transaction transaction) {\n\n transaction = transaction;\n dialog.setMessage(\"Trying to Verify Your Transaction... please wait\");\n Log.d(\"REFERENCE\", transaction.getReference());\n Toast.makeText(getActivity(), transaction.getReference(), Toast.LENGTH_LONG).show();\n\n\n verifyOnServer(transaction.getReference());\n }", "public void toast (String msg)\n\t{\n\t\tToast.makeText (getApplicationContext(), msg, Toast.LENGTH_SHORT).show ();\n\t}", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(MainActivity.this, \"Uploaded\", Toast.LENGTH_SHORT).show();\n }", "private void toast(String string){\n Toast.makeText(this, string, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_LONG).show();\n }", "public void showToast(final String message){\n\t runOnUiThread(new Runnable() {\n\t public void run()\n\t {\n\t Toast.makeText(VisitMultiplayerGame.this, message, Toast.LENGTH_SHORT).show();\n\t }\n\t });\n\t}", "public void doPositiveClick() {\n // Do stuff here.\n Log.i(\"FragmentAlertDialog\", \"Positive click!\");\n }", "public void notificacionToast(String mensaje){\n Toast toast = Toast.makeText(getApplicationContext(),mensaje,Toast.LENGTH_LONG);\n toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 0);\n toast.show();\n }", "public void showToastMessage(String str) {\n Toast.makeText(self, str, Toast.LENGTH_SHORT).show();\n }", "public static void showToast(Context context, String message, int duration) {\n\n if (message.contains(\"任务\") && !getTopActivity(context).contains(\"HomeActivity\")) {\n return;\n }\n\n if (sIsAllowShow) {\n Toast toast = new Toast(context);\n View view = LayoutInflater.from(context).inflate(R.layout.toast_universal, null);\n TextView messageText = view.findViewById(R.id.toast_universal_message_text);\n messageText.setText(message);\n toast.setDuration(duration);\n toast.setView(view);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n }\n }", "private void toastMessage(String message) {\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n\n }", "public void showToast(final String message)\n {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(context, message, Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\r\n protected void onPostExecute(String message) {\n this.progressDialog.dismiss();\r\n Toast.makeText(getApplicationContext(),\r\n message, Toast.LENGTH_LONG).show();\r\n }", "@Override\n\t\tpublic void onServiceComplete(Boolean success, String jsonObj) {\n\t\t\tToast.makeText(getActivity(), jsonObj, Toast.LENGTH_SHORT).show();\n\t\t}", "public void working() {\n\t\t Dialog d = new Dialog(this);\r\n\t\t d.setTitle(\"hech yea!\");\r\n\t\t TextView tv = new TextView(this);\r\n\t\t tv.setText(\"Success\");\r\n\t\t d.setContentView(tv);\r\n\t\t d.show();\t\r\n\t}", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "private void msg(String s)\n {\n Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n\n\n Toast.makeText(MainSOSActivity.this, \"Stay Safe and Confirm the Message!\", Toast.LENGTH_SHORT).show();\n\n }", "public void message(String message){\n Toast.makeText(getContext(),message,Toast.LENGTH_SHORT).show();\n }", "public void toastSuccess(String mensagem){\n\n Context context = getApplicationContext();\n CharSequence text = mensagem;\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n\n View view = toast.getView();\n\n //Obtém o plano de fundo oval real do Toast e, em seguida, define o filtro de cores\n view.getBackground().setColorFilter(getResources().getColor(R.color.colorSuccess), PorterDuff.Mode.SRC_IN);\n\n //Obtém o TextView do Toast para que ele possa ser editado\n TextView newText = view.findViewById(android.R.id.message);\n newText.setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n newText.setTextColor(getResources().getColor(R.color.colorWhite));\n\n toast.show();\n\n }", "private void showErrorToast() {\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n Toast.makeText(getActivity().getApplicationContext(),\n \"Jam SUCCEEDED!\", Toast.LENGTH_SHORT)\n .show();\n }" ]
[ "0.7591368", "0.75661486", "0.7496109", "0.72413343", "0.7141511", "0.71158177", "0.69323134", "0.69323134", "0.68909436", "0.6873877", "0.6845315", "0.68418545", "0.6841735", "0.6811276", "0.68028355", "0.6736051", "0.6730024", "0.67014927", "0.6692438", "0.66601676", "0.6655184", "0.66531104", "0.6644476", "0.6630994", "0.66277933", "0.6619009", "0.66077995", "0.658584", "0.6584119", "0.65824926", "0.65665233", "0.65615547", "0.65411615", "0.65387547", "0.6515359", "0.65055066", "0.6489214", "0.64812994", "0.6475975", "0.64736956", "0.6473567", "0.6473567", "0.6469987", "0.64686847", "0.64600366", "0.64598644", "0.64590186", "0.64563614", "0.6451434", "0.64506525", "0.64458656", "0.6438381", "0.6438381", "0.64335334", "0.6427809", "0.6423521", "0.6423521", "0.6420509", "0.6413613", "0.6410098", "0.6410098", "0.64053017", "0.640481", "0.6404164", "0.6398663", "0.63875824", "0.63860726", "0.63860726", "0.6372982", "0.6368849", "0.6367481", "0.6359359", "0.63516635", "0.6346264", "0.6333153", "0.6331823", "0.63175404", "0.6311479", "0.6309247", "0.63050944", "0.6301945", "0.6299463", "0.6298302", "0.6296841", "0.6294644", "0.629245", "0.62795967", "0.62698656", "0.62655044", "0.6265246", "0.6264971", "0.6257795", "0.62470585", "0.62419856", "0.62389684", "0.62389684", "0.62387145", "0.6231938", "0.6228483", "0.62270904", "0.62242794" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { TreeNode<Character> root = new TreeNode<Character>('A'); root.left = new TreeNode<Character>('B'); root.right = new TreeNode<Character>('C'); root.left.left = new TreeNode<Character>('D'); root.left.right = new TreeNode<Character>('E'); root.right.right = new TreeNode<Character>('F'); System.out.println(getLists(root)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Get the next group of results that compare equal.
@Override public ListMultimap<Iterator<T>, T> next() { ListMultimap<Iterator<T>, T> results = ArrayListMultimap.create(); while (true) { HeapEntry heapEntry = heap.poll(); if (heapEntry == null) { break; // heap is empty } results.put(iterators.get(heapEntry.fromIterator), heapEntry.item); // The heap must contain one entry for each iterator that has >= 1 item remaining. // Replace the one we just popped with a new one from the source iterator. Iterator<T> sourceIterator = iterators.get(heapEntry.fromIterator); if (hasNextWrapper(sourceIterator)) { HeapEntry newEntry = new HeapEntry(nextWrapper(sourceIterator), heapEntry.fromIterator); // Any new heap items should compare >= popped items if input iterators are sorted assert heap.comparator().compare(newEntry, heapEntry) >= 0; heap.add(newEntry); } // Iterate again if and only if the next item on the heap should be returned with this one // (that is, they compare equal by the given comparator). HeapEntry peekHeap = heap.peek(); if (peekHeap == null || heap.comparator().compare(heapEntry, heap.peek()) != 0) { break; } } if (results.size() == 0) { throw new NoSuchElementException(); // Input iterators are empty } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<NoSQLResult> getNextResultGroup() {\n return getNextResultsGroupFromIterator(resultsIterator);\n }", "SearchResult findNext(SearchResult result);", "@Override\n public Tuple nonDistinctNext() {\n //function takes tuples from o2, merges them with t1 from o1 and\n //evaluates them, if it finds a fitting Tuple, returns the result of merge;\n while (tuple1 != null) {\n Tuple tuple2 = o2.nonDistinctNext();\n\n while (tuple2 != null) {\n Tuple result = tupleTrans.transform(new Tuple(tuple1, tuple2));\n if (result != null) {\n return result;\n }\n tuple2 = o2.nonDistinctNext();\n }\n\n //if o2 runs out of Tupes, new t1 is taken from o1 and o2 is reset\n tuple1 = o1.nonDistinctNext();\n o2.reset();\n }\n //if o1 runs out of tuples (t1 == null), the operator is at the end\n return null;\n }", "public Set<E> getNextSet()\r\n/* */ {\r\n/* 155 */ List<E> result = getNextArray();\r\n/* 156 */ if (result == null) {\r\n/* 157 */ return null;\r\n/* */ }\r\n/* */ \r\n/* 160 */ Set<E> resultSet = new LinkedHashSet(result);\r\n/* 161 */ return resultSet;\r\n/* */ }", "private void findNext() {\n \tthis.find(true);\n }", "@Test\n void first() {\n int[] answers = {1,2,3,4,5,1,2,3,4,5};\n int[] first = {1,2,3,4,5};\n int collect = 0;\n for (int i=0; i < answers.length ; i++) {\n if (answers[i] == first[i % 5]) {\n //0 0\n //1 1\n //2 2\n //3 3\n //4 4\n //5 0\n //6 1\n //7 2\n collect++;\n }\n }\n assertThat(collect).isEqualTo(10);\n }", "private static List<NoSQLResult> getNextResultsGroupFromIterator(final Iterator<ListDO> resultsIterator) {\n if (!resultsIterator.hasNext()) {\n return null;\n }\n List<NoSQLResult> resultGroup = new LinkedList<>();\n int itemsRetrieved = 0;\n do {\n // Retrieve the item from the paginated results.\n final ListDO item = resultsIterator.next();\n // Add the item to a group of results that will be displayed later.\n resultGroup.add(new NoSQLListResult(item));\n itemsRetrieved++;\n } while ((itemsRetrieved < RESULTS_PER_RESULT_GROUP) && resultsIterator.hasNext());\n return resultGroup;\n }", "OResultSet fetchNext(int n);", "Iterator<Map.Entry<String, Integer>> getNextPair(){\r\n return entrySet.iterator();\r\n }", "public DoubleLinkedSeq everyOther(){\r\n\t DoubleLinkedSeq everyOther = new DoubleLinkedSeq(); \r\n\t int count = 2; \r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t if(count % 2 == 0){\r\n\t\t\t everyOther.addAfter(this.getCurrent());\r\n\t\t }\r\n\t\t else {}\r\n\t\t \r\n\t\t count += 1; \r\n\t }\r\n\t return everyOther; \r\n\t \r\n}", "@Override\n public Tuple next() {\n return nonDistinctNext();\n }", "@Test\r\n public void sequentialHasNextInvocationDoesntAffectRetrievalOrder() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.next(), is(6));\r\n }", "public Collection<Message> findNextForChecking();", "@Override\r\n protected TupleBatch fetchNextReady() throws DbException {\r\n final Operator child = getChild();\r\n\r\n if (child.eos()) {\r\n return getResultBatch();\r\n }\r\n\r\n TupleBatch tb = child.nextReady();\r\n while (tb != null) {\r\n for (int row = 0; row < tb.numTuples(); ++row) {\r\n int rowHash = HashUtils.hashSubRow(tb, gfields, row);\r\n IntArrayList hashMatches = groupKeyMap.get(rowHash);\r\n if (hashMatches == null) {\r\n hashMatches = newKey(rowHash);\r\n newGroup(tb, row, hashMatches);\r\n continue;\r\n }\r\n boolean found = false;\r\n for (int i = 0; i < hashMatches.size(); i++) {\r\n int value = hashMatches.get(i);\r\n if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) {\r\n updateGroup(tb, row, aggStates.get(value));\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found) {\r\n newGroup(tb, row, hashMatches);\r\n }\r\n Preconditions.checkState(groupKeys.numTuples() == aggStates.size());\r\n }\r\n tb = child.nextReady();\r\n }\r\n\r\n /*\r\n * We know that child.nextReady() has returned <code>null</code>, so we have processed all tuple we can. Child is\r\n * either EOS or we have to wait for more data.\r\n */\r\n if (child.eos()) {\r\n return getResultBatch();\r\n }\r\n\r\n return null;\r\n }", "@Test\n public void equality() {\n new EqualsTester()\n .addEqualityGroup(UnitConverters.identity())\n .addEqualityGroup(UnitConverters.shift(100))\n .addEqualityGroup(UnitConverters.multiply(2))\n .addEqualityGroup(UnitConverters.pow(10, 6))\n .addEqualityGroup(UnitConverters.pow(UnitConverters.multiply(5), 2))\n .addEqualityGroup(UnitConverters.root(UnitConverters.multiply(5), 2))\n .addEqualityGroup(UnitConverters.compose(UnitConverters.shift(100), UnitConverters.multiply(2)))\n .testEquals();\n }", "@Override\n public Integer next() {\n return query.poll();\n }", "protected abstract boolean computeHasNext();", "public abstract PredicateExpr getNext();", "LinkedList<Loop> getCommonEnclosingLoops();", "ImmutableMap<XconnectKey, Integer> getNext();", "@Override\n public Integer next(){\n while(!isPowerOfTwo(this.getValue() + 1)){\n super.next(); \n }\n if(this.getValue() == 3)\n super.next();\n Integer save = this.getValue();\n super.next();\n return save;\n }", "public int[] getNext() {\n\n if (numLeft.equals(total)) {\n numLeft = numLeft.subtract(BigInteger.ONE);\n return a;\n }\n\n int i = r - 1;\n while (a[i] == n - r + i) {\n i--;\n }\n a[i] = a[i] + 1;\n for (int j = i + 1; j < r; j++) {\n a[j] = a[i] + j - i;\n }\n\n numLeft = numLeft.subtract(BigInteger.ONE);\n return a;\n }", "private BasicBlock getUniqueNext(ControlFlowGraph graph, HashSet<BasicBlock[]> setNext) {\n\t\t\n\t\tBasicBlock next = null;\n\t\tboolean multiple = false;\n\t\t\n\t\tfor(BasicBlock[] arr : setNext) {\n\t\t\t\n\t\t\tif(arr[2] != null) {\n\t\t\t\tnext = arr[1];\n\t\t\t\tmultiple = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tif(next == null) {\n\t\t\t\t\tnext = arr[1];\n\t\t\t\t} else if(next != arr[1]) {\n\t\t\t\t\tmultiple = true;\n\t\t\t\t}\n\n\t\t\t\tif(arr[1].getPreds().size() == 1) {\n\t\t\t\t\tnext = arr[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(multiple) { // TODO: generic solution\n\t\t\tfor(BasicBlock[] arr : setNext) {\n\t\t\t\tBasicBlock block = arr[1];\n\t\t\t\t\n\t\t\t\tif(block != next) {\n\t\t\t\t\tif(InterpreterUtil.equalSets(next.getSuccs(), block.getSuccs())) {\n\t\t\t\t\t\tInstructionSequence seqNext = next.getSeq();\n\t\t\t\t\t\tInstructionSequence seqBlock = block.getSeq();\n\n\t\t\t\t\t\tif(seqNext.length() == seqBlock.length()) {\n\t\t\t\t\t\t\tfor(int i=0;i<seqNext.length();i++) {\n\t\t\t\t\t\t\t\tInstruction instrNext = seqNext.getInstr(i);\n\t\t\t\t\t\t\t\tInstruction instrBlock = seqBlock.getInstr(i);\n\n\t\t\t\t\t\t\t\tif(instrNext.opcode != instrBlock.opcode || instrNext.wide != instrBlock.wide\n\t\t\t\t\t\t\t\t\t\t|| instrNext.operandsCount() != instrBlock.operandsCount()) {\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor(int j=0;i<instrNext.getOperands().length;j++) {\n\t\t\t\t\t\t\t\t\tif(instrNext.getOperand(j) != instrBlock.getOperand(j)) {\n\t\t\t\t\t\t\t\t\t\treturn null;\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} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n//\t\t\ttry {\n//\t\t\t\tDotExporter.toDotFile(graph, new File(\"c:\\\\Temp\\\\fern5.dot\"), true);\n//\t\t\t} catch(IOException ex) {\n//\t\t\t\tex.printStackTrace();\n//\t\t\t}\n\t\t\t\n\t\t\tfor(BasicBlock[] arr : setNext) {\n\t\t\t\tif(arr[1] != next) {\n\t\t\t\t\t// FIXME: exception edge possible?\n\t\t\t\t\tarr[0].removeSuccessor(arr[1]);\n\t\t\t\t\tarr[0].addSuccessor(next);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tDeadCodeHelper.removeDeadBlocks(graph);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn next;\n\t}", "Split getNext();", "public int nextHashForEqual() {\n\t/* This actually needs to roll over the UInt32 limit. */\n\tmyCount = myCount + 1;\n\treturn myCount;\n/*\nudanax-top.st:16757:FakePacker methodsFor: 'shepherds'!\n{UInt32} nextHashForEqual\n\t\"Shepherds use a sequence number for their hash. Return the next one\n\t and increment. This should actually spread the hashes.\"\n\t\"This actually needs to roll over the UInt32 limit.\"\n\tmyCount _ myCount + 1.\n\t^ myCount!\n*/\n}", "SearchResult findNext(SearchOptions searchOptions);", "@Override\r\n public Integer next() {\r\n // Time complexity: O(1), where the problem size N \r\n // represents the size of the sequence to generate.\r\n if (!hasNext()) // check if the current element has a next element in this sequence\r\n return null; \r\n int current = next; // set the current element to next\r\n generatedCount++; // increment the number of generated elements so far\r\n next *= RATIO; // set the next element (adds the common ratio to the current number)\r\n return current; // return the current number as the generated one\r\n }", "public int next() {\n moveToNextIndex();\n return _hash._set[_index];\n }", "public void testNext() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.getValue().inRange(0));\n test1.next();\n assertTrue(test1.getValue().inRange(1));\n test1.next();\n assertTrue(test1.getValue().inRange(2));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "public PlayerId next() {\n return (this.ordinal() == (ALL.size() - 1)) ? ALL.get(0) : ALL.get(this.ordinal() + 1);\n }", "public int[] getNext() {\n if (currentRound == -1 || currentHeat == -1 || rounds.size() == 0) {\n return new int[] {-1, -1};\n }\n\n int[] next = new int[2];\n\n // Check if current round has another heat\n int cRoundSize = rounds.get(currentRound).length();\n if (currentHeat + 1 < cRoundSize) {\n // Success, so get the next heat index\n next[0] = currentRound;\n next[1] = currentHeat + 1;\n }\n // There are no more heats left in the current round\n // Check if the race has another round\n else if (currentRound + 1 < rounds.size()) {\n // Success, but check to make sure there is actually a heat in this round\n if (rounds.get(currentRound + 1).length() > 0) {\n // Success, so get the first heat in the next round\n next[0] = currentRound + 1;\n next[1] = 0;\n }\n }\n // There are no more valid heats or rounds left\n else {\n next[0] = -1;\n next[1] = -1;\n }\n return next;\n }", "@Override\n public Iterator<SimilarResult<T>> iterator() {\n lock();\n return Iterators.limit(getResults().iterator(), maxSize);\n }", "private static Step lastStepIfNoDuplicate(Step stepGroup1, Step stepGroup2) {\n Step s = stepGroup1;\n List<Step> stepGroup2Array = stepToArray(stepGroup2);\n while (s.next != null) {\n if (stepGroup2Array.contains(s.next)) {\n return null;\n }\n s = s.next;\n }\n return s;\n }", "@Test\n public void loopTest() {\n Object[] resultActual = new Object[] {this.work1, this.work2, this.work3, this.work4};\n Object[] resultExpected = new Object[4];\n int index = 0;\n while (this.it.hasNext()) {\n resultExpected[index++] = this.it.next();\n }\n assertThat(resultActual, is(resultExpected));\n }", "@Test\n public void nextTest() {\n this.it.next();\n this.it.next();\n assertThat(\"work3\", is(this.it.next()));\n }", "Object getNextElement() throws NoSuchElementException;", "Chunk<K, V> markAndGetNext() {\n // new chunks are ready, we mark frozen chunk's next pointer so it won't change\n // since next pointer can be changed by other split operations we need to do this in a loop - until we succeed\n while (true) {\n // if chunk is marked - that is ok and its next pointer will not be changed anymore\n // return whatever chunk is set as next\n if (next.isMarked()) {\n return next.getReference();\n }\n // otherwise try to mark it\n else {\n // read chunk's current next\n Chunk<K, V> savedNext = next.getReference();\n\n // try to mark next while keeping the same next chunk - using CAS\n // if we succeeded then the next pointer we remembered is set and will not change - return it\n if (next.compareAndSet(savedNext, savedNext, false, true)) {\n return savedNext;\n }\n }\n }\n }", "private static Hand getResults() {\n System.out.println(hands.size());\n Optional<Hand> winner;\n winner = hands.stream()\n .reduce((hand1, hand2)\n -> hand1.compareTo(hand2) == 1 ? hand1 : hand2);\n Hand winningHand = null;\n if (winner.isPresent()) {\n winningHand = winner.get();\n }\n return winningHand;\n\n }", "@Override\r\n public ElementSet nextBestSet() {\r\n \r\n ElementSet bestSet = null; //initialze variables\r\n int countBest = 0;\r\n double bestScore = Double.MAX_VALUE; //arbitrarly large number CHECK ME\r\n int count = 0;\r\n double score = 0;\r\n \r\n for (ElementSet s : _copyModel.getElements()) { //go through all sets in the model\r\n count = 0; //reset count and score for each set\r\n score = 0;\r\n for (Integer i : s.getSet()) {\r\n if(_uncoveredElements.contains(i)) { //get number of covered elements\r\n count++;\r\n } \r\n }\r\n if (count != 0) { //if it contains an element\r\n score = s.getCost() / (double)count; //compute the ratio of cost per element covered\r\n if (score < bestScore) { //if score is better than best score \r\n countBest = count;\r\n bestScore = score;\r\n bestSet = s;\r\n }\r\n }\r\n }\r\n \r\n if (bestSet == null) //if no set was chosen return null\r\n return null;\r\n \r\n _copyModel.getElements().remove(bestSet); //remcoe the chosen set from the model\r\n GreedySolver.printChosenSet(bestSet); //print the chosen set\r\n \r\n return bestSet;\r\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] list = new int[n];\n for (int i = 0; i < n; i++) {\n list[i] = scanner.nextInt();\n }\n int m1 = scanner.nextInt();\n int m2 = scanner.nextInt();\n boolean next = false;\n\n for (int i = 0; i < n - 1; i++) {\n if (list[i] == m1 && list[i + 1] == m2) {\n next = true;\n } else if (list[i] == m2 && list[i + 1] == m1) {\n next = true;\n }\n }\n System.out.println(!next);\n }", "public boolean getNext();", "public void testNext() {\r\n System.out.println(\"next\");\r\n \r\n PartialCombinationIterator instance = null;\r\n Iterator<int[]> iterator = null;\r\n try {\r\n iterator = new PartialCombinationIterator(TestConstants.twoThreeFourValidReactionScheme, TestConstants.twoThreeFourNumRGroups, TestConstants.twoThreeFourNumLinkers, TestConstants.twoThreeFourNumBuildingBlocks);\r\n } catch (ReactionSchemeException ex) {\r\n ex.printStackTrace();\r\n fail(\"Unexpected exception was thrown: \" + ex.getMessage());\r\n } catch (SmiLibIOException ex) {\r\n ex.printStackTrace();\r\n fail(\"Unexpected exception was thrown: \" + ex.getMessage());\r\n } catch (SmiLibException ex) {\r\n ex.printStackTrace();\r\n fail(\"Unexpected exception was thrown: \" + ex.getMessage());\r\n }\r\n \r\n int counter = 0;\r\n while (iterator.hasNext()) {\r\n int[] virtualReaction = iterator.next();\r\n assertTrue(counter + \": \" + Arrays.toString(expectedVirtualReactions[counter]) + \" == \" + Arrays.toString(virtualReaction), Arrays.equals(expectedVirtualReactions[counter], virtualReaction));\r\n counter++;\r\n }\r\n \r\n assertEquals(expectedVirtualReactions.length, counter);\r\n }", "@Test\n public void whenAddThreeDifferentElementsThenSetHasThreeTheSameElements() {\n SimpleSet<Integer> set = new SimpleSet<>();\n set.add(1);\n set.add(2);\n set.add(3);\n\n Iterator<Integer> iterator = set.iterator();\n\n assertThat(iterator.next(), is(1));\n assertThat(iterator.next(), is(2));\n assertThat(iterator.next(), is(3));\n assertThat(iterator.hasNext(), is(false));\n }", "@Test\n public void nextConcurrently() throws Exception {\n doReturn(10).when(domain).getAcquireBlockSize();\n\n sequenceService.register(domain);\n\n List<Future<Long>> result = new ArrayList<>();\n\n int attempts = 2;\n for (int j = 0; j < attempts; j++) {\n CountDownLatch syncLatch = new CountDownLatch(poolSize);\n CountDownLatch setUpLatch = new CountDownLatch(1);\n CountDownLatch endLatch = new CountDownLatch(poolSize);\n\n\n for (int i = 0; i < poolSize; i++) {\n Future<Long> fut = executorService.submit(() -> {\n syncLatch.countDown();\n setUpLatch.await();\n\n long next = sequenceService.next(domain);\n\n endLatch.countDown();\n\n return next;\n });\n\n\n result.add(fut);\n }\n\n syncLatch.await();\n setUpLatch.countDown();\n endLatch.await();\n }\n List<Long> sequences = result.stream()\n .map(r -> Futures.getUnchecked(r))\n .collect(Collectors.toList());\n\n assertEquals(poolSize * attempts, result.size(), () -> {\n return sequences.toString();\n });\n\n LoggerFactory.getLogger(getClass()).debug(\"Sequences: {}\", sequences);\n\n for (int i = 0; i < poolSize; i++) {\n for (int attempt = 1; attempt <= attempts; attempt++) {\n long expectedVal = (i * 10 + attempt);\n assertTrue(sequences.contains(expectedVal), () -> {\n return String.format(\"Expected %d in %s\", expectedVal, sequences);\n });\n }\n }\n }", "default boolean isNext(int vidxa, int vidxb) {\n return findIndexOfNext(vidxa, vidxb) != -1;\n }", "private boolean pareGroup(Double groupKey, int roundNumber) {\n\t\tMap<String, ChesspairingPlayer> group = this.groupsByResult.get(groupKey);\n\t\t//<debug>\n\t\tif (group == null){\n\t\t\tSystem.out.println(\"group is null\");\n\t\t}\n\t\t//</debug>\n\t\tList<ChesspairingPlayer> players = new ArrayList<>();\n\t\tfor (Entry<String, ChesspairingPlayer> entry : group.entrySet()) {\n\t\t\tplayers.add(entry.getValue());\n\t\t}\n\t\t// order the group\n\t\tCollections.sort(players, new ByInitialOrderIdReverce());\n\t\tCollections.sort(players, new ByElo());\n\t\t// by points just in case it was a downfloater in the group\n\t\tCollections.sort(players, new Comparator<ChesspairingPlayer>() {\n\t\t\t@Override\n\t\t\tpublic int compare(ChesspairingPlayer o1, ChesspairingPlayer o2) {\n\t\t\t\tDouble pointsO1 = currentPoints.get(o1.getPlayerKey());\n\t\t\t\tDouble pointsO2 = currentPoints.get(o2.getPlayerKey());\n\t\t\t\treturn Double.compare(pointsO1, pointsO2);\n\t\t\t}\n\t\t});\n\n\t\tif (players.size() % 2 != 0) {\n\t\t\tthrow new IllegalStateException(\"You should have resolved groups count before\");\n\t\t}\n\n\t\t/**\n\t\t * split the list indexes and build the s1 and s2\n\t\t */\n\t\tList<List<Integer>> split = Tools.initialSplitList(players.size());\n\t\tList<Integer> list1 = split.get(0);\n\t\tList<Integer> list2 = split.get(1);\n\t\tint size = list2.size();\n\t\tInteger[] newArray = new Integer[size];\n\t\tInteger[] s1 = new Integer[size];\n\t\t// copy the elements\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tnewArray[i] = list2.get(i);\n\t\t\ts1[i] = list1.get(i);\n\t\t}\n\t\tSet<Integer[]> permutations = Tools.getPermutationsV01(newArray);\n\t\t// for each permutation test if paring is valid\n\t\tSet<Integer[]> validPermutations = new HashSet<>();\n\t\tfor (Integer[] s2 : permutations) {\n\t\t\tif (testIfPermutationIsValid(s1, s2, players)) {\n\t\t\t\tvalidPermutations.add(s2);\n\t\t\t}\n\t\t}\n\t\tif (validPermutations.size() == 0) {\n\t\t\t// drop the group and restart the paring. move all players down?\n\t\t\t// Yes!\n\t\t\treturn false;\n\t\t}\n\t\t// for the moment just take the first permutation and pare the players\n\t\tInteger[] s2 = validPermutations.iterator().next();\n\t\tList<ChesspairingGame> games = buildGamesFromPermutation(s1, s2, players);\n\t\tthis.generatedRound.getGames().addAll(games);\n\t\treturn true;\n\t}", "@Test\n public void whenAddSeveralIdenticalElementsThenSetHasOnlyOneSuchElement() {\n SimpleSet<Integer> set = new SimpleSet<>();\n set.add(1);\n set.add(2);\n set.add(3);\n set.add(3);\n set.add(2);\n set.add(1);\n\n Iterator<Integer> iterator = set.iterator();\n\n assertThat(iterator.next(), is(1));\n assertThat(iterator.next(), is(2));\n assertThat(iterator.next(), is(3));\n assertThat(iterator.hasNext(), is(false));\n }", "public static void testIteratorEqualsOtherMethods(RatingsDataset<Rating> ratingsDataset) {\n\n int errors = 0;\n try {\n\n Map<Integer, Integer> numRatingsUsers_byIterator = new TreeMap<Integer, Integer>();\n Map<Integer, Integer> numRatingsItems_byIterator = new TreeMap<Integer, Integer>();\n\n for (Rating r : ratingsDataset) {\n int idUser = r.getIdUser();\n int idItem = r.getIdItem();\n\n ratingsDataset.getRating(idUser, idItem);\n\n if (numRatingsUsers_byIterator.containsKey(idUser)) {\n numRatingsUsers_byIterator.put(idUser, numRatingsUsers_byIterator.get(idUser) + 1);\n } else {\n numRatingsUsers_byIterator.put(idUser, 1);\n }\n\n if (numRatingsItems_byIterator.containsKey(idItem)) {\n numRatingsItems_byIterator.put(idItem, numRatingsItems_byIterator.get(idItem) + 1);\n } else {\n numRatingsItems_byIterator.put(idItem, 1);\n }\n\n }\n\n for (int idUser : ratingsDataset.allUsers()) {\n int numRatingsUser_byGetRatings = ratingsDataset.getUserRatingsRated(idUser).size();\n int numRatingsUser_ByIterator = numRatingsUsers_byIterator.get(idUser);\n\n if (numRatingsUser_byGetRatings != numRatingsUser_ByIterator) {\n Global.showWarning(\"El usuario \" + idUser + \" tiene:\\n\"\n + \"\\t\" + numRatingsUser_byGetRatings + \" valoraciones según el método getUserRatingsRated(idUser) \\n\"\n + \"\\t\" + numRatingsUser_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n final Set<Integer> allRatedItems = new TreeSet<Integer>(ratingsDataset.allRatedItems());\n\n for (int idItem : allRatedItems) {\n\n int numRatingsItem_byGetRatings = ratingsDataset.getItemRatingsRated(idItem).size();\n int numRatingsItem_ByIterator = numRatingsItems_byIterator.get(idItem);\n\n if (numRatingsItem_byGetRatings != numRatingsItem_ByIterator) {\n Global.showWarning(\"El producto \" + idItem + \" tiene:\\n\"\n + \"\\t\" + numRatingsItem_byGetRatings + \" valoraciones según el método getItemRatingsRated(idItem) \\n\"\n + \"\\t\" + numRatingsItem_ByIterator + \" valoraciones según el iterador\");\n errors++;\n }\n }\n\n if (numRatingsItems_byIterator.keySet().equals(allRatedItems)) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de items valorados es distinto.\");\n\n Set<Integer> AMinusB = new TreeSet<Integer>(numRatingsItems_byIterator.keySet());\n AMinusB.removeAll(allRatedItems);\n\n Set<Integer> BMinusA = new TreeSet<Integer>(allRatedItems);\n BMinusA.removeAll(numRatingsItems_byIterator.keySet());\n\n if (!AMinusB.isEmpty()) {\n Global.showWarning(\"Produtos que no están en el allItemsRated --> \" + AMinusB.toString());\n }\n if (!BMinusA.isEmpty()) {\n Global.showWarning(\"Produtos que no están según el iterador --> \" + BMinusA.toString());\n }\n }\n\n if (numRatingsUsers_byIterator.keySet().equals(ratingsDataset.allUsers())) {\n } else {\n errors++;\n Global.showWarning(\"El conjunto de usuarios es distinto.\");\n }\n\n } catch (UserNotFound ex) {\n ERROR_CODES.USER_NOT_FOUND.exit(ex);\n } catch (ItemNotFound ex) {\n ERROR_CODES.ITEM_NOT_FOUND.exit(ex);\n }\n if (errors == 0) {\n Global.showWarning(\"Finished the dataset test.\");\n } else {\n Global.showWarning(\"Finished the dataset test with \" + errors + \" errors.\");\n }\n }", "public SearchResults<ConsensusSNPSummaryRow> getNextResults() {\n\t\tif (currentOffset.equals(0)) { totalCount = null; }\n\n\t\tPaginator p = new Paginator();\n\t\tp.setResults(batchSize);\n\t\tp.setStartIndex(currentOffset);\n\t\tsearchParams.setPaginator(p);\n\t\tList<String> matchedMarkerIds = new ArrayList<String>();\n\n\t\tSearchResults<ConsensusSNPSummaryRow> results = finder.getSummarySnps(searchParams, matchedMarkerIds);\n\n\t\tcurrentOffset += batchSize;\n\t\ttotalCount = results.getTotalCount();\n\t\treturn results;\n\t}", "public abstract boolean next();", "public abstract boolean next();", "public abstract Tuple getNext();", "private SAMRecord markDuplicatesAndGetTheNextAvailable() {\n\n // Check if there are any we can flush output buffer\n { // NB: braces to limit the scope of 'record'\n final SAMRecord record = flush();\n if (null != record) return record;\n }\n\n // Check if there are any more records to read in\n if (!backingIterator.hasNext()) { // no more records to read in\n\n // Check if there are any more to mark\n if (toMarkQueue.isEmpty()) {\n // check if there are any that can be outputted\n if (outputBuffer.isEmpty()) {\n return null;\n } // no need to flush; no records in the queue and buffer\n } else {\n // force marking duplicates on the remaining records\n tryPollingTheToMarkQueue(true, null);\n }\n\n /* Since we have no more records to read in, and no more records that need duplicate marking run, we\n update our coordinate to past the end of the reference\n */\n referenceIndex = header.getSequenceDictionary().getSequences().size();\n\n /* Now we recurse, so that we can flush from the outputBuffer until it is empty, then return null when\n * all of the input, queue, and buffer are empty */\n return markDuplicatesAndGetTheNextAvailable();\n }\n\n /* We need to retrieve more records from the input iterator and duplicate mark, until we can return one that\n * has been through duplicate marking.\n */\n while (backingIterator.hasNext()) {\n\n // NB: we could get rid of this if we made nextRecord into a list...\n // NB: we do not actually remove this record from the backing iterator until much later, to help with processing unmapped reads at the EOF\n SAMRecord record = backingIterator.peek(); // peek: used for unmapped reads\n final SamRecordWithOrdinal samRecordWithOrdinal = new SamRecordWithOrdinalAndSetDuplicateReadFlag(record, backingIteratorRecordIndex);\n\n ReadEndsForMateCigar readEnds = null;\n boolean performedChunkAndMarkTheDuplicates = false;\n\n // remove duplicate information\n record.setDuplicateReadFlag(false);\n\n /* Check for pairs that have both ends mapped and missing mate cigar. */\n if (ignoreDueToMissingMateCigar(samRecordWithOrdinal)) {\n continue;\n }\n\n // check for an unmapped read\n if (record.getReadUnmappedFlag()) {\n // unmapped reads at the end of the file!\n if (-1 == record.getReferenceIndex()) {\n // NB: this may call markDuplicatesAndGetTheNextAvailable if this is the first time a EOF unmapped record has been seen\n return nextIfRecordIsUnmappedAtEOF(record);\n } else if (!record.isSecondaryOrSupplementary()) {\n // update metrics\n final DuplicationMetrics metrics = getMetrics(record);\n ++metrics.UNMAPPED_READS;\n }\n // we will check for unmapped reads later so as not to add them to mark queue\n } else {\n // If not already set, this sets the minimum distance to twice the read length, or 100, whichever is larger\n if (-1 == toMarkQueue.getToMarkQueueMinimumDistance()) {\n // use twice the first read's length\n toMarkQueue.setToMarkQueueMinimumDistance(Math.max(2 * record.getReadBases().length, 100));\n }\n\n // build a read end for use in the toMarkQueue\n readEnds = new ReadEndsForMateCigar(header, samRecordWithOrdinal, opticalDuplicateFinder, libraryIdGenerator.getLibraryId(samRecordWithOrdinal.getRecord()));\n\n // check that the minimumDistance was not too small\n checkForMinimumDistanceFailure(readEnds);\n\n /*\n * If we can do some duplicate marking, lets do it!\n * IMPORTANT: this does not flush the to-mark-queue, so the minimum distance needs to be set for us to infer\n * which records will never be supplemented (i.e. are non-duplicate).\n */\n performedChunkAndMarkTheDuplicates = tryPollingTheToMarkQueue(false, readEnds);\n }\n\n // We can now remove the record from the input\n backingIterator.next();\n\n // Add this to the outputBuffer so it can be tracked. It will not be available to emit until it has been through duplicate marking.\n addRecordToTheOutputBuffer(samRecordWithOrdinal);\n backingIteratorRecordIndex++; // Each record is has an index and is emitted in the same order. This helps that.\n\n // We do not consider secondary, supplementary, or unmapped alignments for duplicate marking. We can thus mark that duplicate marking on them has been completed.\n final DuplicationMetrics metrics = getMetrics(record);\n if (record.isSecondaryOrSupplementary() || record.getReadUnmappedFlag()) {\n outputBuffer.setResultState(samRecordWithOrdinal, false);\n if(record.isSecondaryOrSupplementary()){\n ++metrics.SECONDARY_OR_SUPPLEMENTARY_RDS;\n }\n } else {\n // Bring the simple metrics up to date\n if (!record.getReadPairedFlag() || record.getMateUnmappedFlag()) {\n ++metrics.UNPAIRED_READS_EXAMINED;\n } else {\n ++metrics.READ_PAIRS_EXAMINED; // will need to be divided by 2 at the end\n }\n\n // Add the record for duplicate marking, which may in fact cause it to be duplicate marked or stored for later\n toMarkQueue.add(readEnds, outputBuffer, getMetrics(readEnds.getRecord()));\n }\n\n // Check if there are any we can flush, which happens if we just performed duplicate marking\n if (performedChunkAndMarkTheDuplicates) {\n record = flush();\n if (null != record) return record;\n }\n }\n\n // try again, as we may have records we can flush, or we want to see if we are at the EOF\n return markDuplicatesAndGetTheNextAvailable();\n }", "private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }", "@Test\n public void getNextN() throws Exception {\n underTest.put(\"start\");\n underTest.put(\"star\");\n underTest.put(\"starter\");\n SortedSet<String> output = new TreeSet<>();\n String word = \"s\";\n output = underTest.getNextN(word, 4);\n for (String elem : output) {\n assert (underTest.contains(elem) == true);\n }\n }", "public static boolean elementsEqual(java.util.Iterator<?> r3, java.util.Iterator<?> r4) {\n /*\n L_0x0000:\n boolean r0 = r3.hasNext()\n if (r0 == 0) goto L_0x001d\n boolean r0 = r4.hasNext()\n r1 = 0\n if (r0 != 0) goto L_0x000e\n return r1\n L_0x000e:\n java.lang.Object r0 = r3.next()\n java.lang.Object r2 = r4.next()\n boolean r0 = com.google.common.base.Objects.equal(r0, r2)\n if (r0 != 0) goto L_0x0000\n return r1\n L_0x001d:\n boolean r3 = r4.hasNext()\n r3 = r3 ^ 1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.common.collect.Iterators.elementsEqual(java.util.Iterator, java.util.Iterator):boolean\");\n }", "@Test\n public void testNext() throws SQLException, InputIterationException {\n // Setup\n ResultSet resultSet = twoLinesResultSetFixture.getTestData();\n ResultSetIterator resultSetIterator = new ResultSetIterator(resultSet);\n\n // Check result\n List<Boolean> expectedNextValues = twoLinesResultSetFixture.getExpectedNextValues();\n List<ImmutableList<String>> expectedRecords = twoLinesResultSetFixture.getExpectedRecords();\n for (int i = 0; i < twoLinesResultSetFixture.numberOfRows(); i++) {\n assertEquals(expectedNextValues.get(i), resultSetIterator.hasNext());\n assertEquals(expectedRecords.get(i), resultSetIterator.next());\n }\n assertEquals(expectedNextValues.get(twoLinesResultSetFixture.numberOfRows()),\n resultSetIterator.hasNext());\n // Next should have been called.\n verify(resultSet, times(3)).next();\n\n }", "Group getNextExecutableGroup();", "public int solution(int[] A) {\n Map<Integer, Integer> map = new HashMap<>();\n\n// for (int i = 0; i < A.length; i++) {\n// map.computeIfPresent(A[i], (key, value) -> ++value);\n// map.putIfAbsent(A[i], 1);\n// }\n IntStream.range(0, A.length)\n .forEach(i -> {\n map.computeIfPresent(A[i], (key, value) -> ++value);\n map.putIfAbsent(A[i], 1);\n });\n\n // TODO: case01. entrySet 2021/04/22 2:03 오후\n map.entrySet().stream()\n .filter(key -> (map.get(key.getKey()) % 2) == 1)\n .forEach(entry -> {\n System.out.println(entry.getKey());\n });\n\n // TODO: case02. entrySet 2021/04/22 2:03 오후\n map.entrySet().stream()\n .map(Map.Entry::getKey)\n .filter(key -> map.get(key) % 2 == 1)\n .forEach(System.out::println);\n\n // TODO: case03. keySet 2021/04/22 2:04 오후\n map.keySet().stream()\n .filter(value -> map.get(value) % 2 == 1)\n .forEach(System.out::println);\n\n // TODO: case04. keySet 2021/04/22 2:04 오후\n return map.keySet().stream()\n .filter(value -> map.get(value) % 2 == 1)\n .findFirst()\n .get();\n\n\n// int result = 0;\n// for (Integer i : map.keySet()) {\n// int value = map.get(i);\n//\n// System.out.println(value);\n// if (value % 2 == 1) {\n// result = i;\n// break;\n// }\n// }\n//\n// return result;\n }", "@Test(expected = NoSuchElementException.class)\r\n public void shouldReturnEvenNumbersSequentially() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(6));\r\n assertThat(it.hasNext(), is(false));\r\n it.next();\r\n }", "public static Group getNextElement(int i, Vector<Group> group, Vector<Group> allGroups, int subjectID, GroupType groupType){\n long countAssignments = allGroups.stream().filter(\n g -> g.getProfessor() != null\n && g.getCourse().getSchoolYear() == g.getCourse().getSchoolYear()\n && g.getCourse().getSubject().getId() == subjectID).count();\n\n // Number of professors that could teach the subject\n long countNonAssigned = getProfessorCouldTeachSubject(getProfessorPosition(groupType.getType()), subjectID).size();\n\n if((countAssignments != countNonAssigned) && i < group.size()){\n if(group.get(i).getProfessor() == null && group.get(i).getCourse().getSubject().getId() == subjectID){\n return group.get(i);\n }\n else getNextElement(i + 1, group, allGroups, subjectID, groupType);\n }\n return null;\n }", "private boolean isEqual(Iterator<?> instance, OasisList<?> baseList) {\n\n boolean equal = true;\n int i = 0;\n while (instance.hasNext()) {\n if (!baseList.get(i++).equals(instance.next())) {\n equal = false;\n break;\n }\n }\n\n return equal;\n }", "public Collection<MatchingPair> matchingPairs(Collection<Integer> values, Integer targetSum)\n {\n HashMap<Integer, Integer> tableCompteur = new HashMap<>();\n LinkedHashMap<Integer, Integer> tablePaire = new LinkedHashMap<Integer, Integer>();\n Collection<MatchingPair> paireSansDuplication = new LinkedList();\n Collection<MatchingPair> solution = new LinkedList();\n\n // On itere sur les valeurs donnee pour savoir le compte de chaque valeur\n for (Integer valeur : values)\n {\n if (tableCompteur.containsKey(valeur))\n {\n // Partie Compteur\n Integer compteur = tableCompteur.get(valeur);\n compteur++;\n tableCompteur.put(valeur, compteur);\n }\n else {\n tableCompteur.put(valeur, 0);\n }\n\n }\n\n // On itere sur les valeurs donnee pour savoir les paires\n for (Integer element : values)\n {\n int temp = targetSum - element;\n if (tablePaire.containsKey(element))\n {\n if (tablePaire.get(element) != null)\n {\n paireSansDuplication.add(new MatchingPair(element, temp));\n }\n // si la table contient l'element on met nul pour ne pas avoir de repetition\n tablePaire.put(temp, null);\n }\n else if (!tablePaire.containsKey(element))\n {\n tablePaire.put(temp, element);\n }\n }\n\n // On trouve le minimum count entre les paire et leur compte pour tenir en compte de toutes les possibilites. Ici le meilleur cas reste O(n) ( pas de paire)\n for (MatchingPair paire : paireSansDuplication)\n {\n if (paire != null) { // verification au debug pr erreur nullpointer\n int a = tableCompteur.get(paire.first);\n int b = tableCompteur.get(paire.second);\n int minCount = Math.min(a+1, b+1);\n for (int i = 0; i < pow(minCount, 2); i++)\n {\n solution.add(new MatchingPair(paire.first, paire.second));\n }\n }\n }\n return solution;\n }", "public boolean hasAdjacentEqualPair()\n { \n \tfor( int i = 0; i < purchases.size()-1; i++ )\n \t{\n \t\tGizmo curr = purchases.get( i );\n \t\tGizmo nxt = purchases.get( i + 1 );\n \t\tif( curr.equals( nxt ) )\n \t\t\treturn true;\n \t}\n \treturn false; \t\n }", "protected Tuple fetchNext() throws NoSuchElementException, TransactionAbortedException, DbException {\n\t\t// some code goes here\n\t\tTuple ret;\n\t\twhile (childOperator.hasNext()) {\n\t\t\tret = childOperator.next();\n\t\t\tif (pred.filter(ret))\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}", "public final boolean equal() {\n\t\tif (size > 1) {\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue == secondTopMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }", "private void findNewNextInStack() {\n if (stack.empty()) {\n next = Chunk.NONE;\n return;\n }\n next = stack.pop();\n long valueReference = INVALID_VALUE_REFERENCE;\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n while (next != Chunk.NONE && valueReference == INVALID_VALUE_REFERENCE) {\n if (!stack.empty()) {\n next = stack.pop();\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n } else {\n next = Chunk.NONE;\n return;\n }\n }\n }", "default Spliterator.OfInt getNextVertices(int vidx) {\n class MySpliterator extends AbstractIntSpliterator{\n int index;\n int limit;\n public MySpliterator (int vidx, int lo, int hi) {\n super(hi,ORDERED|NONNULL|SIZED|SUBSIZED);\n limit=hi;\n index=lo;\n }\n @Override\n public boolean tryAdvance(@Nonnull IntConsumer action) {\n if (index<limit) {\n action.accept(getNext(vidx,index++));\n return true;\n }\n return false;\n }\n @Nullable\n public MySpliterator trySplit() {\n int hi = limit, lo = index, mid = (lo + hi) >>> 1;\n return (lo >= mid) ? null : // divide range in half unless too small\n new MySpliterator(vidx, lo, index = mid);\n }\n \n }\n return new MySpliterator(vidx,0,getNextCount(vidx));\n }", "@Override\n public SingleQuery next() {\n i++;\n current = queries.get(i);\n\n return current;\n }", "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n Assert.assertEquals(10, resultList.size());\n Assert.assertTrue(resultList.stream().limit(3).map(p -> p.getLeft())\n .anyMatch(doc -> doc.getText().contains(\"wics.ics.uci.edu\")));\n }", "private void computeCurrentResults(int roundNumber) {\n\n\t\t// reset playersByResult;\n\t\tthis.groupsByResult = new HashMap<>();\n\t\tthis.orderedGroupKeys = new ArrayList<>();\n\n\t\t// players key\n\t\tthis.currentPoints = new HashMap<>();\n\n\t\tfor (int i = 1; i <= roundNumber; i++) {\n\t\t\tChesspairingRound round = getRound(i);\n\t\t\tList<ChesspairingGame> games = round.getGames();\n\t\t\tfor (ChesspairingGame game : games) {\n\n\t\t\t\tString whiteKey = game.getWhitePlayer().getPlayerKey();\n\t\t\t\t// if white is present\n\t\t\t\tif (this.presentPlayerKeys.contains(whiteKey)) {\n\t\t\t\t\tDouble whitePoints = this.currentPoints.get(whiteKey);\n\t\t\t\t\tif (whitePoints == null) {\n\t\t\t\t\t\twhitePoints = 0.0;\n\t\t\t\t\t\tthis.currentPoints.put(whiteKey, whitePoints);\n\t\t\t\t\t}\n\t\t\t\t\tif (game.getResult() == ChesspairingResult.WHITE_WINS) {\n\t\t\t\t\t\twhitePoints = whitePoints + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (game.getResult() == ChesspairingResult.BYE) {\n\t\t\t\t\t\twhitePoints = whitePoints + 0.5;\n\t\t\t\t\t\t// go to the next game\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tString blackKey = game.getBlackPlayer().getPlayerKey();\n\t\t\t\t\tif (this.presentPlayerKeys.contains(blackKey)) {\n\t\t\t\t\t\tDouble blackPoints = this.currentPoints.get(blackKey);\n\t\t\t\t\t\tif (blackPoints == null) {\n\t\t\t\t\t\t\tblackPoints = 0.0;\n\t\t\t\t\t\t\tthis.currentPoints.put(blackKey, blackPoints);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (game.getResult() == ChesspairingResult.BLACK_WINS) {\n\t\t\t\t\t\t\tblackPoints = blackPoints + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (game.getResult() == ChesspairingResult.DRAW_GAME) {\n\t\t\t\t\t\t\twhitePoints = whitePoints + 0.5;\n\t\t\t\t\t\t\tblackPoints = blackPoints + 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.currentPoints.put(whiteKey, whitePoints);\n\t\t\t\t\t\tthis.currentPoints.put(blackKey, blackPoints);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//iterate over present players and if no current points then add 0 points\n\t\t\tfor (String key: presentPlayerKeys){\n\t\t\t\tif (!currentPoints.containsKey(key)){\n\t\t\t\t\tthis.currentPoints.put(key, 0.0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// simple test to validate some aspects are in order\n\t\tif (presentPlayerKeys.size() != this.currentPoints.entrySet().size()) {\n\t\t\tthrow new IllegalStateException(\"Present players size not the same as currentPoints set size\");\n\t\t}\n\t\t// put the results in playersByResult\n\t\tfor (Entry<String, Double> entry : currentPoints.entrySet()) {\n\t\t\t// if playersByResult group does not exist then create it\n\t\t\tDouble result = entry.getValue();\n\t\t\tif (!this.groupsByResult.containsKey(result)) {\n\t\t\t\tMap<String, ChesspairingPlayer> newGroup = new HashMap<>();\n\t\t\t\tthis.groupsByResult.put(result, newGroup);\n\t\t\t\tthis.orderedGroupKeys.add(result);\n\t\t\t}\n\t\t\tMap<String, ChesspairingPlayer> group = groupsByResult.get(result);\n\t\t\tString playerKey = entry.getKey();\n\t\t\tChesspairingPlayer player = getPlayer(playerKey);\n\t\t\tgroup.put(playerKey, player);\n\t\t}\n\t\t// order the results\n\t\tCollections.reverse(this.orderedGroupKeys);\n\t}", "Object getNumberMatched();", "public BigInteger getNext() {\n\n\t\t//get the last found\n\t\tBigInteger lastFound;\n\t\tif(primes.size()==0) {\n\t\t\t//initialize last found to 1 if \"primes\" is still empty\n\t\t\tlastFound = new BigInteger(\"1\");\n\t\t\tprimes.add(lastFound);\n\t\t}else {\n\t\t\tlastFound = primes.get(primes.size()-1);\n\t\t}\n\n\n\t\tBigInteger one = new BigInteger(\"1\");\n\t\t//increment last found\n\t\tlastFound = lastFound.add(one);\n\n\t\twhile(!isPrime(lastFound)) {\n\t\t\tlastFound = lastFound.add(one);\n\t\t}\n\n\t\tprimes.add(lastFound);\n\t\treturn lastFound;\n\t}", "private boolean sameGroup(RowMetaInterface rowMeta, Object[] previous, Object[] rowData) throws KettleValueException\n\t{\n\t\treturn rowMeta.compare(previous, rowData, data.groupnrs)==0;\n\t}", "private boolean handleNextValue(Value value, ContainerValue result, Map<Object, Object> data, \n List<Value> nextValues) throws ValueDoesNotMatchTypeException {\n boolean changed = false;\n @SuppressWarnings(\"unchecked\")\n Set<Object> marking = (Set<Object>) data.get(DATA_CLOSURE_MARKED);\n if (null == marking) {\n marking = new HashSet<Object>();\n data.put(DATA_CLOSURE_MARKED, marking);\n }\n if (!marking.contains(value)) {\n if (null != nextValues) {\n nextValues.add(value);\n } else {\n if (null != result) {\n result.addElement(value);\n changed = true;\n }\n marking.add(value);\n }\n } else {\n data.put(DATA_CLOSURE_CYCLIC, Boolean.TRUE);\n }\n return changed;\n }", "@Override\n Tuple getNextTuple() {\n System.out.println(\"Please use dump() on SortOperator to get results.\");\n return null;\n }", "public void getNextCriteria() {\n int mayor = -1;\n int pos = -1;\n Criteria criteria = new Criteria();\n for (Criteria c : criteriaList) {\n if (c.getOptionList().size() > mayor && criteriaLeft.contains(c.getKey())) {\n mayor = c.getOptionList().size();\n pos = criteriaList.indexOf(c);\n currentCriteria = pos;\n criteria = c;\n }\n }\n try {\n criteriaLeft.remove(criteriaLeft.indexOf(criteria.getKey()));\n } catch (Exception e) {\n }\n try {\n ((TextView) findViewById(R.id.txtCriteria)).setText(criteriaList.get(pos).getDescription());\n } catch (Exception e) {\n }\n }", "@Test\n public void shouldAssertAllTheGroup() {\n List<Integer> list = Arrays.asList(1, 2, 4);\n assertAll(\"List is not incremental\",\n () -> Assertions.assertEquals(list.get(0).intValue(), 1),\n () -> Assertions.assertEquals(list.get(1).intValue(), 2),\n () -> Assertions.assertEquals(list.get(2).intValue(), 3));\n }", "@Override\n public Integer next() {\n Integer res = next;\n advanceIter();\n return res;\n }", "public boolean hasNext()\r\n/* 30: */ {\r\n/* 31:36 */ return this.nextResult != null;\r\n/* 32: */ }", "private Pair getLastOccurrence(Object o) {\n\t\tNode p, q = null;\n\t\tint k, qK = -1;\n\n\t\tif (o != null) {\n\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (o.equals(p.data)) {\n\t\t\t\t\tq = p;\n\t\t\t\t\tqK = k;\n\t\t\t\t}\n\t\t} else {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (o.equals(p.data)) {\n\t\t\t\t\tq = p;\n\t\t\t\t\tqK = k;\n\t\t\t\t}\n\t\t}\n\n\t\treturn new Pair(q, qK);\n\n\t}", "@Override\n\tpublic Pair<List<Integer>, List<Integer>> getFittest() {\n\t\tif (m_random == null) {\n\t\t\tm_random = new Random();\n\t\t}\n\t\tfinal Pair<List<Integer>, List<Integer>> inc = getRandomIncomparablePair(m_preorder, m_random);\n\t\tif (inc == null) {\n\t\t\treturn Pair.create(m_rvs.getRankVectors().first(), m_rvs.getRankVectors().first());\n\t\t}\n\t\treturn inc;\n\t}", "boolean nextItem();", "public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }", "public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplicatesE(input);\n return dupA == dupB && dupA == dupC && dupA == dupD && dupA == dupE;\n }", "@Override\n protected Iterator<? extends Map<String, AttributeValue>> nextIterator(final int count) {\n if (count == 1) {\n return currentResult.getItems().iterator();\n }\n // subsequent chained iterators will be obtained from dynamoDB\n // pagination\n if ((currentResult.getLastEvaluatedKey() == null)\n || currentResult.getLastEvaluatedKey().isEmpty()) {\n return null;\n } else {\n request.setExclusiveStartKey(currentResult.getLastEvaluatedKey());\n currentResult = dynamoDBClient.query(request);\n return currentResult.getItems().iterator();\n }\n }", "List<PendingAccountStatus> next(int count);", "@Override public Register[] next() {\n if (!temporaryResult.isEmpty()) {\n return temporaryResult.poll();\n }\n\n // Search for next join partner in right table\n Register[] returnValue = null;\n Register[] nextRight;\n\n while ((nextRight = right.next()) != null) {\n\n List<Register[]> joinables = getJoinPartners(nextRight);\n if (joinables != null) { // check for false drops\n for (Register[] left : joinables) {\n Register[] joinResult = createJoinResult(left, nextRight);\n if (returnValue == null) {\n returnValue = joinResult;\n } else {\n temporaryResult.offer(joinResult);\n }\n }\n\n if (returnValue != null) {\n return returnValue;\n }\n }\n }\n\n // No more joins\n return null;\n }", "private void computeNextRound(int roundNumber) {\n\t\tList<ChesspairingGame> games = new ArrayList<>();\n\t\tthis.generatedRound = new ChesspairingRound();\n\t\tthis.generatedRound.setGames(games);\n\t\tthis.generatedRound.setRoundNumber(roundNumber);\n\n\t\tthis.currentDownfloaters = new HashMap<>();\n\n\t\t/**\n\t\t * start the iteration over groups in the descending order. In order to\n\t\t * avoid thread weird behaviour because the group keys wee copy the keys\n\t\t * before wee iterate\n\t\t */\n\t\tList<Double> copyGroupKeys = new ArrayList<>(orderedGroupKeys);\n\n\t\t// while no need to downfloat then keep downfloating\n\t\tboolean someoneWasDownfloated = true;\n\t\twhile (someoneWasDownfloated) {\n\t\t\tsomeoneWasDownfloated = false;\n\t\t\tfor (Double groupKey : copyGroupKeys) {\n\t\t\t\tMap<String, ChesspairingPlayer> group = groupsByResult.get(groupKey);\n\t\t\t\tint size = group.size();\n\t\t\t\t// if modulo 2 != 0 then find a downfloater\n\t\t\t\tif ((size % 2) != 0) {\n\t\t\t\t\tsomeoneWasDownfloated = true;\n\t\t\t\t\tdownfloatSomeoneInGroup(groupKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (Double groupKey : copyGroupKeys) {\n\t\t\t/**\n\t\t\t * check to make sure the group still exists\n\t\t\t * this is related to bug 02\n\t\t\t */\n\t\t\tif (this.groupsByResult.get(groupKey)== null){\n\t\t\t\t//just move on\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tboolean paringOK = pareGroup(groupKey, roundNumber);\n\t\t\tif (!paringOK) {\n\n\t\t\t\t/*\n\t\t\t\t * downfloat all players from group and then start again all\n\t\t\t\t * parings. Note for the future: you should see if you have\n\t\t\t\t * players that can be pared and then downfloat only those that\n\t\t\t\t * can not be pared. For the moment downfloating all will do.\n\t\t\t\t */\n\t\t\t\t// if this is the last group then join with the previous group\n\t\t\t\tif (copyGroupKeys.size() == 1) {\n\t\t\t\t\tthrow new IllegalStateException(\"What should I do when I only have one group?\");\n\t\t\t\t}\n\t\t\t\tDouble sourceGroup = -1.0;\n\t\t\t\tDouble destGroup = -1.0;\n\t\t\t\t// if this is the last index then join with the previous index\n\t\t\t\tif (copyGroupKeys.indexOf(groupKey) == copyGroupKeys.size() - 1) {\n\t\t\t\t\tint indexSource = copyGroupKeys.indexOf(groupKey);\n\t\t\t\t\tint indexDestination = indexSource - 1;\n\t\t\t\t\tsourceGroup = orderedGroupKeys.get(indexSource);\n\t\t\t\t\tdestGroup = orderedGroupKeys.get(indexDestination);\n\t\t\t\t} else {\n\t\t\t\t\tint indexSource = copyGroupKeys.indexOf(groupKey);\n\t\t\t\t\tint indexDestination = indexSource + 1;\n\t\t\t\t\tsourceGroup = orderedGroupKeys.get(indexSource);\n\t\t\t\t\tdestGroup = orderedGroupKeys.get(indexDestination);\n\t\t\t\t}\n\t\t\t\tjoinGroups(sourceGroup, destGroup);\n\t\t\t\t// and start again\n\t\t\t\tcomputeNextRound(roundNumber);\n\t\t\t}\n\t\t}\n\t}", "protected D getNextOrSame(D d) {\n\t\t\tD next = getNext(d);\n\t\t\tif (next == null) {\n\t\t\t\treturn d;\n\t\t\t}\n\t\t\treturn next;\n\t\t}", "IList<T> getNext();", "public Iterator next() {\n return new FilterIterator(succ.iterator(), filter);\n }", "public ArrayList<Integer> getNext() {\n\t\t\n\t\t// run thru our list of permutations\n\t\tdo {\n\t\t\treturnIndex++;\n\t\t\tif (returnIndex == permutations.size()) {\n\t\t\t\t// we reached end of current permutations-list,\n\t\t\t\t// so we have to expand our termIndices-list,\n\t\t\t\t// re-generate our permutations-list and\n\t\t\t\t// reset out returnIndex\n\t\t\t\ttermIndices.add(termIndices.size());\n\t\t\t\tpermute(\"\");\n\t\t\t\treturnIndex = 0;\n\t\t\t}\n\t\t} while (permHistory.contains(permutations.get(returnIndex)));\n\t\t\n\t\tpermHistory.add(permutations.get(returnIndex));\n\t\t\n\t\treturn permutations.get(returnIndex);\n\t}", "@Override\r\n\t\t\tpublic Square next() {\r\n\t\t\t\treturn master.next().getValue();\r\n\t\t\t}", "@Test void addNextRow() {\n\t\tcheckAddNextRow(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckAddNextRow(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckAddNextRow(false,1,1);\n\n\n\n\t\t// X\n\t\t// x\n\t\tcheckAddNextRow(true,1,1);\n\t}", "public static List<Integer> climbingLeaderboard(List<Integer> ranked, List<Integer> player) {\n // Write your code here\n List<Integer> temp = new ArrayList<>();\n List<Integer> result = new ArrayList<>();\n //boolean isNext =false;\n\n temp=ranked.stream()\n .distinct()\n .collect(toList());\n int i = temp.size()-1; //rank 리스트의 마지막 인덱스 값\n\n /**\n * 확실하게 짚고 넘어가기 위한 부연 설명\n *\n * 1 . List player를 순회시키는데, List rank를 뒤에서부터 순회 한다.\n * (List rank를 오름차순 정렬하고 하려해봤는데 랭킹뽑으려고 하는 순간 머리가 꼬이기 시작했었음)\n * 2. 플레이어의 점수가 랭크된 점수보다 작아졌을 때 비로소 플레이어 점수가 랭크되는 순간이다.\n * 따라서 이 때(2번)의 i값이 랭크점수 순회중 만난 최초의 플레이어 점수보다 높아지는 위치가 된다.\n * 그러므로 이 위치의 다음자리가 비교하는 플레이어의 점수가 랭크되는 위치가 되겠다. i+1\n * 하지만 인덱스는 0부터 시작하기때문에 저장할땐 +1을 더 해주어 i+2로 해준다.\n * 3. while문을 통과했을 때 i가 0보다 작아 통과한 경우는 1등을 한 경우가 된다. 인덱스0보다 큰거니까\n * 따라서 i가 0보다 작은 지 for문 끝나기 전 체크 필요\n * 그 후 다음 score 가 while문에 들어갈땐 이전에 비교했던 인덱스값 다음을 비교하게 된다.\n */\n for(int score : player){\n while(i>=0){\n if(score>=temp.get(i)){\n i--;\n }else{\n result.add(i+2); //인덱스는 0부터시작하니까 +1 , 스코어가 랭크된점수보다 낮으므로 한 등수 밀려서 +1 따라서 총 +2\n break;\n }\n }\n if(i<0) result.add(1); //1위\n }\n\n\n\n //-----------------------기존 O(n^2) 풀이.. ---------------------------------------\n\n //2. 배열 순회 하며 범위 찾은인덱스 +1 (내림차순이므로)\n // 2-1. 양 끝 값보다 크거나 작을 경우 케이스 따로 분리\n // 이중루프로 계산 시 TIME OUT\n// for(int score : player){\n// for(int i=0; i<temp.size(); i++){\n// if(!isNext) {\n// if (score >= temp.get(i)) {\n// if(i==0){\n// result.add(1);\n// }else {\n// result.add((i+1)); //인덱스는 0부터 시작하므로\n// }\n// isNext = true;\n// }else if(score<=temp.get(temp.size()-1)){ //가장 작은 케이스\n// if(score==temp.get(temp.size()-1)){ //가장 작은 값과 같은 경우\n// result.add(temp.size());\n// }else{\n// result.add(temp.size()+1);\n// }\n// isNext=true;\n// }\n// }\n// }\n// isNext=false;\n// }\n result.forEach(System.out::println);\n return result;\n }", "@Override\n\tpublic Tuple next(){\n\t\t//Delete the lines below and add your code here\n\t\tTuple temp;\n\t\tTuple t = child.next();\n\t\tint s = -1;\n\t\tString s1;\n\t\tString s2;\n\t\tif(sorted==false){\n\t\t\tif(t!=null){\n\t\t\t\tfor(s=0; s<t.attributeList.size(); s++){\n\t\t\t\t\tif(t.attributeList.get(s).attributeName.equals(orderPredicate)){\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\twhile(t!=null){\n\t\t\t\ttuplesResult.add(t);\n\t\t\t\tt = child.next();\n\t\t\t}\n\t\t\tfor(int i=0; i<tuplesResult.size(); i++){\n\t\t\t\ts1 = tuplesResult.get(i).attributeList.get(s).attributeValue.toString();\n\t\t\t\tfor(int j=i+1; j<tuplesResult.size(); j++){\n\t\t\t\t\ts2 = tuplesResult.get(j).attributeList.get(s).attributeValue.toString();\n\t\t\t\t\tif(s1.compareTo(s2) > 0){\n\t\t\t\t\t\ttemp=tuplesResult.get(i);\n\t\t\t\t\t\ttuplesResult.set(i, tuplesResult.get(j));\n\t\t\t\t\t\ttuplesResult.set(j, temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsorted=true;\n\t\t}\n\t\tif(tuplesResult.size()>0){\n\t\t\treturn tuplesResult.remove(0);\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "@Test\n\tpublic void testNext() {\n\t\tIntArrayIterator instance = createIterator();\n\t\tboolean[] expResults = new boolean[] { true, true, true, true, true, true, false };\n\t\tboolean result = false;\n\t\tboolean exceptionResult = false;\n\t\t\n\t\t// iterate over the underlying array, testing proper\n\t\t// results for each iteration against the iterator\n\t\tfor(int i = 0; i <= testData.length; ++i) {\n\t\t\tresult = instance.hasNext();\n\t\t\tassertEquals(expResults[i], result);\n\n\t\t\ttry {\n\t\t\t\tint value = instance.next();\n\t\t\t\tassertEquals(testData[i], value);\n\t\t\t}\n\t\t\tcatch (NoSuchElementException e) {\n\t\t\t\t// on last iteration, next() should throw\n\t\t\t\tassertEquals(testData.length, i);\n\t\t\t\texceptionResult = true;\n\t\t\t}\n\t\t}\n\t\tassertEquals(true, exceptionResult);\n\t}", "public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}", "public synchronized int getSynchronisedNext() {\n value++;\n return value;\n }" ]
[ "0.6170777", "0.5562631", "0.55367553", "0.5519321", "0.5492687", "0.5461857", "0.54521143", "0.5387187", "0.5314109", "0.5301643", "0.5291528", "0.5290319", "0.51732635", "0.51472765", "0.512334", "0.5056597", "0.5049307", "0.5032542", "0.49839965", "0.4960792", "0.49440014", "0.49428624", "0.49412394", "0.4937964", "0.49332508", "0.4912459", "0.4911271", "0.4909634", "0.49080643", "0.49029127", "0.4895907", "0.48882946", "0.48735318", "0.48594382", "0.48381254", "0.48182502", "0.48148894", "0.48078462", "0.48064858", "0.48055562", "0.47965097", "0.47915184", "0.478754", "0.47829115", "0.47809938", "0.4777753", "0.4753667", "0.4745869", "0.47390628", "0.47343564", "0.47343564", "0.47334826", "0.4726183", "0.47154412", "0.47005463", "0.46943074", "0.46830037", "0.4683001", "0.4661043", "0.4646557", "0.46457392", "0.4645612", "0.46447945", "0.46444443", "0.46405905", "0.46390212", "0.46381435", "0.4636548", "0.4635027", "0.46348166", "0.46233922", "0.4617308", "0.46082607", "0.4607058", "0.4604896", "0.45942056", "0.4591444", "0.45715523", "0.45708466", "0.4555568", "0.4552666", "0.4551635", "0.454093", "0.454006", "0.45308962", "0.45275086", "0.45249718", "0.45240217", "0.45157593", "0.45133394", "0.45110267", "0.4506077", "0.45047703", "0.44998276", "0.44976842", "0.44963965", "0.44942302", "0.4487564", "0.44838768", "0.4474757", "0.44724867" ]
0.0
-1
Get and return the next value from an iterator, and add a tracing record if enabled. Logs tracing info if a RuntimeException occurs.
private T nextWrapper(Iterator<T> it) { try { if (trace != null) { trace.add(new TraceEntry(System.nanoTime(), System.currentTimeMillis(), NextOrHasNext.NEXT, debugLabels.get(it))); } return it.next(); } catch (RuntimeException e) { logTrace(); throw e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testListIteratorNext(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n try{\n list1It.next();\n fail(\"expected a NoSuchElementException to be thrown\");\n }\n catch(NoSuchElementException error){\n assertEquals(error.getMessage(), \"There is no next element in the list\");\n }\n list1It.add(1);\n list1It.previous();\n assertEquals(\"testing with an element in the next spot\", new Integer(1), list1It.next());\n }", "@Override\r\n public T next() {\r\n if (hasNext()) {\r\n node = node.next();\r\n nextCalled = true;\r\n return node.getData();\r\n }\r\n else {\r\n throw new NoSuchElementException(\"Illegal call to next(); \"\r\n + \"iterator is after end of list.\");\r\n }\r\n }", "public IndexRecord getIteratorNext() {\n iter = (iter == next - 1 ? -1: iter + 1);\n return (iter == -1 ? null : data[iter]);\n }", "@Override\n public Integer next() {\n if(peekedVal != null ){\n Integer next = peekedVal;\n peekedVal = null;\n return next;\n }\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n return iter.next();\n\n }", "public void _next() {\n Object o;\n try {\n o = iter.next();\n } catch (NoSuchElementException e) {\n has_next = 0;\n return;\n }\n // resolve object\n if (o == null) {\n has_next = 1;\n next = null;\n } else if (o instanceof IdentityIF) {\n try {\n o = txn.getObject((IdentityIF)o, true);\n if (o == null) {\n _next();\n } else {\n has_next = 1;\n next = (F) o;\n }\n } catch (Throwable t) {\n has_next = -1;\n next = null;\n }\n } else {\n has_next = 1;\n next = (F) o;\n }\n }", "@Override\n public Integer next() {\n Integer result = null;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n while (this.currentIterator.hasNext()) {\n return this.currentIterator.next();\n }\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.next();\n }\n return result;\n }", "void next(T value);", "@Override\n public Integer next() {\n if (next == null) {\n throw new NoSuchElementException();\n }\n Integer toReturn = next;\n next = null;\n if (peekingIterator.hasNext()) {\n next = peekingIterator.next();\n }\n return toReturn;\n }", "@Test\n\tpublic void testNext() {\n\t\tIntArrayIterator instance = createIterator();\n\t\tboolean[] expResults = new boolean[] { true, true, true, true, true, true, false };\n\t\tboolean result = false;\n\t\tboolean exceptionResult = false;\n\t\t\n\t\t// iterate over the underlying array, testing proper\n\t\t// results for each iteration against the iterator\n\t\tfor(int i = 0; i <= testData.length; ++i) {\n\t\t\tresult = instance.hasNext();\n\t\t\tassertEquals(expResults[i], result);\n\n\t\t\ttry {\n\t\t\t\tint value = instance.next();\n\t\t\t\tassertEquals(testData[i], value);\n\t\t\t}\n\t\t\tcatch (NoSuchElementException e) {\n\t\t\t\t// on last iteration, next() should throw\n\t\t\t\tassertEquals(testData.length, i);\n\t\t\t\texceptionResult = true;\n\t\t\t}\n\t\t}\n\t\tassertEquals(true, exceptionResult);\n\t}", "@Override\n public Integer next() {\n if (!isPeeked && hasNext())\n return iterator.next();\n int toReturn = peekedElement;\n peekedElement = -1;\n isPeeked = false;\n return toReturn;\n }", "@Override\n public Map.Entry<K, V> next() {\n if (iter.hasNext()) {\n \n lastItemReturned = iter.next();\n return lastItemReturned;\n } else {\n throw new NoSuchElementException();\n }\n }", "@Override\n public E next() {\n this.modificationCheck();\n E result;\n if (this.position != SimpleArrayList.this.index) {\n result = (E) values[position++];\n } else {\n throw new NoSuchElementException(\"No more suitable elements!\");\n }\n return result;\n }", "@Override\n\tpublic Integer next() {\n\t return iterator.next();\n\t}", "public Record next() {\n if (hasNext()) {\n if (nextRecord != null) {\n Record out = nextRecord;\n nextRecord = null;\n return out;\n }\n }\n throw new NoSuchElementException();\n //throw new UnsupportedOperationException(\"hw3: TODO\");\n }", "@Override\n public V next() throws NoSuchElementException {\n Object result;\n if (this.hasNext()) {\n result = myHashMap.getTable()[this.number].getValue();\n this.number++;\n } else {\n throw new NoSuchElementException(\"\");\n }\n return (V) result;\n }", "@Override\n public Integer next() {\n Integer res = next;\n advanceIter();\n return res;\n }", "public void findNext() {\n\t if (value != null) {\n\t findValue();\n\t } else {\n\t find();\n\t }\n\t}", "public Object next()\n/* */ {\n/* 84 */ if (this.m_offset < this.m_limit) {\n/* 85 */ return this.m_array[(this.m_offset++)];\n/* */ }\n/* 87 */ throw new NoSuchElementException();\n/* */ }", "@Override\n public Integer next() {\n if (next != null) {\n Integer next = this.next;\n this.next = null;\n return next;\n\n }\n\n return iterator.next();\n }", "@Test\r\n public void sequentialHasNextInvocationDoesntAffectRetrievalOrder() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.next(), is(6));\r\n }", "Object nextValue() throws IOException;", "public void next() {\n\t\titerator.next();\n\t}", "@Override\n public E next() throws NoSuchElementException{\n lastItem = it.next();\n nextCount++;\n return(lastItem);\n }", "@Override\r\n public V next() {\r\n // control: fail-fast iterator...\r\n if (TSB_OAHashtable.this.modCount != expected_modCount) {\r\n throw new ConcurrentModificationException(\"next(): modificación inesperada de tabla...\");\r\n }\r\n\r\n if (!hasNext()) {\r\n throw new NoSuchElementException(\"next(): no existe el elemento pedido...\");\r\n }\r\n\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry;\r\n for (next_entry++ ; s[next_entry] != 1; next_entry++);\r\n\r\n // Actualizo los indices\r\n last_entry = current_entry;\r\n current_entry = next_entry;\r\n \r\n // avisar que next() fue invocado con éxito...\r\n next_ok = true;\r\n \r\n // y retornar la clave del elemento alcanzado...\r\n V value = t[current_entry].getValue();\r\n\r\n return value;\r\n }", "private final void advance() {\n if (currentIterator == null) {\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n if (!currentIterator.hasNext()) {\n // we want advance to next iterator only when this iterator is exhausted\n if (index < intMaps.length - 1) {\n // we can advance to next iterator only if currentIterator is not the last iterator\n ++index;\n if (!fetched[index]) {\n GetAllCustomMap.this.fetchValuesForIndex(index);\n }\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n // we can not advance to next iterator because this iterator is the last iterator\n }\n } else {\n // we do not want to advance to next iterator because this iterator is not fully exhausted\n }\n }\n }", "public V next()\n {\n if (hasNext())\n {\n V currentEntry = arrayDictionary.dictionary[cursor].getValue();\n cursor++;\n nextEntry = currentEntry;\n return currentEntry;\n } \n else\n throw new NoSuchElementException();\n // end if\n }", "public Item next() throws XPathException {\n while (true) {\n NodeInfo next = (NodeInfo)iterator.next();\n if (next == null) {\n current = null;\n position = -1;\n return null;\n }\n if (current != null && next.isSameNodeInfo(current)) {\n continue;\n } else {\n position++;\n current = next;\n return current;\n }\n }\n }", "@Test\n public void testListIteratorPrevious(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n try{\n list1It.previous();\n fail(\"expected a NoSuchElementException to be thrown\");\n }\n catch(NoSuchElementException error){\n assertEquals(error.getMessage(), \"There is no previous element in the list\");\n }\n list1It.add(1);\n assertEquals(\"testing with an element in the next spot\", new Integer(1), list1It.previous());\n }", "public E next() {\n\t\t\tif (mIterModCount != modCount) {\n\t\t\t\tSystem.out.println( mIterModCount + \" : \" + modCount);\n\t\t\t\tthrow new ConcurrentModificationException();\n\t\t\t}\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new java.util.NoSuchElementException();\n\t\t\tmLastNodeReturned = mCurrentNode;\n\t\t\tmCurrentNode = mCurrentNode.next;\n\t\t\tmCurrentIndex++;\n\t\t\tmLastIteration = NEXT;\n\t\t\treturn mLastNodeReturned.data;\n\t\t}", "public Object next()\n/* */ {\n/* 93 */ if (this.m_offset < this.m_array.length) {\n/* 94 */ Object localObject = this.m_array[this.m_offset];\n/* 95 */ advance();\n/* 96 */ return localObject;\n/* */ }\n/* 98 */ throw new NoSuchElementException();\n/* */ }", "@Override\n public Integer next() {\n if (!hasNext()) {\n throw new NoSuchElementException(\"The iteration has no more elements.\");\n }\n currentPrime = getNextPrime(currentPrime);\n counter++;\n return currentPrime;\n }", "public boolean next () throws Exception;", "@Test\n public void testListIteratorHasNext(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n assertFalse(\"testing with no next element\", list1It.hasNext());\n list1It.add(1);\n list1It.previous();\n assertTrue(\"testing with a next element\", list1It.hasNext());\n assertEquals(new Integer(1), list1It.next());\n }", "Object getNextElement() throws NoSuchElementException;", "@Override\n\t\t\tpublic FplValue next() {\n\t\t\t\treturn subListIter.next();\n\t\t\t}", "public void testNext() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.getValue().inRange(0));\n test1.next();\n assertTrue(test1.getValue().inRange(1));\n test1.next();\n assertTrue(test1.getValue().inRange(2));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "@Test\n public void testListIterator() {\n DoubleLinkedList<Integer> list = new DoubleLinkedList<Integer>();\n for (int i = 5; i > 0; i--)\n list.addToFront(i);\n \n /* checking that we get out what we put it */\n int i = 1;\n for (Integer x: list)\n assertEquals(\"Testing value returned by iterator\", new Integer(i++), x);\n \n if (i != 6)\n fail(\"The iterator did not run through all the elements of the list\");\n }", "public Object next()\n {\n if(!hasNext())\n {\n throw new NoSuchElementException();\n //return null;\n }\n previous= position; //Remember for remove;\n isAfterNext = true; \n if(position == null) \n {\n position = first;// true == I have not called next \n }\n else\n {\n position = position.next;\n }\n return position.data;\n }", "@Override\n public Object next()\n {\n if (current != null && current.next != null)\n {\n current = current.next; // Move to the next element in bucket\n }\n else // Move to next bucket\n {\n do\n {\n bucketIndex++;\n if (bucketIndex == buckets.length)\n {\n throw new NoSuchElementException();\n }\n current = buckets[bucketIndex];\n }\n while (current == null);\n }\n return current.data;\n }", "public Record next() {\n throw new UnsupportedOperationException(\"hw3: TODO\");\n }", "public T next() {\n\t\t\tif (modCount != expectedModCount)\n\t\t\t\t throw new ConcurrentModificationException();\n\n\t\t\t// if entry is null, we are at the end of the table\n\t\t\tif (table[index].isEmpty())\n\t\t\t\t throw new NoSuchElementException();\n\n\t\t\t//System.out.println(index + \", \" + indexOfCurrentAL + \", \" + globalIndex);\n\t\t\t\n\t\t\t// capture the value we will return\n\t\t\tIterator<T> it = table[index].iterator();\n\t\t\tfor (int i=0; i<indexOfCurrentAVL; i++){\n\t\t\t\tit.next();\n\t\t\t}\n\t\t\tlastReturned = it.next();\n\t\t\t\n\t\t\t// move to the next entry in the current ArrayList\n\t\t\tif (indexOfCurrentAVL + 1 == table[index].size()) {\n\t\t\t\t// record the current bucket index\n\t\t\t\tint i = index;\n\n\t\t\t\ti++;\n\t\t\t\tif (i < table.length) {\n\t\t\t\t\twhile ((i < table.length) && (table[i].isEmpty()))\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\n\t\t\t\t\tindex = i;\n\t\t\t\t\tindexOfCurrentAVL = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tindexOfCurrentAVL++;\n\t\t\t\n\t\t\tglobalIndex++;\n\t\t\t\n\t\t\treturn lastReturned;\n\t\t}", "@Override\n public T next() {\n T n = null;\n if (hasNext()) {\n // Give it to them.\n n = next;\n next = null;\n // Step forward.\n it = it.next;\n stop -= 1;\n } else {\n // Not there!!\n throw new NoSuchElementException();\n }\n return n;\n }", "public Object next()throws NullPointerException\r\n {\r\n if(hasNext())\r\n return e.get(index+1);\r\n else\r\n throw new NullPointerException();\r\n }", "public Item next() {\r\n if (!hasNext()) throw new NoSuchElementException();\r\n lastAccessed = current;\r\n Item item = current.item;\r\n current = current.next;\r\n index++;\r\n return item;\r\n }", "public double provideNextValue() throws IndexOutOfBoundsException {\n try {\n return valuesList.get(currentIndex++);\n } catch (IndexOutOfBoundsException e) {\n throw new IndexOutOfBoundsException();\n }\n }", "@Override\n public E next() {\n if (this.hasNext()) {\n curr = curr.nextNode;\n return curr.getData();\n }\n else {\n throw new NoSuchElementException();\n }\n }", "private void setNextIterator() {\n\t\t\t\n\t\t\tfor (int i = index; i < inconsistencies.size(); i++){\n\t\t\t\tSet<LPGInconsistency> inconsistencyList = inconsistencies.get(i);\n\t\t\t\tif (!inconsistencyList.isEmpty()) {\n\t\t\t\t\titerator = inconsistencyList.iterator();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tindex++;\n\t\t\t}\n\t\t}", "@Override\npublic Tuple get_next() throws IOException, JoinsException, IndexException, InvalidTupleSizeException,\n\t\tInvalidTypeException, PageNotReadException, TupleUtilsException, PredEvalException, SortException,\n\t\tLowMemException, UnknowAttrType, UnknownKeyTypeException, Exception {\n\treturn null;\n}", "@Override\r\n\tpublic T next() throws NoSuchElementException{\n\t\tif (hasNext()) {\r\n\t\t\tT curr = next.getData();\r\n\t\t\tnext = next.getNext();\r\n\t\t\treturn curr;\r\n\t\t}\r\n\t\telse throw new NoSuchElementException();\r\n\t\t\r\n\t}", "private E next() {\n\t\tif (hasNext()) {\n\t\t\tE temp = iterator.data;\n\t\t\titerator = iterator.next;\n\t\t\treturn temp;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@Test\n public void testNext() throws SQLException, InputIterationException {\n // Setup\n ResultSet resultSet = twoLinesResultSetFixture.getTestData();\n ResultSetIterator resultSetIterator = new ResultSetIterator(resultSet);\n\n // Check result\n List<Boolean> expectedNextValues = twoLinesResultSetFixture.getExpectedNextValues();\n List<ImmutableList<String>> expectedRecords = twoLinesResultSetFixture.getExpectedRecords();\n for (int i = 0; i < twoLinesResultSetFixture.numberOfRows(); i++) {\n assertEquals(expectedNextValues.get(i), resultSetIterator.hasNext());\n assertEquals(expectedRecords.get(i), resultSetIterator.next());\n }\n assertEquals(expectedNextValues.get(twoLinesResultSetFixture.numberOfRows()),\n resultSetIterator.hasNext());\n // Next should have been called.\n verify(resultSet, times(3)).next();\n\n }", "@Override\n public Item next() {\n if(!hasNext()) throw new NoSuchElementException(\"Failed to perform next because hasNext returned false!\");\n Item item = current.data;\n current = current.next;\n return item;\n }", "@Override\n\t\tpublic int next() {\n\t\t\treturn current++;\n\t\t}", "@Override\r\n\t\tpublic E next() {\n\t\t\tcaret = caret.next();\r\n\t\t\tif (caret == null)\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\tnextIndex++;\r\n\t\t\treturn caret.n.data[caret.idx];\r\n\t\t}", "public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}", "public T next(){\n if (hasNext())\n return (T)VectorGeneric.this.vec[index++];\n throw new NoSuchElementException(\"Index out of bounds!\");\n \n }", "public T next()\n\t\t{\n\t\t\tif(hasNext())\n\t\t\t{\n\t\t\t\tT currentData = current.getData(); //the data that will be returned\n\t\t\t\t\n\t\t\t\t// must continue to keep track of the Node that is in front of\n\t\t\t\t// the current Node whose data is must being returned , in case\n\t\t\t\t// its nextNode must be reset to skip the Node whose data is\n\t\t\t\t// just being returned\n\t\t\t\tbeforePrevious = previous;\n\t\t\t\t\n\t\t\t\t// must continue keep track of the Node that is referencing the\n\t\t\t\t// data that was just returned in case the user wishes to remove()\n\t\t\t\t// the data that was just returned\n\t\t\t\t\n\t\t\t\tprevious = current; // get ready to point to the Node with the next data value\n\t\t\t\t\n\t\t\t\tcurrent = current.getNext(); // move to next Node in the chain, get ready to point to the next data item in the list\n\t\t\t\t\n\t\t\t\tthis.removeCalled = false;\n\t\t\t\t// it's now pointing to next value in the list which is not the one that may have been removed\n\t\t\t\t\n\t\t\t\treturn currentData;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\t}\n\t\t}", "public T next() {\r\n if\t(!hasNext()) {\r\n throw new NoSuchElementException();\r\n }\r\n return items[now++];\r\n }", "@Test(timeout=100,expected=java.util.NoSuchElementException.class)\r\n\tpublic void testNextThrowsException() {\r\n\t\tString [] r1 = {\"Crash\",\"and\",\"burn\"};\r\n\t\twriteArrayToLine(r1);\r\n\t\tout.close();\r\n\t\t\r\n\t\tCSVReader csv = new CSVReader(getInstream());\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tString [] next = csv.next();\r\n\t\tassertArrayEquals( r1, next );\r\n\t\tcsv.next();\r\n\t\tfail(\"next should throw NoSuchElementException if no more data\");\r\n\t}", "public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }", "@Override\n public Integer next() {\n if (cur != null) {\n int temp = cur.intValue();\n cur = null;\n return temp;\n }\n\n if (iter.hasNext()) {\n return iter.next();\n }\n\n return null;\n }", "public boolean next() throws StandardException;", "public T next()\r\n { \r\n if (next == null)\r\n throw new NoSuchElementException(\"Attempt to\" +\r\n \" call next when there's no next element.\");\r\n\r\n prev = next;\r\n next = next.next;\r\n return prev.data;\r\n }", "public Item next() {\n\t\t\tif (!hasNext())\n\t\t\t\treturn null;\n lastAccessed = current;\n Item item = current.item;\n current = current.next; \n index++;\n return item;\n\t\t}", "@SuppressWarnings(\"unchecked cast\")\n @Override\n public T next() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n lastNext = heap[cursor++];\n return (T) lastNext;\n }", "public Stacktrace next() throws IOException {\n\t\tString line;\n\t\tStacktrace stacktrace = null;\n\t\twhile (stacktrace == null && (line = input.readLine()) != null) {\n\t\t\tif (!StringUtils.isEmpty(line)) {\n\t\t\t\tlineBuffer.add(line);\n\t\t\t\tstacktrace = processLine(line);\n\t\t\t}\n\t\t}\n\t\treturn stacktrace;\n\t}", "public I next(){\n return (I) listI.get(index++);\n }", "public abstract T next() throws NoSuchElementException;", "public E next() \n throws NoSuchElementException {\n if (entries != null && \n size > 0 &&\n position > 0 &&\n position < size) {\n E element = entries[position];\n position++;\n return element;\n } else {\n throw new NoSuchElementException(); \n } \n \n }", "@Override\n public E next() {\n if (hasNext() == false) {\n throw new NoSuchElementException();\n }\n return this.array[this.index++];\n }", "public T next(){\r\n return itrArr[position++];\r\n }", "@Override\n\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\tNoSuchElementException {\n\t\t\tif(tplItr.hasNext())\n\t\t\t\treturn tplItr.next();\n\t\t\tthrow new NoSuchElementException();\n\t\t}", "@Override\n E next();", "@Override\n\t\tpublic T next() {\n\t\t\tmoveToNextIndex();\n\t\t\treturn objectAtIndex(_indicesByInsertOrder[_index]);\n\t\t}", "public Object next()\n {\n return _iterator.next();\n }", "@Test\n public void whenAddOneToEmptyTreeThenIteratorHasNext() {\n tree.add(1);\n\n Iterator<Integer> iterator = this.tree.iterator();\n\n assertThat(iterator.next(), is(1));\n }", "public static void hasNext() {\n\tLinkedList<Integer> list = new LinkedList<>();\n\t\n\tfor (int i = 0; i< 100; i++)\n\t\tif (i % 2 == 0) \n\t\t\tlist.add(i);\n\t\n\tIterator<Integer> g = list.iterator();\n\t\n\t// loop controlled by hasNext\n\twhile(g.hasNext())\n\t\tInteger x = g.next();\n\t \n\t\t//use x .....\n\t\n\n}", "@Test(expected = NoSuchElementException.class)\n public void testNext_End() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n instance.next();\n }", "public Object nextElement() {\n/* 75 */ return this.iterator.next();\n/* */ }", "@Override\n protected List<WriteStatus> computeNext() {\n BoundedInMemoryExecutor<HoodieRecord<T>, HoodieInsertValueGenResult<HoodieRecord>, List<WriteStatus>> bufferedIteratorExecutor =\n null;\n try {\n final Schema schema = new Schema.Parser().parse(hoodieConfig.getSchema());\n bufferedIteratorExecutor =\n new SparkBoundedInMemoryExecutor<>(hoodieConfig, inputItr, getInsertHandler(), getTransformFunction(schema));\n final List<WriteStatus> result = bufferedIteratorExecutor.execute();\n assert result != null && !result.isEmpty() && !bufferedIteratorExecutor.isRemaining();\n return result;\n } catch (Exception e) {\n throw new HoodieException(e);\n } finally {\n if (null != bufferedIteratorExecutor) {\n bufferedIteratorExecutor.shutdownNow();\n }\n }\n }", "public void nextHard() {\n\t\titerator.next();\n\t}", "protected Tuple fetchNext() throws NoSuchElementException, TransactionAbortedException, DbException {\n\t\t// some code goes here\n\t\tTuple ret;\n\t\twhile (childOperator.hasNext()) {\n\t\t\tret = childOperator.next();\n\t\t\tif (pred.filter(ret))\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}", "public NV readNext() throws ThingsException;", "@Test\n public void testIterator(){\n while(ROW_ITR.hasNext()){\n ROW_ITR.next();\n }\n }", "@Override\n public Resource next() {\n if (wrapped == null || !wrapped.hasNext()) {\n throw new NoSuchElementException();\n }\n failFast(this);\n try {\n return wrapped.next();\n } finally {\n if (!wrapped.hasNext()) {\n wrapped = null;\n remove(this);\n }\n }\n }", "public E next()\n\t{\n\t\treturn (vector.get(curr++));\n\t}", "public void Next() {\n OCCwrapJavaJNI.Interface_EntityIterator_Next(swigCPtr, this);\n }", "@Test\n public void testNext_Start() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 3, 4, 5));\n\n ListIterator<Integer> instance = baseList.listIterator();\n Integer expResult = 1;\n Integer result = instance.next();\n assertEquals(expResult, result);\n }", "@Override\r\n public K next() {\r\n // control: fail-fast iterator...\r\n if (TSB_OAHashtable.this.modCount != expected_modCount) {\r\n throw new ConcurrentModificationException(\"next(): modificación inesperada de tabla...\");\r\n }\r\n\r\n if (!hasNext()) {\r\n throw new NoSuchElementException(\"next(): no existe el elemento pedido...\");\r\n }\r\n\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry;\r\n for (next_entry++ ; s[next_entry] != 1; next_entry++);\r\n\r\n // Actualizo los indices\r\n last_entry = current_entry;\r\n current_entry = next_entry;\r\n \r\n // avisar que next() fue invocado con éxito...\r\n next_ok = true;\r\n \r\n // y retornar la clave del elemento alcanzado...\r\n K key = t[current_entry].getKey();\r\n\r\n return key;\r\n }", "@Override public WALRecord next() throws IgniteCheckedException {\n WALRecord rec = super.next();\n\n if (rec == null)\n return null;\n\n if (rec.type() == CHECKPOINT_RECORD) {\n CheckpointRecord cpRec = (CheckpointRecord)rec;\n\n // We roll memory up until we find a checkpoint start record registered in the status.\n if (F.eq(cpRec.checkpointId(), status.cpStartId)) {\n log.info(\"Found last checkpoint marker [cpId=\" + cpRec.checkpointId() +\n \", pos=\" + rec.position() + ']');\n\n needApplyBinaryUpdates = false;\n }\n else if (!F.eq(cpRec.checkpointId(), status.cpEndId))\n U.warn(log, \"Found unexpected checkpoint marker, skipping [cpId=\" + cpRec.checkpointId() +\n \", expCpId=\" + status.cpStartId + \", pos=\" + rec.position() + ']');\n }\n\n return rec;\n }", "public V next() {\n\t if(hasNext()==false) {\n\t \tthrow new NoSuchElementException();\n\t }\n\t // while itr.hasNext() is false, increment bucket and get the next iterator\n\t while(itr.hasNext()==false) {\n\t \titeratorbucket++;\n\t \titr=table[iteratorbucket].iterator();\n\t }\n\t // now increment nextCount and return the key from the item itr.next() returns\n\t \tnextCount++;\n\t \treturn itr.next().value;\n\t \n\t }", "public T next(){\r\n\t\t\tif (expectedModCount != modCount){\r\n\t\t\t\tthrow new ConcurrentModificationException();\r\n\t\t\t}\r\n\t\t\tT passed = current;\r\n\t\t\tif ((currentNode.next==endMarker)&&(currentNode.getLast()==current)){\r\n\t\t\t\tcurrentNode = endMarker;\r\n\t\t\t\tcurrent = null;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\r\n\t\t\tif (currentNode.indexOf(current)==currentNode.getArraySize()-1){\r\n\t\t\t\tcurrentNode = currentNode.next;\r\n\t\t\t\tcurrent = currentNode.getFirst();\r\n\t\t\t\tidx = 0;\r\n\t\t\t\treturn passed;\r\n\t\t\t}\t\r\n\t\t\tidx++;\r\n\t\t\tcurrent = currentNode.get(idx);\r\n\t\t\treturn passed;\r\n\t\t}", "@SuppressWarnings(\"unchecked\")\n\t\tpublic T next() throws NoSuchElementException {\n\t\t\ttry {\n//\t\t\t\tT object = (T)data[cursor * numCols + pinnedColumn];\n\t\t\t\tT object = get(cursor, pinnedColumn);\n\t\t\t\tlastRet = cursor++;\n\t\t\t\treturn object;\n\t\t\t} catch ( IndexOutOfBoundsException e ) {\n\t\t\t\tthrow new NoSuchElementException( \"You have iterated past the last element.\" + e.toString() );\n\t\t\t}\n\t\t}", "@Override\r\n public Entry<K, V> next() {\r\n // control: fail-fast iterator...\r\n if (TSB_OAHashtable.this.modCount != expected_modCount) {\r\n throw new ConcurrentModificationException(\"next(): modificación inesperada de tabla...\");\r\n }\r\n\r\n if (!hasNext()) {\r\n throw new NoSuchElementException(\"next(): no existe el elemento pedido...\");\r\n }\r\n\r\n // variable auxiliar t y s para simplificar accesos...\r\n Entry<K, V> t[] = TSB_OAHashtable.this.table;\r\n int s[] = TSB_OAHashtable.this.states;\r\n\r\n // busco el siguiente indice cerrado\r\n int next_entry = current_entry;\r\n for (next_entry++ ; s[next_entry] != 1; next_entry++);\r\n\r\n // Actualizo los indices\r\n last_entry = current_entry;\r\n current_entry = next_entry;\r\n \r\n // avisar que next() fue invocado con éxito...\r\n next_ok = true;\r\n \r\n // y retornar el entry alcanzado...\r\n return t[current_entry];\r\n }", "protected int handleNext(int position) {\n/* 283 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public Integer peek() {\n if(peekedVal == null){\n if(!iter.hasNext()){\n throw new NoSuchElementException();\n }\n peekedVal = iter.next();\n }\n return peekedVal;\n }", "@Override\n public T next() {\n current = current.next;\n return current.data;\n }", "public void next() {\n\t\t}", "public boolean onNextRecord(IDataTableRecord record) throws Exception;", "public BSCObject next()\n {\n if (ready_for_fetch)\n {\n // the next sibling is waiting to be returned, so just return it\n ready_for_fetch = false;\n return sibling;\n }\n else if (hasNext())\n {\n // make sure there is a next sibling; if so, return it\n ready_for_fetch = false;\n return sibling;\n }\n else\n throw new NoSuchElementException();\n }" ]
[ "0.5716555", "0.5695445", "0.55941606", "0.557606", "0.55670947", "0.5545275", "0.55389714", "0.54936755", "0.5446439", "0.5444948", "0.5437756", "0.53937495", "0.53719276", "0.5371264", "0.53177744", "0.5301063", "0.5281723", "0.523925", "0.523867", "0.5227037", "0.5185049", "0.5178581", "0.5175053", "0.51576245", "0.514495", "0.51302564", "0.51270807", "0.51218975", "0.5113651", "0.5098965", "0.50915337", "0.50877017", "0.5074696", "0.50699437", "0.5063931", "0.5034174", "0.50339675", "0.50306624", "0.5027421", "0.5024575", "0.50245", "0.5021515", "0.5021153", "0.5020427", "0.5016414", "0.4997598", "0.499644", "0.4994181", "0.49932083", "0.49880853", "0.49860263", "0.4985554", "0.4983175", "0.49781895", "0.4972825", "0.497111", "0.49705753", "0.4969454", "0.49546817", "0.49533102", "0.49446225", "0.49367136", "0.49362907", "0.49360868", "0.49146333", "0.49113038", "0.4910434", "0.49082527", "0.49054262", "0.48988163", "0.489863", "0.4897118", "0.48958462", "0.48857975", "0.4869592", "0.4869347", "0.48675838", "0.48657876", "0.48654065", "0.4855939", "0.48504514", "0.48357615", "0.4831564", "0.48249966", "0.48245403", "0.4823964", "0.48212883", "0.4821062", "0.48188365", "0.4811154", "0.480468", "0.47913915", "0.4785052", "0.47812158", "0.47717896", "0.47698858", "0.47660547", "0.4764271", "0.47476873", "0.4744552" ]
0.70639646
0
This problem was asked by Microsoft. You have an N by N board. Write a function that, given N, returns the number of possible arrangements of the board where N queens can be placed on the board without threatening each other, i.e. no two queens share the same row, column, or diagonal. n queens problem, tough one there's a lot of possible solutions so this will probably be some sort of recursive solution, couldn't figure this one out for the life of me, this solution us elegant and utilizes a 1d array, because we know we can only have one queen per row, hence the index of the array is representive of a column, and the value is representive of a row
int n_queens(int n, ArrayList<Integer> board){ System.out.println(board.toString()); if(n == board.size()){ return 1; } int count = 0; for(int i = 0; i < n; i++){ // make sure we haven't included it if(!board.contains(i)){ board.add(i); System.out.println("!! " + i); if(isValid(board)){ count += n_queens(n,board); } board.remove(board.size()-1); } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int totalNQueens(int n) {\n\n if (n <= 0){\n return 0;\n }\n // int count = 0不行\n int[] count = new int[1];\n List<Integer> cur = new ArrayList<Integer>();\n dfs(n, cur, count);\n return count[0];\n }", "public int totalNQueens(int n) {\n count = 0;\n // 1 n=4->size=01111\n size = (1 << n) - 1;\n solve(0, 0, 0, 0);\n return count;\n }", "public int createNQueens(int col, int[] rows, int row) {\n\t\tint number = 0;\r\n\t\tfor (int i = 0; i < col; i++) {\r\n\t\t\tint j;\r\n\t\t\tfor (j = 0; j < row; j++) {\r\n\t\t\t\tif (rows[j] == i || (row - j == Math.abs(rows[j] - i))) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (j < row) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\trows[row] = i;\r\n\t\t\tif (row == col - 1) {\r\n\t\t\t\trows[row] = -1;\r\n\t\t\t\treturn 1;\r\n\t\t\t} else {\r\n\t\t\t\tint tmp = createNQueens(col, rows, row + 1);\r\n\t\t\t\tnumber += tmp;\r\n\t\t\t}\r\n\t\t\trows[row] = -1;\r\n\r\n\t\t}\r\n\t\treturn number;\r\n\t}", "public int totalNQueens(int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tint[] cols = new int[n];\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tcols[i] = -1;\r\n\t\t}\r\n\t\tint number = createNQueens(n, cols, 0);\r\n\t\treturn number;\r\n\r\n\t}", "public int totalNQueens(int n) {\n return backtrack(0, new int[n]);\n }", "public int totalNQueens(int n) {\n\t\tcount = 0;\n\t\tallQueen = (1 << n) - 1;\n\t\tcal(0, 0, 0);\n\t\treturn count;\n\t}", "public int totalNQueens(int n) {\n mRet = 0;\n mSize = n;\n mMask = (1 << mSize) - 1;\n queen(0, 0, 0, 0);\n return mRet;\n }", "public int totalNQueens(int n) {\n if(n<=0) return 0;\n dfs(0, n);\n return res;\n }", "public static void main(String[] args) {\n\t\tScanner sc= new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the number of queens\");\r\n\t\tint n=sc.nextInt();\r\n\t\tint[] X= new int[n];\r\n\t\tint k=0;\r\n\t\tfor(int i=0;i<n;i++) {\r\n\t\t\tX[i]=0;\r\n\t\t}\r\n\t\twhile(k>=0) {\r\n\t\t\tX[k]=X[k]+1;\r\n\t\t\twhile(X[k]<=n && !place(k,X)) {\r\n\t\t\t\tX[k]=X[k]+1;\r\n\t\t\t}\r\n\t\t\tif(X[k]<=n) {\r\n\t\t\t\tif(k==n-1) {\r\n\t\t\t\t\tfor(int m=0;m<n;m++) {\r\n\t\t\t\t\t\tSystem.out.print(X[m]+\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tk=k+1;\r\n\t\t\t\t\tX[k]=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tk=k-1;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean SolveNQueenProblem(int columIndex) {\n if (columIndex >= this.SIZE_OF_CHESS_BOARD) {\n return true;\n }\n\n for (int i = 0; i < this.SIZE_OF_CHESS_BOARD; i++) {\n if (this.IsSafe(i, columIndex)) {\n this.maps[i][columIndex] = true;\n\n //if this case is true and we can set all queen i the chess board\n if (this.SolveNQueenProblem(columIndex + 1) == true) {\n return true;\n }\n this.maps[i][columIndex] = false;//back tracking\n }\n }\n return false;\n }", "public List<List<Integer>> nqueens(int n) {\n\t\tList<List<Integer>> result = new ArrayList<List<Integer>>();\n\t\t// cur will be a list of size n, and cur[i] is the column number where the queen\n\t\t// on row i positioned\n\t\tList<Integer> cur = new ArrayList<Integer>();\n\t\thelper(n, cur, result);\n\t\treturn result;\n\t}", "void solveNQueens(int n, int row, List<Integer> colPalcement, List<ArrayList<Integer>> result) {\n\t\tif (row == n) {\n\t\t\tresult.add(new ArrayList<>(colPalcement));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor (int col = 0; col < n; col++) {\n\t\t\tcolPalcement.add(col);\n\t\t\tif (isColPlacementValid(colPalcement)) {\n\t\t\t\tsolveNQueens(n, row + 1, colPalcement, result);\n\t\t\t}\n\t\t\tcolPalcement.remove(colPalcement.size() - 1);\n\t\t}\n\t\t\n\t}", "private static int findCollision(int[][] matrix, int n) {\n int count = 0;\n for (int i = 0; i <= n - 1; i++) {\n for (int j = 0; j <= n - 1; j++) {\n if (matrix[i][j] == 1) {\n // left row\n for (int k = j - 1; k >= 0; k--) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // right row\n for (int k = j + 1; k <= n - 1; k++) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // up col\n for (int k = i - 1; k >= 0; k--) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // down col\n for (int k = i + 1; k <= n - 1; k++) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // up left\n for (int k = i - 1, l = j - 1; k >= 0 && l >= 0; k--, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down left\n for (int k = i + 1, l = j - 1; k <= n - 1 && l >= 0; k++, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // up right\n for (int k = i - 1, l = j + 1; k >= 0 && l <= n - 1; k--, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down right\n for (int k = i + 1, l = j + 1; k <= n - 1 && l <= n - 1; k++, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n }\n }\n }\n return count / 2;\n }", "private static boolean solveQueenProblem(int[][] board, int row) {\n\t\tif(row>=N)\n\t\t\treturn true;\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tif(isSafe(board,row,i)) {\n\t\t\t\tboard[row][i]=1;\n\t\t\t\tif(solveQueenProblem(board, row+1))\n\t\t\t\treturn true;\n\t\t\t\telse {\n\t\t\t\t\tboard[row][i]=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public int numSquaresIII(int n) {\n List<Integer> squareNum = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n squareNum.add(i * i);\n }\n Queue<Integer> queue = new ArrayDeque<>();\n queue.offer(n);\n int level = 0;\n while (!queue.isEmpty()) {\n ++level;\n Queue<Integer> nextQueue = new ArrayDeque<>();\n for (Integer rem : queue) {\n for (Integer square : squareNum) {\n if (rem.equals(square)) {\n return level;\n } else if (rem < square) {\n break;\n } else {\n nextQueue.offer(rem - square);\n }\n }\n }\n queue = nextQueue;\n }\n return level;\n }", "public ArrayList<String[]> solveNQueens(int n) {\n ArrayList<String[]> res= new ArrayList<String[]>();\n int[] board=new int[n];\n dfs(res,board,n,0);\n return res;\n }", "public int numSquares(int n) {\n List<Integer> sq = populateSquaresTill(n);\n int[] C = new int[n + 1];\n C[0] = 0;\n for (int i = 1; i <= n; i++) {\n C[i] = Integer.MAX_VALUE;\n for (int k = 1; k < sq.size(); k++) {\n if (i - sq.get(k) >= 0)\n if (C[i] > C[i - sq.get(k)] + 1)\n C[i] = C[i - sq.get(k)] + 1;\n }\n }\n return C[n];\n }", "public int numSquares(int n) {\n\n\t\tint[] dp = new int[n + 1];\n\t\tArrays.fill(dp, Integer.MAX_VALUE);\n\t\tdp[0] = 0;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j * j <= i; j++) {\n\t\t\t\t\n\t\t\t\tdp[i] = Math.min(dp[i], dp[i-j*j] +1 ); // You basically subtract J*J from i. so you add exactly 1 since you subtract a sqaure\n\t\t\t}\n\t\t}\n\t\treturn dp[n];\n\t}", "public List<List<Integer>> nqueens(int n) {\n List<List<Integer>> solu = new ArrayList<List<Integer>>();\n List<Integer> curr = new ArrayList<Integer>();\n if (n <=0)\n return solu;\n nqueens(n, 0, curr, solu);\n return solu;\n }", "ArrayList<ArrayList<String>> solveNQueens(int n) {\n ArrayList<ArrayList<String>> results = new ArrayList<>();\n if (n <= 0) {\n return results;\n }\n\n search(results, new ArrayList<Integer>(), n);\n return results;\n }", "public List<List<String>> solveNQueens(int n) {\n if (n < 1) return Collections.EMPTY_LIST;\n\n char[][] board = new char[n][n];\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) board[i][j] = '.';\n }\n\n List<List<String>> result = new ArrayList<>();\n boolean[][] visited = new boolean[3][2 * n];\n backtracking(0, n, board, result, visited);\n return result;\n }", "public static int queensAttack(int n, int k, int r_q, int c_q, List<List<Integer>> obstacles)\n {\n int squaresQueenCanAttack = 0;\n int r_RightObs = -1;\n int c_RightObs = -1;\n int r_BelowRightObs = -1;\n int c_BelowRightObs = -1;\n int r_BelowObs = -1;\n int c_BelowObs = -1;\n int r_BelowLeftObs = -1;\n int c_BelowLeftObs = -1;\n int r_LeftObs = -1;\n int c_LeftObs = -1;\n int r_AboveLeftObs = -1;\n int c_AboveLeftObs = -1;\n int r_AboveObs = -1;\n int c_AboveObs = -1;\n int r_AboveRightObs = -1;\n int c_AboveRightObs = -1;\n for (int i = 0; i < k; i++) { // Find the closest obstacles in each direction\n int r_obs = obstacles.get(i).get(0);\n int c_obs = obstacles.get(i).get(1);\n // Above\n if ((r_obs < r_AboveObs || r_AboveObs == -1) && r_obs > r_q && c_obs == c_q) {\n r_AboveObs = r_obs;\n c_AboveObs = c_obs;\n }\n // Below\n if ((r_obs > r_BelowObs || r_BelowObs == -1) && r_obs < r_q && c_obs == c_q) {\n r_BelowObs = r_obs;\n c_BelowObs = c_obs;\n }\n // Left\n if ((c_obs > c_LeftObs || r_LeftObs == -1) && c_obs < c_q && r_obs == r_q) {\n r_LeftObs = r_obs;\n c_LeftObs = c_obs;\n }\n // Right\n if ((c_obs < c_RightObs || r_RightObs == -1) && c_obs > c_q && r_obs == r_q) {\n r_RightObs = r_obs;\n c_RightObs = c_obs;\n }\n // Above Left\n if (c_q - c_obs == r_obs - r_q && c_obs < c_q && r_obs > r_q && ((r_obs < r_AboveLeftObs && c_obs > c_AboveLeftObs) || r_AboveLeftObs == -1)) {\n r_AboveLeftObs = r_obs;\n c_AboveLeftObs = c_obs;\n }\n // Above Right\n if (r_obs - r_q == c_obs - c_q && c_obs > c_q && r_obs > r_q && ((r_obs < r_AboveRightObs && c_obs < c_AboveRightObs) || r_AboveRightObs == -1)) {\n r_AboveRightObs = r_obs;\n c_AboveRightObs = c_obs;\n }\n // Below Left\n if (r_q - r_obs == c_q - c_obs && c_obs < c_q && r_obs < r_q && ((r_obs > r_BelowLeftObs && c_obs > c_BelowLeftObs) || r_BelowLeftObs == -1)) {\n r_BelowLeftObs = r_obs;\n c_BelowLeftObs = c_obs;\n }\n // Below Right\n if (r_q - r_obs == c_obs - c_q && c_obs > c_q && r_obs < r_q && ((r_obs > r_BelowRightObs && c_obs < c_BelowRightObs) || r_BelowRightObs == -1)) {\n r_BelowRightObs = r_obs;\n c_BelowRightObs = c_obs;\n }\n }\n squaresQueenCanAttack += (r_AboveObs != -1) ? (r_AboveObs - r_q - 1) : n - r_q; // Squares the queen can attack above\n squaresQueenCanAttack += (r_BelowObs != -1) ? (r_q - r_BelowObs - 1) : r_q - 1; // Squares the queen can attack below\n squaresQueenCanAttack += (c_LeftObs != -1) ? (c_q - c_LeftObs - 1) : c_q - 1; // Squares the queen can attack to the left\n squaresQueenCanAttack += (c_RightObs != -1) ? (c_RightObs - c_q - 1) : n - c_q; // Squares the queen can attack to the right\n squaresQueenCanAttack += (c_AboveLeftObs != -1) ? (c_q - c_AboveLeftObs - 1) : Math.min(c_q - 1, n - r_q); // Squares the queen can attack above and left\n squaresQueenCanAttack += (r_AboveRightObs != -1) ? (c_AboveRightObs - c_q - 1) : Math.min(n - c_q, n - r_q); // Squares the queen can attack above and right\n squaresQueenCanAttack += (r_BelowLeftObs != -1) ? (c_q - c_BelowLeftObs - 1) : Math.min(c_q - 1, r_q - 1); // Squares the queen can attack below and left\n squaresQueenCanAttack += (c_BelowRightObs != -1) ? (c_BelowRightObs - c_q - 1) : Math.min(n - c_q, r_q - 1); // Squares the queen can attack below and right\n return squaresQueenCanAttack;\n }", "public ArrayList<String[]> solveNQueens(int n) {\n int[] board=new int[n];\n res=new ArrayList<String[]>();\n dfs(board,0);\n return res;\n }", "int nDiagonalLeft(int n, int[][] board, int playerNumber, int width, int height, int connectN){\r\n\t\t//int max = 0;\r\n\t\tint num = 0;\r\n\t\t//int opponentNumber = (playerNumber==1) ? 2 : 1;\r\n\t\tfor(int i=width; i < (width-connectN); i--){\r\n\t\t\tfor (int j=0; j<(height-connectN); j++){\r\n\t\t\t\tif (n == 2) {\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (n == 3){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-2][j+2] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(n == 4){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-2][j+2] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i-3][j+3] == playerNumber){\r\n\t\t\t\t\t\tnum++;\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 num;\r\n\t}", "public int numSolutions(int N, int M) {\n HashMap<Integer, Integer> dp = new HashMap<Integer, Integer>();\n dp.put(0, 1);\n for (int i = 0; i < N; ++i) {\n for (int j = 0; j < M; ++j) {\n HashMap<Integer, Integer> nDp = new HashMap<Integer, Integer>();\n for (Integer key : dp.keySet()) {\n int leftCell = getCell(key, j - 1);\n int upCell = getCell(key, j);\n int count = dp.get(key);\n if (upCell != 0) {\n // This is the last chance to fulfill upCell.\n if (upCell == 1 || upCell == 3) {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n } else {\n // Paint this cell.\n int current = 2 + (leftCell == 0 ? 0 : 1);\n int newKey = setCell(key, j, current);\n if (leftCell != 0) {\n newKey = setCell(newKey, j - 1, leftCell + 1);\n }\n addValue(nDp, newKey, count);\n }\n } else {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n // Paint this cell.\n if (leftCell == 0) {\n newKey = setCell(key, j, 1);\n } else {\n newKey = setCell(key, j - 1, leftCell + 1);\n newKey = setCell(newKey, j, 2);\n }\n addValue(nDp, newKey, count);\n }\n }\n dp = nDp;\n }\n }\n int result = 0;\n for (Integer key : dp.keySet()) {\n boolean valid = true;\n for (int i = 0; i < M; ++i) {\n int current = getCell(key, i);\n if (current == 2 || current == 4) {\n valid = false;\n break;\n }\n }\n if (valid) {\n result = (result + dp.get(key)) % MOD;\n }\n }\n return result;\n }", "public void backtracking(int row, int n){\n if(row == n){\n res++;\n return;\n }\n //我们只要看列和对角线就可以了, 因为我们是row by row的dfs,一行放一个queen,因为同行不能有其他queen.\n for(int col=0; col<n; col++){\n if(cols[col] || digl1[row+col] || digl2[row-col+n-1]){\n continue;\n }\n cols[col] = true;\n digl1[row+col] = true;\n digl2[row-col+n-1] = true;\n backtracking(row+1, n);\n cols[col] = false;\n digl1[row+col] = false;\n digl2[row-col+n-1] = false;\n }\n }", "public static int numSquares(int n) {\n\t\t int m = (int)Math.sqrt(n) + 1 ;\n\t\t int[][] table = new int[m][n+1] ;\n\t\t for(int i = 0 ; i < n+1 ; i++){\n\t\t\t table[1][i] = i;\n\t\t }\n\t\t for(int i = 0 ; i < m ; i++){\n\t\t\t table[i][0] = 0;\n\t\t }\n\t\t \n\t\t int x, y;\n\t\t for(int i = 2; i < m ; i++){\n\t\t\t for(int j = 1; j < n+1; j++){\n\t\t\t\t x = table[i-1][j];\n\t\t\t\t y = j - (i*i) >= 0 ? table[i][j - (i*i)] + 1 : n+1 ;\n\t\t\t\t table[i][j] = Math.min(x, y);\n\t\t\t }\n\t\t }\n\t\treturn table[m-1][n];\n\t \n\t \n\t \n\t }", "public static boolean SolveNinePuzzle(int board [][]){\n\t\tfor(int i = 0; i < board.length;i++){\n\t\t\t\tfor (int j = 0;j < board[i].length;j++) {\n\t\t\t\t\tSystem.out.print(board[i][j] + \" \");\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Attempting to solve board ...\");\n \n\t\tQueue node_queue = new Queue();\n\t\tBoard start_board = new Board(board);\n\t\tint goal_board [][] = {{1,2,3},{4,5,6},{7,8,0}}; \n\t\tBoard goal = new Board(goal_board);\n\t\t//check if the start board is the solved board\n\t\tif(start_board.compare(goal)){\n\t\t\treturn true;\n\t\t}\n\t\t//new tree for unique moves; root node is start board\n\t\tBoard_Tree result_tree = new Board_Tree(start_board);\n\t\tnode_queue.enqueue(start_board);\n\t\t//add root node string representation to hashset\n\t\tvertex_check.add(start_board.board_string);\n\t\twhile(!node_queue.isEmpty()){\n\t\t\tBoard v = node_queue.dequeue();\n\t\t\tcompute_possible_moves(v);\n\t\t\tfor(Board s: possible_boards){\n\t\t\t\tif(s.compare(goal)){\n\t\t\t\t\tresult_tree.insert(v,s);\n\t\t\t\t\tresult_tree.goal_board(s);\n\t\t\t\t\treturn true;\n\t\t\t\t}else if(!(vertex_check.contains(s.board_string))){\n\t\t\t\t\tvertex_check.add(s.board_string);\n\t\t\t\t\tnode_queue.enqueue(s);\n\t\t\t\t\tresult_tree.insert(v,s);\n\t\t\t\t}else{\n\t\t\t\t\t//ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "int nDiagonalRight(int n, int[][] board, int playerNumber, int width, int height, int connectN){\r\n\t\t//int max = 0;\r\n\t\tint num = 0;\r\n\t\t//int opponentNumber = (playerNumber==1) ? 2 : 1;\r\n\t\tfor(int i=0; i < (width-connectN); i++){\r\n\t\t\tfor (int j=0; j<(height-connectN); j++){\r\n\t\t\t\tif (n == 2) {\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (n == 3){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+2][j+2] == playerNumber){\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(n == 4){\r\n\t\t\t\t\tif(board[i][j] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+1][j+1] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+2][j+2] == playerNumber &&\r\n\t\t\t\t\t\t\tboard[i+3][j+3] == playerNumber){\r\n\t\t\t\t\t\tnum++;\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 num;\r\n\t}", "public int numSquaresii(int n) {\n int[] result = new int[n + 1];\n result[0]=0;\n for(int i=1;i<n+1;i++){\n int minSquare=Integer.MAX_VALUE;\n for(int j=1;j*j<=i;j++){\n minSquare=Math.min(minSquare,result[i-j*j]+1);\n }\n result[i]=minSquare;\n }\n return result[n];\n }", "private boolean isValid(char [][] nQueens, int row, int col, int n){\n\t\tfor(int i=0;i!=row;i++){\n\t\t\tif(nQueens[i][col] == 'Q') return false;\n\t\t}\n\t\t//diagonal\n\t\tfor(int i=row-1, j=col-1;i>=0 &&j>=0;i--,j--){\n\t\t\tif(nQueens[i][j] == 'Q') return false;\n\t\t}\n\t\t//check another diagonal\n\t\tfor(int i=row-1, j=col+1;i>=0 && j<n; i--,j++){\n\t\t\tif(nQueens[i][j] == 'Q') return false;\n\t\t}\n\t\treturn true;\n\t}", "public void countSolutionsH(int c){\n if(c == board.length){\n counter ++;\n return;}\n for(int i = 0; i < board.length; i++){\n // if free space add a queen\n if(board[i][c] == 0){\n edit(i, c, true);\n //move to next column\n countSolutionsH(c + 1);\n // backtrack and try row underneath\n edit(i, c, false);}}\n }", "public List<List<String>> solveNQueens(int n) {\n N = n;\n results = new ArrayList<List<String>>();\n\n putQueenInRow(0, null, null);\n\n return results;\n }", "ArrayList<ArrayList<String>> solveNQueens(int n) {\n // write your code here\n\n ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n ArrayList<Integer> solution = new ArrayList<Integer>();\n\n helper(res, solution, n);\n\n for(int i = 0; i < res.size(); i++){\n ArrayList<Integer> temp = res.get(i);\n ArrayList<String> str = new ArrayList<String>();\n StringBuilder s = new StringBuilder();\n for(int j = 0; j < n; j++){\n int position = temp.get(j);\n\n for(int k = 0; k < n; k++){\n if(k == position)\n s.append('Q');\n else\n s.append('.');\n }\n str.add(s.toString());\n s = new StringBuilder();\n }\n\n result.add(str);\n }\n\n return result;\n }", "int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }", "private void helper(int n, List<Integer> cur, List<List<Integer>> result) {\n\t\tif (cur.size() == n) {\n\t\t\tresult.add(new ArrayList<Integer>(cur));\n\t\t\treturn;\n\t\t}\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t// check if putting a queen at column i at current row is valid.\n\t\t\tif (valid(cur, i)) {\n\t\t\t\tcur.add(i);\n\t\t\t\thelper(n, cur, result);\n\t\t\t\tcur.remove(cur.size() - 1);\n\t\t\t}\n\t\t} // end for\n\t}", "public static boolean solve(int[][] board) {\nfor (int x=0; x<9; x++) {\n for (int y=0; y<9; y++) {\nif (board[x][y] == 0) {\n \n // Try each possibile value in this space\n // and see if the rest of the puzzle can be filled in.\n for (board[x][y]=1; board[x][y]<=9; board[x][y]++) {\n if (isLegal(board) && solve(board)) {\n return true;\n }\n }\n \n // There is no value that we can put in the first\n // empty space that was found, so the puzzle is\n // unsolvable given the values put in up to this\n // point.\n board[x][y] = 0;\n return false;\n}\n }\n}\n \n// There were no empty spaces to fill in, so the\n// puzzle must be solved.\nreturn true;\n }", "static int numberAmazonTreasureTrucks(int rows, int column,\n\t\t\t\t\t\t\t\t List<List<Integer> > grid)\n {\n // WRITE YOUR CODE HERE\n int count = 0;\n for(int i=0;i<rows;i++) {\n for(int j=0;j<column;j++) {\n if(grid.get(i).get(j) == 1) {\n count++;\n markNeighbours(grid, i, j, rows, column);\n }\n }\n }\n return count;\n }", "public Board(int n){\n attackLeftDiag = new boolean[2*n - 1];\n attackRightDiag = new boolean[2*n - 1];\n attackSide = new boolean[n];\n \n sizeOfBoard = n;\n numberOfQueensPlaced = 0;\n \n rowUsedByColNumber = new int[n];\n validConfigOfQueens = new ArrayList<String[]>();\n QueenInRow = generatePositions();\n }", "int countSusbset(int n, int w){\n int dp[][] = new int[n+1][w+1];\n for(int i=0;i<=n;i++){\n for(int j=0;j<=w;j++){\n //when no items are there and target sum is 0, only one empty subset is possible\n if(i == 0 && j == 0){\n dp[i][j] = 1;\n }\n //no items left and target sum is greater than 0, no set is possible\n else if(i == 0 && j > 0){\n dp[i][j] = 0; \n }\n //if target sum is 0, no matter how many items we have , only one empty subset is possible\n else if(j == 0){\n dp[i][j] = 1;\n }\n //since item > target sum, so exclude\n else if(arr[i-1] > j){\n dp[i][j] = dp[i-1][j];\n }else{\n //two cases include and exclude\n dp[i][j] = dp[i-1][j] + dp[i-1][j - arr[i-1]];\n }\n }\n }\n return dp[n][w];\n}", "public int numberofDistinctIslands(int[][] grid) {\n int rows = grid.length;\n if (rows == 0){\n return 0;\n }\n int cols = grid[0].length;\n int count = 0;\n\n visited = new boolean[rows][cols];\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n visited[i][j] = false;\n }\n }\n\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (grid[i][j] == 1 && !visited[i][j]){\n dfs(grid, i, j, rows, cols);\n count++;\n }\n }\n }\n\n System.out.println(count);\n return count;\n }", "public int numSquares(int n) {\n int[] dp = new int[n + 1];\n Arrays.fill(dp, Integer.MAX_VALUE);\n dp[0] = 0;\n // pre-calculate the square numbers.\n int maxSquareIndex = (int) Math.sqrt(n) + 1;\n int squareNums[] = new int[maxSquareIndex];\n for (int i = 1; i < maxSquareIndex; ++i) {\n squareNums[i] = i * i;\n }\n\n for (int i = 1; i <= n; ++i) {\n for (int s = 1; s < maxSquareIndex; ++s) {\n if (i < squareNums[s])\n break;\n dp[i] = Math.min(dp[i], dp[i - squareNums[s]] + 1);\n }\n }\n return dp[n];\n }", "public static int numTrees(int n){\n int[] dp = new int[n+1];\n dp[0] = 1;\n for (int i = 1; i <= n; i++){\n for (int j = 0; j < i; j++){\n dp[i] += dp[j] * dp[i-1-j];\n }\n }\n\n return dp[n];\n }", "public static int numSquares1(int n) {\n\t\t int[] table = new int[n+1] ;\n\t\t Arrays.fill(table, n+1);\n\t\t int m = (int)Math.sqrt(n) + 1;\n\t\t int i = 0;\n\t\t table[0] = 0;\n\t\t while(i++ <= m ){\n\t\t\t for(int j = 0; j < n+1; j++){\n\t\t\t\t int x = j - (i * i) >= 0 ? table[j - (i * i)] : n+1;\n\t\t\t\t table[j] = Math.min(table[j], x + 1);\n\t\t\t }\n\t\t }\n\t \n\t return table[n]; \n\t \n\t }", "public Board(int n){\n openPositions = new boolean[n][n];\n numberOfQueensPlaced = 0;\n rowUsedByColNumber = new int[n];\n validConfigOfQueens = new ArrayList<String[]>();\n sizeOfBoard = n;\n QueenInRow = generatePositions();\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint [][][] dp = new int[n+1][m+1][m+1];\n\t\tint [][] arr = new int[n+1][m+1];\n\t\tint max = 1;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (arr[i][j] == 1) {\n\t\t\t\t\tfor (int z = j; z <= m && arr[i][z] == 1; z++) {\n\t\t\t\t\t\tdp[i][j][z] = dp[i-1][j][z] + 1;\n\t\t\t\t\t\tmax = Math.max(max, Math.min(dp[i][j][z], z-j+1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}", "static long numWays(int index, int m, int n, int[] arr) {\n long count = 0;\n\n\n if (n == 0 || index == (m - 1)) {\n if (index == (m - 1)) {\n arr[index] = n;\n }\n// for (int x : arr) {\n// System.out.print(x + \",\");\n// }\n// System.out.println();\n return 1;\n }\n\n if (n < 0 || index >= m) {\n return 0;\n }\n\n\n String key = index(arr, index, m, n);\n if (dp.containsKey(key)) {\n return dp.get(key);\n }\n\n\n for (int i = 0; i <= n; i++) {\n arr[index] = i;\n count += numWays(index + 1, m, n - i, arr);\n// for (int j = index + 1; j < arr.length; j++) {\n// arr[j] = 0;\n// }\n }\n\n dp.put(key, count % prime);\n return count % prime;\n }", "public int conflicts() {\n int total = 0;\n int dist;\n if (!isValid()) return 0;\n for (int r = 0; r < Board.dim; r++) {\n int row = r*Board.dim; \n for (int i = row; i < row + Board.dim; i++)\n for (int j = i + 1; j < row + Board.dim; j++) \n if (Board.rowOf[state[i]] == r && \n Board.rowOf[state[j]] == r &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n }\n for (int col = 0; col < Board.dim; col++) \n for (int i = col; i < state.length - Board.dim; i+= Board.dim) {\n for (int j = i + Board.dim; j < state.length; j+= Board.dim) \n if (Board.colOf[state[i]] == col &&\n Board.colOf[state[j]] == col &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n } \n return total; \n }", "public static int leastNumberOfPerfectSquares(int n)\n {\n int max = (int)Math.sqrt(n);\n\n int [] dp = new int[n + 1];\n Arrays.fill(dp, Integer.MAX_VALUE);\n\n for(int i = 1; i <= n; ++i)\n {\n for(int j = 1; j <= max; ++j)\n {\n if(i == j * j)\n {\n dp[i] = 1;\n }\n else if( i > j * j)\n {\n dp[i] = Math.min(dp[i], dp[i - j * j] + 1);\n }\n }\n }\n return dp[n];\n }", "public void wallsAndGates(int[][] rooms) {\n if (rooms == null || rooms.length == 0 || rooms[0] == null || rooms[0].length == 0)\n return;\n\n Queue<int[]> queue = new LinkedList<>();\n\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0)\n queue.add(new int[]{i,j});\n }\n }\n\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0];\n int col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row+1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE){\n rooms[row][col -1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col +1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n\n }", "private static boolean placeQueen(char[][] board, int row, int col) {\n\n\t\tif (row > board.length || col > board[0].length) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tboard[row][col] = 'Q';\n\t\t\treturn true;\n\t\t}\n\t}", "public static void solve(char[][] board) {\n\t\t\n\t\tint height = board.length;\n\t\tif(height==0){\n\t\t\treturn;\n\t\t}\n\t\tint width = board[0].length;\n\t\t\n\t\tLinkedList<int[]> queue = new LinkedList<int[]>();\n\t\t//top edge & bottom edge\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tif(board[0][i]=='O'){\n\t\t\t\tint[] coord = {0, i};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t\t\n\t\t\tif(board[height-1][i]=='O'){\n\t\t\t\tint[] coord = {height-1, i};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//left edge & right edge\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tif(board[i][0]=='O'){\n\t\t\t\tint[] coord = {i, 0};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t\t\n\t\t\tif(board[i][width-1]=='O'){\n\t\t\t\tint[] coord = {i, width-1};\n\t\t\t\tqueue.add(coord);\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile(queue.size()>0){\n\t\t\tint[] coord = queue.removeLast();\n\t\t\tint row = coord[0];\n\t\t\tint column = coord[1];\n\t\t\tif(board[row][column]=='O'){\n\t\t\t\tboard[row][column]='.';\n\t\t\t}\n\t\t\t//check left cell.\n\t\t\tif(column-1>0 && board[row][column-1]=='O'){\n\t\t\t\tint[] newCoord = {row, column-1};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check right cell.\n\t\t\tif(column+1 < width-1&& board[row][column+1]=='O'){\n\t\t\t\tint[] newCoord = {row, column+1};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check upper cell.\n\t\t\tif(row-1>0 && board[row-1][column]=='O'){\n\t\t\t\tint[] newCoord = {row-1, column};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t\t\n\t\t\t//check lower cell.\n\t\t\tif(row+1<height-1 && board[row+1][column]=='O'){\n\t\t\t\tint[] newCoord = {row+1, column};\n\t\t\t\tqueue.add(newCoord);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//convert \".\" to \"O\" and \"O\" to \"X\".\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif(board[i][j]=='.'){\n\t\t\t\t\tboard[i][j] = 'O';\n\t\t\t\t}else if(board[i][j]=='O'){\n\t\t\t\t\tboard[i][j] = 'X';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }", "public int numTrees(int n) {\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n for (int i=2; i<=n; i++) {\n for (int j=0; j<i; j++) {\n dp[i] = dp[i] + dp[j]*dp[i-j-1];\n }\n }\n \n return dp[n];\n }", "public int numTrees(int n) {\n if (n==0) return 1;\n int[] dp = new int[n+1];\n dp[0] = dp[1] = 1;\n for (int i=2;i<=n;i++) {\n for (int j=1;j<=i;j++) {\n dp[i] += dp[j-1] * dp[i-j];\n }\n }\n return dp[n];\n }", "public void findMaxComb() {\n\t\tHashMap<Integer, HashSet<Integer>> adj = new HashMap<Integer, HashSet<Integer>>();\n\t\tfor (int row=0; row< w; row++) {\n\t\t\tfor (int col=0; col<l; col++) {\n\t\t\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\t\t\t//go left\n\t\t\t\tif (inBoard(row, col-1) && visited[row][col-1] != visited[row][col]) //in board and not equal\n\t\t\t\t\ths.add(visited[row][col-1]);\n\n\t\t\t\t//go up\n\t\t\t\tif (inBoard(row-1, col) && visited[row-1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row-1][col]);\n\n\t\t\t\t//go right\n\t\t\t\tif (inBoard(row, col+1) && visited[row][col+1] != visited[row][col])\n\t\t\t\t\ths.add(visited[row][col+1]);\n\n\t\t\t\t//go down\n\t\t\t\tif (inBoard(row+1, col) && visited[row+1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row+1][col]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (adj.containsKey(visited[row][col])) {\n\t\t\t\t\tHashSet<Integer> tt = adj.get(visited[row][col]);\n\t\t\t\t\ttt.addAll(hs);//union, return boolen\n\t\t\t\t\tadj.put(visited[row][col], tt); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tadj.put(visited[row][col], hs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tint tempMax = 0;\n\t\tfor (Integer key : adj.keySet()) {\n\t\t\tfor (Integer ele : adj.get(key)) {\n\t\t\t\ttempMax = Math.max(tempMax, map.get(key) + map.get(ele));\n\t\t\t}\n\t\t}\n\t\tmaxComb = tempMax;\n\t}", "public static void queenSet() {\n\n boolean[][] boxes = new boolean[4][4];\n // System.out.println(queenPermutation2D(boxes, 4, 0, \"\"));\n System.out.println(queenCombination2D(boxes, 4, 0, \"\"));\n }", "public void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) return;\n Queue<int[]> queue = new LinkedList<>();\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0) queue.add(new int[]{i, j});\n }\n }\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0], col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row + 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE) {\n rooms[row][col - 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col + 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n }", "public static void printQueens(int[] q) {\n int n = q.length;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n System.out.print(\"|\");\n if (q[i] == j) System.out.print(\"Q\");\n else System.out.print(\" \");\n }\n System.out.println(\"|\");\n }\n System.out.println();\n }", "public List<int[][]> evaluate(IBoard board){\n\n int area = board.getHeight() * board.getWidth();\n\n int[][] newArray = new int[area][2];\n\n int k = 0;\n\n while (k < newArray.length) {\n for (int i = 0; i < board.getHeight(); i++) {\n for (int j = 0; j < board.getWidth(); j++) {\n newArray[k][0] = i;\n newArray[k][1] = j;\n k++;\n }\n }\n }\n\n List<int[][]> Allmoves = new ArrayList<>();\n\n int res = newArray.length / board.getHeight();\n\n /*For rows*/\n int q = 0;\n int w = res;\n\n for (int i = 0; i < res; i++) {\n int[][] arr = new int[res][2];\n\n int e = 0;\n\n for (int j = q; j < w; j++) {\n arr[e][0] = newArray[j][0];\n arr[e][1] = newArray[j][1];\n e++;\n }\n\n w += res;\n q += res;\n\n Allmoves.add(arr);\n\n }\n\n /*For columns*/\n int r = 0;\n for (int i = 0; i < res; i++) {\n\n int[][] arr = new int[res][2];\n int e = 0;\n\n for (int j = 0; j < res; j++) {\n arr[e][0] = newArray[r][0];\n arr[e][1] = newArray[r][1];\n\n r += res;\n e++;\n }\n r = 0;\n r += i + 1;\n\n Allmoves.add(arr);\n }\n\n /*For diagonal - 1*/\n int[][] arr = new int[res][2];\n int d1 = res + 1;\n int d = 0;\n int e = 0;\n for (int i = 0; i < res; i++) {\n arr[e][0] = newArray[d][0];\n arr[e][1] = newArray[d][1];\n d += d1;\n e++;\n }\n\n Allmoves.add(arr);\n\n int[][] arr1 = new int[res][2];\n int d2 = res - 1;\n int D = res - 1;\n int p = 0;\n for (int i = 0; i < res; i++) {\n arr1[p][0] = newArray[D][0];\n arr1[p][1] = newArray[D][1];\n D += d2;\n p++;\n }\n\n Allmoves.add(arr1);\n\n return Allmoves;\n\n }", "public int[][] generateMatrix(int n) {\n\t \n\t int matrix[][] = new int[n][n];\n\t int count = n * n +1;\n int topRow = 0;\n int bottomRow = n-1;\n int leftmostColumn = 0;\n int rightmostColumn = n -1;\n int added = 0;\n\t \n\t \n\t while(leftmostColumn <= rightmostColumn && topRow<= bottomRow && added <= count){\n \n \n \tif(added != count){\n for(int i = leftmostColumn; i <= rightmostColumn;i++){\n \t matrix[topRow][i] = added +1;\n // #arrList.add(matrix[topRow][i]);\n added = added+1;\n /* if(added == count)\n \tbreak;*/\n }\n topRow = topRow +1;\n \t}\n \n \n \tif(added != count){\t\n for(int j = topRow; j <= bottomRow;j++){\n //arrList.add(matrix[j][rightmostColumn]);\n \t matrix[j][rightmostColumn] = added+1;\n added = added+1;\n /*if(added == count)\n \tbreak;*/\n }\n rightmostColumn = rightmostColumn -1;\n \t} \n \t\n \t\n \tif(added != count){\t\n for(int k = rightmostColumn; k >= leftmostColumn; k--){\n \t matrix[bottomRow][k] = added +1;\n //arrList.add(matrix[bottomRow][k]);\n added = added+1;\n /*if(added == count)\n \tbreak;*/\n }\n bottomRow = bottomRow -1;\n \t}\n \t\n \t\n \tif(added != count){\t\n for(int l = bottomRow; l >= topRow ;l--){\n // arrList.add(matrix[l][leftmostColumn]);\n \t matrix[l][leftmostColumn] = added +1;\n added = added+1;\n /*if(added == count)\n \tbreak;*/\n }\n leftmostColumn = leftmostColumn +1;\n \t}\n \n }\n\t \n\t return matrix;\n \n}", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}", "public static int[][] task9_spiralGenerate(int n) {\n\t\tif (n <= 0) {\n\t\t\treturn new int[][] {};\n\t\t}\n\t\tint rLen = n;\n\t\tint cLen = n;\n\t\tint[][] matrix = new int[n][n];\n\t\tint leftB = 0, rightB = cLen - 1;\n\t\tint upperB = 0, lowerB = rLen - 1;\n\t\tint counter = 1;\n\t\twhile (true) {\n\t\t\tfor (int j = leftB; j <= rightB; j++) {\n\t\t\t\tmatrix[upperB][j] = counter++;\n\t\t\t}\n\t\t\tupperB++;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int i = upperB; i <= lowerB; i++) {\n\t\t\t\tmatrix[i][rightB] = counter++;\n\t\t\t}\n\t\t\trightB--;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int j = rightB; j >= leftB; j--) {\n\t\t\t\tmatrix[lowerB][j] = counter++;\n\t\t\t}\n\t\t\tlowerB--;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (int i = lowerB; i >= upperB; i--) {\n\t\t\t\tmatrix[i][leftB] = counter++;\n\t\t\t}\n\t\t\tleftB++;\n\t\t\tif (leftB > rightB || upperB > lowerB) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn matrix;\n\t }", "private boolean isSafe(int row, int col, int[] queens) {\n int hillCol = col+1, daleCol = col-1;\n for(int i=row-1; i>=0; i--) {\n if(queens[i] == col || queens[i] == hillCol++ || queens[i] == daleCol--) \n return false;\n }\n \n return true;\n }", "public static int numTrees(int n) {\n\n int[] count = new int[n + 1];\n\n count[0] = 1;\n count[1] = 1;\n count[2] = 2;\n\n if (count[n] != 0) return count[n];\n\n // Get from count[1] to count[n]\n // G(n) = ∑ i=1ton, G(i−1)⋅G(n−i)\n for (int j = 3; j <= n; j++) {\n int total = 0;\n for (int i = 1; i <= j; i++) {\n int llen = i - 1;\n int rlen = j - i;\n total += (count[llen] * count[rlen]);\n }\n count[j] = total;\n }\n\n return count[n];\n }", "public void computeConflicts() { //compute the number of conflicts to calculate fitness\r\n String board[][] = new String[MAX_LENGTH][MAX_LENGTH]; //initialize board\r\n int x = 0; //row\r\n int y = 0; //column\r\n int tempx = 0; //temprow\r\n int tempy = 0; //temcolumn\r\n\r\n int dx[] = new int[] {-1, 1, -1, 1}; //to check for diagonal\r\n int dy[] = new int[] {-1, 1, 1, -1}; //paired with dx to check for diagonal\r\n\r\n boolean done = false; //used to check is checking fo diagonal is out of bounds\r\n int conflicts = 0; //number of conflicts found\r\n\r\n clearBoard(board); //clears the board into empty strings\r\n plotQueens(board); // plots the Q in the board\r\n\r\n // Walk through each of the Queens and compute the number of conflicts.\r\n for(int i = 0; i < MAX_LENGTH; i++) {\r\n x = i;\r\n y = pos[i];\r\n\r\n // Check diagonals.\r\n for(int j = 0; j < 4; j++) { // because of dx and dy where there are 4 directions for diagonal searching for conflicts\r\n tempx = x;\r\n tempy = y; // store coordinate in temp\r\n done = false;\r\n\r\n while(!done) {//traverse the diagonals\r\n tempx += dx[j];\r\n tempy += dy[j];\r\n\r\n if((tempx < 0 || tempx >= MAX_LENGTH) || (tempy < 0 || tempy >= MAX_LENGTH)) { //if exceeds board\r\n done = true;\r\n } else {\r\n if(board[tempx][tempy].equals(\"Q\")) {\r\n conflicts++;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.conflicts = conflicts; //set conflicts of this particle\r\n }", "public static void compute_possible_moves(Board s){\n\t\tint b [][] = s.board;\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tfor (int i = 0;i < b.length;i++) {\n\t\t\tfor (int j = 0;j < b[i].length;j++) {\n\t\t\t\tif(b[i][j] == 0){\n\t\t\t\t\tx = i;\n\t\t\t\t\ty = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tint left [][];\n\t\tint right [][];\n\t\tint up [][];\n\t\tint down [][];\n\t\tpossible_boards.clear();\n\t\tif(x - 1 != -1 && x >= 0 && x < 3){\n\t\t\t//up is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\n\t\t\tint temp = temporary_board[x - 1][y];\n\t\t\ttemporary_board[x - 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tup = temporary_board;\n\n\t\t\tBoard up_board = new Board(up);\n\t\t\tpossible_boards.add(up_board);\n\n\t\t}\n\t\tif(x + 1 != 3 && x >= 0 && x < 3){\n\t\t\t//down is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x + 1][y];\n\t\t\ttemporary_board[x + 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tdown = temporary_board;\n\t\t\tBoard down_board = new Board(down);\n\t\t\tpossible_boards.add(down_board);\n\t\t}\n\t\tif(y - 1 != -1 && y >= 0 && y < 3){\n\t\t\t//left move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y - 1];\n\t\t\ttemporary_board[x][y - 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tleft = temporary_board;\n\t\t\tBoard left_board = new Board(left);\n\t\t\tpossible_boards.add(left_board);\n\n\t\t}\n\t\tif(y + 1 != 3 && y >= 0 && y < 3){\n\t\t\t//right move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y + 1];\n\t\t\ttemporary_board[x][y + 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tright = temporary_board;\n\t\t\tBoard right_board = new Board(right);\n\t\t\tpossible_boards.add(right_board);\n\n\t\t}\n\n\t}", "private static int getNoOfWays() {\n int[][] arr = new int[4][4];\n\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 4; j++) {\n if(i == 0 || j == 0) {\n arr[i][j] = 1;\n } else {\n arr[i][j] = arr[i][j - 1] + arr[i - 1][j];\n }\n }\n }\n return arr[3][3];\n }", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "private int count(int row, int col) {\n\tif (row > X || col > Y || row < 0 || col < 0) return 0;\n\tif (row == X && col == Y) return 1;\n\tif (grid[row][col] == -1) return 0;\n\t\n\tif (memo[row][col] != -1) return memo[row][col];\n\t\n\tint ways = 0;\n\tfor (int i = 0; i < 2; ++i) {\n\t ways += count(row + y_dir[i], col + x_dir[i]); \n\t}\n\n\treturn memo[row][col] = ways;\n }", "@Test\n public void testQueenPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(0, chessBoard.getPiece(0, 3).getRow());\n assertEquals(3, chessBoard.getPiece(0, 3).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 3).getRow());\n assertEquals(3, chessBoard.getPiece(7, 3).getColumn());\n }", "int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }", "public static int[][] queenMoves(int[] currentQueen, BoardModel model) {\n\n int[][] moveLevel = new int[10][10];\n boolean[][] visited = new boolean[10][10];\n Queue<int[]> nodesToCheck = new LinkedList<>();\n //initialize the queen array to show the location of the queen and the \n // number of moves it takes to get to the queen. \n int[] initQueen = new int[3];\n initQueen[0] = currentQueen[0];\n initQueen[1] = currentQueen[1];\n initQueen[2] = 0;\n moveLevel[initQueen[0]][initQueen[1]] = initQueen[2];\n nodesToCheck.add(initQueen);\n while (!nodesToCheck.isEmpty()) {\n int[] neighbourNode = nodesToCheck.poll();\n // search nodes above until positions are no longer available; \n for (int i = neighbourNode[0] + 1; i < 10; i++) {\n if (!visited[i][neighbourNode[1]]) {\n if (model.getTile(i, neighbourNode[1]) == BoardModel.POS_AVAILABLE) {\n visited[i][neighbourNode[1]] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = i;\n initCurrentSpot[1] = neighbourNode[1];\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n\n nodesToCheck.add(initCurrentSpot);\n\n } else {\n break;\n\n }\n }\n }\n // search nodes below until positions are no longer available\n for (int i = neighbourNode[0] - 1; i >= 0; i--) {\n if (!visited[i][neighbourNode[1]]) {\n if (model.getTile(i, neighbourNode[1]) == BoardModel.POS_AVAILABLE) {\n visited[i][neighbourNode[1]] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = i;\n initCurrentSpot[1] = neighbourNode[1];\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n\n }\n // search nodes to the right until positions are no longer available\n for (int i = neighbourNode[1] + 1; i < 10; i++) {\n if (!visited[neighbourNode[0]][i]) {\n if (model.getTile(neighbourNode[0], i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0]][i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0];\n initCurrentSpot[1] = i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n\n // search nodes to the left until position are no longer available; \n for (int i = neighbourNode[1] - 1; i >= 0; i--) {\n if (!visited[neighbourNode[0]][i]) {\n if (model.getTile(neighbourNode[0], i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0]][i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0];\n initCurrentSpot[1] = i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n // search nodes diagonally up and right until positions are no longer available;\n // up == decreasing in row, right == increasing in column \n for (int i = 1; neighbourNode[0] - i >= 0 && neighbourNode[1] + i < 10; i++) {\n if (!visited[neighbourNode[0] - i][neighbourNode[1] + i]) {\n if (model.getTile(neighbourNode[0] - i, neighbourNode[1] + i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0] - i][neighbourNode[1] + i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0] - i;\n initCurrentSpot[1] = neighbourNode[1] + i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n\n //search nodes diagonally down and left until positions are no longer available \n for (int i = 1; neighbourNode[0] + i < 10 && neighbourNode[1] - i >= 0; i++) {\n if (!visited[neighbourNode[0] + i][neighbourNode[1] - i]) {\n if (model.getTile(neighbourNode[0] + i, neighbourNode[1] - i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0] + i][neighbourNode[1] - i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0] + i;\n initCurrentSpot[1] = neighbourNode[1] - i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n\n // search nodes diagonally up and left until positions are no longer available \n for (int i = 1; neighbourNode[0] - i >= 0 && neighbourNode[1] - i >= 0; i++) {\n if (!visited[neighbourNode[0] - i][neighbourNode[1] - i]) {\n if (model.getTile(neighbourNode[0] - i, neighbourNode[1] - i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0] - i][neighbourNode[1] - i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0] - i;\n initCurrentSpot[1] = neighbourNode[1] - i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n\n // search nodes diagonally down and right until positions are no longer available\n for (int i = 1; neighbourNode[0] + i < 10 && neighbourNode[1] + i < 10; i++) {\n if (!visited[neighbourNode[0] + i][neighbourNode[1] + i]) {\n if (model.getTile(neighbourNode[0] + i, neighbourNode[1] + i) == BoardModel.POS_AVAILABLE) {\n visited[neighbourNode[0] + i][neighbourNode[1] + i] = true;\n int[] initCurrentSpot = new int[3];\n initCurrentSpot[0] = neighbourNode[0] + i;\n initCurrentSpot[1] = neighbourNode[1] + i;\n initCurrentSpot[2] = neighbourNode[2] + 1;\n moveLevel[initCurrentSpot[0]][initCurrentSpot[1]] = initCurrentSpot[2];\n nodesToCheck.add(initCurrentSpot);\n } else {\n break;\n }\n }\n }\n\n }\n return moveLevel;\n }", "public static boolean allTheQueensAreSafe(ArrayList<String> coordinateStrings, int boardSize)\n\t{\n\t\tint rowFreq[] = new int[boardSize + 1];\n\t\tint columnFreq[] = new int[boardSize + 1];\n\t\tint diagonalFreq1[] = new int[boardSize * 2];\n\t\tint diagonalFreq2[] = new int[boardSize * 2];\n\t\t\n\t\t// If boardSize is zero then there are no queens to attack each other so return true.\n\t\tif (boardSize <= 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Loops throught the ArrayList of n queens checking for possible attacks.\n\t\tfor (String coordinate : coordinateStrings)\n\t\t{\n\t\t\tstringProcessor(coordinate);\n\t\t\t\n\t\t\t// Defensive coding for good measure.\n\t\t\tif (queenRow > boardSize || queenColumn > boardSize)\n\t\t\t{\n\t\t\t\t// False is returned because in this case we are dealing with a rogue queen.\n\t\t\t\t// She can be anywhere on the board at any given time. Very dangerous.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// If there are more than 1 queen in a given row then an attack can be made.\n\t\t\tif (++(rowFreq[queenRow]) > 1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// If there are more than 1 queen in a given column then an attack can be made.\n\t\t\telse if (++(columnFreq[queenColumn]) > 1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// If there is more than 1 queen in a \"top left to bottom right\" diagonal then an \n\t\t\t// attack can be made.\n\t\t\t// NOTE: Each diagonal has the same of row + column, therefore the same index.\n\t\t\telse if (++(diagonalFreq1[queenRow + queenColumn]) > 1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// This utilizes the same logic as the if condition above, but has to flip the rows, such\n\t\t\t// that the same sum for any piece within a \"top right to bottom left\" diagonal is achieved.\n\t\t\t// NOTE: boardSize - queenRow + 1 is what flips the numerical value of a row.\n\t\t\telse if (++(diagonalFreq2[(boardSize - queenRow + 1) + queenColumn]) > 1)\n\t\t\t{\n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "static int numberOfPaths(int m, int n) {\n\t\tint count[][] = new int[m][n];\n\n\t\t// Count of paths to reach any cell in\n\t\t// first column is 1\n\t\tfor (int i = 0; i < m; i++)\n\t\t\tcount[i][0] = 1;\n\n\t\t// Count of paths to reach any cell in\n\t\t// first column is 1\n\t\tfor (int j = 0; j < n; j++)\n\t\t\tcount[0][j] = 1;\n\n\t\t// Calculate count of paths for other\n\t\t// cells in bottom-up manner using\n\t\t// the recursive solution\n\t\tfor (int i = 1; i < m; i++) {\n\t\t\tfor (int j = 1; j < n; j++)\n\n\t\t\t\t// By uncommenting the last part the\n\t\t\t\t// code calculatest he total possible paths\n\t\t\t\t// if the diagonal Movements are allowed\n\t\t\t\tcount[i][j] = count[i - 1][j] + count[i][j - 1]; // + count[i-1][j-1];\n\n\t\t}\n\t\tfor (int k = 0; k < count.length; k++) {\n\t\t\tfor (int k2 = 0; k2 < count.length; k2++) {\n\t\t\t\tSystem.out.print(count[k][k2] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\treturn count[m - 1][n - 1];\n\t}", "public int updateBoard() {\n clearTemporaryData();\n setUsedValuesbyRow();\n setUsedValuesByColumns();\n setUsedValueInBoxes();\n findUniqueInBoxes();\n updateValues();\n\n return numbers.stream()\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList()).size();\n }", "private void printNQueen(int[] x2) {\n\t\t\r\n\t\tint N = x2.length;\r\n\t\t\r\n\t\tfor(int i=0;i<N;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<N;j++)\r\n\t\t\t{\r\n\t\t\t\tif(x[i] == j)\r\n\t\t\t\t\tSystem.out.print(\"Q\");\r\n\t\t\t\telse \r\n\t\t\t\t\tSystem.out.print(\"*\");\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t}", "public int toLinearIndex(int nQueens) {\n return row * nQueens + column;\n }", "public static void eightQueens(Integer[] rows, int rowNum, ArrayList<Integer[]> boards) {\n \n // If we've gone through every row, add the solution\n if (rowNum > rows.length - 1) {\n boards.add(rows);\n return;\n }\n\n // Try placing a queen in every column of the row\n for (int col = 0; col < rows.length; col++) {\n // If valid, recurse\n if (isValid(rows, rowNum, col)) {\n rows[rowNum] = col;\n eightQueens(rows, rowNum + 1, boards);\n }\n }\n }", "public String[][] plotQueens(String[][] board) {\r\n for(int i = 0; i < MAX_LENGTH; i++) {\r\n board[i][this.pos[i]] = \"Q\";\r\n }\r\n return board;\r\n }", "public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }", "public static int checkNeighbor(int[][] board, int i, int j, int m, int n) {\n int count = 0;\n // from i-1 to i+1\n for (int x = Math.max(i - 1, 0); x <= Math.min(i + 1, m - 1); x++) {\n // from j-1 to j+1\n for (int y = Math.max(j - 1, 0); y <= Math.min(j + 1, n - 1); y++) {\n // if board[x][y] is alive now, add count\n count += board[x][y] & 1;\n }\n }\n count -= board[i][j] & 1;\n return count;\n }", "public int numTrees(int n) {\n if(n<=1)\n return 1;\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n dp[2] = 2;\n \n for(int i=3;i<=n;i++){\n int sum = 0;\n for(int a=0;a<i;a++){\n sum+=dp[0+a]*dp[i-1-a];\n }\n dp[i] = sum;\n //if i is odd then add the i/2 dp after you multiply by 2\n }\n return dp[n];\n }", "@SuppressWarnings(\"Duplicates\")\n public static Solver makeNQueenWithBinaryConstraints(int n){\n Solver solver = new Solver();\n IntVar[] vars = new IntVar[n];\n for (int i = 0; i < vars.length; i++) {\n vars[i] = VariableFactory.enumerated(\"Q_\" + i, 1, n, solver);\n }\n solver.addHook(\"vars\", vars);\n for (int i = 0; i < n - 1; i++) {\n for (int j = i + 1; j < n; j++) {\n int k = j - i;\n solver.post(IntConstraintFactory.arithm(vars[i], \"!=\", vars[j]));\n solver.post(IntConstraintFactory.arithm(vars[i], \"!=\", vars[j], \"+\", -k));\n solver.post(IntConstraintFactory.arithm(vars[i], \"!=\", vars[j], \"+\", k));\n }\n }\n return solver;\n }", "public int[][] getMovesQueen(Piece p) {\n x = p.getX();\n y = p.getY();\n int temp[][] = getMovesBishop(p);\n int legalMoves[][] = getMovesRook(p);\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n if (temp[i][j] == 1) {\n legalMoves[i][j] = 1;\n }\n }\n }\n return legalMoves;\n }", "public int numTrees(int n) {\n if(n == 0 || n == 1 || n == 2)\n return n;\n int[] c = new int[n + 1];\n c[2] = 2;\n c[3] = 5;\n for(int i = 4; i < n + 1; i++){\n for(int j = 2; j < i; j++)\n c[i] += 2 * (c[j]);\n }\n return c[n];\n }", "public int numTrees(int n) {\n int[] table = new int[n+1];\n table[0] = 1;\n table[1] = 1;\n for (int i=2; i<=n ;i++) {\n for (int j=0; j<i; j++) {\n table[i] = table[i] + table[j] * table[i-j-1];\n }\n \n }\n \n return table[n];\n }", "public int[] hasNSequentially(int lengthOfHand) {//check for Ace case //need to NOT ALLOW DUPLICATES\n ArrayList<Card> handList = new ArrayList<Card>();\n int solution[] = {0, 0};//number in a row, lowest number of that\n boolean foundSomeNInAFow = false;\n int hasAce = 0;\n\n int usedNumbers[] = new int[13];//2,3,4,5,6,7,8,9,10,j,q,k,a --> THIS HANDLES THE ACE CASE\n for (int i = 0; i < lengthOfHand; i++) {//was\n usedNumbers[allCards[i].value - 2]++;//USED\n if (usedNumbers[allCards[i].value - 2] == 1) {//handles NOT having doubles of numbers like 2 3 4 4 5 \n handList.add(this.allCards[i]);\n if (this.allCards[i].value == 14) {\n Card c = new Card(1, this.allCards[i].suit);\n handList.add(0, c);//add to front..shifts elements to right\n }\n }\n }\n\n for (int i = 0; i < handList.size() - 4; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 4; j++) {//was 4\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 4) {//was 4\n foundSomeNInAFow = true;\n solution[0] = 5;\n solution[1] = val;\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 3; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 3; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 3) {\n // System.out.println(\"yes 4 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 4;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 2; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 2; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 2) {\n // System.out.println(\"yes 3 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 3;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 1; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 1; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 1) {\n //System.out.println(\"yes 2 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 2;\n solution[1] = val;\n\n }\n }\n }\n }\n\n return solution;//return at end that way if there is 2,3,5,7,8 it returns 7 8 not 2 3\n\n }", "public int[][] generateMatrix(int n) {\n int[][] result = new int[n][n];\n int val = 1;\n int rowBegin = 0;\n int colBegin = 0;\n int rowEnd = n - 1;\n int colEnd = n - 1;\n while (rowBegin <= rowEnd && colBegin <= colEnd) {\n // travel right\n for (int j = colBegin; j <= colEnd; j++) {\n result[rowBegin][j] = val++;\n }\n rowBegin++;\n // travel down\n for (int i = rowBegin; i <= rowEnd; i++) {\n result[i][colEnd] = val++;\n }\n colEnd--;\n // travel left\n if (rowBegin <= rowEnd) {\n for (int j = colEnd; j >= colBegin; j--) {\n result[rowEnd][j] = val++;\n }\n }\n rowEnd--;\n // travel up\n if (colBegin <= colEnd) {\n for (int i = rowEnd; i >= rowBegin; i--) {\n result[i][colBegin] = val++;\n }\n }\n colBegin++;\n }\n return result;\n\n }", "public int numIslands(char[][] grid) {\n\n int n = grid.length;\n if(n==0)\n return 0;\n int m = grid[0].length;\n if(m==0)\n return 0;\n \n int ans =0;\n for(int i=0;i<n;i++)\n {\n m = grid[i].length;\n for(int j=0;j<m;j++)\n {\n if(grid[i][j]=='1')\n {\n ans++;\n dfs(grid,i,j,n,m);\n }\n }\n }\n return ans;\n }", "public int numIslands(boolean[][] grid) {\n m = grid.length;\n if (m == 0) return 0;\n n = grid[0].length;\n if (n == 0) return 0;\n \n int ans = 0;\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n if (!grid[i][j]) continue;\n ans++;\n dfs(grid, i, j);\n }\n }\n return ans;\n }", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[] array = new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarray[i] = sc.nextInt();\n\t\t}\n\t\tint[][] dp = new int[n][n];\n\t\tint[][] c = new int[n][n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tint count=0,max=0;\n\t\t\tfor(int j=i;j<n;j++)\n\t\t\t{\n\t\t\t\tif(j==i){\n\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\tcount++;\n\t\t\t\t\tc[i][j]=count;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tif(array[j]==array[j-1]){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tif(max<count) {\n\t\t\t\t\t\t\tmax =count;\n\t\t\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\tdp[i][j]=dp[i][j-1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcount =1;\n\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t//System.out.print(dp[i][j]+\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t}\n\t\t\n\t\tfor(int i=0;i<m;i++)\n\t\t{\n\t\t\tint l = sc.nextInt()-1;\n\t\t\tint r = sc.nextInt()-1;\n\t\t\tint k = sc.nextInt();\n\t\t\tif(c[l][r]>k)\n\t\t\t{\n\t\t\t\tSystem.out.println(dp[l][r]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t}\n\t\t}\n\t}", "private int exploreCC(Bitboard board, int posMask, int turn) {\n // (this isn't a real queue... but we're not doing shortest path so its fine)\n int queue = posMask;\n int ccSize = 0;\n while (queue != 0) {\n posMask = queue & ~(queue - 1);\n queue ^= posMask;\n\n if ((visited & posMask) != 0)\n continue;\n\n visited |= posMask;\n\n if (!board.isValid(posMask))\n continue;\n\n if (board.owns(posMask, 1 - turn))\n continue;\n else if (board.owns(posMask, turn)) {\n ccSize++;\n }\n\n queue |= BitMasks.orthogonal.get(posMask);\n }\n return ccSize;\n }", "private static int count(int S[], int m, int n) {\n // If n is o then there is 1 solution\n if (n == 0 ) return 1;\n // If n is less than 0 then no solution exists\n if (n < 0 ) return 0;\n // If there are no coins and n >= 0, then no solution exists\n if (m <= 0 && n >= 1) return 0;\n\n // Count is sum of solution that do not contain mth coin && contain at least one coin mth.\n // Including S[m-1] && excluding S[m-1]\n return count(S, m-1, n) + count(S, m, n-S[m-1]);\n }", "public int[][] generateMatrix(int n) {\n\t\tint[][] res = {};\n\t\tif (n <= 0) {\n\t\t\treturn res;\n\t\t}\n\t\tres = new int[n][n];\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint count = 1;\n\n\t\twhile (n > 0) {\n\t\t\tif (n == 1) {\n\t\t\t\tres[x][y] = count;\n\t\t\t}\n\t\t\t// move right\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y++] = count++;\n\t\t\t}\n\t\t\t// move down\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x++][y] = count++;\n\t\t\t}\n\t\t\t// move left\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y--] = count++;\n\t\t\t}\n\t\t\t// move up\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x--][y] = count++;\n\t\t\t}\n\t\t\tx = x + 1;\n\t\t\ty = y + 1;\n\t\t\tn = n - 2;\n\t\t}\n\t\treturn res;\n\t}", "public static int fittnes(int [] tablero){ \n int cantidadchoques=0; // si hay dos numeros iguales,suma un choque\n for(int i=0;i<tablero.length;i++){ \n for(int j=0;j<tablero.length;j++){\n if((i-tablero[i]==j-tablero[j])||(i+tablero[i])==j+tablero[j]){\n cantidadchoques++;\n }\n }\n } \n cantidadchoques=Math.abs(cantidadchoques-tablero.length);\n return cantidadchoques;\n }", "public boolean solveH(int c){\n if(c >= board.length){\n // if all queens are on board return true\n return true;}\n // go through column\n for(int i = 0; i < board.length; i++){\n // if can put queen do so\n if(board[i][c] == 0){\n edit(i, c, true);\n // advance to next column\n if(solveH(c + 1)){\n return true;}\n // if it doesn't work out go back and try underneath\n edit(i, c, false);}}\n // if all attempts don't work return false\n return false;}", "private int gameV(int i, int j, int x) {\n int count = 2;\n for (int ii = 0; ii < i; ii++) {\n for (int jj = ii + 1; jj < n; jj++) {\n if (ii != x && jj != x) count++;\n }\n }\n for (int jj = i + 1; jj < j; jj++) {\n if (jj != x) count++;\n }\n return count;\n }", "public static void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) {\n return;\n }\n\n int m = rooms.length;\n int n = rooms[0].length;\n\n Queue<int[]> queue = new LinkedList();\n boolean[][] visited = new boolean[m][n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n if (rooms[i][j] == 0) {\n queue.add(new int[] {i, j});\n }\n }\n }\n\n int level = 1;\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n int[] cur = queue.poll();\n int currow = cur[0];\n int curcol = cur[1];\n\n int row;\n int col;\n\n //up\n row = currow-1;\n col = curcol;\n if (row >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //down\n row = currow+1;\n if (row < m) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //left\n row = currow;\n col = curcol-1;\n if (col >= 0) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n\n //right\n row = currow;\n col = curcol + 1;\n if (col < n) {\n if (rooms[row][col] == Integer.MAX_VALUE && !visited[row][col]) {\n visited[row][col] = true;\n rooms[row][col] = level;\n queue.add(new int[] {row, col});\n }\n }\n }\n level++;\n }\n\n }" ]
[ "0.7566172", "0.72386944", "0.7140882", "0.71400577", "0.7129468", "0.69935215", "0.69791996", "0.6952163", "0.6739701", "0.66639644", "0.66383576", "0.6598375", "0.65680236", "0.6459679", "0.6411279", "0.63974905", "0.6384336", "0.6358113", "0.6352739", "0.63192636", "0.63016576", "0.62858486", "0.6284122", "0.6227208", "0.61873084", "0.6140768", "0.6111746", "0.6111717", "0.60829383", "0.60813653", "0.607328", "0.6065931", "0.60594183", "0.6044215", "0.60323775", "0.6024307", "0.6013671", "0.6009601", "0.6008676", "0.59949106", "0.59927434", "0.5962098", "0.59451324", "0.5930201", "0.59235334", "0.59153646", "0.5893959", "0.589256", "0.585514", "0.58549803", "0.5849294", "0.58380026", "0.5832629", "0.58284926", "0.5817389", "0.58086014", "0.5803713", "0.5799196", "0.5799192", "0.57977253", "0.5792102", "0.57726985", "0.574489", "0.57370526", "0.5735751", "0.57295525", "0.572779", "0.57077557", "0.5701552", "0.5700133", "0.569596", "0.56951827", "0.56903577", "0.56798506", "0.56782156", "0.5677341", "0.56758755", "0.567285", "0.5666353", "0.56654704", "0.5664328", "0.56637096", "0.5646193", "0.5633443", "0.56270444", "0.56252104", "0.56250924", "0.5621536", "0.56086767", "0.5607855", "0.5604607", "0.5600844", "0.559791", "0.5580856", "0.5572957", "0.55722064", "0.5566166", "0.5564315", "0.555671", "0.5554587" ]
0.7729555
0
we can guarantee that we dont have the same columns because we've alreay checked that before adding, we can also guarantee we don't have the same rows because rows are index based and we're adding a new index each time
Boolean isValid(ArrayList<Integer> colQ){ int curcol = colQ.size() - 1; int row = colQ.get(colQ.size() - 1); int i = 0; int j = 0; for(i = curcol-1, j = 1; i >= 0; i--, j++) { // check if we have two of the same row || check diags if(row == colQ.get(i) || row+j == colQ.get(i) || row-j == colQ.get(i)) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void addUniqueMultiple(List<kelondroRow.Entry> rows) throws IOException {\n TreeMap<Integer, byte[]> indexed_result = super.addMultiple(rows);\r\n // indexed_result is a Integer/byte[] relation\r\n // that is used here to store the index\r\n Iterator<Map.Entry<Integer, byte[]>> i = indexed_result.entrySet().iterator();\r\n Map.Entry<Integer, byte[]> entry;\r\n while (i.hasNext()) {\r\n entry = i.next();\r\n index.puti(entry.getValue(), entry.getKey().intValue());\r\n }\r\n assert this.size() == index.size() : \"content.size() = \" + this.size() + \", index.size() = \" + index.size();\r\n \t\t\r\n }", "public void addColumns(Column[] cols) {\n\n\t\t//\t\t\tAllocate a new array.\n\t\tint number = cols.length;\n\t\tint cnt = columns.length + number;\n\t\tColumn[] newColumns = new Column[cnt];\n\n\t\t// copy current columns.\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//\t\t\tANCA: need to expand the Column[] cols\n\n\t\tfor (int k = 0; k < cols.length; k++) {\n\n\t\t\tString columnClass = (cols[k].getClass()).getName();\n\t\t\tColumn expandedColumn = null;\n\n\t\t\t//if col is the first column in the table add it as is and initialize subset\n\t\t\tint numRows = super.getNumRows();\n\t\t\tif (columns.length == 0) {\n\t\t\t\tif (subset.length == 0) {\n\t\t\t\t\tnumRows = cols[k].getNumRows();\n\t\t\t\t\tsubset = new int[numRows];\n\t\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\t\tsubset[i] = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// LAM-tlr, I moved this down from inside the above condition. If it is\n\t\t\t\t// inside the condition above, after the first column is added, the rest of\n\t\t\t\t// the columns are empty.\n\t\t\t\texpandedColumn = cols[k];\n\t\t\t} else {\n\t\t\t\t// LAM-tlr, I moved this down from above. If we are to use the column\n\t\t\t\t// as is, we don't need to reallocate it.\n\t\t\t\ttry {\n\t\t\t\t\texpandedColumn =\n\t\t\t\t\t\t(Column) Class.forName(columnClass).newInstance();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}\n\t\t\t\texpandedColumn.addRows(numRows);\n\t\t\t\texpandedColumn.setLabel(cols[k].getLabel());\n\t\t\t\texpandedColumn.setComment(cols[k].getComment());\n\t\t\t\texpandedColumn.setIsScalar(cols[k].getIsScalar());\n\t\t\t\texpandedColumn.setIsNominal(cols[k].getIsNominal());\n\n\t\t\t\t//initialize all values as missing for the beginning\n\t\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\t\tObject el;\n\t\t\t\tfor (int i = 0; i < subset.length; i++) {\n\t\t\t\t\tel = cols[k].getObject(i);\n\t\t\t\t\texpandedColumn.setObject(el, subset[i]);\n\t\t\t\t\texpandedColumn.setValueToMissing(false, subset[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewColumns[columns.length + k] = expandedColumn;\n\t\t}\n\t\tcolumns = newColumns;\n\n\t}", "@Override\n public int hashCode() {\n\treturn (rowIndex * 10) + colIndex; \n }", "void incrementColumnIndex();", "void incrementColumnIndex();", "void incrementColumnIndex(int size);", "void incrementColumnIndex(int size);", "private boolean noRepeatedNumbersInColumns() {\n return !this.hasAnyRepeatedInColumn();\n }", "private boolean correctRowNumber()\n {\n \n extraRows = 0;\n final int oldSize = gradeAndSemesterList.size()-1+extraRows;\n \n \n if(gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type2.ordinal()< 2)\n extraRows += 2 - gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type2.ordinal();\n \n extraRows += 3*(this.extraGradeLevel-gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type1.intValue());\n //Debug.line(\"extra rows post correction:\"+extraRows);\n \n \n this.fireTableRowsDeleted(gradeAndSemesterList.size()-1+extraRows, oldSize);\n return true; \n }", "@Test\n public void testCreateRowIndices2(){\n int[][] a = new int[4][2];\n a[0][0] = 0;\n a[0][1] = 0;\n a[1][0] = 0;\n a[1][1] = 1;\n a[2][0] = 0;\n a[2][1] = 2;\n a[3][0] = 2;\n a[3][1] = 1;\n\n double[][] input = new double[4][3];\n\n for(int i = 0 ; i < a.length ; i++){\n input[a[i][0]][a[i][1]] = 1;\n }\n\n int[][] myIndices = HarderArrayProblems.createRowIndices(input);\n for(int i = 0 ; i < a.length ; i++){\n assertEquals(a[i][0], myIndices[i][0]);\n assertEquals(a[i][1], myIndices[i][1]);\n }\n\n }", "@Override\n public boolean equals (Object o) {\n if (!(o instanceof Row)) return false;\n\n Row other = (Row)o;\n if(index!=other.getIndex())\n return false;\n for (int i = 0; i < row.size(); i++)\n if (!row.get(i).equals(other.get(i)))\n return false;\n return true;\n }", "public void update() {\n // If no previous columns, use new columns and return\n if(this.columns == null || this.columns.size() == 0) {\n if(this.newColumns.size() > 0){\n finish(newColumns);\n }\n return;\n }\n \n // If no new columns, retain previous columns and return\n if(this.newColumns.size() == 0) {\n this.index = 0;\n this.column = this.columns.get(index);\n return;\n }\n \n // Merge previous columns with new columns\n // There will be no overlapping\n List<ColumnCount> mergeColumns = new ArrayList<ColumnCount>(\n columns.size() + newColumns.size());\n index = 0;\n newIndex = 0;\n column = columns.get(0);\n newColumn = newColumns.get(0);\n while(true) {\n int ret = Bytes.compareTo(\n column.getBuffer(), column.getOffset(),column.getLength(), \n newColumn.getBuffer(), newColumn.getOffset(), newColumn.getLength());\n \n // Existing is smaller than new, add existing and iterate it\n if(ret <= -1) {\n mergeColumns.add(column);\n if(++index == columns.size()) {\n // No more existing left, merge down rest of new and return \n mergeDown(mergeColumns, newColumns, newIndex);\n finish(mergeColumns);\n return;\n }\n column = columns.get(index);\n continue;\n }\n \n // New is smaller than existing, add new and iterate it\n mergeColumns.add(newColumn);\n if(++newIndex == newColumns.size()) {\n // No more new left, merge down rest of existing and return\n mergeDown(mergeColumns, columns, index);\n finish(mergeColumns);\n return;\n }\n newColumn = newColumns.get(newIndex);\n continue;\n }\n }", "protected void addNewRow(Object[] row) {\n for (int i = 0; i < aggregators.length; i++) {\n if (null != row[i]) {\n this.isNotNullValue[i] = true;\n aggregators[i].agg(row[i]);\n }\n }\n prvKey = (byte[]) row[this.keyIndex];\n calculateMaxMinUnique();\n }", "public void testAddingNewIndexWhenFKContainsIndexColumns() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n\n List<String[]> fkCols = new ArrayList<String[]>();\n String[] fcol1 =\n {\"col1\", \"etable\", \"ecol1\"};\n fkCols.add(fcol1);\n String[] fcol2 =\n {\"col2\", \"etable\", \"ecol1\"};\n fkCols.add(fcol2);\n PSJdbcForeignKey fk = new PSJdbcForeignKey(fkCols.iterator(), PSJdbcTableComponent.ACTION_DELETE);\n List<PSJdbcForeignKey> fks = new ArrayList<>();\n fks.add(fk);\n tableSchema1.setForeignKeys(fks,true);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col2\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_Name\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE).next();\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema1.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema1.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the new index that got created has the same set of\n // columns as foreign key.\n assertTrue(fk.getForeignKeyColumnNames().containsAll(newIndex.getIndexColumnNames()));\n\n // Makes sure if the index name of newly created index has a unique name.\n assertTrue(tableSchema1.doesIndexNameExists(newIndex.getName()));\n\n }", "public void addColumn(Column col) {\n\t\t// Allocate a new array.\n\t\tColumn[] newColumns = new Column[columns.length + 1];\n\n\t\t// copy current columns if any\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//ANCA: need to expand the column\n\t\t// old:\t\tnewColumns[newColumns.length - 1] = col;\n\n\t\tString columnClass = (col.getClass()).getName();\n\t\tColumn expandedColumn = null;\n\t\ttry {\n\t\t\texpandedColumn = (Column) Class.forName(columnClass).newInstance();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t\t//if col is the first column in the table add it as is and initialize subset\n\t\tint numRows = super.getNumRows();\n\t\tif (columns.length == 0) {\n\t\t\tif (subset.length == 0) {\n\t\t\t\tnumRows = col.getNumRows();\n\t\t\t\tsubset = new int[numRows];\n\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\tsubset[i] = i;\n\t\t\t\t}\n\t\t\t\texpandedColumn = col;\n\t\t\t}\n\t\t} else if (numRows == col.getNumRows()) {\n expandedColumn = col;\n } else {\n\t\t\texpandedColumn.addRows(numRows);\n\t\t\texpandedColumn.setLabel(col.getLabel());\n\t\t\texpandedColumn.setComment(col.getComment());\n\t\t\texpandedColumn.setIsScalar(col.getIsScalar());\n\t\t\texpandedColumn.setIsNominal(col.getIsNominal());\n\n\t\t\t//initialize all values as missing for the beginning\n\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\tObject el;\n\t\t\tfor (int i = 0; i < subset.length; i++) {\n if (col.isValueMissing(i)) {\n expandedColumn.setValueToMissing(true, i);\n } else {\n\t\t\t\t el = col.getObject(i);\n\t\t\t\t expandedColumn.setObject(el, subset[i]);\n\t\t\t\t expandedColumn.setValueToMissing(false, subset[i]);\n }\n\t\t\t}\n\t\t}\n\t\tnewColumns[newColumns.length - 1] = expandedColumn;\n\t\tcolumns = newColumns;\n\t}", "public boolean matchSameColumns(Key key);", "private void maybeResize() {\n\t\tif ( this.size <= this.table.length / 2) return;\r\n\t\t\r\n\t\t//store the current entries\r\n\t\tList<Entry<K,V>> temp = new ArrayList<>();\r\n\t\tfor (Entry<K,V> entry : this.entrySet())\r\n\t\t\ttemp.add(temp.size(), entry);\r\n\t\t\r\n\t\t//create new table\r\n\t\tthis.createTable(this.table.length * 2);\r\n\t\t\r\n\t\t//reinsert the old entries (since the capacity has changed, indices will be different)\r\n\t\tfor (Entry<K,V> entry : temp ) \r\n\t\t\tthis.put(entry.getKey(), entry.getValue());\r\n\t\t\r\n\t}", "public boolean createIndex_random(Hashtable<String, Hashtable<Integer,Quad>> ind_buffer){\n\t\tSet<String> keys = ind_buffer.keySet();\n\t\tHashtable<Integer,Quad> list;\n\t\tint part;\n\t\t\n\t\tint type_s, type_o, type1_s, type1_o;\n\t\tint o_bytes, s_bytes, o_bytes1, s_bytes1;\n\t\t\n\t\tString check = \"select resource, part, type_s, type_o, weight, o_bytes, s_bytes from `\"+table+\"` where \";\n\t\tResultSet rs = null;\n\t\tPreparedStatement prepstmt = null;\n\t\tQuad item;\n\t\tString res;\n\t\tfor(String key : keys){\n\t\t\tlist = ind_buffer.get(key);\n\t\t\tif(key.indexOf('\\'') != -1 )\n\t\t\t\tres = key.replaceAll(\"'\", \"''\");\n\t\t\telse\n\t\t\t\tres = key;\n\t\t\tfor(int i : list.keySet()){\n\t\t\t\titem = list.get(i);\n\t\t\t\ttype_s = item.type_s;\n\t\t\t\ttype_o = item.type_o;\n\t\t\t\t\n\t\t\t\to_bytes = item.o_bytes;\n\t\t\t\ts_bytes = item.s_bytes;\n\t\t\t\tpart = i;\n\t\n\t\t\t// seach if have res in table\n\t\t\t\tStringBuilder sql = new StringBuilder();\n\t\t\t\n\t\t\t\tsql.append(check).append(\"resource='\").append(res).append(\"' and part=\").append(part);\n\t\t\t//\trs = search(sql.toString());\n\t\t\t\ttry {\n\t\t\t\t\tprepstmt = conn.prepareStatement(sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\t\t\tResultSet.CONCUR_UPDATABLE);\n\t\t\t\t\trs = prepstmt.executeQuery();\n\t\t\t\t\tif(rs.next()){\n\t\t\t\t\t// updates the records\t\n\t\t\t\t\t\ttype1_s = rs.getInt(\"type_s\");\n\t\t\t\t\t\ttype1_o = rs.getInt(\"type_o\");\n\t\t\t\t\t\to_bytes1 = rs.getInt(\"o_bytes\");\n\t\t\t\t\t\ts_bytes1 = rs.getInt(\"s_bytes\");\n\t\t\t\t\t\t\n\t\t\t\t\t\to_bytes1 += o_bytes;\n\t\t\t\t\t\ts_bytes1 += s_bytes;\n\t\t\t\t\t// unpdate records\t\t\n\t\t\t\t\t\tif(type_s != 0 && type1_s == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\tif(type_o != 0 && type1_o == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes1);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes1);\n\t\t\t\t\t\trs.updateRow();\n\t\t\t\t\t}else {\n\t\t\t\t\t// directly insert the record\n\t\t\t\t\t\trs.moveToInsertRow();\n\t\t\t\t\t\trs.updateString(\"resource\", key);\n\t\t\t\t\t\trs.updateInt(\"part\", part);\n\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes);\n\t\t\t\t\t\trs.insertRow();\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\treturn false;\n\t\t\t\t}finally{\n\t\t\t\t\tif (rs != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trs.close();\n\t\t\t\t\t\t\tprepstmt.close();\n\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean createIndex(Hashtable<String, Hashtable<Integer,Quad>> ind_buffer){\n\t\tSet<String> keys = ind_buffer.keySet();\n\t\tHashtable<Integer,Quad> list;\n\t\tQuad comp;\n\t\tint part;\n\t\tint type1_s, type1_o;\n\t\tint type_s,type_o;\n\t\tint wei, wei1; // compared use\n\t\tint o_bytes, s_bytes, o_bytes1, s_bytes1;\n\t\tString check = \"select resource, part, type_s, type_o, weight, o_bytes, s_bytes from `\"+table+\"` where \";\n\t\t//String insert = \"insert into `sindex` values \";\n//\t\tString update = \"update \"\n\t\tResultSet rs = null;\n\t\tPreparedStatement prepstmt = null;\n\t\tString res;\n\t\tfor(String key : keys){\n\t\t\tlist = ind_buffer.get(key);\n\t\t\tif(key.indexOf('\\'') != -1 )\n\t\t\t\tres = key.replaceAll(\"'\", \"''\");\n\t\t\telse res = key;\n\t\t// hashcode sealing\t\n\t\t//\tkey = String.valueOf(key.hashCode()); \n\t\t\t\n\t\t\tfor(int i : list.keySet()){\n\t\t\t\tcomp = list.get(i);\n\t\t\t\tpart = i;\n\t\t\t\ttype_s = comp.type_s;\n\t\t\t\ttype_o = comp.type_o;\n\t\t\t\twei = comp.weight;\n\t\t\t\to_bytes = comp.o_bytes;\n\t\t\t\ts_bytes = comp.s_bytes;\n\t\t\t// seach if have res in table\n\t\t\t\tStringBuilder sql = new StringBuilder();\n\t\n\t\t\t\tsql.append(check).append(\"resource='\").append(res).append(\"' and part=\").append(part);\n\n\t\t\t\ttry {\n\t\t\t\t\tprepstmt = conn.prepareStatement(sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\t\t\tResultSet.CONCUR_UPDATABLE);\n\t\t\t\t\trs = prepstmt.executeQuery();\n\t\t\t\t\tif(rs.next()){\n\t\t\t\t\t\t// updates the records\t\n\t\t\t\t\t\ttype1_o = rs.getInt(\"type_o\");\n\t\t\t\t\t\ttype1_s = rs.getInt(\"type_s\");\n\t\t\t\t\t\twei1 = rs.getInt(\"weight\");\n\t\t\t\t\t\to_bytes1 = rs.getInt(\"o_bytes\");\n\t\t\t\t\t\ts_bytes1 = rs.getInt(\"s_bytes\");\n\t\t\t\t\t\t// unpdate records\t\n\t\t\t\t\t\twei += wei1;\n\t\t\t\t\t\t/*if(wei < wei1){\n\t\t\t\t\t\t\twei = wei1;\n\t\t\t\t\t\t\tflag2 = 1;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\to_bytes1 += o_bytes;\n\t\t\t\t\t\ts_bytes1 += s_bytes;\n\t\t\t\t\t\tif(type_s != 0 && type1_s == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\tif(type_o != 0 && type1_o == 0)\n\t\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t//\tif(flag2 == 1)\n\t\t\t\t\t\t\trs.updateInt(\"weight\", wei);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes1);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes1);\n\t\t\t\t\t\t\n\t\t\t\t\t\trs.updateRow();\n\t\t\t\t\t}else {\n\t\t\t\t// directly insert the record\n\t\t\t\t\t\n\t\t\t\t/**\t\t(option 1 as below)\t\n\t\t\t\t *\t\tvalue = \"('\"+key+\"',\"+part+\",'\"+type+\"',\"+wei+\")\";\n\t\t\t\t *\t\tupdateSql(insert+value);\n\t\t\t\t */\n\t\t\t\t//\t\toption 2 to realize\t\t\n\t\t\t\t\t\trs.moveToInsertRow();\n\t\t\t\t\t\trs.updateString(\"resource\", key);\n\t\t\t\t\t\trs.updateInt(\"part\", part);\n\t\t\t\t\t\trs.updateInt(\"type_s\", type_s);\n\t\t\t\t\t\trs.updateInt(\"type_o\", type_o);\n\t\t\t\t\t\trs.updateInt(\"weight\", wei);\n\t\t\t\t\t\trs.updateInt(\"o_bytes\", o_bytes);\n\t\t\t\t\t\trs.updateInt(\"s_bytes\", s_bytes);\n\t\t\t\t\t\trs.insertRow();\n\t\t\t\t\t\t\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\tSystem.out.println(key);\n\t\t\t\t}finally{\n\t\t\t\t// ??should wait until all database operation finished!\t\t\n\t\t\t\t\tif (rs != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trs.close();\n\t\t\t\t\t\t\tprepstmt.close();\n\t\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected void checkRow(int row) {\n\tif (row < 0 || row >= rows) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at row=\"+row);\n}", "public void testAddingNewIndex() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n PSJdbcForeignKey fk = createForeignKey(tableSchema1);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col3\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_col1\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE).next();\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema1.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema1.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the number of foreign key columns and eqal to that of\n // index columns.\n assertTrue(fk.getForeignKeyColumnNames().size() == newIndex.getIndexColumnNames().size());\n\n // Makes sure if the new index that got created has the same set of\n // columns as foreign key.\n assertTrue(fk.getForeignKeyColumnNames().containsAll(newIndex.getIndexColumnNames()));\n\n // Makes sure if the index name of newly created index has a unique name.\n assertTrue(tableSchema1.doesIndexNameExists(newIndex.getName()));\n\n }", "private void setUsedValuesByColumns() {\n //Loop through each column.\n IntStream.rangeClosed(1,9).forEach(i -> {\n //Loop through each position in the row.\n IntStream.rangeClosed(1,9).forEach(j -> {\n //If this value is not set find all the other values in the row and set \n //the possible values of this item to those that are not currently set.\n int column = i;\n Number currentNumber = numbers.stream()\n .filter(n -> n.getRow() == j)\n .filter(n -> n.getColumn() == column)\n .findAny().get();\n if (currentNumber.getValue() < 1) {\n //Used numbers in this column\n List<Integer> usedNumbers = numbers.stream()\n .filter(n -> n.getValue() > 0)\n .filter(n -> n.getRow() != j)\n .filter(n -> n.getColumn() == column)\n .map(Number::getValue)\n .collect(Collectors.toList());\n\n //Figure out where the numbers are different\n if (currentNumber.getUsedValues() == null){\n currentNumber.setUsedValues(usedNumbers);\n }\n else {\n currentNumber.setUsedValues(\n CollectionUtils.union(currentNumber.getUsedValues(), usedNumbers)\n .stream().collect(Collectors.toList()));\n }\n }\n });\n });\n\n }", "void updateRow(int rowId, int[] newRow) {\n int oldHead = 0;\n int newHead = 0;\n int[] oldRow = this.rows[rowId];\n while (oldHead < oldRow.length && newHead < newRow.length) {\n int oldColId = oldRow[oldHead];\n int newColId = newRow[newHead];\n if (oldColId < newColId) {\n synchronized (this.getColumn(oldColId)) {\n this.getColumn(oldColId).remove(rowId);\n }\n oldHead++;\n } else if (oldColId > newColId) {\n synchronized (this.getColumn(newColId)) {\n this.getColumn(newColId).add(rowId);\n }\n newHead++;\n } else {\n oldHead++;\n newHead++;\n }\n }\n while (oldHead < oldRow.length) {\n int oldColId = oldRow[oldHead];\n synchronized (this.getColumn(oldColId)) {\n this.getColumn(oldColId).remove(rowId);\n }\n oldHead++;\n }\n while (newHead < newRow.length) {\n int newColId = newRow[newHead];\n synchronized (this.getColumn(newColId)) {\n this.getColumn(newColId).add(rowId);\n }\n newHead++;\n }\n this.rows[rowId] = newRow;\n }", "public void testAddingNewIndexWhenIndexContainsFKColumns() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n coldefs.add(new PSJdbcColumnDef(dataTypeMap, \"col3\", PSJdbcTableComponent.ACTION_DELETE, Types.INTEGER, null,\n true, null));\n PSJdbcTableSchema tableSchema1 = createTableSchema(coldefs);\n setPrimaryKey(tableSchema1);\n\n List<String[]> fkCols = new ArrayList<String[]>();\n String[] fcol1 =\n {\"col1\", \"etable\", \"ecol1\"};\n fkCols.add(fcol1);\n PSJdbcForeignKey fk = new PSJdbcForeignKey(fkCols.iterator(), PSJdbcTableComponent.ACTION_DELETE);\n List<PSJdbcForeignKey> fks = new ArrayList<>();\n fks.add(fk);\n tableSchema1.setForeignKeys(fks,true);\n\n List<String> indexCols = new ArrayList<String>();\n indexCols.add(\"col1\");\n indexCols.add(\"col2\");\n PSJdbcIndex index1 = new PSJdbcIndex(\"IX_Name\", indexCols.iterator(), PSJdbcTableComponent.ACTION_CREATE);\n tableSchema1.setIndex(index1);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema1.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n PSJdbcIndex newIndex = (PSJdbcIndex) tableSchema2.getIndexes().next();\n\n // Makes sure if the table schema has not changed\n assertTrue((tableSchema1.equals(tableSchema2)));\n\n }", "@Override\n\tpublic void addCol() {\n\t\tif(this.numRows == 0){\n\t\t\tthis.numRows++;\n\t\t}\n\t\tthis.numCols++;\n\t}", "@Test\n public void testCreateRowIndices3(){\n int[][] a = new int[4][2];\n a[0][0] = 0;\n a[0][1] = 0;\n a[1][0] = 0;\n a[1][1] = 1;\n a[2][0] = 0;\n a[2][1] = 2;\n a[3][0] = 2;\n a[3][1] = 1;\n\n double[][] input = new double[4][4];\n\n for(int i = 0 ; i < a.length ; i++){\n input[a[i][0]][a[i][1]] = 1;\n }\n\n int[][] myIndices = HarderArrayProblems.createRowIndices(input);\n for(int i = 0 ; i < a.length ; i++){\n assertEquals(a[i][0], myIndices[i][0]);\n assertEquals(a[i][1], myIndices[i][1]);\n }\n }", "boolean checkNoDuplicateFields() {\n\t if (duplicateNames == null | duplicateNames.isEmpty())\n\t return true;\n\t Iterator iter = duplicateNames.iterator();\n\t String names = \"\";\n\t while (iter.hasNext()) {\n\t names = names + iter.next(); \n\t }\n\t cat.error(loc,DUPLICATE_COLUMN_NAMES,new Object[] {names});\n\t return false;\n\t }", "void calculateLobColumnPositionsForRow() {\n int currentPosition = 0;\n\n for (int i = 0; i < columns_; i++) {\n if ((isNonTrivialDataLob(i))\n && (locator(i + 1) == -1)) // Lob.INVALID_LOCATOR))\n // key = column position, data = index to corresponding data in extdtaData_\n // ASSERT: the server always returns the EXTDTA objects in ascending order\n {\n extdtaPositions_.put(i + 1, currentPosition++);\n }\n }\n }", "Matrix add(Matrix M) {\n if(getSize() != M.getSize()) {\n throw new RuntimeException(\"Matrix Error: Matrices not same size\");\n }\n if (M.equals(this)) return M.scalarMult(2);\n int c = 0, e2 = 0;\n double v1 = 0, v2 = 0;\n List temp1, temp2;\n Matrix addM = new Matrix(getSize());\n for(int i = 1; i <= rows.length; i++) {\n temp1 = M.rows[i-1];\n temp2 = this.rows[i-1];\n if(temp1.isEmpty() && !temp2.isEmpty()) {\n temp2.moveFront();\n while(temp2.index() != -1) {\n addM.changeEntry(i, ((Entry)temp2.get()).column, ((Entry)temp2.get()).value);\n temp2.moveNext();\n }\n }else if(!temp1.isEmpty() && temp2.isEmpty()) {\n temp1.moveFront();\n while(temp1.index() != -1) {\n addM.changeEntry(i, ((Entry)temp1.get()).column, ((Entry)temp1.get()).value);\n temp1.moveNext();\n }\n }else if(!temp1.isEmpty() && !temp2.isEmpty()) {\n temp2.moveFront();\n temp1.moveFront();\n while(temp1.index() != -1 && temp2.index() != -1) {\n if(((Entry)temp1.get()).column == ((Entry)temp2.get()).column) {\n v1 = ((Entry)temp1.get()).value;\n v2 = ((Entry)temp2.get()).value;\n c = ((Entry)temp2.get()).column;\n addM.changeEntry(i, c, (v1+v2));\n temp1.moveNext();\n if(!this.equals(M))\n temp2.moveNext();\n ///if temp1 < temp2\n //this < M\n }else if(((Entry)temp1.get()).column < ((Entry)temp2.get()).column) {\n v1 = ((Entry)temp1.get()).value;\n c = ((Entry)temp1.get()).column;\n addM.changeEntry(i, c, v1);\n temp1.moveNext();\n //if temp1>temp2\n }else if(((Entry)temp1.get()).column > ((Entry)temp2.get()).column) {\n v2 = ((Entry)temp2.get()).value;\n c = ((Entry)temp2.get()).column;\n addM.changeEntry(i, c, v2);\n temp2.moveNext();\n }\n }\n while(temp1.index() != -1) {\n addM.changeEntry( i, ((Entry)temp1.get()).column, ((Entry)temp1.get()).value);\n temp1.moveNext();\n }\n while(temp2.index() != -1) {\n addM.changeEntry(i, ((Entry)temp2.get()).column, ((Entry)temp2.get()).value);\n temp2.moveNext();\n }\n }\n }\n return addM;\n }", "public boolean hasDuplicateColumnNames() {\n\t\tint nmbrOfColumns = this.getAllSelectColumnNames().size();\n\t\tint nmbrOfcolumnsRemovedDuplicatedColumns = new HashSet<String>(getAllSelectColumnNames()).size();\n\t\tif (nmbrOfColumns == nmbrOfcolumnsRemovedDuplicatedColumns) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private void transformRows() {\n this.rowCounts = this.rowDeduplicator.values().toIntArray();\n }", "@Test\n public void testCreateRowIndices1(){\n\n double[][] input = new double[4][3];\n int[][] myIndices = HarderArrayProblems.createRowIndices(input);\n assertEquals(0, myIndices.length);\n assertEquals(0, myIndices[0].length);\n }", "public boolean addColumns(ArrayList<String> columnNames, ArrayList<ArrayList<String>> columnValues) {\r\n\t\tif(this.df.size() == 0) {\r\n\t\t\t//System.out.println(\"wefweewfwe\");\r\n\t\t\tthis.fieldNames = new String[columnNames.size()];\r\n\t\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\t\tthis.fieldNames[i] = columnNames.get(i);\r\n\t\t\t}\r\n\t\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\t\tthis.columnMapping.put(this.fieldNames[i], i);\r\n\t\t\t}\r\n\r\n\t\t\tint firstSize = columnValues.get(0).size();\r\n\t\t\tfor(ArrayList<String> oneCol : columnValues) {\r\n\t\t\t\tif(oneCol.size() != firstSize) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(columnNames.size() != columnValues.size()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < columnValues.get(0).size(); i++) {\r\n\t\t\t\tthis.df.add(new String[columnNames.size()]);\r\n\t\t\t\tfor(int k = 0; k < columnNames.size(); k++) {\r\n\t\t\t\t\tthis.df.get(i)[k] = columnValues.get(k).get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tint firstSize = columnValues.get(0).size();\r\n\t\tfor(ArrayList<String> oneCol : columnValues) {\r\n\t\t\tif(oneCol.size() != firstSize) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(columnNames.size() != columnValues.size()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(String colName : columnNames) {\r\n\t\t\tif(this.columnMapping.containsKey(colName)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint nsize = this.fieldNames.length;\r\n\t\tfor(int i = 0; i < columnNames.size(); i++) {\r\n\t\t\tthis.columnMapping.put(columnNames.get(i), nsize+i);\r\n\t\t}\r\n\t\t\r\n\t\tString[] newFieldNames = new String[nsize+columnNames.size()];\r\n\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\tnewFieldNames[i] = this.fieldNames[i];\r\n\t\t}\r\n\t\tfor(int i = 0; i < columnNames.size(); i++) {\r\n\t\t\tnewFieldNames[i+nsize] = columnNames.get(i);\r\n\t\t}\r\n\t\tSystem.out.println(Arrays.toString(this.fieldNames));\r\n\t\tSystem.out.println(Arrays.toString(newFieldNames));\r\n\t\tthis.fieldNames = newFieldNames;\r\n\t\tSystem.out.println(Arrays.toString(this.fieldNames));\r\n\t\t\r\n\t\tfor(int i = 0; i < this.nrow(); i++) {\r\n\t\t\tString[] newRow = new String[nsize+columnNames.size()];\r\n\t\t\tfor(int k = 0; k < this.get(i).length; k++) {\r\n\t\t\t\tnewRow[k] = this.get(i, k);\r\n\t\t\t}\r\n\t\t\tfor(int k = 0; k < columnValues.size(); k++) {\r\n\t\t\t\tnewRow[nsize+k] = columnValues.get(k).get(i);\r\n\t\t\t}\r\n\t\t\tthis.df.set(i, newRow);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public synchronized void putMultiple(List<kelondroRow.Entry> rows) throws IOException {\n Iterator<kelondroRow.Entry> i = rows.iterator();\r\n kelondroRow.Entry row;\r\n int pos;\r\n byte[] key;\r\n TreeMap<Integer, kelondroRow.Entry> old_rows_ordered = new TreeMap<Integer, kelondroRow.Entry>();\r\n ArrayList<kelondroRow.Entry> new_rows_sequential = new ArrayList<kelondroRow.Entry>();\r\n assert this.size() == index.size() : \"content.size() = \" + this.size() + \", index.size() = \" + index.size();\r\n while (i.hasNext()) {\r\n row = i.next();\r\n key = row.getColBytes(0);\r\n pos = index.geti(key);\r\n if (pos < 0) {\r\n new_rows_sequential.add(row);\r\n } else {\r\n old_rows_ordered.put(new Integer(pos), row);\r\n }\r\n }\r\n // overwrite existing entries in index\r\n super.setMultiple(old_rows_ordered);\r\n \r\n // write new entries to index\r\n addUniqueMultiple(new_rows_sequential);\r\n assert this.size() == index.size() : \"content.size() = \" + this.size() + \", index.size() = \" + index.size();\r\n }", "@Test\n public void testKeyColumnIndex() throws Exception {\n \tfor(Row r : project.rows) {\n \t\tr.cells.add(0, null);\n \t}\n \tList<Column> newColumns = new ArrayList<>();\n \tfor(Column c : project.columnModel.columns) {\n \t\tnewColumns.add(new Column(c.getCellIndex()+1, c.getName()));\n \t}\n \tproject.columnModel.columns.clear();\n \tproject.columnModel.columns.addAll(newColumns);\n \tproject.columnModel.update();\n \t\n \tAbstractOperation op = new FillDownOperation(\n EngineConfig.reconstruct(\"{\\\"mode\\\":\\\"record-based\\\",\\\"facets\\\":[]}\"),\n \"second\");\n Process process = op.createProcess(project, new Properties());\n process.performImmediate();\n\n Assert.assertEquals(\"c\", project.rows.get(0).cells.get(3).value);\n Assert.assertEquals(\"c\", project.rows.get(1).cells.get(3).value);\n Assert.assertNull(project.rows.get(2).cells.get(3));\n Assert.assertEquals(\"h\", project.rows.get(3).cells.get(3).value);\n }", "void insertEmptyColumns() {\n List<DateTime> starts = new ArrayList<>();\n for (Long startMillis : mColumnsByStartMillis.keySet()) {\n starts.add(new DateTime(startMillis));\n }\n int maxEmptyColumns = 3 / getSegmentStartTimes().length;\n DateTime prev = starts.get(0);\n for (DateTime next : starts) {\n if (!next.isAfter(prev.plusDays(maxEmptyColumns))) {\n for (DateTime dt = prev.plusDays(1); dt.isBefore(next); dt = dt.plusDays(1)) {\n getColumnContainingTime(dt); // creates a column if it doesn't exist yet\n }\n }\n prev = next;\n }\n }", "@Override\n public boolean isUsableIndex(int idx) {\n if ( idx < 0 )\n return false;\n if ( idx >= numDataCols )\n return false;\n return Boolean.TRUE.equals(standardized[idx]);\n }", "private void updateEqualRows(String tableName, String[][] tableData, String[][] selectedCells) \n {\n String[][] modifiedCells = new String[selectedCells.length][selectedCells[0].length];\n// int cont = 0;\n for (int i = 0; i < selectedCells.length; i++) \n {\n for (int j = 0; j < selectedCells[0].length; j++) \n {\n if (!selectedCells[i][j].toString().equals(tableData[i][j].toString())) \n {\n adapter.updateRow(tableName, tableData[0][j], selectedCells[i][j], tableData[i][0]);\n// cont++;\n// System.out.println(\"GOT HERE: \" + cont);\n// System.out.println(\"table name: \" + tableName);\n// System.out.println(\"table data 0j: \" + tableData[0][j]);\n// System.out.println(\"selected cells ij: \" + selectedCells[i][j]);\n// System.out.println(\"tabledata i0: \" + tableData[i][0]);\n// System.out.println(\"\\n\");\n }\n }\n// cont = 0;\n }\n }", "private static boolean checkIsTrue() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(col[i]!=colTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(row[i]!=rowTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void addRow() {\n\t\tif(this.numCols == 0){\n\t\t\tthis.numCols++;\n\t\t}\n\t\tthis.numRows++;\n\t}", "@Override\n\tpublic boolean addCols(Collection<T> valuesIn) {\n\t\tQueue<T> valuesToAdd = new LinkedList<>(valuesIn);\n\t\t\n\t\tlong curCol = this.getNumCols();\n\t\t\n\t\twhile(!valuesToAdd.isEmpty()){\n\t\t\tthis.addCol();\n\t\t\tfor(long i = 0; i < this.getNumRows(); i++){\n\t\t\t\t//add values to new row\n\t\t\t\tif(valuesToAdd.isEmpty()){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.setValue(curCol, i, valuesToAdd.poll());\n\t\t\t}\n\t\t\tcurCol++;\n\t\t}\n\t\treturn true;\n\t}", "private boolean noConflictInColumn(int columnIndex, int number) {\n for (int i = 0; i < 9; i++) {\n if (grid[i][columnIndex] == number) {\n return false;\n }\n }\n return true;\n }", "@Override\npublic boolean equals(Object tbl) {\n Table table;\n\n try {\n table = (Table) tbl;\n } catch (Exception e) {\n return false;\n }\n\n if (getNumRows() != table.getNumRows()) {\n return false;\n }\n\n if (getNumColumns() != table.getNumColumns()) {\n return false;\n }\n\n for (int i = 0; i < getNumRows(); i++) {\n\n for (int j = 0; j < getNumColumns(); j++) {\n\n if (!getObject(i, j).equals(table.getObject(i, j))) {\n return false;\n }\n }\n }\n\n return true;\n\n }", "private void setUsedValuesbyRow() {\n \n //Loop through each row.\n IntStream.rangeClosed(1,9).forEach(i -> {\n //Loop through each position in the row.\n IntStream.rangeClosed(1,9).forEach(j -> {\n //If this value is not set find all the other values in the row and set \n //the possible values of this item to those that are not currently set.\n int row = i;\n Number currentNumber = numbers.stream()\n .filter(n -> n.getRow() == row)\n .filter(n -> n.getColumn() == j)\n .findAny().get();\n //If the value is 0 it is not set\n if (currentNumber.getValue() < 1) {\n //Used numbers in this row\n List<Integer> usedNumbers = numbers.stream()\n .filter(n -> n.getValue() > 0)\n .filter(n -> n.getRow() == row)\n .filter(n -> n.getColumn() != j)\n .map(Number::getValue)\n .collect(Collectors.toList());\n\n //If position currently doesn't have used values then set them to \n //the ones that were found.\n if (currentNumber.getUsedValues() == null){\n currentNumber.setUsedValues(usedNumbers);\n }\n else {\n //Set the position's used values to the union of what it currently has and the\n //identifed used values.\n currentNumber.setUsedValues(\n CollectionUtils.union(currentNumber.getUsedValues(), usedNumbers)\n .stream().collect(Collectors.toList()));\n }\n }\n });\n });\n }", "boolean isNewIndex();", "private void updateCell(byte i, byte j) throws Exception {\n\t\tCell cell = cells[i][j];\n\t\tif (cell.isEmpty()) {\n\t\t\t// check row\n\t\t\tboolean[] inRow = new boolean[10];\n\t\t\tfor (byte n = 0; n < 9; n++) {\n\t\t\t\tif (n != j) {\n\t\t\t\t\tCell c = cells[i][n];\n\t\t\t\t\tif (!c.isEmpty()) {\n\t\t\t\t\t\tbyte v = c.getValue();\n\t\t\t\t\t\tif (inRow[v]) {\n\t\t\t\t\t\t\tthrow new Exception(\"Duplicates at row \" + (i + 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinRow[v] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check column\n\t\t\tboolean[] inCol = new boolean[10];\n\t\t\tfor (byte m = 0; m < 9; m++) {\n\t\t\t\tif (m != i) {\n\t\t\t\t\tCell c = cells[m][j];\n\t\t\t\t\tif (!c.isEmpty()) {\n\t\t\t\t\t\tbyte v = c.getValue();\n\t\t\t\t\t\tif (inCol[v]) {\n\t\t\t\t\t\t\tthrow new Exception(\"Duplicates at column \"\n\t\t\t\t\t\t\t\t\t+ (j + 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinCol[v] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check box\n\t\t\tboolean[] inBox = new boolean[10];\n\t\t\tint qRow = i / 3;\n\t\t\tint qCol = j / 3;\n\n\t\t\tfor (int m = 3 * qRow; m < 3 * qRow + 3; m++) {\n\t\t\t\tfor (int n = 3 * qCol; n < 3 * qCol + 3; n++) {\n\t\t\t\t\tif (m != i || n != j) {\n\t\t\t\t\t\tCell c = cells[m][n];\n\t\t\t\t\t\tif (!c.isEmpty()) {\n\t\t\t\t\t\t\tbyte v = c.getValue();\n\t\t\t\t\t\t\tif (inBox[v]) {\n\t\t\t\t\t\t\t\tthrow new Exception(\n\t\t\t\t\t\t\t\t\t\t\"Duplicates in box having row \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ (i + 1) + \" and column \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ (j + 1));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinBox[v] = true;\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\n\t\t\tbyte rank = 0;\n\t\t\tfor (byte v = 1; v <= 9; v++) {\n\t\t\t\tif (inRow[v] || inCol[v] || inBox[v]) {\n\t\t\t\t\tcell.setAvailable(v, false);\n\t\t\t\t} else {\n\t\t\t\t\tcell.setAvailable(v, true);\n\t\t\t\t\trank++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (rank > 0) {\n\t\t\t\tcell.setRank(rank);\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"No value can be set at row \" + (i + 1)\n\t\t\t\t\t\t+ \" and column \" + (j + 1));\n\t\t\t}\n\t\t}\n\t}", "boolean hasCol();", "private void adjustColumnOffsetsForColumnsPreviouslyCalculated(int index) {\n for (int j = 0; j <= index; j++) {\n columnDataPosition_[j] -= currentRowPosition_;\n }\n }", "private void multiLeafUpdate()\r\n {\n \t\tfor (int i=0;i<this.allCols.size();i++)\r\n \t{\r\n \t\t\tif (this.allCols.get(i).endsWith(HEADER))\r\n \t\t\t{\r\n \t\t\t\tString headerCol=this.allCols.get(i);\r\n \t\t\t\tString col=this.allCols.get(i).replace(HEADER, \"\");\r\n \t\t\t\t\r\n \t\t\t\tthis.requete.append(\"\\n UPDATE \"+this.tempTableA+\" SET i_\"+headerCol+\"=i_\"+col+\" WHERE i_\"+headerCol+\" IS NULL and i_\"+col+\" IS NOT NULL;\");\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n }", "private boolean noConflictInRow(int rowIndex, int number) {\n for (int i = 0; i < 9; i++) {\n if (grid[rowIndex][i] == number) {\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean isUsableIndex(int idx) {\n\t\tif ( idx < 0 )\n\t\t\treturn false;\n\t\tif ( idx >= numDataCols )\n\t\t\treturn false;\n\t\treturn Boolean.TRUE.equals(standardized[idx]);\n\t}", "private void calculateIndex() {\n for(int i=0; i<matrix.length; i++) {\n for(int j=0; j<matrix.length; j++) {\n if(matrix[i][j] == 0) {\n index = (i*matrix.length)+(j+1);\n return;\n }\n }\n }\n }", "public void tableChanged(TableModelEvent e) {\n reallocateIndexes();\n super.tableChanged(e);\n }", "void addRows(int row1, int row2, int k)\r\n {\n \r\n int tmp[] = new int[cols];\r\n \r\n for(int j=0; j<cols; j++)\r\n tmp[j] = k*(matrix[row2][j]);\r\n \r\n for(int j=0; j<cols; j++)\r\n matrix[row1][j]+=tmp[j];\r\n \r\n \r\n }", "public abstract boolean isMissing(int columnIndex);", "public void testAddingNewIndexWithoutIndex() throws Exception\n {\n PSJdbcDataTypeMap dataTypeMap = new PSJdbcDataTypeMap(\"MYSQL\", \"mysql\", null);\n ArrayList<PSJdbcColumnDef> coldefs = createColumnDef(dataTypeMap);\n PSJdbcTableSchema tableSchema = createTableSchema(coldefs);\n setPrimaryKey(tableSchema);\n PSJdbcForeignKey fk = createForeignKey(tableSchema);\n\n Document doc = PSXmlDocumentBuilder.createXmlDocument();\n Element el = tableSchema.toXml(doc);\n PSJdbcTableSchema tableSchema2 = new PSJdbcTableSchema(el, dataTypeMap);\n\n Iterator<?> itIndex = tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE);\n PSJdbcIndex index = (PSJdbcIndex) itIndex.next();\n String IndexName = index.getName();\n String fkcolname = fk.getForeignKeyColumnNames().get(0);\n\n // Makes sure if the table schema has changed\n assertFalse((tableSchema.equals(tableSchema2)));\n\n // Makes sure if a new index definition of non unique have been added to\n // table schema.\n assertFalse((tableSchema.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n assertTrue((tableSchema2.getIndexes(PSJdbcIndex.TYPE_NON_UNIQUE)).hasNext());\n\n // Makes sure if the index name has taken the first foreign key column name.\n assertTrue((StringUtils.equalsIgnoreCase(IndexName, \"IX_\" + fkcolname)));\n\n // Makes sure if the createForeignkeyIndexes attribute for mysql.\n assertTrue(dataTypeMap.isCreateForeignKeyIndexes());\n\n }", "boolean isNeedColumnInfo();", "public int getColumnIndex() {\n/* 2979 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void addIndexWrite(Object key, Object value, BitSet dirty, IndexMetadata idxMeta, long clock, Mutator<byte[]> mutator, EConsistencyLevel level)\n {\n List<Object> propVals = null;\n DynamicComposite colName = new DynamicComposite();\n boolean propertyNotSet = false;\n int ttl = -1;\n for(SimplePropertyMetadata pm : idxMeta.getIndexedProperties())\n {\n Object pval = invokeGetter(pm, value);\n if(pval != null)\n {\n if(propVals == null)\n propVals = new ArrayList<Object>(idxMeta.getIndexedProperties().size());\n\n if(pm.isTtlSet())\n {\n int colTtl = pm.ttl();\n if(ttl < 0 || colTtl < ttl) //min ttl of the indexed properties\n ttl = colTtl;\n }\n propVals.add(pval);\n colName.add(pval);\n }\n else if(!dirty.get(_entityMeta.getPropertyPosition(pm))) //prop value is null and not set\n propertyNotSet = true;\n }\n\n if(propVals == null) //no index property updated\n return;\n \n if(propertyNotSet) //must update none or all of a multi column index\n throw new IllegalArgumentException(\"cannot write a subset of columns to multi-column index: \" + idxMeta);\n \n if(propVals.size() < idxMeta.getIndexedProperties().size()) //some index properties set to null -> entry is removed from index\n return;\n \n colName.add(key);\n \n HColumn<DynamicComposite, byte[]> column = HFactory.createColumn(colName, IDX_COL_VAL, clock, SER_DYNAMIC_COMPOSITE, SER_BYTES);\n \n DynamicComposite rowKey = new DynamicComposite(idxMeta.id());\n \n List<List<Object>> allPartitions = idxMeta.getIndexPartitioner().partitionValue(propVals);\n if(allPartitions.size() != 1)\n throw new IllegalStateException(\"expected single partition but encountered \" + allPartitions.size());\n \n _logger.trace(\"writing to partition {}\", allPartitions.get(0));\n for(Object partitionVal : allPartitions.get(0))\n rowKey.add(partitionVal);\n \n if(ttl > 0)\n column.setTtl(ttl);\n \n mutator.addInsertion(SER_DYNAMIC_COMPOSITE.toBytes(rowKey), _entityMeta.getIndexFamilyName(), column);\n }", "@Override\r\n\tpublic void updateNbCol() {\r\n\t\treturn;\r\n\t}", "private boolean rowCheck() {\n\t\tfor(int[] row : puzzle) {\n\t\t\tfor(int i = 0; i < row.length; i++) {\n\t\t\t\tif(row[i] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < row.length; j++) {\n\t\t\t\t\t\tif(row[i] == row[j])\n\t\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 true;\n\t}", "private static boolean colAreInvalid(int[][] grid) {\n\t\tfor(int i = 0; i < BOUNDARY; i++) {\n\t\t\tList<Integer> row = new ArrayList<>();\n\t\t\tfor(int j = 0; j < BOUNDARY; j++) {\n\t\t\t\trow.add(grid[i][j]);\n\t\t\t}\n\t\t\tif(collectionHasRepeat(row)) return true;\n\t\t}\n\t\treturn false;\n\t}", "protected void checkColumn(int column) {\n\tif (column < 0 || column >= columns) throw new IndexOutOfBoundsException(\"Attempted to access \"+toStringShort()+\" at column=\"+column);\n}", "private boolean checkRowCol(int c1, int c2, int c3) \r\n {\r\n return ((c1 != -1) && (c1 == c2) && (c2 == c3)); //eida ekhon porjonto kaaj e lage nai\r\n }", "private void markRowsAndCols(int row){\n if(row < 0)\n return;\n\n markedRows[row] = true;\n for (int j = 0; j < cols; j++)\n if(j != chosenInRow[row] && source[row][j] == 0) {\n markedCols[j] = true;\n markRowsAndCols(chosenInCol[j]);\n }\n }", "private Vector getModifiedRows()\r\n {\r\n Vector vecUpdatedRows = new Vector();\r\n int rowCount = 0;\r\n \r\n /* CASE #607 Add deletes to the vector before inserts and updates to avoid \r\n * unique constraint error */\r\n \r\n if (vecDeletedRows.size() > 0 )\r\n {//append deleted rows to vecUpdatedRows\r\n for (int row = 0; row < vecDeletedRows.size(); row++)\r\n {\r\n vecUpdatedRows.add(vecDeletedRows.get(row));\r\n } \r\n } \r\n\r\n while(rowCount < tblProtoCorresp.getRowCount())\r\n {// check AC_TYPE field\r\n String tmpACType ;\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowCount), codeTableModel.getColumnCount()-1) != null)\r\n {\r\n vecUpdatedRows.add(getTableRow(rowCount)) ;\r\n }\r\n rowCount++ ;\r\n }//end while\r\n\r\n return vecUpdatedRows ;\r\n }", "public void checkRows() {\n\t\tint [] array = new int [9];\n\n\t\t//store the row in the array from the sudoku board\n\t\tfor (int i = 0; i < sudoku.length; i ++) {\n\t\t\tarray[i] = sudoku[row][i];\n\t\t\t//System.out.print(\"Element \" + i + \" in row \" + row + \" : \" + array[i] + \" \\n\"); \n\t\t}\n\n\t\t//checking for duplicate elements in the array/row\n\t\tfor(int j = 0; j < sudoku.length; j++){\n\t\t\tfor(int k = j+1; k < sudoku.length; k++){\n\t\t\t\tif (array[j] == array[k]) {\n\t\t\t\t\tSystem.out.println(\"Duplicate found in row #\" + row);\n\t\t\t\t\tvalue = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public static boolean haveColumnDuplicates(final Column[] columns)\n {\n boolean duplicates = false;\n for (int j = 0; j < columns.length; j++)\n {\n for (int k = j + 1; k < columns.length; k++)\n {\n if (k != j && columns[k].getName().equals(columns[j].getName()))\n {\n duplicates = true;\n }\n }\n }\n\n return duplicates;\n }", "private static boolean rowAreInvalid(int[][] grid) {\n\t\tfor(int j = 0; j < BOUNDARY; j++) {\n\t\t\tList<Integer> row = new ArrayList<>();\n\t\t\tfor(int i = 0; i < BOUNDARY; i++) {\n\t\t\t\trow.add(grid[i][j]);\n\t\t\t}\n\t\t\tif(collectionHasRepeat(row)) return true;\n\t\t}\n\t\treturn false;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void rehash()\r\n\t{\r\n\t\tint M = table.length;\r\n\t\tMapEntry<K, V>[] origTable = table; // save original\r\n\t\t\r\n\t\t//new table\r\n\t\ttable = new MapEntry[2*M + 1];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\t\r\n\t\tfor (MapEntry<K, V> oe : origTable)\r\n\t\t{\r\n\t\t\tMapEntry<K, V> e = oe;\r\n\t\t\tif (e != null && e != DUMMY) // No need to rehash dummy\r\n\t\t\t{\r\n\t\t\t\tint slot = findSlot(e.getKey(), true);\r\n\t\t\t\ttable[slot] = e;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "boolean hasIndex();", "private BitSet initRowToLayoutBitSet() {\n int rowCount = getItemCount();\n BitSet bitSet = new BitSet(rowCount);\n for (int row = 0; row < rowCount; ++row) {\n if (tableView.isRowFixingEnabled() && tableView.getFixedRows().contains(row)) {\n bitSet.set(row);\n }\n }\n return bitSet;\n }", "Table joinTwoTables(String name, Table t1, Table t2) {\n if (t1.equals(t2)) {\n return t1;\n }\n int sim = 0;\n LinkedList<String> simNames = new LinkedList<>();\n for (String c1 : t1.getColNames()) {\n for (String c2 : t2.getColNames()) {\n if (c1.equals(c2)) {\n sim += 1;\n simNames.addLast(c1);\n }\n }\n }\n if (sim == 0) {\n return noCommonJoin(name, t1, t2);\n }\n //Check matches between similar columns and log the row number per table\n LinkedList<Integer> simRowsT1 = new LinkedList<>();\n HashMap<Integer, LinkedList> t1ToT2 = new HashMap<>();\n LinkedList<LinkedList> totalSimRows = new LinkedList<>();\n\n checkSimColumns(t1, t2, simNames, t1ToT2, simRowsT1, totalSimRows);\n boolean flag = false;\n\n /**Here we check if there is a repetition\n * of the same row equal to the number of similar columns*/\n simRowsT1 = totalSimRows.get(0);\n LinkedHashSet<Integer> similarRow = new LinkedHashSet<>();\n LinkedList<Integer> simRowsTemp;\n LinkedList<Integer> simRowsFinal = new LinkedList<>();\n if (totalSimRows.size() > 1) {\n for (int i = 1; i < totalSimRows.size(); i++) {\n simRowsTemp = totalSimRows.get(i);\n int count = 0;\n for (int j = 0; j < simRowsT1.size(); j++) {\n Integer intTemp = simRowsT1.get(j);\n for (int k = 0; k < simRowsTemp.size(); k++) {\n if (intTemp == simRowsTemp.get(k)) {\n count += 1;\n }\n if (count == sim) {\n similarRow.add(intTemp);\n break;\n }\n }\n }\n }\n } else {\n simRowsFinal = simRowsT1;\n }\n simRowsFinal.addAll(0, similarRow);\n /**Call createSubTable with similar column & rows to generate similarity subTable*/\n Table simTable = t1.similarSubTable(simNames, simRowsFinal);\n /**Call createSubTable with unsimilar column & rows to generate unsimilar subTable from t1*/\n Table unsimT1 = t1.unsimSubTable(simNames, simRowsFinal);\n /**Call createSubTable with unsimilar column & rows to generate unsimilar subTable from t2*/\n if (!flag) {\n for (int i = 0; i < simRowsFinal.size(); i++) {\n simRowsFinal.addLast(\n (Integer) (t1ToT2.get(simRowsFinal.removeFirst())).removeFirst());\n }\n } else {\n int row;\n int size1 = simRowsFinal.size();\n int size2;\n for (int i = 0; i < size1; i++) {\n row = simRowsFinal.removeFirst();\n size2 = (t1ToT2.get(row).size());\n for (int j = 0; j < size2; j++) {\n simRowsFinal.addLast((Integer) (t1ToT2.get(row).removeFirst()));\n }\n }\n }\n Table unsimT2 = t2.unsimSubTable(simNames, simRowsFinal);\n simTable = simTable.naiveJoinTables(unsimT1);\n return simTable.naiveJoinTables(unsimT2);\n }", "void checkSimColumns(Table t1, Table t2, LinkedList<String> simNames, HashMap<Integer,\n LinkedList> t1ToT2, LinkedList<Integer> simRowsT1,\n LinkedList<LinkedList> totalSimRows) {\n boolean flag = false;\n LinkedList<Integer> temp;\n for (String cn : simNames) {\n String[] t1Col = t1.getCol(cn);\n String[] t2Col = t2.getCol(cn);\n for (int i = 0; i < t1Col.length; i++) {\n for (int j = 0; j < t2Col.length; j++) {\n if (t1Col[i].equals(t2Col[j])) {\n simRowsT1.addLast(i);\n if (t1ToT2.containsKey(i)) {\n temp = t1ToT2.get(i);\n temp.addLast(j);\n t1ToT2.put(i, temp);\n flag = true;\n } else {\n temp = new LinkedList<>();\n temp.addLast(j);\n t1ToT2.put(i, temp);\n }\n }\n }\n }\n totalSimRows.addLast(simRowsT1);\n }\n }", "public boolean forUpdateOfColumns() {\n \t\t// by default we report no support\n \t\treturn false;\n \t}", "protected static boolean isColumnsOrderChanged(List<AbstractColumn> newColumns, List<AbstractColumn> oldColumns) {\n // last founded column\n int i = -1;\n for (AbstractColumn col : newColumns) {\n // old column index\n int index = 0;\n // search old column index by new column name\n for ( ; index < oldColumns.size(); index++) {\n if (col.getName().equals(oldColumns.get(index).getName())) {\n break;\n }\n }\n\n if (index == oldColumns.size()) {\n // New column was not found in original table.\n // After this column can be only new columns.\n i = Integer.MAX_VALUE;\n } else if (index < i) {\n // New column was found in original table\n // but one of previous columns was not found\n // or was located on more later index\n return true;\n } else {\n // New column was found in original table.\n // Safe index of column in original table.\n i = index;\n }\n }\n\n return false;\n }", "public int getColumnCount() {\n/* 2881 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void rehash(){\n\t\tHashTable that = new HashTable(2 * this.table.length);\n\t\tfor (int i = 0; i < this.table.length; i++){\n\t\t\tif (this.table[i] != null){\n\t\t\t\tthat.addRecord(this.table[i].getValue());\n\t\t\t}\n\t\t}\n\t\tthis.table = that.table;\n\t\treturn;\n\t}", "private void validateInternalTable(ConnectorTableMetadata meta)\n {\n String table = AccumuloTable.getFullTableName(meta.getTable());\n String indexTable = Indexer.getIndexTableName(meta.getTable());\n String metricsTable = Indexer.getMetricsTableName(meta.getTable());\n\n if (conn.tableOperations().exists(table)) {\n throw new PrestoException(ACCUMULO_TABLE_EXISTS,\n \"Cannot create internal table when an Accumulo table already exists\");\n }\n\n if (AccumuloTableProperties.getIndexColumns(meta.getProperties()).size() > 0) {\n if (conn.tableOperations().exists(indexTable) || conn.tableOperations().exists(metricsTable)) {\n throw new PrestoException(ACCUMULO_TABLE_EXISTS,\n \"Internal table is indexed, but the index table and/or index metrics table(s) already exist\");\n }\n }\n }", "private void setUniqueToViewTableAndFilter() {\n\t\tsearchColumns.setItems(fillComboBox());\n\t\t//tableView.getColumns().setAll(fillColumns());\n\t}", "private List<T> mergeResults( final Rows<R, C> result, final int maxSize ) {\n\n if (logger.isTraceEnabled()) logger.trace( \"Multiple rows have columns. Merging\" );\n\n\n final List<T> mergedResults = new ArrayList<>(maxSize);\n\n\n\n\n for ( final R key : result.getKeys() ) {\n final ColumnList<C> columns = result.getRow( key ).getColumns();\n\n\n for (final Column<C> column :columns ) {\n\n final T returnedValue = columnParser.parseColumn( column );\n\n //Use an O(log n) search, same as a tree, but with fast access to indexes for later operations\n int searchIndex = Collections.binarySearch( mergedResults, returnedValue, comparator );\n\n /**\n * DO NOT remove this section of code. If you're seeing inconsistent results during shard transition,\n * you'll\n * need to enable this\n */\n //\n // if ( previous != null && comparator.compare( previous, returnedValue ) == 0 ) {\n // throw new RuntimeException( String.format(\n // \"Cassandra returned 2 unique columns,\n // but your comparator marked them as equal. This \" +\n // \"indicates a bug in your comparator. Previous value was %s and\n // current value is \" +\n // \"%s\",\n // previous, returnedValue ) );\n // }\n //\n // previous = returnedValue;\n\n //we've already seen it, no-op\n if(searchIndex > -1){\n continue;\n }\n\n final int insertIndex = (searchIndex+1)*-1;\n\n //it's at the end of the list, don't bother inserting just to remove it\n if(insertIndex >= maxSize){\n continue;\n }\n\n if (logger.isTraceEnabled()) logger.trace( \"Adding value {} to merged set at index {}\", returnedValue, insertIndex );\n\n mergedResults.add( insertIndex, returnedValue );\n\n\n //prune the mergedResults\n while ( mergedResults.size() > maxSize ) {\n\n if (logger.isTraceEnabled()) logger.trace( \"Trimming results to size {}\", maxSize );\n\n //just remove from our tail until the size falls to the correct value\n mergedResults.remove(mergedResults.size()-1);\n }\n }\n\n if (logger.isTraceEnabled()) logger.trace( \"Candidate result set size is {}\", mergedResults.size() );\n\n }\n return mergedResults;\n }", "public void updateIndex() {\n int i = this.index;\n if (i == -1 || i > HashBiMap.this.size || !Objects.equal(HashBiMap.this.keys[this.index], this.key)) {\n this.index = HashBiMap.this.findEntryByKey(this.key);\n }\n }", "private int same(ColEdge[] edge, HashMap<Integer, Integer> colours, int Vs, int Vi){\r\n\t\tHashMap<Integer, Integer> cloneCol = (HashMap) colours.clone();\r\n\t\tfor(int j = 0; j < edge.length; j++){\r\n\t\t\tif(edge[j].v = Vs || edge[j].v = Vi){\r\n\t\t\t\tcloneCol.remove(edge[j].u);\r\n\t\t\t}else if(edge[j].u = Vs || edge[j].u = Vi){\r\n\t\t\t\tcloneCol.remove(edge[j].v);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cloneCol.size();\r\n\t}", "@Override\n\tpublic int hashCode() {\n\t\treturn idx1.hashCode() * 811 + idx2.hashCode();\n\t}", "private boolean checkColoumnForQuadPair(int j1) {\n for(int i=0;i<4;i++)\r\n {\r\n if(Kmap[i][j1]==0 || Kmap[i][j1]==-1)\r\n return false;\r\n }\r\n for(int i=0;i<4;i++)\r\n {\r\n Kmap[i][j1]=-1;\r\n }\r\n return true; \r\n }", "public boolean insert(String[] tuple) {\n if (columnsDefinedOrder.size() <= 0) {\n columnsDefinedOrder = rows.stream()\n .findFirst()\n .map(x -> new ArrayList<>(x.keySet()))\n .orElse(columnsDefinedOrder);\n }\n if (tuple.length == columnsDefinedOrder.size()) {\n LinkedHashMap<String, String> r = new LinkedHashMap<>();\n for (int i = 0; i < columnsDefinedOrder.size(); i++) {\n String columnName = columnsDefinedOrder.get(i);\n r.put(columnName, tuple[i]);\n }\n return rows.add(r);\n } else {\n return false;\n }\n }", "protected abstract Object calcJoinRow();", "protected void checkRowIndexes(int[] indexes) {\n\tfor (int i=indexes.length; --i >= 0; ) {\n\t\tint index = indexes[i];\n\t\tif (index < 0 || index >= rows) checkRow(index);\n\t}\n}", "public void addRow(String data){//adds a new row of data to the table\n\t\t\t\tif(row_count<100){//checks to see if there is space left in the current datum for an additional rows\n\t\t\t\t\tif(row_count<50){//halvs the data for more efficiant row insertion\n\t\t\t\t\t\tif(row_count<10){//checks to see if it is in the first inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[0]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<20){//checks to see if it is in the second inner datum\n\t\t\t\t\t\t\tf(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[1]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<30){//checks to see if it is in the third inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[2]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<40){//checks to see if it is in the fourth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[3]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the fifth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[4]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t\n\t\t\t\t\t\tif(row_count<60){//checks to see if it is in the sixth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[5]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<70){//checks to see if it is in the seventh inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[6]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<80){//checks to see if it is in the eighth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[7]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<90){//checks to see if it is in the ninth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[8]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the tenth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[9]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\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}else{//acctivated when there is no room left in the current outer datum}\n\t\t\t\t\tif(next==null){//checks to see if there is a next outer datum\n\t\t\t\t\t\tnext=new OuterDatum();\t\n\t\t\t\t\t}\n\t\t\t\t\tnext.addRow(data);\n\t\t\t\t}\n\t\t\t}", "UsingCols createUsingCols();", "@Test\n public void testMerge() {\n \t//create data set\n final LastWriteWinSet<String> lastWriteWinSet1 = new LastWriteWinSet<>();\n lastWriteWinSet1.add(time3, \"php\");\n lastWriteWinSet1.add(time1, \"java\");\n lastWriteWinSet1.add(time1, \"scala\");\n lastWriteWinSet1.delete(time2, \"scala\");\n\n final LastWriteWinSet<String> lastWriteWinSet2 = new LastWriteWinSet<>();\n lastWriteWinSet2.add(time1, \"php\");\n lastWriteWinSet2.add(time1, \"python\");\n lastWriteWinSet2.add(time1, \"scala\");\n lastWriteWinSet2.delete(time2, \"php\");\n\n // run test\n final LastWriteWinSet<String> resultSet = lastWriteWinSet1.merge(lastWriteWinSet2);\n\n assertTrue(resultSet.getData().size() == 3);\n assertTrue(resultSet.getData().contains(\"php\"));\n assertTrue(resultSet.getData().contains(\"python\"));\n assertTrue(resultSet.getData().contains(\"java\"));\n \n \n final GrowOnlySet<LastWriteWinSet.ItemTD<String>> resultAddSet = resultSet.getAddSet();\n final Set<LastWriteWinSet.ItemTD<String>> addedData = resultAddSet.getData();\n assertTrue(addedData.size() == 5);\n assertTrue(addedData.contains(new LastWriteWinSet.ItemTD<>(1, \"php\")));\n assertTrue(addedData.contains(new LastWriteWinSet.ItemTD<>(3, \"php\")));\n assertTrue(addedData.contains(new LastWriteWinSet.ItemTD<>(1, \"java\")));\n assertTrue(addedData.contains(new LastWriteWinSet.ItemTD<>(1, \"python\")));\n assertTrue(addedData.contains(new LastWriteWinSet.ItemTD<>(1, \"scala\")));\n\n final GrowOnlySet<LastWriteWinSet.ItemTD<String>> resultDeleteSet = resultSet.getDeleteSet();\n final Set<LastWriteWinSet.ItemTD<String>> deletedData = resultDeleteSet.getData();\n assertTrue(deletedData.size() == 2);\n assertTrue(deletedData.contains(new LastWriteWinSet.ItemTD<>(2, \"scala\")));\n assertTrue(deletedData.contains(new LastWriteWinSet.ItemTD<>(2, \"php\")));\n }", "private boolean checkRowForQuadPair(int i1) {\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i1][j]==0 || Kmap[i1][j]==-1)\r\n return false;\r\n }\r\n for(int j=0;j<4;j++)\r\n {\r\n Kmap[i1][j]=-1;\r\n }\r\n return true;\r\n }", "private static void mergeAllRowsIfPossible(ArrayList<Row> rows) {\n // use fixed seed in order to get consistent results (with random properties)\n Random rand = new Random(5711l);\n int tries = 0;\n // this should be enough to be quite sure we don't miss any optimalization\n // possibility\n final int maxTries = rows.size() * 2;\n\n // do this loop until we successfully merged everything into one row\n // or we give up until too much tries\n while (rows.size() > 1 && tries < maxTries) {\n // choose two random entries\n int oneIdx = rand.nextInt(rows.size());\n int secondIdx = rand.nextInt(rows.size());\n if (oneIdx == secondIdx) {\n // try again if we choose the same rows by accident\n continue;\n }\n\n Row one = rows.get(oneIdx);\n Row second = rows.get(secondIdx);\n\n if (one.merge(second)) {\n // remove the second one since it is merged into the first\n rows.remove(secondIdx);\n\n // success: reset counter\n tries = 0;\n } else {\n // increase counter to avoid endless loops if no improvement is possible\n tries++;\n }\n }\n }", "@Test\n\tpublic void testCreateRowForceNormalDuplicate() {\n\t\tSystem.out.println(\"testCreateRowForceNormalDuplicate\");\n\t\tArrayList<String> rows = new ArrayList<>();\n\t\tArrayList<String> cols = new ArrayList<>();\n\n\t\trows.add(\"row1\");\n\t\trows.add(\"row2\");\n\t\trows.add(\"row3\");\n\t\trows.add(\"row4\");\n\n\t\tcols.add(\"col1\");\n\t\tcols.add(\"col2\");\n\t\tcols.add(\"col3\");\n\t\tcols.add(\"col4\");\n\t\tcols.add(\"col5\");\n\n\t\tDoubleMatrixDataset dataset = new DoubleMatrixDataset(rows, cols);\n\n\t\tdataset.setElementQuick(0, 0, 1);\n\t\tdataset.setElementQuick(0, 1, 2);\n\t\tdataset.setElementQuick(0, 2, 3);\n\t\tdataset.setElementQuick(0, 3, 4);\n\t\tdataset.setElementQuick(0, 4, 5);\n\n\t\tDoubleMatrixDataset datasetForNormal = dataset.createRowForceNormalDuplicate();\n\n//\t\tSystem.out.println(datasetForNormal.getElementQuick(0, 0));\n//\t\tSystem.out.println(datasetForNormal.getElementQuick(0, 1));\n//\t\tSystem.out.println(datasetForNormal.getElementQuick(0, 2));\n//\t\tSystem.out.println(datasetForNormal.getElementQuick(0, 3));\n//\t\tSystem.out.println(datasetForNormal.getElementQuick(0, 4));\n//\t\t\n\t\tassertEquals(datasetForNormal.getElementQuick(0, 0), 0.9736890569622489, 0.000001);\n\t\tassertEquals(datasetForNormal.getElementQuick(0, 4), 5.0263109430377515, 0.000001);\n\n\t}", "@Override\n public boolean equals(Object obj){\n if(this == obj){\n return true;\n }\n else if(!(obj instanceof Row)){\n return false;\n }\n\n Row row2 = (Row)obj;\n\n return this.index == row2.index && this.spaces.equals(row2.spaces);\n }" ]
[ "0.6116364", "0.60939616", "0.5936204", "0.5876224", "0.5876224", "0.58013177", "0.58013177", "0.5777093", "0.56776744", "0.56314754", "0.56312126", "0.5624868", "0.5617303", "0.5599142", "0.55384225", "0.5536911", "0.5528058", "0.5512347", "0.55004424", "0.5482807", "0.5451187", "0.5432635", "0.54288286", "0.5418797", "0.5405977", "0.53880113", "0.5384904", "0.5376882", "0.5356606", "0.53499824", "0.5344317", "0.5339596", "0.53391504", "0.5308566", "0.5274274", "0.5267107", "0.52516097", "0.52446336", "0.5231467", "0.52202296", "0.521988", "0.5194721", "0.51854277", "0.518483", "0.51600957", "0.51590914", "0.5158848", "0.5157842", "0.5154604", "0.5152233", "0.5146623", "0.51414675", "0.513351", "0.51313674", "0.5127398", "0.5124582", "0.51237816", "0.51149607", "0.51052666", "0.5103816", "0.5096882", "0.5096596", "0.50932014", "0.5086752", "0.508371", "0.50786257", "0.50724643", "0.50712895", "0.5059217", "0.5057647", "0.50566375", "0.50566375", "0.50566375", "0.50566375", "0.50566375", "0.50566375", "0.5047884", "0.50428385", "0.5030274", "0.50087535", "0.5004427", "0.50017935", "0.49985942", "0.4989724", "0.49882773", "0.49866033", "0.49801713", "0.49770296", "0.49758744", "0.49703678", "0.49580637", "0.49515775", "0.49452072", "0.49439543", "0.49308193", "0.49241057", "0.49191862", "0.49100158", "0.49096859", "0.49093947" ]
0.514888
50
/ int v1=5; int v2=2; int result1= v1+v2; System.out.println(result1); int result2= v1v2; System.out.println(result2); int result3= v1v2; System.out.println(result3); int result4= v1/v2; System.out.println(result4); int result5= v1%v2; System.out.println(result5); double result6 = (double)v1 / v2; System.out.println(result6); char c1='A'+1; System.out.println(c1); char c2='A'; char c3 = c2+1; int result = c2+1; System.out.println(result); char c3= (char)result; System.out.print(c3); int x=5; double y=0.0; double z =5/y; System.out.print(z); System.out.println(Double.isInfinite(z)); System.out.println(Double.isNaN(z));
public static void main(String[] args) { String st1= "jdk" + 6.0; String st2 = st1 + " Ư¡"; System.out.println(st2); String st3 = "jdk"+3+3.0; String st4 = 3+3.0+"jdk"; System.out.println(st3); System.out.println(st4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n double x = 34.56;\n double y = 2.45;\n\n System.out.println(x + y);\n System.out.println(x - y);\n System.out.println(x * y);\n System.out.println(x / y);\n\n var a = 5;\n int b = 9;\n\n System.out.println(a + b);\n System.out.println(a - b);\n System.out.println(a * b);\n System.out.println(a / b);\n System.out.println(a / (double)b);\n\n System.out.println(a % b);\n\n }", "public static void main(String[] args) {\n\n System.out.println(3 + 9);\n\n System.out.println(10 - 2);\n\n System.out.println(10 * 3);\n\n System.out.println(10 / 2);\n\n System.out.println(10 % 4); // 2\n\n int result = 10 % 3;\n\n System.out.println(\"result = \" + result);\n\n System.out.println(10 / 4); // 2\n System.out.println(10.0 / 4); // 2.5\n System.out.println(10 / 4.0); // 2.5\n\n double d1 = 10 / 4; // 2.0\n\n System.out.println(\"d1 = \" + d1);\n\n double d2 = 10 / 4.0f; // 2.5\n\n System.out.println(\"d2 = \" + d2);\n }", "public static void main(String[]args) {\n\t\tdouble d=10;\n\t\tint num=10;\n\t\t\n\t\tSystem.out.println(d);\n\t\tint i=(int) 12.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)130;\n\t\tSystem.out.println(b);\n\t\t\n\t double number =12;\n\t\tdouble result = number/5;\n\t\tSystem.out.println(result);\n\t\t\n\t\tdouble newNum=10;\n\t\tnewNum=newNum/3;\n\t\tSystem.out.println(newNum);\n\t\t\n\t\tdouble num1=10+10.5;\n\t\t\n\t\tSystem.out.println(num1);\n\t\t\n\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t float x=1;\r\n\t\t int y=2;\r\n\t\t float z=3;\r\n\t\t int a=4;\r\n\t\t int b=5;\r\n\t\t float result =x/y ;\r\n\t\t \r\n\t\t System.out.println (result);\r\n result =x+y ;\r\n\t\t \r\n\t\t System.out.println (\"9+2=\" +result);\t\r\n result =x-y ;\r\n\t\t \r\n\t\t System.out.println (\"9-2=\" +result);\r\n result =x*y ;\r\n\t\t \r\n\t\t System.out.println (\"9-2=\" +result);\r\n\t\t\r\n\t\t \r\n\t\t if (x==b)\r\n\t\t {\r\n\t\t\t System.out.println (\"true\");\r\n\t\t }\r\n\t\t else \r\n\t\t {\r\n\t\t\t System.out.println (\"false\"); \r\n\t\t }\r\n\t\t if (x!=a)\r\n\t\t {\r\n\t\t\t System.out.println (\"true\");\r\n\t\t }\r\n\t\t else \r\n\t\t {\r\n\t\t\t System.out.println (\"false\"); \r\n\t\t }\r\n\t\t if (z<b)\r\n\t\t {\r\n\t\t\t System.out.println (\"b is grather \");\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t System.out.println (\"b is less\"); \r\n\t\t }\r\n\t\t \r\n\t}", "public static void main( String[] args) {\n System.out.println( 3 + 5.0/2 + 5 * 2-3 );\n System.out.println( 3.0 + 5/2 + 5 * 2-3 );\n System.out.println( (int)(3.0 + 5)/(2 + 5.0) * 2-3); // -.2\n \n // initial variables\n double d1 = 37.9;\n double d2 = 1004.128;\n int i1 = 12;\n int i2 = 18;\n \n System.out.println( \"Problem 1: \" + (57.2 * (i1/i2) + 1) ); // 1.0\n System.out.println( \"Problem 2: \" + (57.2 * ((double)i1/i2) + 1) ); // 39.13333\n System.out.println( \"Problem 3: \" + (15 - i1 * (d1 * 3 ) + 4) ); // -1345.39999\n System.out.println( \"Problem 4: \" + (15 - i1 * (int)(d1 * 3) + 4) ); // -1337\n System.out.println( \"Problem 5: \" + (15 - i1 * ((int)d1 * 3) + 4) ); // -1313\n \n // Exercises 10-15 page 5-4\n System.out.println( \"Exercise 10\" );\n int p1 = 3;\n double d3 = 10.3;\n int j1 = (int)5.9;\n System.out.println( p1 + p1 * (int)d3 - 3 * j1 );\n \n System.out.println( \"Exercises 12-15\" );\n int dividend = 12, divisor = 4, quotient = 0, remainder = 0;\n int dividend2 = 13, divisor2 = 3, quotient2 = 0, remainder2 = 0;\n \n quotient = dividend/divisor; // 3\n remainder = dividend % divisor; // 0\n quotient2 = dividend / divisor2; // 4\n remainder2 = dividend2 % divisor2; //1\n \n System.out.println( quotient );\n System.out.println( remainder );\n System.out.println( quotient2 );\n System.out.println( remainder2 );\n \n // Exercise 17\n final String M = \"ugg\"; // constant String M\n // M = \"wow\"; // compile error\n \n // Math class methods\n \n /*\n * Math class methods:\n * \n * Math.abs(x); = Absolute value (int,double)\n * Math.pow(x,y); = Exponent (x to the power of y)\n * Math.sqrt(x); = Square root (double)\n * Math.ceil(x); = Ceiling (the next highest whol num 1.1 = 2\n * Math.floor(x); = Floor (the next lowest num 1.9 = 1)\n * Math.min(x,y); = Minimum of x or y \n * Math.max(x,y); = Maximum of x or y\n * Math.random(); = Returns a random num between 0<=x<1\n * Math.round(x); = Rounds the number\n * Math.PI = Constant variable, returns 3.14159265...\n */\n System.out.println( \"\\nMath class methods\" );\n System.out.println( Math.abs(-312.7) );\n System.out.println( Math.pow(5,5) );\n System.out.println( Math.sqrt(1.0) );\n System.out.println( Math.ceil(99.1));\n System.out.println( Math.floor(100.9) );\n System.out.println( Math.min(2, 25) );\n System.out.println( Math.max(2, 25) );\n System.out.println( Math.round(99.5) );\n System.out.println( Math.random() + \"\\t\" + Math.random() );\n System.out.println( Math.PI );\n \n /*\n * Other Math methods\n * \n * Math.log(x); == log base e of x\n * Math.sin(x); == sin of angle x in radians\n * Math.cos(x); == cos of angle x in radians\n * Math.tan(x); == tan of angle x in radians\n * Math.asin(x); == arcisne of x in radians -PI/2 to PI/2\n * Math.acos(x); == arccosine of x in radians -PI/2 to PI/2\n * Math.atan(x); == arctan of x in range -PI/2 to PI/2\n * Math.toDegrees(x); == converts radians to degrees\n * Math.toRadians(x); == converts degrees to radians\n */\n \n /*\n * Project: ComputeThis\n * \n * Print: d1 = 3PIsin(187deg) + |cos(122deg)| = -0.618672237585067\n * Print: d2 = (14.72)^3.801 + ln72 = 27496.9888867001543\n */\n \n double d10 = 3 * Math.PI * Math.sin(Math.toRadians(187)) + Math.abs( Math.cos( Math.toRadians(122) ) );\n double d20 = Math.pow(14.72, 3.801) + Math.log(72);\n System.out.println( \"d1 = \" + d10 );\n System.out.println( \"d2 = \" + d20 );\n \n \n \n }", "@Override\n public InterpreterValue div(InterpreterValue v) {\n\n // If the given value is a IntegerValue create a new DoubleValue from\n // the division-result\n if(v instanceof IntegerValue) return new DoubleValue(getValue() / ((IntegerValue) v).getValue());\n\n // If the given value is a DoubleValue create a new DoubleValue from\n // the division-result\n if(v instanceof DoubleValue) return new DoubleValue(getValue() / ((DoubleValue) v).getValue());\n\n // In other case just throw an error\n throw new Error(\"Operator '/' is not defined for type double and \" + v.getName());\n\n }", "public static void main(String [] args){\n double a= 5+(4*5)/5;\n double b= (6*4%2)+15;\n System.out.println(\"a = \"+a);\n System.out.println(\"b = \"+b); \n \n //Ejemplo de operadores relacionales.\n boolean resultado1= a > b;\n boolean resultado2= a !=b; \n System.out.println(\"R1= \"+resultado1);\n System.out.println(\"R2= \"+resultado2); \n }", "private Double check_mathOperator(Double result) {\n \r\n switch(mathOperator){\r\n case '/':\r\n result =totalFirst/totalLast;\r\n break;\r\n case 'x':\r\n result =totalFirst*totalLast;\r\n break;\r\n case '-':\r\n result =totalFirst-totalLast;\r\n break;\r\n case '+':\r\n result =totalFirst+totalLast;\r\n break;\r\n \r\n }\r\n return result;\r\n }", "public static void main(String[] args) {\n\n double fraction = 1/2.0;\n System.out.println(fraction);\n\n //Modules is the remainder of a division problem\n //25 % 6 = 1\n //31 % 5 = 1\n //17 % 3 = 2\n //4 % 2 = 0\n //5 % 2 = 1\n //6 % 2 = 0\n //121 % 100 = 21\n // 47 % 15 = 2\n //55 % 15 =10\n\n //5 + 2 * 4 =\n //12 / 2 - 4 =\n //4 + 17 % 2 -1 =\n //4 + 5 * 2 / 2 + 1 =\n //4 * (6 + 3 * 2) + 7 =\n\n System.out.println(5 + 2 * 4);\n System.out.println (12 / 2 -4);\n System.out.println(4 + 17 % 2 - 1);\n System.out.println(4 + 5 * 2 / 2 + 1);\n System.out.println(4 * (6 + 3 *2) + 7);\n\n\n }", "public static void main(String[] args) {\n\n int a=5;\n int b=0;\n\n System.out.println(\"a/b = \" + a/b);\n\n }", "public static void main(String[] args) {\n int x = 10;\r\n int b = 8;\r\nint result = x + b;\r\nSystem.out.println(\"더하기 결과\" + result);\r\nresult = x - b;\r\nSystem.out.println(\"빼기\"+result);\r\n\r\nresult = x * b;\r\nSystem.out.println(\"*\"+result);\r\n\t\r\n\t\r\n\tresult = x / b;\r\n\tSystem.out.println(\"나누기\"+result);\r\n\t\r\n\tresult = x % b;\r\n\tSystem.out.println(\"나머지\"+result); //나누고 난 후 나머지 결과\r\n\t\r\n\ttry {\r\n\t\tresult = x / b;\r\n\t\tSystem.out.println(result);\r\n\t} catch (Exception e) {\r\n\t\tSystem.out.println(\"not\");\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t}", "public void main(int number)\n {\n Double f = 100.00/0.0;\n System.out.println(1 + 2 + \"3\");\n System.out.println(\"1\" + 2 + 3);\n char ch = 'd';\n if (ch > 3.00) {\n System.out.println(\"ch > 3.00\");\n System.out.println((int)ch);\n }\n byte b = 10;\n // bytes are promoted to int before being added.\n // since the JVM has no instructions for arithmetic on\n // char byte or short. \n // b = (byte)(b + a); \n b += 10;\n System.out.println(\"b = \" + b);\n \n float ff = 7/2;\n System.out.println(ff);\n \n final int a = 10;\n final int x = a;\n byte bb = x;\n System.out.println(\"bb = \" + bb);\n }", "public static void main(String[] args) {\n\t\tint a=20;\n\t\tint b=0;\n\t\tint c=a/b;\n\t\tSystem.out.println(c);\n\t\tSystem.out.println(\"division=\"+c);\n\t\tSystem.out.println(c);\n\n\t}", "public static void calculateMathProblem(){\n\n int num1 = 5;\n double num2 = 3.0d;\n float num3 = 3.0f;\n double result1 = num1 + num2;\n double result2 = num1 - num2;\n double result3 = num1 * num2;\n double result4 = num1 / num2;\n float result5 = num1 / num3;\n System.out.println(result1);\n System.out.println(result2);\n System.out.println(result3);\n System.out.println(result4);\n System.out.println(result5);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tdouble a=5;\n\t\t\n\t\tdouble b;\n\t\t\n\t\tb=7;\n\t\t\n\t\tdouble c=b+a;\n\t\tSystem.out.println(\"LA SUMA DE C ES : \"+c);\n\t\tc+=6;\n\t\tSystem.out.println(\"LA SUMA DE C ES : \"+c);\n\n\t\t//en tipo int\n\t\t c =b/a;\n\t\tSystem.out.println(\"LA DIVISION DE C ES : \"+c);\n\t\t\n\t\t//en float\n\t\tdouble c2=b/a;\n\t\tSystem.out.println(\"LA DIVISION DE C ES : \"+c2);\n\n\t\t\n\n\t\t \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public static double div() {\n System.out.println(\"Enter dividend\");\n double a = getNumber();\n System.out.println(\"Enter divisor\");\n double b = getNumber();\n\n return a / b;\n }", "public static void main(String[] args){\n\t\tSystem.out.println(1/1+1/2+1/3+1/4+1/5+1/6+1/7+1/8+1/9+1/10);\n\t\t//Computes the sum of 1/1+1/2+...+1/10 correctly.\n\t\tSystem.out.println(1/1.0+1/2.0+1/3.0+1/4.0+1/5.0+1/6.0+1/7.0+1/8.0+1/9.0+1/10.0);\n\t\t\t\t\n\t\t/* The second method prints a correct value because it is understood\n\t\t * to be a floating point. The values from the first method are truncated to\n\t\t * \"1+0+0+....+0\" respectively. */\n\t\n\t\t}", "public static void main(String[] args) {\n\n Scanner tc = new Scanner(System.in);\n\n double a, b, c = 0;\n String soma = \"+\";\n String subtração = \"-\";\n String multiplicação = \"*\";\n String divisão = \"/\";\n String potência = \"^\";\n String raiz = \"~\";\n String operação = \"\";\n System.out.println(\"Qual operação deseja fazer ?\");\n operação = tc.nextLine();\n System.out.println(\"insira um numero ó mortal\");\n a = tc.nextDouble();\n System.out.println(\"insira um numero ó mortal\");\n b = tc.nextDouble();\n ;\n if (operação == null ? soma == null : operação.equals(soma)) {\n c = a + b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? subtração == null : operação.equals(subtração)) {\n c = a - b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? multiplicação == null : operação.equals(multiplicação)) {\n c = a * b;\n System.out.println(\"o resultado é \" + c);\n }\n else \n c = a/b;\n \n System.out.println(\"o resultado é \" + c);\n }", "public static void main(String[] args) {\n double x, y;\r\n byte b;\r\n int i;\r\n char ch;\r\n x = 10.0;\r\n y = 3.0;\r\n i = (int) (x / y); //truncation will occur when casting double to int\r\n System.out.println(\"Integer outcome of x / y: \" + i);\r\n\r\n i = 100;\r\n b = (byte) i;\r\n System.out.println(\"Value of b: \" + b); // no loss of info as a byte can hole the value 100\r\n\r\n i = 257;\r\n b = (byte) i;\r\n System.out.println(\"Value of b: \" + b); // loss of info as a byte can hole the value 257\r\n\r\n b = 88; //ASCII code fo X\r\n ch = (char) b;\r\n System.out.println(\"ch: \" + ch); // cast between incompatible types\r\n\r\n }", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "public static void main(String[] args) {\n\t\tfinal double d = 1 / 2; \n\t\tSystem.out.println(d); \n\t}", "public static double divide(double num1,double num2){\n\n // return num1/num2 ;\n\n if(num2==0){\n return 0 ;\n } else {\n return num1/num2 ;\n }\n }", "public void testORDINARY_DIV1() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 10, \"fess\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "@Override\n\tpublic double divide(double in1, double in2) {\n\t\treturn 0;\n\t}", "public static void main(String[] args) {\n\n\t\tdouble d=12/7;\n\t\tSystem.out.println(d);\n\t\t\n\t\tdouble e=9;//widening\n\t\tSystem.out.println(e);\n\t\t\n\t\tint i=(int)9.99;// narrowing\n\t\tSystem.out.println(i);\n\t\t\n\t\tbyte b=(byte)130;// narrowing\n\t\tSystem.out.println(b);\n\t\t\n\t\t\n\t\t\n\t}", "@Test\n public void test07() throws Throwable {\n Complex complex0 = new Complex(2479.28439673, Double.NaN);\n boolean boolean0 = complex0.isNaN();\n String string0 = complex0.toString();\n Complex complex1 = complex0.acos();\n Complex complex2 = complex1.exp();\n }", "double divide (double a, double b) {\n\t\tdouble result = a/b;\n\t\treturn result;\n\t}", "public static void main(String[] args){\n Scanner input = new Scanner(System.in);\n int result = 0;\n\n System.out.print(\"Enter three integer number : \");\n String num = input.nextLine();\n\n String [] operand = num.split(\" \");\n int x = Integer.parseInt(operand[0]);\n int y = Integer.parseInt(operand[1]);\n int z = Integer.parseInt(operand[2]);\n\n System.out.print(\"Enter two operand : \");\n String operator = input.nextLine();\n\n String [] op = operator.split(\" \");\n String a = op[0];\n String b = op[1];\n\n int temp = 0;\n\n for(int i = 0; i< op.length; i++){\n if(a.equals(\"X\") || a.equals(\"D\") || a.equals(\"M\") || b.equals(\"X\") || b.equals(\"D\") || b.equals(\"M\")){\n\n if(a.equals(\"X\") || b.equals(\"X\")){\n if(a.equals(\"X\")){\n if(i == 0) temp = x*y;\n else result = temp * x;\n a = \"\";\n }\n else if(b.equals(\"X\")){\n if(i == 0) temp = y*z;\n else result = temp * z;\n b = \"\";\n }\n }\n\n else if(a.equals(\"D\") || b.equals(\"D\")){\n if(a.equals(\"D\")){\n if(i==0) temp = x/y;\n else result = x/temp;\n a = \"\";\n }\n else if(b.equals(\"D\")){\n if(i == 0) temp = y/z;\n else result = temp / z;\n b = \"\";\n }\n }\n\n else if(a.equals(\"M\") || b.equals(\"M\")){\n if(a.equals(\"M\")){\n if(i == 0)temp = x % y;\n else result = x % temp;\n a = \"\";\n }\n\n else if(b.equals(\"M\")) {\n if(i == 0) temp = y % z;\n else result = temp % z;\n b = \"\";\n }\n }\n\n } else{\n if(a.equals(\"A\")){\n if(b.equals(\"A\")) result = x+y+z;\n else if(b.equals(\"S\")) result = x+y-z;\n else result = temp + x;\n }\n\n else if(b.equals(\"A\")){\n if(a.equals(\"A\")) result = x+y+z;\n else if(a.equals(\"S\")) result = x-y+z;\n else result = temp + z;\n }\n }\n }\n System.out.println(x + \" \" + op[0] + \" \" + y + \" \" + op[1] + \" \" + z + \" = \" + result);\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a,b;\n\t\tdouble resultado;\n\t\t\n\t\ta = 5;\n\t\tb = 2;\n\t\t\n\t\tresultado = (double) a / b;\n\t\t\n\t\tSystem.out.println(resultado);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint a = 1+9;\n\t\tSystem.out.println(\"a = \" + a);\n\t\tint e = 12 - 7;\n\t\tSystem.out.println(\"e = \" + e);\n\t\tint i = 2 * 5;\n\t\tSystem.out.println(\"i = \" + i);\n\t\tint m = 12 / 6;\n\t\tSystem.out.println(\"m = \" + m);\n\t\t\n\t\t//Adding two decimal numbers and storing in an int type variable\n\t\t// int b = 5.5 + 7.5; //Adding two decimal numbers i.e. 5.5 and 3.2 and storing the result in the int type variable 'b'\n\t\t//We cant assign decimal values to the int type variables.\n\t\t//by adding type cast to the decimal values, the program will not throw the error, digits after the decimal points will be ignored while adding.\n\t\t\n\t\tint b = (int)5.5 + (int)7.5; //Type casting the flote values to int\n\t\tSystem.out.println(\"b = \" + b);\n\t\tint f = (int)9.5 - (int)7.5;\n\t\tSystem.out.println(\"f = \" + f);\n\t\tint j = (int)9.5 * (int)7.5;\n\t\tSystem.out.println(\"j = \" + j);\n\t\tint n = (int)5.5 / (int)3.2;\n\t\tSystem.out.println(\"n = \" + n);\n\t\t\n\t\tdouble c = 5 + 4;//Adding two integers i.e. 5 and 3 and storing the result in the double type variable 'a'\n\t\tSystem.out.println(\"c = \" + c);\n\t\tdouble g = 9 - 7;\n\t\tSystem.out.println(\"g = \" + g);\n\t\tdouble k = 9 * 7;\n\t\tSystem.out.println(\"k = \" + k);\n\t\tdouble o = 5 / 3;\n\t\tSystem.out.println(\"o = \" + o);\n\t\t\n\t\tdouble d = 4.5 + 5.3;\n\t\tSystem.out.println(\"d = \" + d);\n\t\tdouble h = 8.5 - 5.3;\n\t\tSystem.out.println(\"h = \" + h);\n\t\tdouble l = 8.5 * 5.3;\n\t\tSystem.out.println(\"l = \" + l);\n\t\tdouble p = 5.0 / 3;\n\t\tSystem.out.println(\"p = \" + p);\n\t\t\n\t\t//The Modulus operator '%' returns the reminder of a division operator.\n\t\tint q = 8%3;\n\t\tSystem.out.println(\"q = \" + q);\n\t\tdouble r = 8.568%3;\n\t\tSystem.out.println(\"r = \" + r);\n\t\t\n\t\t//Java provides special operators called Compound Assignment operators which combine an arithmetic operation with an assignment '='\n\t\tint s = 4;\n\t\ts+= 3;//you need to write s+= no space between + and = for compound assignment otherwise it will throw an error\n\t\t//Using Compound assignment operator to increment the variable 's' value by 3 i.e. 4+3\n\t\tSystem.out.println(\"s = \" + s);\n\t\tint t = 4;\n\t\tt-= 3;\n\t\tSystem.out.println(\"t = \" + t);\n\t\tint u = 4;\n\t\tu*= 3;\n\t\tSystem.out.println(\"u = \" + u);\n\t\tint v = 4;\n\t\tv/= 2;\n\t\tSystem.out.println(\"v = \" + v);\n\t\tint w = 5;\n\t\tw%= 3;\n\t\tSystem.out.println(\"w = \" + w);\n\t\t\n\t\tint x = 4;\n\t\tx++;\n\t\tSystem.out.println(\"x = \" + x);\n\t\tint y = 4;\n\t\t++y;\n\t\tSystem.out.println(\"y = \" + y);\n\t\t\n\t\tint pre = 4;\n\t\tSystem.out.println(\"The value of variable 'pre' before incremental using prefix operator = \" + pre);\n\t\tSystem.out.print(\"The value of variable 'pre' while incremental using prefix operator = \" );\n\t\tSystem.out.println(++pre); //(Incremented and printed)\n\t\tSystem.out.println(\"The value of variable 'pre' after incremental using prefix operator = \" + pre);\n\t\t\n\t\tint post = 4;\n\t\tSystem.out.println(\"The value of variable 'post' before incremental using prefix operator = \" + post);\n\t\tSystem.out.print(\"The value of variable 'post' while incremental using prefix operator = \" );\n\t\tSystem.out.println(post++); //(Printed without increment)\n\t\tSystem.out.println(\"The value of variable 'post' after incremental using prefix operator = \" + post); //(Incremented here)\n\t\t\n\t\tint a1 = 1;\n\t\tint b1 = 1;\n\t\tint c1 = ++b1;\n\t\tint d1 = a1++;\n\t\t\n\t\tSystem.out.println(\"a1 = \" + a1);\n\t\tSystem.out.println(\"b1 = \" + b1);\n\t\tSystem.out.println(\"c1 = \" + c1);// Here the value of variable 'b1' will get incremented first and then the incremented value gets assinged to vartiable 'c1'\n\t\tSystem.out.println(\"d1 = \" + d1); // Here the value of variable 'a1' will get assigned to variable 'd' and later the value of variable 'a1' gets incremented\n\t\t\n\t\tint pren = 4;\n\t\tSystem.out.println(\"The value of variable 'pren' before incremental using prefix operator = \" + pren);\n\t\tSystem.out.print(\"The value of variable 'pren' while incremental using prefix operator = \" );\n\t\tSystem.out.println(--pren); //decremented and printed)\n\t\tSystem.out.println(\"The value of variable 'pren' after incremental using prefix operator = \" + pren);\n\t\t\n\t\tint postn = 4;\n\t\tSystem.out.println(\"The value of variable 'postn' before incremental using prefix operator = \" + postn);\n\t\tSystem.out.print(\"The value of variable 'postn' while incremental using prefix operator = \" );\n\t\tSystem.out.println(postn--); //(Printed without decremented)\n\t\tSystem.out.println(\"The value of variable 'postn' after incremental using prefix operator = \" + postn); //(decremented here)\n\t\t\n\t\tint a2 = 1;\n\t\tint b2 = 2;\n\t\tint c2 = --b2;\n\t\tint d2 = a2--;\n\t\t\n\t\tSystem.out.println(\"a2 = \" + a2);\n\t\tSystem.out.println(\"b2 = \" + b2);\n\t\tSystem.out.println(\"c2 = \" + c2);// Here the value of variable 'b1' will get incremented first and then the incremented value gets assinged to vartiable 'c1'\n\t\tSystem.out.println(\"d2 = \" + d2); // Here the value of variable 'a1' will get assigned to variable 'd' and later the value of variable 'a1' gets incremented\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println((0+15)/2);\r\n\t\tSystem.out.println(2.0e-6*10000000000.1);\r\n\t\tSystem.out.println(true&&false||true&&true);\r\n\t\t\r\n\t\t//1.1.2\r\n\t\tSystem.out.println((1+2.236)/2);\r\n\t\tSystem.out.println(1+2+3+4.0);\r\n\t\tSystem.out.println(4.1>=4);\r\n\t\tSystem.out.println(1+2+\"3\");\r\n\t\t\r\n\t\t//1.1.3\r\n//\t\tSystem.out.println(\"Please enter three nums\");\r\n\t\tScanner scanner=new Scanner(System.in);\r\n//\t\tint num=scanner.nextInt();\r\n//\t\tint num2=scanner.nextInt();\r\n//\t\tint num3=scanner.nextInt();\r\n//\t\r\n//\t\tif(num==num2&&num==num3) {\r\n//\t\t\tSystem.out.println(\"Eqaul:\");\r\n//\t\t}else {\r\n//\t\t\tSystem.out.println(\"Not equal:\");\r\n//\t\t}\r\n//\r\n//\t\t\t\r\n//\t\t//1.1.4\r\n//\t\t//a. then 语法错误\r\n//\t\t//b. ok\r\n//\t\t//c. ok\r\n//\t\t//d. ok\r\n//\r\n//\t\t\r\n//\t\t//1.1.5\r\n//\t\tint x=scanner.nextInt();\r\n//\t\tint y=scanner.nextInt();\r\n//\t\tif(x<1.0 && y<1.0 && x>0 && y>0) {\r\n//\t\t\tSystem.out.println(\"true\");\r\n//\t\t}\r\n//\t\telse {\r\n//\t\t\tSystem.out.println(\"false\");\r\n//\t\t}\r\n//\t\t\r\n\t\t\r\n\t\t//1.1.6\r\n//\t\tint f=0;\r\n//\t\tint g=1;\r\n//\t\tfor(int i=0;i<=15;i++) {\r\n//\t\t\tSystem.out.print(f+\"\\t\");\r\n//\t\t\tf=f+g;\r\n//\t\t\tg=f-g;\r\n//\t\t}\r\n\t\t\r\n\t\t//1.1.7\r\n//\t\tdouble t=9.0;\r\n//\t\twhile(Math.abs(t-9.0/t)> .001) {\r\n//\t\t\tt=(9.0/t+t)/2.0;\r\n//\t\t}\r\n//\t\tSystem.out.printf(\"%.5f\\n\", t);\r\n//\t\t\r\n//\t\t\r\n//\t\tint sum=0;\r\n//\t\tfor(int i=1;i<1000;i++)\r\n//\t\t\tfor(int j=0;j<i;j++)\r\n//\t\t\t\tsum++;\r\n//\t\tSystem.out.println(sum);\r\n//\t\r\n//\t\t\r\n//\t\tint sum2=0;\r\n//\t\tfor(int i=1;i<1000;i*=2)\r\n//\t\t\tfor(int j=0;j<1000;j++)\r\n//\t\t\t\tsum2++;\r\n//\t\tSystem.out.println(sum2);\r\n\t\r\n\t\t//1.1.8\r\n//\t\tSystem.out.println('b');\r\n//\t\tSystem.out.println('b'+'c');\r\n//\t\tSystem.out.println((char)('a'+4));\r\n\t\t\r\n\t\t//1.1.9\r\n//\t\tSystem.out.println(\"Please enter one num and return with a binary code\");\r\n//\t\tint N=scanner.nextInt();\r\n//\t\tString string=\"\";\r\n//\t\tfor(int n=N;n>0;n/=2) {\r\n//\t\t\tstring=(n%2)+string;\r\n//\t\t}\r\n//\t\tSystem.out.println(string);\r\n\t\t\r\n\t\t//1.1.10\r\n\t\t//int[] a=new int[10];\r\n\t\t\r\n\t\t//1.1.11\r\n//\t\tboolean[][] arrays= {{true,true,true},\r\n//\t\t\t\t{false,false,false},\r\n//\t\t\t\t{true,false,true},\r\n//\t\t};\r\n//\t\t\r\n//\t\tfor(int i=0;i<arrays.length;i++)\r\n//\t\t\tfor(int j=0;j<arrays.length;j++) {\r\n//\t\t\t\tif(arrays[i][j]) {\r\n//\t\t\t\t\tSystem.out.print(\"*\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\tSystem.out.print(\"^\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t//1.1.12\r\n//\t\tint[] a=new int[10];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=9-i;\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=a[a[i]];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\tSystem.out.println(i);\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t}", "public static double div(double a, double b){\r\n\t\treturn a/b;\r\n\t}", "public static void main(String[] args) {\n\t\tint var1 = 3;\r\n\t\tint var2 = 2;\r\n\t\tint var3 = var1 / var2;\r\n\t\tdouble var4 = 3;\r\n\t\tdouble var5 = 2;\r\n\t\tdouble var6 = var4 / var5;\r\n\t\tSystem.out.print(var3);\r\n\t\tSystem.out.println(var6);\r\n\t}", "@Test\n\tvoid divide() {\n\t\tfloat result = calculator.divide(12, 4);\n\t\tassertEquals(3,result);\n\t}", "@Override\n\tpublic double dividir(double numerador, double denominador) throws ArithmeticException {\n\t\treturn 0;\n\t}", "public int division(int x,int y){\n System.out.println(\"division methods\");\n int d=x/y;\n return d;\n\n }", "public static double Div(double x, double y) \n\t{\n\t\t\n\t\tif(y !=0)\n\t\t\treturn x / y;\n\t\telse \n\t\t\tSystem.out.println(\"FEL\");\n\t\t\treturn 0;\n\t\t\n\t}", "public static void main (String[] args) {\nSystem.out.println(\"Privet\");\r\n int a=20;\r\n int b=8;\r\n int c=a+b;\r\n int test;\r\n String s = \"Deleni po mod \";\r\n// boolean check1, check2;\r\n test=a%b;\r\n System.out.print(s);\r\n System.out.println(test);\r\n System.out.println(c);\r\n double d=35.9;\r\n\t\t double f=c+d;\r\n\t\t double tes=f%c; \r\n\t\t String s2=\"Delenie f/c\";\r\n\t\t \r\n\t\t System.out.println(f);\r\n\t\t System.out.println(s2);\r\n\t\t System.out.println(tes);\r\n\t\t System.out.println(s+s2);// s и s2\r\n\t\t if (f==61.9) {System.out.println(\"Proverka ok\"); } // if \r\n\t\t else {System.out.println(\"proverka not\");}}", "@Test\n\tvoid testWhenDenominatorIsZero() {\n\t\ttry {\n\t\t\tcalculator.divide(1, 0);\n\t\t} catch (Exception e) {\n\t\t\tassertNotNull(e);\n\t\t\tassertEquals(ArithmeticException.class,e.getClass());\n\t\t}\n\t\n\t}", "@Test\n\tpublic void divisionTest() {\n\t\tMathOperation division = new Division();\n\n\t\tassertEquals(0, division.operator(ZERO, FIVE).intValue());\n\t\tassertEquals(4, division.operator(TWENTY, FIVE).intValue());\n\t}", "public static strictfp final \n\tvoid myMethod5()throws Exception{\n\t\tdouble dnum=100/3;\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(123/10);\n\t}", "public static void main(String[] args) {\n\t\tScanner console = new Scanner(System.in);\n\t\tSystem.out.println(\"Hey give me a number or a fraction.\");\n\t\tString oneNumber = console.nextLine();\n\t\tSystem.out.println(\"Hey give me another number or a fraction.\");\n\t\tString twoNumber = console.nextLine();\n\t\tSystem.out.println(\"hey give me a number 1-4. 1=+, 2=-, 3=* 4=/\");\n\t\tString simble = console.nextLine();\n\t\tSystem.out.println(oneNumber);\n\t\tint v = Integer.parseInt(simble);\n\t\tif (v == 1) {\n\t\t\tSystem.out.println(\"+\");\n\t\t} else if (v == 2) {\n\t\t\tSystem.out.println(\"-\");\n\t\t} else if (v == 3) {\n\t\t\tSystem.out.println(\"*\");\n\t\t} else if (v == 4) {\n\t\t\tSystem.out.println(\"/\");\n\t\t} else\n\t\t\tSystem.out.println(\"\\\\('_')/\");\n\n\t\tSystem.out.println(twoNumber);\n\t\tSystem.out.println(\"=\");\n\t\tint numerator1;\n\t\tint denominator1;\n\t\tif (oneNumber.contains(\"/\")) {\n\t\t\tString numbers[] = oneNumber.split(\"/\");\n\t\t\tnumerator1 = Integer.parseInt(numbers[0]);\n\t\t\tdenominator1 = Integer.parseInt(numbers[1]);\n\n\t\t} else {\n\t\t\tnumerator1 = Integer.parseInt(oneNumber);\n\t\t\tdenominator1 = 1;\n\t\t\t}\n\t\t\tint numerator2;\n\t\t\tint denominator2;\n\t\tif (twoNumber.contains(\"/\")) {\n\t\t\tString numbers[] = twoNumber.split(\"/\");\n\t\t\tnumerator2 = Integer.parseInt(numbers[0]);\n\t\t\tdenominator2 = Integer.parseInt(numbers[1]);\n\t\t\t\n\t\t} else {\n\t\t\tnumerator2 = Integer.parseInt(twoNumber);\n\t\tdenominator2 = 1;\n\t\t}\n\t\tif (v == 1) {\n\t\t\tint r_numerator =(numerator1 * denominator2) + (numerator2 * denominator1);\n\t\t\tint r_denominator = denominator1 * denominator2;\n\t\t\tfraction_boy(r_numerator, r_denominator);\n\t\t} else if (v == 2) {\n\t\t\tint r_numerator =(numerator1 * denominator2) - (numerator2 * denominator1);\n\t\t\tint r_denominator = denominator1 * denominator2;\n\t\t\tfraction_boy(r_numerator, r_denominator);\n\t\t} else if (v == 3) {\n\t\t\tint r_numerator = numerator1 * numerator2;\n\t\t\tint r_denominator = denominator1 * denominator2;\n\t\t\tfraction_boy(r_numerator, r_denominator);\n\t\t} else if (v == 4) {\n\t\t\tint r_numerator = numerator1 * denominator2;\n\t\t\tint r_denominator = numerator2 * denominator1;\n\t\t\tfraction_boy(r_numerator, r_denominator);\n\t\t} else\n\t\t\tSystem.out.println(\"sorry man this is'nt going to work.\");\n\n\n\t\t}", "public static void main(String[] args) {\n\n int year = 2020; // boolean: ==, =, !=, <=, >=, <, >\n boolean result = year % 4 == 0;\n\n System.out.println(\"Year\" + year + \"is a leap year: \" + result); // 2020 is a leap year : true; 2021 is a leap year : false\n System.out.println ( 10/3.0 );\n\n System.out.println ( (int)(10.0/3) );\n\n\n\n\n\n\n\n\n }", "double doubleValue()\n {\n double top = 1.0 * numerator;\n double bottom=1.0*denominator;\n top=top/bottom;\n return top;\n\n }", "public double divide(double firstNumber, double secondNUmber){\n\t\tdouble result=0.0;\n\t\t\n\t\t\tresult = firstNumber / secondNUmber;\n\t\t\n\t\t\tSystem.out.println(\"hej \");\n\t\t\n\t\tif (Double.isInfinite(result)){\n\t\t\tSystem.out.println(\"7767878\");\n\t\t\treturn -1111.1111;\n\t\t}\t\t\n\t\t\n\t\t\n\t\treturn result;\n\t}", "private static double operate(Double a, Double b, String op){\n\t switch (op){\r\n\t case \"+\": return Double.valueOf(a) + Double.valueOf(b);\r\n\t case \"-\": return Double.valueOf(a) - Double.valueOf(b);\r\n\t case \"*\": return Double.valueOf(a) * Double.valueOf(b);\r\n\t case \"/\": try{\r\n\t return Double.valueOf(a) / Double.valueOf(b);\r\n\t }catch (Exception e){\r\n\t e.getMessage();\r\n\t }\r\n\t default: return -1;\r\n\t }\r\n\t }", "public static void main(String[] args) {\n\n\t\t\n\t\t\t\tdouble a = -5 + 8 * 6;\n\t\t\t\tSystem.out.println(a);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble b = (55+9) % 9;\n\t\t\t\tSystem.out.println(b);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble c = 20+ -3.0*5.0/8.0; \n\t\t\t\tSystem.out.println(c);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble d = 5 + 15/3 *2 - 8 % 3;\n\t\t\t\tSystem.out.println(d);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t int myIntValue=5/2;\r\n\t //width of float = 32 (4 bytes)\r\n\t float myFloatValue=(float) 5/3; // lub 5.2f;\r\n //width of double = 64 (8 bytes)\r\n\t double myDoubleValue=5d/3d;\r\n System.out.println(\"myIntValue =\" + myIntValue);\r\n System.out.println(\"myFLoatValue =\" + myFloatValue);\r\n System.out.println(\"myDoubleValue =\" + myDoubleValue);\r\n\r\n double pounds = 200d;\r\n double kilograms = pounds*0.45359237d;\r\n System.out.println(pounds + \" pounds equals \" + kilograms);\r\n }", "public static void main(String[] args) {\n Scanner entrada=new Scanner(System.in);\n \n double x;\n double y;\n double z;\n double m;\n \n System.out.println(\"Ingrese el valor de la variable X: \");\n x = entrada.nextDouble();\n System.out.println(\"Ingrese el valor de la variable Y: \");\n y = entrada.nextDouble();\n System.out.println(\"Ingreese el valor de la variable Z: \");\n z = entrada.nextDouble();\n \n m = ((x+(y/z))/(x-(y/z)));\n \n System.out.println(\"El valor de m en base a las variables: \");\n System.out.printf(\"x= %f\\n\", x);\n System.out.printf(\"y= %f\\n\", y);\n System.out.printf(\"z= %f\\n\", z);\n System.out.println(\"Da como resultado:\");\n System.out.printf(\"m= %f\", m); \n}", "public void testORDINARY_DIV4() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 13, \"cross\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public static void main(String[] args) {\n int iValue=256;//\n //强制把一个int类型的值转换为byte类型的值\n byte bValue=(byte)iValue;//-128--0-127\n System.out.println(bValue);//将输出多少?为什么\n short s3=100;\n s3=(short)(s3+2);\n\n byte b=25;//25.0\n char c='a';//97.0\n int i=23;\n double d=.3;\n //右边表达式中在最高等级操作数为duble类型,\n //则右边表达式的类型为double型,故付给一个double型变量\n float result=(float)(b+c+i*d);\n System.out.println(result);\n System.out.println('a'+\"\"+1);\n System.out.println('a'+1+\"\");\n\n System.out.println(1+\"\"+'a'+'b');\n System.out.println('a'+\"\"+'b');\n System.out.println('d'+1*'a'+'c');\n\n\n }", "private double evaluarExp3() throws Excepciones{\n char op;\n double resultado;\n double resultadoParcial;\n resultado = evaluarExp4();\n while((op = token.charAt(0)) == '*' || op == '/' || op == '%'){\n obtieneToken();\n resultadoParcial = evaluarExp4();\n switch(op) {\n case '*':\n resultado = resultado * resultadoParcial;\n break;\n case '/':\n if(resultadoParcial == 0.0){\n obtieneError(DIVENTRECERO);\n }\n resultado = resultado / resultadoParcial;\n break;\n case '%':\n if(resultadoParcial == 0.0){\n obtieneError(DIVENTRECERO);\n }\n resultado = resultado % resultadoParcial;\n break;\n }\n }\n return resultado;\n }", "static void diviser() throws IOException {\n\t Scanner clavier = new Scanner(System.in);\n\tdouble nb1, nb2, resultat;\n\tnb1 = lireNombreEntier();\n\tnb2 = lireNombreEntier();\n\tif (nb2 != 0) {\n\tresultat = nb1 / nb2;\n\tSystem.out.println(\"\\n\\t\" + nb1 + \" / \" + nb2 + \" = \" +\n\tresultat);\n\t} else\n\tSystem.out.println(\"\\n\\t le nombre 2 est nul, devision par 0 est impossible \");\n\t}", "public int division(){\r\n return Math.round(x/y);\r\n }", "@Test\n public void test01() {\n\n float a = 0.1f;\n float b = 0.2f;\n float c = 0.4f;\n float d = 0.6f;\n\n\n System.out.println(a+b);\n System.out.println(c+d);\n\n System.out.println(a+b == 0.3d);\n System.out.println(c+d == 1.0d);\n }", "public static void main(String[] args) {\n\n\n\n System.out.println(4 * (1.0 - (1 / 3) + (1 / 5) - (1 / 7) + (1 / 9) - (1 / 11)));\n\n System.out.println(4 * (1.0 - (1/3) + (1/5) - (1/7)\n + (1 / 9) - (1/11) + (1/13)));\n }", "@Override\n\tpublic double divide(double a, double b) {\n\t\treturn (a/b);\n\t}", "void div(double val) {\r\n\t\tresult = result / val;\r\n\t}", "void doStuff() {\n System.out.println(7/0);\r\n }", "public static void main(String[] args) {\n\n\t\tint numA = 10;\n\n\t\tint numB = 2;\n\n\t\tint result = numA + numB;\n//\t\t 10 + 2\n\t\tSystem.out.println(numA + numB);// 12\n\n\t\tSystem.out.println(result);\n\n//\t\t 10 - 2 \n\t\tSystem.out.println(numA - numB); // 8\n\n//\t\t 10 * 2\n\t\tSystem.out.println(numA * numB); // 20\n\n//\t\t 10 / 2\n\t\tSystem.out.println(numA / numB); // 5\n\n\t\tint numC = numB + 1; // 3\n\n\t\tSystem.out.println(numC);\n\n\t\tSystem.out.println(numA / numC);\n\n\t\t// Modular operator %\n\n//\t\t 10 / 3 = 3.333333\n\n//\t\t 10 = 3 +3 + 3 +1 \n\n\t\tSystem.out.println(10 % 3);\n\n\t\tSystem.out.println(10 % 5);\n\n\t\tSystem.out.println(10 % 4); // (4 + 4 + 2)\n\n\t\tSystem.out.println(10 % 9);// (9 + 1)\n\n\t\t// even number\n\n\t\tSystem.out.println(numA % 2);\n\n\t\t// odd number\n\t\tSystem.out.println(11 % 2);\n\n\t\tSystem.out.println(1231210 % 2);\n\t\tSystem.out.println(1231211 % 2);\n\n\t\t// increment ++\n\n\t\tint valueA = 1;\n\n//\t\t valueA = valueA +1;\n\n\t\tvalueA++;\n\t\tvalueA++;\n\t\tvalueA++;\n\n\t\tSystem.out.println(valueA);\n\t\t\n\t\t\n\t\tint valueB = 0;\n\t\t\n\t\tSystem.out.println(valueB++);\n\t\tSystem.out.println(valueB);// 1\n\t\t\n\t\t\n\t\tSystem.out.println(++valueB);//2\n\t\t\n\t\t\n\t\t//--\n\t\tint c = 5;\n\t\t\n\t\tc-- ; // c = c -1\n\t\tc-- ;\n\t\t\n\t\tSystem.out.println(c);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n int myIntValue = 5 / 3;\r\n float myFloatValue = 5f / 3f;\r\n double myDoubleValue = 5d / 3f;\r\n\r\n System.out.println(\"myIntValue = \" + myIntValue);\r\n System.out.println(\"myFloatValue = \" + myFloatValue);\r\n System.out.println(\"myDoubleValue = \" + myDoubleValue);\r\n\r\n // challenge\r\n\r\n double myPounds = 200d;\r\n double myTotalKg = 0.45359237 * myPounds;\r\n System.out.println(myTotalKg);\r\n\r\n }", "@Test\n\tpublic void testDFnumber(){\n\t\tdouble d1 = 0.05;\n\t\tdouble d2 = 0.01;\n\t\tSystem.out.println(d1+d2);\n System.out.println(1.0-0.42);\n System.out.println(4.015*100);\n System.out.println(123.3/100);\n\t}", "public double divide(double a, double b, boolean rem){ return rem? a%b: a/b; }", "public void testORDINARY_DIV5() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 14, \"saltire\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public static int p_div(){\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"please put the first number that you want to divide:\");\n int v_div_number_1 = keyboard.nextInt();\n System.out.println(\"please put the second number that you want to divide:\");\n int v_div_number_2 = keyboard.nextInt();\n int v_total_div= v_div_number_1/v_div_number_2;\n return v_total_div;\n }", "public void testDivide() {\r\n System.out.println(\"Divide\");\r\n Double [][] n = new Double[][]{{-3., -2.5, -1., 0., 1., 2., 3.4, 3.5, 1.1E100, -1.1E100}, \r\n {-3., 2.5, 0., 0., 1., -2., 3., 3.7, 1.1E100, 1.1E100}, \r\n {1., -1., 0., 0., 1., -1., 1.133333, 0.945945, 1., -1.}};\r\n for(int i = 0; i < 10; i++){\r\n try{\r\n Double x = n[0][i];\r\n Double y = n[1][i];\r\n double expResult = n[2][i];\r\n double result = MathOp.Divide(x, y);\r\n assertEquals(expResult, result, 0.001);\r\n }\r\n catch(DividedByZeroException e){\r\n assertTrue(e instanceof DividedByZeroException);\r\n }\r\n }\r\n }", "@Test\r\n public void testInvalidDivideAssignmentExpressionWithSIUnits3() throws IOException {\n checkError(\"varM/=varM\", \"0xA0179\");\r\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"今晚夜色真好\");\r\n\t\t//mathod2();\r\n\t\t\r\n\t\t//public static void method() throws ArithmeticException {\r\n\t\t\tint a=10;\r\n\t\t\tint b=0;\r\n\t\t\ttry {\r\n\t\t\tSystem.out.println(a/b );}\r\n\t\t\tcatch(ArithmeticException e){\r\n\t\t\t\tSystem.out.println(\"除数为零了\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\tSystem.out.println(\"可惜我不在你身边\");\r\n\t\r\n\t}", "@Test\n public void testDivisao() {\n System.out.println(\"divisao\");\n float num1 = 0;\n float num2 = 0;\n float expResult = 0;\n float result = Calculadora_teste.divisao(num1, num2);\n assertEquals(expResult, result, 0);\n }", "public void enfoncerDiv() {\n\t\ttry {\n\t\t\tthis.op = new Div();\n\t\t\tif (!raz) {\n\t\t\t\tthis.pile.push(valC);\n\t\t\t}\n\t\t\tint a = this.pile.pop(); int b = this.pile.pop();\n\t\t\tthis.valC = this.op.eval(b,a);\n\t\t\tthis.pile.push(this.valC);\n\t\t\tthis.raz = true;\n\t\t}\n\t\tcatch (ArithmeticException e) {\n\t\t\tSystem.out.println(\"Erreur : Division par zero !\");\n\t\t}\n\t\tcatch (EmptyStackException e) {\n\t\t\tSystem.out.println(\"Erreur de syntaxe : Saisir deux operandes avant de saisir un operateur\");\n\t\t}\n\t}", "public static void main(String[] args) {\n int myInt = 5;\n float myFloatValue = 5f / 3f;\n double myDoubleValue = 5d / 3f;\n System.out.println(\"my Int \" + myInt);\n System.out.println(\"my Int \" + myFloatValue);\n System.out.println(\"my Int \" + myDoubleValue);\n\n\n double numPounds = 200d;\n double converKil0 = numPounds * 0.45359237d;\n System.out.println(converKil0);\n\n double pi =3.14;\n }", "@Override\r\n\tpublic int div() {\n\t\treturn 0;\r\n\t}", "public void testORDINARY_DIV3() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 12, \"bend\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public void testORDINARY_DIV2() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 11, \"pale\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public void testORDINARY_DIV8() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 17, \"bend sinister\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public static double div(double a, double b) {\n return a / b;\n }", "public void testORDINARY_DIV6() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 15, \"chevron\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public static double divide(int left, int right){\n double output = (double)left/right;\n if (output == Double.POSITIVE_INFINITY) {\n throw new ArithmeticException(\"Cannot divide by 0\");\n }\n return (double)left / right;\n }", "public static double inverseFunction(Double num) {\n// try {\n// return 1 / num;\n// } catch (Exception e) {\n// Console.println(\"Err\");\n// }\n return 1 / num;\n }", "public static void main (String[] args) {\n\t\t\n\t\tbyte a = 5;\n\t\tbyte b = 3;\n\t\tboolean c;\n\t\n\t\tc = a != b;\n\t\tSystem.out.println(c);\n\t\t\n\t\t\n\t\tint g = 5;\n\t\tint h = 2;\n\t\tSystem.out.println(\"same datatype int: \" + g / h);\n\t\tSystem.out.println(\"same datatype int: \" + h / g);\n\t\n\t\tSystem.out.println(\"same datatype int mit modulo-Restwert: \" + g % h);\n\t\t\n\t\tdouble k = 5.2;\n\t\tdouble l = 2;\n\t\tSystem.out.println(\"same datatype double: \" + k / l);\n\t\t\n\t\tint i = 5;\n\t\tdouble j = 2;\n\t\tSystem.out.println(\"different datatype: \" + i / j);\n\t\t\n\t\t\n\t/* calculating with bytes & boolean (true/false) as result */\n\t\tbyte d = 1;\n\t\tbyte e = 0;\n\t\tboolean f;\n\t\n\t\tf = d == e;\n\t\tSystem.out.println(\"boolean: \" + f);\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "include<stdio.h>\nint main()\n{\n int num1,num2,num3;\n scanf(\"%d %d %d\",&num1,&num2,&num3);\n int av=(num1+num2+num3)/3;\n printf(\"%d\",av);\n return 0;\n}", "@Test\r\n public void testInvalidDivideAssignmentExpressionWithSIUnits2() throws IOException {\n checkError(\"varI_M/=varI_M\", \"0xA0179\");\r\n }", "public static void main(String args[]) {\nint a;\nint b;\na=100;\nSystem.out.println(\"variable a =\"+a);\nSystem.out.println(a);\nb=a/2;\nSystem.out.println(\"variable b=a/2=\" + b);\nSystem.out.println(\"Java drives the Web.\");\n}", "@Override\n public Float div(Float lhs, Float rhs) {\n\t\n\tassert(rhs != 0);\n\t\n\tfloat res = lhs/rhs;\n\treturn res;\n }", "@Test\n public void testZeroPuncturePoint(){\n assertTrue(\n \"Test [x = 0.0]: zero value puncture point\",\n Double.isNaN(systemFunctions.calculate(0))\n );\n }", "@Test\n public void testZeroPuncturePoint(){\n assertTrue(\n \"Test [x = 0.0]: zero value puncture point\",\n Double.isNaN(systemFunctions.calculate(0))\n );\n }", "public void testORDINARY_DIV9() throws Exception {\n\t\tObject retval = execLexer(\"ORDINARY_DIV\", 18, \"gyronny\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"ORDINARY_DIV\", expecting, actual);\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"\\\"\\\\\\'\");\nSystem.out.print(\" 2+2=5\");\nSystem.out.print(\"%\");\nint count=0;\nint z=0;\n\t /* for (int y = 0; y >= z; ++y, z++) {\n\t System.out.print(y + \"~\");\n\t System.out.println(z);*/\n\t \nif( 1 > 2 )\n{\nSystem.out.println(\" 1 is greater than 2\");\n}\nelse\n{\nSystem.out.println(\" 2 is greater than 1\");\n}\nint day = 7;\nswitch(day) {\n\ncase 1:\nSystem.out.println(\"Monday\");\ncase 2:\nSystem.out.println(\"Tuesday\");\ncase 3:\nSystem.out.println(\"Wednesday\");\ncase 4:\nSystem.out.println(\"Thursday\");\ncase 5:\nSystem.out.println(\"Friday\");\n}\nboolean a,b,c;\na = b = c = true;\nfloat f = 75.0f;\ndouble d = 75.0;\nint i = 75;\nif( f == d ) {\n if( f == i ) {\n System.out.println(\"f, d and i are equal\");\n } else {\n System.out.println(\"f, d are equal but i is not equal\");\n }\n} else {\n System.out.println(\"f and d are not equal\");\n}\n\n\n\nint t=2, sum=0;\nwhile(z<9) {\n z++;\n sum=sum+z;\n}\nSystem.out.print(sum);\nint x=1;\ndo{\n x++;\n System.out.print(x);\n}while(x<5);\nint count2 = 0;\nwhile (count2++ < 10) {\nSystem.out.println(\"Welcome to Java\");\n}\n}", "double test(double a){\n System.out.println(\"double a: \"+a);\n return a*a;\n }", "int div(int num1, int num2) {\n\t\treturn num1/num2;\n\t}", "public void testSUBORDINARY_DIV1() throws Exception {\n\t\tObject retval = execLexer(\"SUBORDINARY_DIV\", 28, \"pall\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"SUBORDINARY_DIV\", expecting, actual);\n\t}", "public static void main(String[] args) {\n\n salutare(\"Diana\");\n\n /* System.out.println(5+3);\n System.out.println(Integer.sum(5,3));\n System.out.println(\"Sum of 5 and 3 is \" + Integer.sum(5,3));\n System.out.println(\"Sum of 5 and 3 is \" + (5+3));*/\n\n\n int rezultatulAdunarii = adunare(5,4);\n System.out.println(\"Suma este \" + rezultatulAdunarii);\n\n\n/* int a = 10;\n double b = 3;\n System.out.println(a/b);\n\n int a1 = 10;\n int b1 = 3;\n double c1=b1;\n System.out.println(a1/c1);*/\n\n double rezultatulImpartire = impartire(10,3);\n System.out.println(\"Rezultatul impartirii este \" + rezultatulImpartire);\n\n/* System.out.println(-5+8*6);\n\n int x = -5;\n int y = 8;\n int z = 6;\n System.out.println(x+y*z);*/\n\n int rezultatCalul1 = calculComplex1(-5,8,6);\n System.out.println(\"Rezultat calculului este \" + rezultatCalul1);\n System.out.println(\"Rezultat calculului este \" + calculComplex1(-5,8,6));\n\n\n //System.out.println((55+9)%9);\n\n int rezultatCalcul2 = calcul2(55,9,9);\n System.out.println(\"Rezultat calculului este \" + rezultatCalcul2);\n\n /* double z1 = 20;\n double z2 = -3;\n double z3 = 5;\n double z4 = 8;\n System.out.println(z1+z2*z3/z4);\n System.out.println(20 + -3*5 / 8);*/\n\n double rezultatCalcul3 = calcul3(20, -3, 5, 8);\n System.out.println(\"Rezultat calculului este \" + rezultatCalcul3);\n\n //System.out.println(5 + 15 / 3 * 2 - 8 % 3);\n\n int rezultatCalcul4 = calcul4(5,15,3,2,8,3);\n System.out.println(\"Rezultatul calcului este \" + rezultatCalcul4);\n\n //Chem Metode Punct 2\n\n int substraction = subs(5,1);\n System.out.println(\"Rezultatul scaderii este \" + substraction);\n\n double divide = div(5,2);\n System.out.println(\"Rezultatul imparitrii este \" + divide);\n\n int add = addition(5,8);\n System.out.println(\"Rezultatul adunarii este \" + add);\n\n double multip = multiplication(3.2,4.5);\n System.out.println(\"Rezultatul inmultirii este \" + multip);\n\n //Chem Metode - Punct 3\n\n String scrieJ = \" J a v v a\\n\" + \" J a a v v a a\\n\" + \"J J aaaaa V V aaaaa\\n\" + \" JJ a a V a a\\n\";\n printWord(scrieJ);\n\n\n //Chem Metode Punct 4\n\n double rezultatMedie = mediaAritmetica(10,5,7);\n System.out.println(\"Rezultat este \" + rezultatMedie);\n\n //Refolosesc Metoda Punct 3\n\n String scrieFace = \"\"\"\n +\\\"\\\"\\\"\\\"\\\"+\n [| o o |]\n | ^ |\n | '_' |\n +-----+ \n \n \"\"\";\n\n String scrieFace2 = \" +\\\"\\\"\\\"\\\"\\\"+\\n\" + \" [| o o |]\\n\" + \" | ^ |\\n\" + \" | '_' | \\n\" + \" +-----+\\n\";\n\n printWord(\" +\\\"\\\"\\\"\\\"\\\"+\\n\" + \" [| o o |]\\n\" + \" | ^ |\\n\" + \" | '_' | \\n\" + \" +-----+\\n\");\n\n printWord(scrieFace);\n printWord(scrieFace2);\n\n //Chem Metode Punct 6\n\n //int rezultatModulo = modulo(10,3);\n // System.out.println(\"Rezultat este \" + rezultatModulo);\n System.out.println(\"Rezultat este \" + modulo(10,3));\n\n //Chem Metode Punct 7\n\n double c = transform(70);\n System.out.println(\"Transformare F= \" + c + \"C\");\n\n //Chem Metode Punct 8\n\n double m = convert(24.2);\n System.out.println(\"Transformare in= \" +m + \"M\");\n\n //Chem Metode Punct 8\n\n viteza(1000,1,60,0);\n\n }", "public static void main(String[] args) {\n int a =0;\n System.out.println((a!=0)?\"true\":\"false\");\n Double d = null;\n System.out.println((d instanceof Double)?true:false);\n\n\n }", "public static void main(String[] args) {\n System.out.print(\"a= \");\n int a= new Scanner(System.in).nextInt();\n System.out.print(\"b= \");\n int b = new Scanner(System.in).nextInt();\n int c=a*b;\n while (a!=b){\n if (a>b) a=a-b;\n else b=b-a;\n }\n System.out.println(\"UCLN= \"+a);\n System.out.println(\"BCNN= \"+(c/a));\n\n }", "public static void main(String[] args) {\n\r\n\t\tint a;\r\n\t\tint b;\r\n\t\t\r\n\t\ta=20;\r\n\t\tb=10;\r\n\t\t\t\t\r\n\t\tint quotient;\r\n\t\t\r\n\t\tquotient = a/b;\r\n\t\t\r\n\t\tSystem.out.println(\"the quotient of the 2 numbers is:\" + quotient);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tint num1=90;\n\t\tint num2=10;\n\t\t//syso +ctrl+space (short cut)\n\t\tSystem.out.println(num1+num2);\n\t\tSystem.out.println(num1-num2);\n\t\tSystem.out.println(num1*num2);\n\t\tSystem.out.println(num1/num2);\n\t\tint sum=num1+num2;\n\t\tSystem.out.println(sum);\n\t\tint sub=num1-num2;\n\t\tSystem.out.println(num1-num2);\n\t\tdouble n1=1.99;\n\t\tdouble n2=4.99;\n\t\tdouble total=n1+n2;\n\t\tSystem.out.println(total);\n\t\tdouble resultOfDivision=n1/n2;\n\t\tSystem.out.println(resultOfDivision);\n\t\tfloat f1=2.99f;\n\t\tfloat f2=4.05f;\n\t\tfloat floatDivision=f1/f2;\n\t\tSystem.out.println(floatDivision);\n\t\t//modulus %\n\t\tint number1, number2, mod;\n\t\tnumber1=10;\n\t\tnumber2=6;\n\t\tmod=number1%number2;\n\t\tSystem.out.println(mod);\n\t\t\n\t}", "public void testVARIABLE_DIV1() throws Exception {\n\t\tObject retval = execLexer(\"VARIABLE_DIV\", 103, \"gyronny\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"VARIABLE_DIV\", expecting, actual);\n\t}", "public static void main(String[] args) {\n\t\ttry\n{\n\t\n\tint data=80/0;\n}\ncatch (ArithmeticException e)\n\t\t{\n\tSystem.out.println(e);\n\t\t}\nSystem.out.println(\"rest of the work done\");\n\t\n\n\n\t}", "public int division(int a, int b) {\n return a / b;\n }", "private double _evaluate(String exp) throws NumberFormatException, ArithmeticException {\r\n return _evaluate(exp,0,(exp.length()-1));\r\n }" ]
[ "0.68117726", "0.6631241", "0.6611751", "0.6590554", "0.63612", "0.6314685", "0.6269568", "0.6229422", "0.61904275", "0.6181771", "0.6173312", "0.6123822", "0.6119136", "0.61170095", "0.6115569", "0.60749674", "0.6065513", "0.6051928", "0.6024278", "0.5999242", "0.5992323", "0.5979396", "0.5956343", "0.5943844", "0.5917939", "0.5904848", "0.5890271", "0.58844", "0.5862606", "0.5859435", "0.58532065", "0.58432466", "0.583193", "0.58292186", "0.5801861", "0.57893103", "0.57890433", "0.57830596", "0.5781612", "0.57763517", "0.5770279", "0.57613635", "0.57503706", "0.57330287", "0.57158095", "0.5703922", "0.57038534", "0.5697487", "0.5692403", "0.56912845", "0.5686012", "0.5683862", "0.56759316", "0.5668302", "0.56666267", "0.5659615", "0.5652348", "0.5651975", "0.56517977", "0.56485397", "0.5643798", "0.5641835", "0.56382823", "0.56370884", "0.5624613", "0.5611752", "0.55988574", "0.55948275", "0.559103", "0.55867535", "0.55778843", "0.5577278", "0.55685693", "0.5564187", "0.55598104", "0.5553366", "0.55499715", "0.55454516", "0.5544684", "0.55233574", "0.55225134", "0.552163", "0.5519429", "0.5518381", "0.5518246", "0.55179214", "0.55179214", "0.5515003", "0.55116504", "0.5505635", "0.55012023", "0.5478779", "0.54706997", "0.54694515", "0.54570705", "0.54554313", "0.54545784", "0.5454508", "0.54429895", "0.5442156", "0.5442082" ]
0.0
-1
Methods Clear the image on canvas
public void clearImage() { // Clear Image Area paint = false; this.repaint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearCanvas() {\n updateImageSize(mScale);\n }", "public void clearCanvas() {\n bitmap = Bitmap.createBitmap(display.getWidth(), display.getHeight(), Bitmap.Config.ARGB_4444);\n canvas.setBitmap(bitmap);\n mCurrentPathIndex = 0;\n invalidate();\n if (mListener != null) {\n mListener.pathCancelled();\n }\n }", "public void clearCanvas() {\n\n path_draw.reset();\n\n invalidate();\n\n }", "public void clearImage()\n {\n //Initialize the array of 0s\n int arr_len;\n if (image.getHeight() > image.getWidth()) arr_len = image.getHeight();\n else arr_len = image.getWidth();\n int[] rgb = new int[arr_len];\n //Set the whole image to black color\n image.setRGB(0,0,image.getWidth()-1,image.getHeight()-1,rgb,0,0);\n }", "public void clear()\n\t{\n\t\tgetGraphics().clearRect(0, 0, canvasWidth, canvasHeight);\n\t}", "public void clearImage() {\n IntStream.range(0, bytes.length).forEach(i -> bytes[i] = CLEAR_BYTE);\n }", "public void clearCanvas() {\n \tgc.setFill(Color.BLACK);\r\n //\tSystem.out.println(xCanvasSize+\" \"+ yCanvasSize);\r\n\t\tgc.fillRect(0, 0, xCanvasSize, yCanvasSize);}", "private static void clearCanvas(Canvas canvas) {\r\n canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n }", "public void clear() {\n if (Platform.isFxApplicationThread()) {\n clearImage();\n } else {\n Platform.runLater(() -> clearImage());\n }\n }", "public synchronized void clearImage()\r\n\t{\r\n\t\treferenceImage.clearImage();\r\n\t\tdisplayedImage.clearImage();\r\n\t}", "public void clear(){\r\n canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1);\r\n pane.getChildren().clear();\r\n }", "public void eraseImage() {\n\t\timage = null;\n\t}", "public void clear()\n\t{\n\t\tsignCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);\n\t\tpath.reset();\n\t\tinvalidate();\n\t}", "public void clear() {\n\t\tfor(int i=0;i<getWidth();i++) {\n\t\t\tfor(int j=0;j<getHeight();j++) {\n\t\t\t\tbImage.setRGB(i, j, 0xffffffff);\n\t\t\t}\n\t\t}\n\t}", "void clearCanvasAndDraw()\n {\n \tlauncher.clearRect(0, 0, launcherCanvas.getWidth(), launcherCanvas.getHeight());\n \tdrawLauncher(angle);\n \tcanvas.clearRect(0, 0, mainCanvas.getWidth(), mainCanvas.getHeight());\n \tdrawSky();\n \tdrawGrass();\n }", "public void cleanCanvas() {\n\t\tclean = true;\n\t\tthis.invalidate();\n\t\t\n\t\t// adiciona ponto fict’cio para informar que o canvas foi limpo num dado momento\n\t\tif (toReplay) {\n\t\t\txs.add(-2.0f);\n\t\t\tys.add(-2.0f);\n\t\t\tcolors.add(mPaint.getColor());\n\t\t}\n\t}", "private void erase()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.erase(this);\n }", "public void clear() { drawData.clear(); }", "public void clear() {\n\t\tsetImageResource(R.drawable.barcode);\n\t\tthis.setScaleType(ScaleType.CENTER);\n\t}", "protected void clearImageView(ImageView imageView) {\n imageView.setImageBitmap(null);\n }", "public static void forceClearBitmap() {\n System.gc();\n System.runFinalization();\n System.gc();\n }", "public void ClearBuffer() {\n\t\tfor (int y = 0; y < height; y++) {\n\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\tpixel_data[x + y * width] = 0x00000000;\n\t\t\t}\n\t\t}\n\t}", "public void clearSurface() {\n Canvas canvas = this.mSurfaceHolder.lockCanvas();\n if (canvas != null) {\n try {\n canvas.drawColor(0, PorterDuff.Mode.CLEAR);\n } finally {\n unlockCanvasAndPostSafely(canvas);\n }\n }\n }", "public void clear() {\r\n\tcount = 0;\r\n isDrawn = false;\r\n repaint();\r\n }", "public void clearImages() {\n\t images.clear();\n\t}", "public void erase()\n {\n canvas.eraseCircle(xPosition, yPosition, diameter);\n }", "public Builder clearImage() {\n \n image_ = getDefaultInstance().getImage();\n onChanged();\n return this;\n }", "public void draw(Canvas canvas)\n {\n if(img==null) {return;}\n canvas.drawBitmap(img.getBitmap(), x, y, null);\n }", "static void ClearDraw() {\n\t\tshape = new GeneralPath();\n\t\ti1.setOverlay(null);\n\t\tOL = new Overlay();\n\n\t}", "private synchronized void clearCanvasAndChart() {\n this.getLiveContext().clearRect(0, 0, this.getLiveCanvas().getWidth(), this.getLiveCanvas().getHeight());\n this.getxSeries().getData().clear();\n this.getySeries().getData().clear();\n }", "public void clearCircle();", "public final void clearBuffer() {\n width = 0;\n height = 0;\n noiseBuffer = null;\n }", "public void clear()\n {\n clear(BLACK);\n }", "public void ClearActionPerformed(java.awt.event.ActionEvent evt) {\n drawingPanel.setPath(\"null\"); \r\n }", "public void clear(View v) {\n myFingerPainterView.clearCanvas();\n }", "public void redraw() {\n\t\timgDisplay = null;\n\t\trepaint();\n\t}", "public void destroy(){\n\t\tcimg.destroy();\n\t}", "public void clear()\n {\n Arrays.fill(data, clearColor);\n }", "void deleteCurrentImageBuffered();", "public void clearScreen();", "public void newDrawing()\n {\n //clear the current canvas\n canvas.drawColor(0, PorterDuff.Mode.CLEAR);\n //reprint the screen\n invalidate();\n }", "private void resetBuffer() {\n\t\tbufferWidth = getSize().width;\n\t\tbufferHeight = getSize().height;\n\n\t\t// clean up the previous image\n\t\tif (bufferGraphics != null) {\n\t\t\tbufferGraphics.dispose();\n\t\t\tbufferGraphics = null;\n\t\t}\n\t\tif (bufferImage != null) {\n\t\t\tbufferImage.flush();\n\t\t\tbufferImage = null;\n\t\t}\n\t\tSystem.gc();\n\n\t\tbufferImage = new BufferedImage(bufferWidth, bufferHeight,\n\t\t\t\tBufferedImage.TYPE_INT_RGB);\n\t\tbufferGraphics = bufferImage.createGraphics();\n\t\tbufferGraphics.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t}", "private void desenhaCanoInferior(Canvas canvas) {\n canvas.drawBitmap(canoInferior, posicao, alturaCanoInferior, null);\n }", "public void clear() {\n int var1 = 0;\n if(field_759 || var1 < this.spritePixels.length) {\n do {\n this.spritePixels[var1] = null;\n this.field_736[var1] = 0;\n this.field_737[var1] = 0;\n this.spriteColoursUsed[var1] = null;\n this.spriteColourList[var1] = null;\n ++var1;\n } while(var1 < this.spritePixels.length);\n\n }\n }", "void kill () {if (img != null) {img.flush (); img = null;}}", "public void clear() {\n\t\tpoints.clear();\n\t\trepaint();\n\t}", "public void clearRect(int x, int y, float width, float height);", "public void clearAllGraphics()\r\n {\r\n graphics.clear();\r\n fullExtent = null;\r\n }", "@Override\n public void clearRect(double x, double y, double width, double height) {\n graphicsEnvironmentImpl.clearRect(canvas, x, y, width, height);\n }", "void clear() ;", "private void desenhaCanosuperior(Canvas canvas) {\n canvas.drawBitmap(canoSuperior, posicao, 0, null);\n }", "public void clear() throws OmDeveloperException\n \t{\n \t\t// Load image if needed\n \t\tif(isPropertySet(PROPERTY_FILEPATH) &&\n \t\t\t(!getQuestion().isFixedColour() || getBoolean(PROPERTY_REQUIREBG)))\n \t\t{\n \t\t\tif(biBackground!=null)\n \t\t\t{\n \t\t\t\tgetImage().setData(biBackground.getRaster());\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t// Fill to background\n \t\t\t\tGraphics g=getImage().getGraphics();\n \t\t\t\tg.setColor(getBackground());\n \t\t\t\tg.fillRect(0,0,bi.getWidth(),bi.getHeight());\n \n \t\t\t\t// Load file into it\n \t\t\t\ttry\n \t\t\t\t{\n \t\t\t\t\tbyte[] abData=getQuestion().loadResource(getString(PROPERTY_FILEPATH));\n \t\t\t\t\tBufferedImage loadedImage=ImageIO.read(new ByteArrayInputStream(abData));\n \t\t\t\t\tgetGraphics().drawImage(loadedImage,0,0,null);\n \t\t\t\t}\n \t\t\t\tcatch(IOException ioe)\n \t\t\t\t{\n \t\t\t\t\tthrow new OmDeveloperException(\"Failed to load image: \"+getString(PROPERTY_FILEPATH),ioe);\n \t\t\t\t}\n \n \t\t\t\t// Cache\n \t\t\t\tbiBackground=new BufferedImage(getImage().getWidth(),getImage().getHeight(),\n \t\t\t\t\tBufferedImage.TYPE_INT_RGB);\n \t\t\t\tbiBackground.setData(getImage().getRaster());\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\t// Fill to background\n \t\t\tGraphics g=getImage().getGraphics();\n \t\t\tg.setColor(getBackground());\n \t\t\tg.fillRect(0,0,bi.getWidth(),bi.getHeight());\n \t\t}\n \n \t\tbChanged=true;\n \t}", "void clear() {\n\t\tdispose();\n\t}", "public void erase() {\n if (r.isVisible()) {\n Canvas canvas = Canvas.getCanvas();\n canvas.erase(r);\n }\n }", "public abstract void clearRect(int x, int y, int width, int height);", "void resetDragImage();", "public static void clearXY()\r\n{\r\n\tx = 0;\r\n\ty = 0; \r\n\t\r\n}", "public void clear(){\n\t\tgraphics.setColor(Constants.COLOR_BACKGROUND);\n\t\tgraphics.fillRect(0, 0,setup.getFrameWidth()+12,setup.getFrameHeight()+12);\n\t\tdrawWindowSetup();\n\t}", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();", "void clear();" ]
[ "0.8564687", "0.8057267", "0.7896598", "0.781178", "0.77421826", "0.7657506", "0.76079416", "0.7550452", "0.74761933", "0.74672467", "0.74423236", "0.743919", "0.74069095", "0.73588234", "0.730762", "0.7292872", "0.7128996", "0.6988125", "0.6972421", "0.6932609", "0.6837326", "0.68320274", "0.6831344", "0.673912", "0.67274135", "0.66763526", "0.66645384", "0.6636366", "0.66236335", "0.660713", "0.6588359", "0.6540706", "0.6540298", "0.6532621", "0.6492603", "0.6472231", "0.6466043", "0.6443609", "0.6427136", "0.63951844", "0.63777375", "0.6348805", "0.6347958", "0.63430965", "0.6339036", "0.6335219", "0.6329674", "0.6320455", "0.63028795", "0.6276172", "0.62729967", "0.62603396", "0.62559044", "0.6253114", "0.6246438", "0.6244633", "0.6190199", "0.61870116", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622", "0.6182622" ]
0.82097197
1
Draw an image on the panel This is a standard method used by Graphics
@Override public void paintComponent(Graphics g) { // Paint image on panel if (paint && image != null) { g.drawImage(image, 0, 0, this); } else { // Paint panel black g.setColor(Color.white); g.fillRect(0, 0, getWidth(), getHeight()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void paintComponent(Graphics2D g) {\r\n g.drawImage(img, x, y, null);\r\n }", "public void drawImage(float x, float y, float width, float height);", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void draw(){\n\t\tString filename = \"images/\" + this.imgFileName;\n\t\tStdDraw.picture(this.xxPos, this.yyPos, filename);\n\t}", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponents(g);\n\t\tg.drawImage(img, 0, 0, sizeX, sizeY, this);\n\t}", "@Override\n protected void paintComponent(final Graphics g) {\n super.paintComponent(g);\n g.drawImage(image, 0, 0, this);\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(img, 0, 0, null);\n }", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tg.drawImage(image, 0, 0, getWidth(), getHeight(), null);\n\t}", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tg.drawImage(image, 310, 40, 200, 150, this);\n\t}", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "@Override\n\tpublic void draw(Graphics g) {\n\t\tthis.canvas.drawImage(g, this.image.getImage(), this.position.x, this.position.y);\n\t}", "public void paintComponent(Graphics g) {\n super.paintComponent(g);\n drawImage(g);\n }", "public void draw(PApplet p){\n p.image(img, x, y, width, height);\n }", "void drawStuff () {drawStuff (img.getGraphics ());}", "public void drawImage(float x, float y, float width, float height,\n\t\t\tColor color);", "public void paint(Graphics g)\r\n { \r\n g.drawImage(image, 0, 0, null); \r\n }", "public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}", "public void render() { image.drawFromTopLeft(getX(), getY()); }", "public void paint(Graphics g) {\r\n\r\n\t\tg.drawImage(myImage, x, y, null);\r\n\t}", "protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters \n }", "public void Draw() {\n\t\timgIcon = new ImageIcon(imgUrl);\n\t}", "protected void draw(GraphicsContext gc, Image img) {\n\t\tgc.drawImage(img, x, y, width, height);\n\t}", "public void draw(Graphics g) {\n image.paintIcon(null, g, xPos, yPos);\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g); // paint parent's background\n setBackground(Color.WHITE); // set background color for this JPanel\n if (img != null) {\n g.drawImage(img, 100, 100, this);\n }\n }", "public void paintComponent(Graphics g)\n\t\t{\n\t\t super.paintComponents(g);\n\t\t g.drawImage(img,0,0,this.getWidth(),this.getHeight(),this);\n\t\n\t\t}", "public void drawImage()\n {\n imageMode(CORNERS);\n //image(grayImgToFit, firstCellPosition[0], firstCellPosition[1]);\n image(canvas, firstCellPosition[0], firstCellPosition[1]);\n //image(tileMiniaturesV[0],10,250);\n //if(avaragedImgs.length > 4)\n // image(avaragedImgs[3],200,200);\n //getTileIntensityAtIndex(15,15);\n //println(tiles[7].getEndBrightness());\n \n }", "public void paint(Graphics g){\n\n // Draw our Image object.\n\n \nimage = Toolkit.getDefaultToolkit().getImage(\"D:\\\\screenShot.jpg\");\n g.drawImage(image,i,j,k,l, this); // at location 50,10\n System.out.print(\"inside\");\n g.drawString(\"hello\",500,500);\n \n // 200 wide and high\n }", "@Override\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(image, 1, 0, null); \n g.drawImage(player, 1, 0, null); \n \n }", "public void drawImage(Graphics g, int x, int y) {\n sg.bindTarget(g);\n sg.render(x, y, scalableImage);\n sg.releaseTarget();\n }", "@Override\n public void drawImage(Image image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh) {\n Object nativeImage = graphicsEnvironmentImpl.drawImage(canvas, image, sx, sy, sw, sh, dx, dy, dw, dh, image.getCached());\n image.cache(nativeImage);\n }", "public void render () {\n image (img, xC, yC, xLength * getPixelSize(), yLength * getPixelSize());\n }", "protected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\n\t\tGraphics2D g2 = (Graphics2D) g.create();\n\t\tg2.drawImage(img, 0, 0, width, height, null);\n\t}", "public void paintComponent(Graphics g){\n Dimension tam = this.getSize();\n g.drawImage(this.image, 0, 0, tam.width, tam.height, null);\n super.paintComponent(g);\n }", "public void paintComponent(Graphics g){\n Dimension tam = this.getSize();\n g.drawImage(this.image, 0, 0, tam.width, tam.height, null);\n super.paintComponent(g);\n }", "public void draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "private void drawImages() {\n\t\t\r\n\t}", "public void drawImage() {\n mTextureRender.drawFrame(mSurfaceTexture);\n }", "@Override\n public final void paint(float delta) {\n game.graphics.drawImage(\n image,\n centerX - (width / 2),\n centerY - (height / 2),\n scale, 0);\n }", "public void paint(Graphics g) {\r\n // simply draw the buffered image\r\n g.drawImage(img, 0, 0, getWidth(), getHeight(), this);\r\n }", "@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\tg2d.translate(this.getWidth() / 2, this.getHeight() / 2);\n\t\t\t\tg2d.translate(-image.getWidth(null) / 2, -image.getHeight(null) / 2);\n\t\t\t\tg2d.drawImage(image, 0, 0, null);\n\t\t\t}", "@Override\r\n\tpublic void render(GameContainer gc, Graphics g) {\n\r\n\t\tg.drawImage(image, drawX - 16, drawY - 24); \r\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(curr_img, x, y, null);\n\t}", "@Override\n public void paint(Graphics g) {\n g.drawImage(imgFond.getImage(), 0, 0, getWidth(), getHeight(),this);\n setOpaque(false);\n super.paint(g);\n }", "public void drawImage(ImageResource imageResource, float destinationX, float destinationY);", "@Override\n\t\tpublic void paint(Graphics g) {\n\t\t\tsuper.paint(g);\n\t\t\tg.drawImage(photoImage, 10, 2, 110, 130, this);\t\t\n\t\t}", "public void draw(File imageFile) {\n try {\n setImageSource(imageFile);\n } catch (IOException ex) {\n Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void paint(Graphics g, int xTower, int yTower){\n\t\tg.drawImage(img, xTower, yTower, null);\n\t}", "private void paintTheImage() {\n SPainter klee = new SPainter(\"Red Cross\", 600,600);\n SRectangle rectangle = new SRectangle(500, 100);\n klee.setColor(Color.RED);\n klee.paint(rectangle);\n klee.tl();\n klee.paint(rectangle);\n }", "public void paint( Graphics g ) {\r\n\t\tg.drawImage(image, 0, 0, (int) size.getWidth(), (int) size.getHeight(), this);\r\n\t}", "public void drawPixmap(Pixmap pixmap, int x, int y, int srcX, int srcY,\n\t int srcWidth, int srcHeight);", "@Override\n public void paint (Graphics graphics) \n {\n if (image_ == null) return;\n //graphics.drawImage (image_, 0, 0, width_, height_, this);\n Graphics2D g2d=(Graphics2D)graphics;\n g2d.drawImage(image_,null,0,0);\n g2d.setComposite(AlphaComposite.Src);\n g2d.dispose();\n }", "public void paint(Graphics g) {\n\t\tg.drawImage(img, 0, 0, getWidth(), getHeight(), this);\n\t}", "@Override\r\n public void Draw(Graphics g)\r\n {\r\n g.drawImage(image, (int)x, (int)y, width, height, null);\r\n\r\n\r\n ///doar pentru debug daca se doreste vizualizarea dreptunghiului de coliziune altfel se vor comenta urmatoarele doua linii\r\n //g.setColor(Color.blue);\r\n //g.fillRect((int)(x + bounds.x), (int)(y + bounds.y), bounds.width, bounds.height);\r\n }", "public void drawImage(Graphics gameImage){\n AffineTransform currRotation = AffineTransform.getTranslateInstance(x, y);\n currRotation.rotate(Math.toRadians(angle),this.objectImg.getWidth() / 2.0, this.objectImg.getHeight() /2.0);\n Graphics2D currImage = (Graphics2D) gameImage;\n currImage.drawImage(this.objectImg, currRotation, null);\n\n if(drawHitBox){\n gameImage.setColor(Color.GREEN);\n gameImage.drawRect(x,y,this.objectImg.getWidth(),this.objectImg.getHeight());\n }\n }", "public void drawTheImage(Graphics g)\r\n\t{\r\n\t\tg.setColor(Color.BLACK);\r\n\t\tg.fillOval(theX, theY, 10,10);\r\n\t\ttheX+=velX;\r\n\t\ttheY+=velY;\r\n\t}", "public void draw(){\n\t\tcomponent.draw();\r\n\t}", "@Override\n protected void paintBackground(Graphics2D g) {\n g.drawImage(image, 0, 0, this);\n }", "private void drawImage(Graphics g) {\n ProxyModel proxyModel = ProxyModel.instance();\n ClassLoader cl = this.getClass().getClassLoader();\n Graphics2D g2d = (Graphics2D) g;\n InputStream url = cl.getResourceAsStream(\"title.png\");\n BufferedImage img = null;\n\n try {\n img = ImageIO.read(url);\n } catch (IOException e) {\n e.printStackTrace();\n return;\n }\n\n Font font = new Font(\"Serif\", Font.PLAIN, 24);\n g2d.drawImage(img, 0, 0, 600, 600, null);\n g2d.setColor(new Color(20, 20, 20));\n g2d.setFont(font);\n g2d.drawString(\"SANTORINI BOARD GAME GUI SIMULATION\", 15, 640);\n\n /*\n g2d.drawImage(img, 0, 0, 600, 600, null);\n JTextField textField = new JTextField(\"Nickname\",20);\n textField.setFont(font);\n this.add(textField);\n\n */\n\n }", "public void draw(){\n\t\t/* Stamps a copy of the planet at the position. the file of the planet image is under folder of \"images\".\n\t\t * a mistake easily to be ignored here..*/\n\t\tString imageToDraw = \"images/\" + imgFileName;\n\t\tStdDraw.picture(xxPos, yyPos, imageToDraw);\n\n\t}", "public void paint(Graphics g) {\n\t\tGraphics2D g2 = (Graphics2D) g;\n\t\tg2.drawImage(img, tx, null);\n\t\t\n\t}", "protected void paintComponent(Graphics g) {\r\n super.paintComponent(g);\r\n g.drawImage(i, 0, 0, null); // see javadoc for more info on the parameters \r\n }", "public boolean drawImage(Image img, int x, int y, int width, int height,\r\n\t\t\tColor bgcolor, ImageObserver observer)\r\n\t{\r\n\t\t// System.out.println(\"drawImage\");\r\n\t\treturn false;\r\n\t}", "public abstract void render(PixelImage canvas);", "@Override\r\n public void paintComponent(Graphics g){\r\n super.paintComponent(g);\r\n Image fondo = loadImage(\"fondo.png\");\r\n g.drawImage(fondo, 0, 0, this);\r\n g.drawRect(this.tanque.getX(), this.tanque.getY(), 30, 30);\r\n Image tank = loadImage(this.tanque.getImagenes()[tanque.getAngulo()]);\r\n g.drawImage(tank, tanque.getX(), tanque.getY(), this);\r\n }", "public void draw (Graphics g, int x, int y)\r\n {\r\n\tmakeRGBImage().draw (g, x, y);\r\n }", "public void paint(Graphics g) {\r\n if (img != null) {\r\n g.drawImage(img, 0, 0, this);\r\n }\r\n }", "public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,\r\n\t\t\tint sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)\r\n\t{\r\n\t\t// System.out.println(\"drawImage\");\r\n\t\treturn false;\r\n\t}", "@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\t\n\t\tg.drawImage(bi, 0, 0, this.getWidth(), this.getHeight(), null);\n\t}", "public void paintComponent(Graphics g) {\n\n\t\tg.drawImage(bImage, 0, 0, this);\n\n\n\n\t}", "@Override\r\n public final void getDrawn(final DrawTool drawTool, final Image image) {\r\n drawTool.draw(this, image);\r\n }", "public boolean drawImage(Image img, int x, int y, ImageObserver observer)\r\n\t{\r\n\t\t// System.out.println(\"drawImage\");\r\n\t\treturn false;\r\n\t}", "@Override\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(volvoImage, volvoPoint.x, volvoPoint.y, null); // see javadoc for more in fo on the parameters\n g.drawImage(saabImage, saabPoint.x, saabPoint.y, null);\n g.drawImage(scaniaImage, scaniaPoint.x, scaniaPoint.y, null);\n }", "public void drawPixmap(Pixmap pixmap, int x, int y);", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "@Override\n public void render(Graphics g) {\n if (isVisible()) { \n g.drawImage(getImage(), (int)position.getX(), (int) position.getY(), width, height, null);\n }\n }", "public void drawImage(ImageResource imageResource, float destinationX, float destinationY, float destinationWidth, float destinationHeight);", "@Override\r\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(image, (int) (x - handler.getGameCamera().getxOffset()), \r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height, null);\r\n\t}", "void drawImage(Graphics g, Image i, int index, int x, int y, int width, int height){\n\t\tg.drawImage(images.get(i).get(index), (int) (x*worldScale), (int) (y*worldScale), (int) (width*worldScale), (int) (height*worldScale), this);\n\t}", "protected abstract void draw();", "@Override\n public void render(Graphics g) {\n\n g.drawImage(displayedImage, x, y, null);\n\n if(Game.showHitbox) {\n g.setColor(Color.green);\n g.drawRect(x, y, 64, 64);\n }\n }", "@Override\n public void drawImage(Image image, double x, double y) {\n Object nativeImage = graphicsEnvironmentImpl.drawImage(canvas, image, x, y, image.getCached());\n image.cache(nativeImage);\n }", "public void paintComponent(Graphics page) {\r\n super.paintComponent(page);\r\n IMAGE.paintIcon(this, page, x, y);\r\n }", "public void paint(Graphics g){\r\n \t/*\r\n \t * override default paint to draw \r\n \t * screen image in panel using current\r\n \t * scn_background.\r\n \t */\r\n \tg.drawImage(scn_image,0,0,scn_width,scn_height,scn_background_color,this);\r\n }", "public abstract void draw(java.awt.Graphics canvas);", "public void repaint (Graphics g){\r\n g.drawLine(10,10,150,150); // Draw a line from (10,10) to (150,150)\r\n \r\n g.setColor(Color.darkGray);\r\n g.fillRect( 0 , 0 , \r\n 4000 , 4000 ); \r\n \r\n g.setColor(Color.BLACK);\r\n \r\n BufferedImage image;\r\n \r\n for(int h = 0; h < 16; h++){\r\n for(int w =0; w< 16; w++){\r\n //g.drawImage(image.getSubimage(w *16, h*16, 16, 16), 0+(32*w),0 +(32*h), 32,32,this);\r\n g.drawRect(w *32, h*32, 32, 32);\r\n \r\n if(coord.xSelected >=0){\r\n g.setColor(Color.WHITE);\r\n g.drawRect(coord.xSelected *32, coord.ySelected *32, 32, 32);\r\n g.setColor(Color.BLACK);\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "@Override\r\n\tpublic void paintComponent(Graphics g) {\r\n\r\n\t\t// Gets the image\r\n\t\tBufferedImage image = null;\r\n\t\ttry {\r\n\t\t\timage = ImageIO.read(new File(logoFileName));\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif (image == null)\r\n\t\t\treturn;\r\n\r\n\t\t// Draws the image with auto-scaling\r\n\t\tg.drawImage(image, imageXCordinate, imageYCordinate, imageX2Cordinate,\r\n\t\t\t\timageY2Cordinage, 0, 0, image.getWidth(), image.getHeight(),\r\n\t\t\t\tnull);\r\n\t}", "public void paintComponent(Graphics g){\n\t\tg.drawImage(bf, 0, 0, this);\n\t}", "public void paintComponent(Graphics g){\n\t\t\tg.drawImage(img, 0,0,getWidth(), getHeight(), this);\n\t\t\tg.setFont(new Font(\"Times\", Font.BOLD, 55));\n\t\t\tg.drawString(\"DOGFIGHT\", 30, 60);\n\t\t}", "@Override\n\tpublic void draw(Graphics2D g) {\n\t\tImage pic = Toolkit.getDefaultToolkit().getImage(\"Space.png\");\n g.drawImage(pic, x, y, width, height, null);\n\t\t\n\t}", "public void drawOn(Graphics g);", "@Override\r\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\r\n Graphics2D g2d = (Graphics2D) g;\r\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n g2d.setRenderingHint(RenderingHints.KEY_RENDERING,\r\n RenderingHints.VALUE_RENDER_QUALITY);\r\n \r\n\r\n Image icon = new ImageIcon(getClass().getClassLoader().getResource(\"wallpaper.jpg\")).getImage();\r\n g2d.drawImage(icon,0,0,this);\r\n //drawScenario(g2d);\r\n if(currentState == Common.GAME_STATE.INGAME){\r\n drawGaming(g2d);\r\n }\r\n if(currentState == Common.GAME_STATE.MENU || currentState == Common.GAME_STATE.LOSE){\r\n drawMenu(g2d);\r\n }\r\n\r\n Toolkit.getDefaultToolkit().sync();\r\n }", "public void displayNewImage() {\n\t\tthis.canvas.display();\n\t}", "@Override\n public void drawImage(Image image, double x, double y, double width, double height) {\n Object nativeImage = graphicsEnvironmentImpl.drawImage(canvas, image, x, y, width, height, image.getCached());\n image.cache(nativeImage);\n }", "protected BufferedImage drawBoard(BufferedImage img) {\n myGame.initTiles();\n Graphics2D g2d = img.createGraphics();\n \n //player one\n g2d.setColor(Color.RED);\n int posx1 = myGame.posX(myGame.playerPos(1));\n int posy1 = myGame.posY(myGame.playerPos(1));\n g2d.fill(new Rectangle(posx1, posy1, 20, 20));\n \n //player two\n g2d.setColor(Color.BLUE);\n int posx2 = myGame.posX(myGame.playerPos(2)) + 20;\n int posy2 = myGame.posY(myGame.playerPos(2)) + 20;\n g2d.fill(new Rectangle(posx2, posy2, 20, 20));\n \n g2d.dispose();\n return img;\n }", "public void draw(Graphics g);", "public void draw(Graphics g);", "@Override\r\n\tpublic void render(Graphics g) {\n\t\timg.setPosition(x - cam.getX(), y - cam.getY());\r\n\t\timg.render(g);\r\n\t}", "public boolean drawImage(Image img, int x, int y, Color bgcolor,\r\n\t\t\tImageObserver observer)\r\n\t{\r\n\t\t// System.out.println(\"drawImage\");\r\n\t\treturn false;\r\n\t}" ]
[ "0.7604444", "0.7592043", "0.7566816", "0.7515273", "0.7448507", "0.7429448", "0.74182844", "0.7416162", "0.74043065", "0.73965394", "0.7387023", "0.7305082", "0.726118", "0.72277015", "0.7202397", "0.71260107", "0.7068519", "0.7024587", "0.69740826", "0.6962104", "0.693682", "0.6932188", "0.69303435", "0.69218826", "0.6904444", "0.68932915", "0.6862879", "0.6860589", "0.6824924", "0.6817906", "0.679127", "0.6779468", "0.677727", "0.676266", "0.6762206", "0.6762206", "0.67335594", "0.6725166", "0.6696158", "0.6683285", "0.66682875", "0.6643742", "0.66324013", "0.6629361", "0.66167736", "0.6615093", "0.6583878", "0.6570017", "0.65560144", "0.6533148", "0.6531861", "0.6510731", "0.65096563", "0.64943933", "0.64920014", "0.6482307", "0.6478416", "0.64747477", "0.64691657", "0.6461575", "0.6458045", "0.6456721", "0.64542145", "0.6452573", "0.6449446", "0.64439774", "0.6443975", "0.6434963", "0.6418694", "0.6417466", "0.6403837", "0.63922954", "0.6390947", "0.638235", "0.63811207", "0.63768464", "0.6364722", "0.63632065", "0.6362524", "0.63485664", "0.6337993", "0.6333094", "0.6328865", "0.6308377", "0.62972265", "0.62915426", "0.6286746", "0.6285539", "0.62838584", "0.62784076", "0.6274371", "0.6270699", "0.6264803", "0.6264627", "0.62577647", "0.62460244", "0.62453455", "0.62453455", "0.62451845", "0.6238938" ]
0.73062426
11
Update the panel This method is called automatically when repaint() is called. It is necesarry to doublebuffer the panel (to prevent it from blinking when updated).
@Override public void update(Graphics g) { paint(g); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}", "@Override\n\tpublic void Update(JPanel panel) {\n\t\t\n\t}", "private void updatePanel() {\n\t\tProbeUtilities.updateModelProbePanel();\n\t}", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "public void update()\n\t{\n\t\tJPanel panel = getPanel();\n\n\t\tif (panel instanceof StylePanel)\n\t\t\t((StylePanel) panel).updatePanel();\n\t}", "public void updateLayer() {\n bufferedImage = null;\n repaint();\n panelResized();\n }", "public void updateDrawing() {\n\n\t\tdrawingContainer.setDrawing(controller.getDrawing());\n\t\tscrollpane.setPreferredSize(new Dimension(drawingContainer\n\t\t\t\t.getPreferredSize().width + 100, drawingContainer\n\t\t\t\t.getPreferredSize().height + 100));\n\t\tpack();\n\t\trepaint();\n\t}", "protected void reDraw(){\n\t\tcontentPane.revalidate();\n\t\trepaint();\n\t}", "public void repaint()\n\t{\n\t\tif (game.getPlayerID() != game.getCurrentIdx())\n\t\t{\n\t\t\tthis.disable();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.enable();\n\t\t}\n\n\t\tthis.resetSelected();\n\t\tbigTwoPanel.repaint();\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "@Override\r\n\tpublic void repaint() {\n\t\tsuper.repaint();\r\n\t}", "@Override\r\n\tpublic void repaint() {\n\t\tsuper.repaint();\r\n\t}", "public void update(){\n\t\tsetChanged();\n\t\trender();\n\t\tprintTimer();\n\t}", "@Override\r\n public void repaint() {\r\n }", "public void requestRepaint() {\n }", "@Override\n public void update() {\n this.blnDoUpdate.set(true);\n }", "public void refresh() {\n\t\tthis.repaint();\n\t}", "public void refreshPanelComponents() {\r\n }", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "public void update( ) {\n\t\tdraw( );\n\t}", "@Override\n\tpublic void repaint() {\n\t\tsuper.repaint();\n\t}", "public void update() {\n\tfireContentsChanged(this, 0, getSize());\n }", "public void repaint() {}", "public void repaint() {\n\n\t}", "public void update(){\n\t\tif (!VisualizerMain.selectedRun.equals(\"\")){\n\t\t\tupdateEpochNum();\n\t\t\tupdateParticles();\n\t\t\tthis.repaint();\n\t\t}\n\t\t\n\t}", "@Override \n\tpublic void update(Graphics g) \n\t{\n\t\tpaint(g); \n\t}", "@Override\n protected void freeUpdate()\n {\n if (raceStarted)\n dragRacePanel.updateGameImage();\n\n /* Repaint panel */\n dragRacePanel.repaint();\n }", "public void refresh() {\n\t\tdisp.refresh();\n\t\tdisp.repaint();\n\t}", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "protected void updatePanelContent() {\n updating = true;\n jTextFieldName.setText(bulb.getName());\n jTextFieldName.setToolTipText(bulb.getType());\n jSlider1.setValue(bulb.getIntensity());\n jToggleButton1.setSelected(bulb.isOn());\n if (bulb.getColor() != null) {\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n switch(bulb.getColor()) {\n case TradfriConstants.COLOR_NORMAL: jRadioNormal.setSelected(true); break;\n case TradfriConstants.COLOR_WARM: jRadioWarm.setSelected(true); break;\n case TradfriConstants.COLOR_COLD: jRadioCold.setSelected(true); break;\n }\n }\n else {\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n }\n \n \n if (bulb.isOnline()) {\n jToggleButton1.setEnabled(true);\n jRadioCold.setEnabled(true);\n jRadioNormal.setEnabled(true);\n jRadioWarm.setEnabled(true);\n jSlider1.setEnabled(true);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [online]\");\n }\n else {\n jToggleButton1.setEnabled(false);\n jRadioCold.setEnabled(false);\n jRadioNormal.setEnabled(false);\n jRadioWarm.setEnabled(false);\n jSlider1.setEnabled(false);\n jLabelDates.setText(\"Installed: \"+bulb.getDateInstalled()+\" - Last seen: \"+bulb.getDateLastSeen()+\" - Firmware: \" + bulb.getFirmware() + \" [offline]\");\n }\n \n updating = false;\n }", "public void redraw()\r\n\t{\r\n\t\tif (needsCompleteRedraw)\r\n\t\t{\r\n\t\t\tcompleteRedraw();\r\n\t\t\tneedsCompleteRedraw = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpartialRedraw();\r\n\t\t}\r\n\t}", "private void drawPanelComponentResized(java.awt.event.ComponentEvent evt) {\n \n ((DrawPanel)drawPanel).updateEllipse();\n }", "public void update(Graphics g){\n paint (g);\r\n \r\n }", "public void requestRedraw() {\n\n this.getParent().repaint();\n\n }", "public void paintImmediately() {\n apparatusPanel2.paintDirtyRectanglesImmediately();\n }", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "@Override\n\tpublic void redraw() {\n\t\t\n\t}", "public void repaint() {\n\t\n}", "public void redraw() {\n\t\tif(this.getGraphics() != null){\n\t\t\tthis.getGraphics().drawImage(imageBuffer, 0, 0, this); // Swap\n\t\t}\n\t}", "public void redraw() {\n\t\t// LdvInt leftButtonWidth = new LdvInt(DOM.getElementPropertyInt(_leftScrollButton.getElement(), \"offsetWidth\"));\n\t\t// LdvInt rightButtonWidth = new LdvInt(DOM.getElementPropertyInt(_rightScrollButton.getElement(), \"offsetWidth\"));\n\t\t//_scrollArea.getElement().setPropertyInt(\"left\", leftButtonWidth);\n\t\t//_scrollArea.getElement().setPropertyInt(\"right\", rightButtonWidth);\n\t\t// _mainpanel.setCellWidth(_leftScrollButton, leftButtonWidth.intToString(-1)+\"px\");\n\t\t// _mainpanel.setCellWidth(_rightScrollButton, rightButtonWidth.intToString(-1)+\"px\");\n\t}", "public void PerformTimerTask() {\n \tif(refreshRate !=0){\n x+=px;\n y+=py;\n if (x+width >= panelW) {\n x = panelW - width;\n px = -px;\n }\n if (y+height >= panelH) {\n y = panelH - height;\n py = -py;\n }\n if (x < 0) {\n x = 0;\n px = -px;\n }\n if (y < 0) {\n y = 0;\n py = -py;\n }\n repaint();\n \t}\n }", "void updateDrawing() {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n }", "public void updateGamePanel() {\n\t\tthis.removeAll();\n\t\t\n\t\tButton2 buttonTip = new Button2(\"DICA\", 75, 100, 100, 100);\n\t\tbuttonTip.addActionListener(e -> Controller.game.showTip());\n\t\tthis.add(buttonTip);\n\t\t\n\t\tButton2 menu = new Button2(\"Menu\", 200, 100, 100, 100);\n\t\tmenu.addActionListener(e -> this.frame.setVisible(\"menu\"));\n\t\tthis.add(menu);\n\t\t\n\t\tthis.drawButtons();\n\t\t\n\t\t//Adding labels\n\t\tthis.add(frame.getWordShow());\n\t\tthis.add(frame.getLifeShow());\n\t\t\n\t\tthis.frame.add(this);//Adding the gameJPanel to the frame\n\t}", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "public void updateInfo()\n\t{\n\t\twidth = Game.frame.getWidth();\n\t\theight = Game.frame.getHeight();\n\t\tGame.frame.revalidate();\n\t\tGame.frame.repaint();\n\t}", "public void draw() {\n\t\tsuper.repaint();\n\t}", "public void update(Graphics g){\n paint(g);\n }", "protected void repaint()\n {\n // Update the contents if an update is needed.\n // Will only actually repaint if the contents are dirty.\n view.getEditor().getInteractionFigure().repaint();\n }", "public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }", "private void updateAndRender(long deltaMillis) {\n currentState.update(deltaMillis / 1000f); \r\n //Double Buffering (reduce tearing)\r\n prepareGameImage();\r\n currentState.render(gameImage.getGraphics(), this.getWidth(), this.getHeight());\r\n renderGameImage(getGraphics());\r\n }", "public void repaint() {\n setBackground(Color.white);\n super.repaint();\n setVisible(true);\n\n }", "public void doRepaint() {\n window.getApplication().doRepaint();\n }", "public void repaint() {\n frame.repaint();\n frame.requestFocus();\n }", "public void update(Graphics g) {\n // Note: Since the paint method is going to draw an\n // image that covers the complete area of the component we\n // do not fill the component with its background color\n // here. This avoids flickering.\n paint(g);\n }", "public void refreshAll() {\n\t\tdrawingPanel.repaint();\n\t}", "public void updatePanelWithAnimation() {\n AnimatorSet buildAnimatorSet = buildAnimatorSet(this.mLayoutView, 0.0f, (float) this.mLayoutView.findViewById(C0010R$id.panel_container).getHeight(), 1.0f, 0.0f, 200);\n ValueAnimator valueAnimator = new ValueAnimator();\n valueAnimator.setFloatValues(0.0f, 1.0f);\n buildAnimatorSet.play(valueAnimator);\n buildAnimatorSet.addListener(new AnimatorListenerAdapter() {\n /* class com.android.settings.panel.PanelFragment.AnonymousClass3 */\n\n public void onAnimationEnd(Animator animator) {\n PanelFragment.this.createPanelContent();\n }\n });\n buildAnimatorSet.start();\n }", "public void requestRepaint() {\n\t\tJWLC.nativeHandler().wlc_output_schedule_render(this.to());\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "public void refresh()\n {\n this.invalidate();\n this.validate();\n this.repaint();\n }", "@Override\n\tpublic void update(Observable o, Object arg) {\n\t\tthis.repaint(); // Schedule a call to paintComponent\n\t}", "public void partialRedraw()\r\n\t{\r\n\t\tg.clearRect(0,0,NumerateGame.WINDOW_X,NumerateGame.WINDOW_Y);\r\n\t}", "public void repaint();", "@Override\n\tpublic void updateScreen() {\n\t\tfield_154330_a.tick();\n\t\tsuper.updateScreen();\n\t}", "public void update() {\n\t\tif (c.getResamplingFactor() != 1) return;\n\t\trenderer.getVolume().updateData();\n\t}", "public void render() {\n this.canvas.repaint();\n }", "public void update(Graphics g) {\n paint(g);\n }", "public void update(Graphics g) {\n paint(g);\n }", "@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}", "public void update(Graphics g, JComponent c)\n/* */ {\n/* 304 */ super.update(g, c);\n/* */ }", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "public void update() {\n\n\t\tdisplay();\n\t}", "@Override\n\tpublic void updatePanel() {\n\t\tstatTable.setStatTable(getModel().getRowCount(),\n\t\t\t\tgetModel().getRowNames(), getModel().getColumnCount(),\n\t\t\t\tgetModel().getColumnNames());\n\t\tgetModel().updatePanel();\n\t}", "private void forceRedraw(){\n postInvalidate();\n }", "public void update() {\r\n\t\tthis.removeAll();\r\n\t\tdrawLinesAndLabels(this.getWidth(), this.getHeight());\r\n\t\tdrawNameSurferEntries();\r\n\t}", "public void repaint()\n\t{\n\t\tpanel.remove(recipeEntryDisplay); //remove the old display\n\t\trecipeEntryDisplay = renderEntryDisplay(); //create a new one\n\t\t//load new display into main panel\n\t\tpanel.add(recipeEntryDisplay, BorderLayout.CENTER);\n\t\tpanel.revalidate(); //tell BorderLayout changes have been made\n\t\tpanel.repaint(); //repaint just in case\n\t}", "public void update() {\n\t\tupdate(1);\n\t}", "private void updateCanvas()\r\n\t{\r\n\t\tboardCanvas.repaint();\r\n\t\tdiceCanvas.repaint();\r\n\t}", "private void controlResized() {\n disposeBackBuffer();\n initializeBackBuffer();\n\n redraw();\n }", "@Override\n public void updateScreen() {\n if (dirty) {\n Alkahestry.logger.info(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// String name = String.valueOf(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040);\n// fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040);\n dirty = false;\n }\n// ((ContainerMoleculeSplitter) container)\n// .moleculeSplitterTileEntity\n// .\n super.updateScreen();\n }", "@Override\n public void update() {\n updateBuffs();\n }", "public void update(Graphics g) {\r\n paint(g);\r\n }", "@Override\n\tpublic void update() {\n\t\t\n\t\tif(!this.explShowing)\n\t\t{\n\t\t\tx+= dx;\n\t\t\ty+= dy;\n\t\n\t\t\tif(x < 0)\n\t\t\t{\n\t\t\t\tx = 0;\n\t\t\t\tdx = dx *-1;\n\t\t\t}\n\t\t\telse\n\t\t\tif(x + w > MainGame.getInstance().X_WORLD_END)\n\t\t\t{\n\t\t\t\tx = MainGame.getInstance().X_WORLD_END - w ;\n\t\t\t\tdx = dx *-1;\t\n\t\t\t}\n\t\n\t\t\tif(y < 0)\n\t\t\t{\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t\telse\n\t\t\tif(y + h > MainGame.getInstance().Y_WORLD_END)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t}\n\t\t\n\t\ts.update();\n\t\n\t\tif(this.explShowing)\n\t\t{\n\t\t\tif(expl.isHasFinished())\n\t\t\t{\n\t\t\t\texplShowing = false;\n\t\t\t\ts = this.normalImage;\n\t\t\t\tthis.x = this.xStart;\n\t\t\t\tthis.y = this.yStart;\n\t\t\t\ts.setX(this.xStart);\n\t\t\t\ts.setY(this.yStart);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//s.setX(x);\n\t\t//s.setY(y);\n\t\t\n\t\tthis.rect.setFrame(getX(),getY(),getW(),getH());\t\n\t}", "private synchronized void updateData() {\n if (nanoseconds >= 1000000000) {\n fps = frames;\n ups = updates;\n nanoseconds = nanoseconds - 1000000000;\n frames = 0;\n updates = 0;\n }\n\n long elapsedTime = System.nanoTime() - oldTime;\n oldTime = oldTime + elapsedTime;\n nanoseconds = nanoseconds + elapsedTime;\n\n particleSimulator.update(elapsedTime * 1e-9);\n\n // An update occurred, increment.\n updates++;\n\n // Ask for a repaint if we know of a component to repaint\n if (gameDrawingComponent != null) {\n gameDrawingComponent.repaint();\n }\n }", "public void draw(){\n super.repaint();\n }", "@Override\npublic void rebuildPanel() {\n\t\n}", "@Override\r\n\tpublic void paint(float deltaTime) {\n\t\t\r\n\t}", "public void run() {\n\t\t\t\t\t\t\t\t heavyResize();\n\t\t\t\t\t\t\t\t invokeRedraw();\n\t\t\t\t\t\t\t\t }", "@Override\n public void update(int mouseX, int mouseY, boolean click) {\n super.update(mouseX, mouseY, click);\n _innerSize._x = _size._x * _progress;\n }", "@Override\n public void paint(Graphics g) {\n super.paintComponents(g);\n\n // a continuación apunto al jPanel\n Graphics2D g2 = (Graphics2D) jPanel1.getGraphics();\n\n // pinto el buffer sobre el jPanel\n g2.drawImage(buffer, 0, 0, null);\n \n \n }", "public void completeRedraw()\r\n\t{\r\n\t\tg = (Graphics2D) s.getDrawGraphics();\r\n\t}", "void updateControls();", "@Override\n public void run() {\n drawComponents();\n // Ve lai sau 1p\n drawComponentsHandler.postDelayed(drawComponentsRunnable, 60000);\n }", "private void rSButton6ActionPerformed(java.awt.event.ActionEvent evt) {\n home.removeAll();\n home.repaint();\n home.revalidate();\n \n home.add(updatepanel);\n home.repaint();\n home.revalidate();\n update1();\n }", "public void update()\n\t{\n\t\t// Place this GameCanvas at the proper location and size\n\t\tthis.setBounds(0, 0, game.getWindow().getWidth(), game.getWindow().getHeight());\n\t\t\n\t\tif (timeCount > game.getFps())\n\t\t\ttimeCount = 0;\n\t\t\n\t\ttimeCount++;\n\t}", "@Override\n public void update() {\n super.update();\n Frame parentFrame = getParentFrame(0);\n setEnabled(parentFrame != null);\n setToolTipText(getToolTipText(parentFrame));\n }", "public void repaint() {\n if ( clock != null && clock.isPaused() ) {\n super.repaint();\n }\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tpublic void updateScreen()\n {\n super.updateScreen();\n ++this.updateCount;\n }", "public abstract void forceRepaint();", "public PaintPanel()\r\n {\r\n // handle frame mouse motion event\r\n addMouseMotionListener(\r\n new MouseMotionAdapter()\r\n {\r\n // store drag points and repaint\r\n @Override\r\n public void mouseDragged(MouseEvent event)\r\n {\r\n points.add(event.getPoint());\r\n repaint(); // repaint JFrame\r\n }\r\n }\r\n );\r\n }" ]
[ "0.7420368", "0.71725535", "0.69325674", "0.6922367", "0.67842066", "0.6667775", "0.6639219", "0.6636938", "0.6533235", "0.6532996", "0.6514416", "0.6514416", "0.6512487", "0.65109956", "0.6496583", "0.64768887", "0.64635766", "0.64535815", "0.64235157", "0.6412551", "0.64033", "0.6368681", "0.63671345", "0.6366436", "0.6365929", "0.6363601", "0.6361766", "0.6346588", "0.6335146", "0.63338226", "0.63314354", "0.6320675", "0.63136595", "0.6290356", "0.62896067", "0.6286708", "0.62682295", "0.6268141", "0.6243601", "0.6228084", "0.6224419", "0.6222879", "0.6186231", "0.61855686", "0.6172066", "0.6159834", "0.61544853", "0.6154016", "0.6153139", "0.6144173", "0.6134917", "0.6130051", "0.61293846", "0.6123235", "0.6107385", "0.60961765", "0.60950917", "0.6094681", "0.6071556", "0.6058051", "0.60501224", "0.6036382", "0.6032844", "0.6020603", "0.6006381", "0.60041803", "0.60041803", "0.6002504", "0.5995391", "0.5993882", "0.5988023", "0.59870577", "0.5973767", "0.5973331", "0.59643316", "0.59608996", "0.59537923", "0.59505934", "0.5948817", "0.59477204", "0.5945307", "0.5930965", "0.5924762", "0.59215677", "0.5918002", "0.59170777", "0.5910367", "0.5908808", "0.590304", "0.5899379", "0.58957267", "0.58867127", "0.5882493", "0.58749956", "0.5866065", "0.5859552", "0.5859451", "0.5851412", "0.584776", "0.5840677" ]
0.6391718
21
Set the given image to current and redraw panel
public void setImage(BufferedImage i) { // Paint image object paint = true; image = i; this.repaint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateImgCanvas() {\n\t\timgCanvas.updateCanvasImage(source.source);\n\t\tthis.revalidate();\n\t\tthis.repaint();\n\t}", "public void redraw() {\n\t\tif(this.getGraphics() != null){\n\t\t\tthis.getGraphics().drawImage(imageBuffer, 0, 0, this); // Swap\n\t\t}\n\t}", "public void setActiveImage() {\n\t\tsetGraphic(new ImageView(activePiece));\n\t\tisActiveImageOn = true;\t\t\n\t}", "public void updateImage() {\n \t\tAnimation anim = this.animationCollection.at(\n \t\t\t\tfak.getCurrentAnimationTextualId());\n \n \t\t// if animation is set to something bad, then set it to back to initial\n \t\tif(anim==null)\n \t\t{\n \t\t\tfak.setCurrentAnimationTextualId(ConstantsForAPI.INITIAL);\n \t\t\tanim = this.animationCollection.at(\n \t\t\t\t\tfak.getCurrentAnimationTextualId());\n \t\t}\n \n \t\tif(anim==null)\n \t\t{\n \t\t\tanim = this.animationCollection.at(0);\n \t\t\tfak.setCurrentAnimationTextualId(anim.getTextualId());\n \t\t}\n \n \t\tif (anim != null) {\n \t\t\tif (fak.getCurrentFrame()\n \t\t\t\t\t>= anim.getLength()) {\n \t\t\t\tfak.setCurrentFrame(\n \t\t\t\t\t\tanim.getLength() - 1);\n \t\t\t}\n \n \t\t\tcom.github.a2g.core.objectmodel.Image current = anim.getImageAndPosCollection().at(\n \t\t\t\t\tfak.getCurrentFrame());\n \n \t\t\t// yes current can equal null in some weird cases where I place breakpoints...\n \t\t\tif (current != null\n \t\t\t\t\t&& !current.equals(this)) {\n \t\t\t\tif (this.currentImage != null) {\n \t\t\t\t\tthis.currentImage.setVisible(\n \t\t\t\t\t\t\tfalse, new Point(this.left,this.top));\n \t\t\t\t}\n \t\t\t\tthis.currentImage = current;\n \t\t\t}\n \t\t}\n \t\t// 2, but do this always\n \t\tif (this.currentImage != null) {\n \t\t\tthis.currentImage.setVisible(\n \t\t\t\t\tthis.visible, new Point(this.left,\n \t\t\t\t\t\t\tthis.top));\n \t\t}\n \n \t}", "public void displayNewImage() {\n\t\tthis.canvas.display();\n\t}", "public void redraw() {\n\t\timgDisplay = null;\n\t\trepaint();\n\t}", "public void changeImage(){\n if(getImage()==storeItemImg) setImage(selected);\n else setImage(storeItemImg);\n }", "public void affiche() {\n\t\tcontroller.image.repaint();\n\t}", "private void displayCurrentPicture() {\r\n\t\tglobalContainer.setWidget(0, 0, getCurrentPicture());\r\n\t}", "public void changeImage() {\r\n this.image = ColourDoor.image2;\r\n }", "public void Draw() {\n\t\timgIcon = new ImageIcon(imgUrl);\n\t}", "public void update(ImageObject nImage) { \r\n selectedImage = nImage;\r\n \r\n update();\r\n }", "public void updateLayer() {\n bufferedImage = null;\n repaint();\n panelResized();\n }", "public void act() {\n setImage(myGif.getCurrentImage());\n }", "private void setImageOnGUI() {\n\n // Capture position and set to the ImageView\n if (AppConstants.fullScreenBitmap != null) {\n fullScreenSnap.setImageBitmap(AppConstants.fullScreenBitmap);\n }\n\n }", "public void setCurrentImageHistory(Stack<ColorImage> img) {\n currentImage = img;\n }", "public void changeImageMule(){\n\t\tsetIcon(imgm);\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 setImage(Image newImage)\n {\n if (newImage == null)\n {\n setFill(null);\n }\n else\n {\n setFill(new ImageFill(newImage));\n }\n }", "public void updateImage(final Image image) { //The Reason that we have Set the Image to final over here is because once we fetch the Image from the AbsolutePath then after scaling this should be the Final Image in which we detect the Faces \n\t\timagelabel.setIcon(new ImageIcon(scaleImage(image))); \n\t}", "public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}", "public void redraw(Graphics g)\n {\n g.drawImage(img, (int)x, (int)y, this);\n }", "@Override\n public void onScreenUpdated(BufferedImage image) {\n RemoteMachineConfig.SCREEN = image;\n panel1.repaint();\n panel1.setSize(1020,600);\n }", "void setImage(BufferedImage i);", "@Override\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(curr_img, x, y, null);\n\t}", "void lSetImage(Image img);", "public void update(BufferedImage newImg, structs.ScreenRegion frame) {\r\n\t\tfeed.updateImage(newImg, frame);\r\n\t}", "public void videoOriginal(BufferedImage img) {\n\t\t// update image\n\t\tcurrFrame++;\n\t\tpanel.removeAll();\n\t\tpanel.setLayout(new BorderLayout());\n\t\tJLabel label = new JLabel(new ImageIcon(img));\n\t\tlabel.setPreferredSize(new Dimension(img.getWidth(), img.getHeight()));\n\t\tpanel.add(label, BorderLayout.CENTER);\n\t\tpanel.revalidate();\n\t\tpanel.repaint();\n\t\tslider.setValue(currFrame);\n\t}", "void setImage(BufferedImage valueImage, BufferedImage BackImage);", "public void revealImage(int current){\r\n System.out.println(gameBoard[current].getPicture());\r\n if(clickable){\r\n clickable = false;\r\n /*Getting the image in our ImageArray[current] and setting the image to the new image from our\r\n card Object in our gameBoard, adding the new image to the grid, to display, and using cardIndx\r\n object to store the col Index and Row Index*/\r\n imageArr[current] = new ImageView(new Image(gameBoard[current].getPicture()));\r\n grid.add(imageArr[current], cardIndx[current].getColIndex(), cardIndx[current].getRowIndex());\r\n \r\n if(ctr == 0){\r\n clicked[0] = current;\r\n clickable = true;\r\n ctr++;\r\n }\r\n \r\n else{\r\n imageArr[current] = new ImageView(new Image(gameBoard[current].getPicture()));\r\n grid.add(imageArr[current], cardIndx[current].getColIndex(), cardIndx[current].getRowIndex());\r\n \r\n clicked[1] = current;\r\n ctr = 0; \r\n try {\r\n \r\n Thread.sleep(300);\r\n compare();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n \r\n }\r\n \r\n \r\n \r\n }", "private void updateImage() {\r\n\r\n final BufferedImage image = imageCanvas.getImage();\r\n\r\n //\r\n // no image, no size\r\n\r\n if (image == null) {\r\n imageCanvas.setPreferredSize(new Dimension(0, 0));\r\n }\r\n\r\n else {\r\n\r\n final int imageWidth = image.getWidth();\r\n final int imageHeight = image.getHeight();\r\n\r\n //\r\n // if zoom is set to real size there is no need for calculations\r\n\r\n if (zoom == ZOOM_REAL_SIZE) {\r\n imageCanvas.setPreferredSize(new Dimension(imageWidth, imageWidth));\r\n }\r\n\r\n //\r\n // apply the zoom ratio to the image size\r\n\r\n else {\r\n\r\n final double ratio = ((double) zoom) / ((double) ZOOM_REAL_SIZE);\r\n\r\n final double imageCanvasMaxWidth = ((double) imageWidth) * ratio;\r\n final double imageCanvasMaxHeight = ((double) imageHeight) * ratio;\r\n\r\n imageCanvas.setPreferredSize(new Dimension((int) imageCanvasMaxWidth, (int) imageCanvasMaxHeight));\r\n }\r\n }\r\n\r\n //\r\n // revalidation\r\n // do not use #revaliade() method, validation will occur after all currently\r\n // pending events have been dispatched, use invalidate/validate/repaint\r\n\r\n imageCanvas. invalidate();\r\n imageCanvas.validate();\r\n imageCanvas.repaint();\r\n \r\n// imageCanvas.revalidate();\r\n \r\n invalidate();\r\n validate();\r\n repaint();\r\n\r\n// revalidate();\r\n \r\n //\r\n // this is the best place to update the cursor\r\n // since all actions on the image will call this method\r\n\r\n updateCursor(false);\r\n }", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "public void update() {\n if (this.active) {\n GameObject.processing.image(this.image, this.xPosition, this.yPosition);\n }\n }", "public void setImage(final BufferedImage image) {\n\t\tpicturePanel.setImage(image);\r\n\t\tpack();\r\n\t}", "public void updateImage(ColorImage newImage) {\n currentImage.push(newImage);\n }", "public void setImage(BufferedImage image) {\n\t\tdisplayImage = image;\n\t\tinitBbox();\n\t}", "@Override\n public Action update() {\n // draws the image \"image\" at position \"this.x\" and \"this.y\" and then returns null\n Thing.getProcessing().image(this.image, this.x, this.y);\n return null;\n }", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "public void setTempImage()\n {\n URL url = this.getClass().getResource(lastselection.getImage());\n\t\tImage image = Toolkit.getDefaultToolkit().getImage(url);\n\t\ttempImage = new PImage(image);\n\t\ttempImage.setBounds(0,0,65,170);\n\t\ttempImage.setTransparency(0);\n\t\tlayer.addChild(tempImage);\n\t}", "public void draw(){\n\t\tString filename = \"images/\" + this.imgFileName;\n\t\tStdDraw.picture(this.xxPos, this.yyPos, filename);\n\t}", "public void updateImage(BufferedImage displayImage) {\n this.imageToDisplay = new ImageIcon(displayImage);\n this.revalidate();\n this.repaint();\n }", "private void changeGraphic(ToggleButton toggleButton, Image diceImage){\n\t toggleButton.setGraphic(new ImageView(diceImage));\n\t}", "public void setImage(VolatileImage back, VolatileImage image, VolatileImage over){\n try{\n backVimImage = back;\n turnedVimImage = image;\n overVimImage = over;\n \n if(IS_TURNED) vimage = turnedVimImage;\n else vimage = backVimImage;\n }\n catch(Exception e){\n System.err.println(\"FUCK!!\");\n }\n this.repaint();\n }", "public void ChangeImage(Image SymImage){\n\n this.imgBackground = SymImage;\n /**\n imwidth = (double) this.imgBackground.getWidth(null);\n oldwidth = 461;\n oldheight = 361;\n */\n }", "public void updateObjectImage() {\r\n\t\tif (this.objectDescriptionTabItem != null) this.objectDescriptionTabItem.redrawImageCanvas();\r\n\t}", "public void setCurrentImage(int index) {\n if ((index >= 0) && (index < mTexIdArray.length)) {\n mTexId = mTexIdArray[index];\n }\n }", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(img, 0, 0, null);\n }", "public void update(Graphics g) {\n\t\tjava.awt.Image i = image;\n\t\tg.drawImage(i, 0, 0, this);\n\t\t// Graphics gr = this.getGraphics();\n\n\t}", "public void move() {\r\n\t\tsetY(getY() + 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 300, 60);\r\n\r\n\t}", "void setImage(Layer layer, Image image);", "@Override\n protected void paintComponent(final Graphics g) {\n super.paintComponent(g);\n g.drawImage(image, 0, 0, this);\n }", "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void updateOnCtWindowChange() {\n int[] displayImageData = resolveRaw(imgData[currentLayer]);\n raster.setPixels(0, 0, imgWidth, imgHeight, displayImageData);\n image.setData(raster);\n }", "public void repaint (Graphics g){\r\n g.drawLine(10,10,150,150); // Draw a line from (10,10) to (150,150)\r\n \r\n g.setColor(Color.darkGray);\r\n g.fillRect( 0 , 0 , \r\n 4000 , 4000 ); \r\n \r\n g.setColor(Color.BLACK);\r\n \r\n BufferedImage image;\r\n \r\n for(int h = 0; h < 16; h++){\r\n for(int w =0; w< 16; w++){\r\n //g.drawImage(image.getSubimage(w *16, h*16, 16, 16), 0+(32*w),0 +(32*h), 32,32,this);\r\n g.drawRect(w *32, h*32, 32, 32);\r\n \r\n if(coord.xSelected >=0){\r\n g.setColor(Color.WHITE);\r\n g.drawRect(coord.xSelected *32, coord.ySelected *32, 32, 32);\r\n g.setColor(Color.BLACK);\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "public void setImageView() {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image); \n }", "public void set(RenderedImage im) {\n this.im = im;\n ic.set(im);\n }", "private void runSlideshow(ActionEvent actionEvent) {\n Picture pictureToDisplay = getNextPicture();\n try {\n InputStream inputStream = new FileInputStream(pictureToDisplay.getAbsolutePath());\n BufferedImage bufferedImage = ImageIO.read(inputStream);\n Image image = SwingFXUtils.toFXImage(bufferedImage, null);\n\n this.imageView.setImage(image);\n inputStream.close();\n } catch (IOException ignored) {\n }\n }", "public void setHotImage (Image image) {\r\n\tcheckWidget();\r\n\tif (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);\r\n\tif ((style & SWT.SEPARATOR) != 0) return;\r\n\r\n\t/* TEMPORARY CODE: remove when when FLAT tool bars are implemented */\r\n\tif ((parent.style & SWT.FLAT) != 0) setImage (image);\r\n\r\n\thotImage = image;\r\n}", "public void setImg(){\n if(PicSingleton.getInstance().getPicToShape() != null){\n\n mResultImg.setImageDrawable(PicSingleton.getInstance().getPicShaped());\n }\n }", "public void setImage(Image image, boolean isNew)\r\n\t{\r\n\t\tif (isNew)\r\n\t\t{\r\n\t\t\tmRawImage = image;\r\n\t\t\tif (! mZoom)\r\n\t\t\t{\r\n\t\t\t\tint height = image.getHeight(null);\r\n\t\t\t\tint width = image.getWidth(null);\r\n\t\t\t\tif (mCurrentHeight != height) // assume different widths if different heights\r\n\t\t\t\t{\r\n\t\t\t\t\tsetTargetHeight(height);\r\n\t\t\t\t\tsetTargetWidth(width);\r\n\t\t\t\t\tnew ZoomAnimation().start();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// scale image to canvas as necessary\r\n\t\timage = new ImageIcon(image.getScaledInstance(getCurrentWidth(), getCurrentHeight(), Image.SCALE_FAST)).getImage();\r\n\r\n\t\t// check BufferedImage fit\r\n\t\tmImageBuffer = resizeBuffer(image);\r\n\r\n\t\t// paint incoming Image to BufferedImage\r\n\t\tGraphics2D g = mImageBuffer.createGraphics();\r\n\t\tg.drawImage(image, 0, 0, null);\r\n\t\tg.dispose();\r\n\r\n\t\tmCameraListener.newImage();\r\n\t}", "abstract public void modifyImage(long dt, long curTime, BufferedImage image) ;", "public void setImage(Image img) {\r\n this.img = img;\r\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tMat frame = grabFrame();\n\t\t\t\t\t\t// convert and show the frame\n\t\t\t\t\t\tImage imageToShow = Utils.mat2Image(frame);\n\t\t\t\t\t\tupdateImageView(imgPanel, imageToShow);\n\t\t\t\t\t}", "protected void onReloadImage() {\n String url = DataProvider.SCREEN + DataProvider.SCREEN_INDEX + mScreenId + \"&time=\" + System.currentTimeMillis();\n image.setUrl(url); //just to avoid caching\n loadTree();\n }", "@Override\n\t\tpublic void update(Graphics g) {\n\t\t\t\n\t\t\tImage pieceImg = null;\n\t\t\tif (board.square(row,column).isOccupied()) {\n\t\t\t\tint index = board.square(row,column).piece().imageIndex();\n\t\t\t\tpieceImg = pieceImages[index];\n\t\t\t}\n\t\t\tif (lightSquare)\n\t\t\t\t{ setIcon(new ImageIcon(combine(pieceImg, lightSquareImg))); }\n\t\t\telse\n\t\t\t\t{ setIcon(new ImageIcon(combine(pieceImg, darkSquareImg))); }\n\t\t}", "public void actionPerformed(ActionEvent e) {\n img = readImage(tfIDRead.getText());\n repaint();\n }", "void setImage(PImage img) {\n _img = img;\n }", "private void updatePicture() {\n \tif (!picture.getText().equals(\"\")) {\n\t\t\tif ( currentProfile != null ) {\n\t\t\t\t//Tries to open the given image fileName from user, throws an error if unable to open file.\n\t\t\t\tGImage image = null;\n\t\t\t\ttry {\n\t\t\t\t\timage = new GImage(picture.getText());\n\t\t\t\t} catch (ErrorException ex) {\n\t\t\t\t\tthrow ex;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Sets the currentProfile picture to the opened image and informs the user accordingly\n\t\t\t\tcurrentProfile.setImage(image);\n\t\t\t\tcanvas.displayProfile(currentProfile);\n\t\t\t\tcanvas.showMessage(\"Picture updated\");\n\t\t\t} else {\n\t\t\t\tcanvas.showMessage(\"Please select a profile to change picture\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void imageOpened(ImagePlus imp) {\n update(imp);\n }", "public void updateImage() {\n Graphics2D g = img.createGraphics();\n for (Circle gene : genes) {\n gene.paint(g);\n }\n g.dispose();\n }", "@Override\n public void paintComponent( Graphics g )\n {\n super.paintComponent( g ); // call superclass paintComponent\n \n images[ currentImage ].paintIcon(this, g, 115, 100);\n \n // Set next image to be drawn only if Timer is running\n if ( animationTimer.isRunning() )\n currentImage = ( currentImage + 1 ) % TOTAL_IMAGES;\n }", "public void loadImage() {\n\t\ttry {\n\t\t\tcurrImage = ImageIO.read(new File(INPUT_DIR,fileNames.get(fileCounter)));\n\t\t\tcurrImageOrigDim = new Dimension(currImage.getWidth(), currImage.getHeight());\n\t\t\tlabel4.setText(\"Processing: \" + fileNames.get(fileCounter));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// Resize to Frame\n\t\tdouble imgHt = currImage.getHeight();\n\t\tdouble imgWt = currImage.getWidth();\n\t\tdouble wRatio = FRAME_SIZE/imgWt;\n\t\tdouble hRatio = FRAME_SIZE/imgHt;\n\t\taspectR = Math.min(wRatio,hRatio);\n\t\tcurrImage = getScaledInstance(currImage, (int)(aspectR*imgWt), (int)(aspectR*imgHt));\n\t\tcurrImageBounds = new Rectangle(0, 0, currImage.getWidth(), currImage.getHeight());\n\t\trepaint();\n\t}", "public void run() {\n sight.setImageBitmap(bmp);\n // old = null;\n }", "public void setImage(Image img, boolean setVisible) {\n setImage(img);\n setImageVisible(setVisible);\n }", "public void refresh(Image img, int[][] meta) {\n \t\n panel.refresh(img, meta);\n \n }", "private void showImage() {\n this.animalKind = (String) imageCbox.getSelectedItem();\n try {\n ImageIcon imageIcon = new ImageIcon(getClass().getResource(\"/\" + animalKind + \"E.png\")); // load the image to a imageIcon\n Image image = imageIcon.getImage(); // transform it\n Image newImg = image.getScaledInstance(120, 120, Image.SCALE_SMOOTH); // scale it the smooth way\n imageIcon = new ImageIcon(newImg);// transform it back\n imgLabel.setIcon(imageIcon);\n this.add(imgLabel, gbc);\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n repaint();\n }", "public void render() { image.drawFromTopLeft(getX(), getY()); }", "public void draw(File imageFile) {\n try {\n setImageSource(imageFile);\n } catch (IOException ex) {\n Logger.getLogger(ImagePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void AnnulerEffect() {\n panImg.setImg(lstImg.getSelectImg(), lstImg.getSelectTitle());\n panImg.repaint();\n }", "private void animate() {\r\n\t\tif (spriteCounter > 50) {\r\n\t\t\tanimationFrame = 0;\r\n\t\t} else {\r\n\t\t\tanimationFrame = -16;\r\n\t\t}\r\n\t\t\r\n\t\tif (spriteCounter > 100) {\r\n\t\t\tspriteCounter = 0;\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tspriteCounter++;\r\n\t\tsetImage((Graphics2D) super.img.getGraphics());\r\n\t}", "public void update()\n {\n // get the GridSquare object from the world\n Terrain terrain = game.getTerrain(row, column);\n boolean squareVisible = game.isVisible(row, column);\n boolean squareExplored = game.isExplored(row, column);\n \n if (game.hasPlayer(row, column)){\n setImage2(\"images/player.png\");\n } else {\n player = null;\n }\n \n //ImageIcon image = null;//new ImageIcon(\"images/blank.png\");\n JLabel lblImage = new JLabel(); // create a new label to put an image on\n \n // call the method to set a new Buffered image to this panel\n \n if (squareVisible && image == null){\n switch ( terrain )\n {\n case SAND : setImage(\"images/sand.png\"); break;// = new ImageIcon(\"images/sand.png\"); break;\n case FOREST : setImage(\"images/forest.png\"); break;\n case WETLAND : setImage(\"images/wetland.png\"); break;\n case SCRUB : setImage(\"images/scrub.png\"); break;\n case WATER : setImage(\"images/water.png\"); break;\n default : image = null; break;\n }\n }\n \n// this is old code that use to change the graphics, trying BufferedImage instead of IconImage\n// switch ( terrain )\n// {\n// case SAND : setImage(\"images/forest.png\");// = new ImageIcon(\"images/sand.png\"); break;\n// case FOREST : image = new ImageIcon(\"images/forest.png\"); break;\n// case WETLAND : image = new ImageIcon(\"images/wetland.png\"); break;\n// case SCRUB : image = new ImageIcon(\"images/scrub.png\"); break;\n// case WATER : image = new ImageIcon(\"images/water.png\"); break;\n// default : image = null; break;\n// }\n \n if ( squareExplored || squareVisible )\n {\n // Set the text of the JLabel according to the occupant\n lblText.setText(game.getOccupantStringRepresentation(row,column)); \n }\n else {\n lblText.setText(\"\");\n image = null;\n }\n \n // if the game is not being played, remove the activeBorder (this fixes the multiple borders glitch)\n// if (game.getState() != GameState.PLAYING) {\n// setBorder(normalBorder);\n// } \n \n // set the redsquare border to active if the player is here\n setBorder(game.hasPlayer(row,column) ? activeBorder : normalBorder);\n \n\n // add the imageIcon to the gridsquare panel\n //lblImage.setIcon((Icon) image); // add the image to the label\n this.add(lblImage); // add the jlabel image to the current gridsquare\n \n JLabel lblImage2 = new JLabel(); \n this.add(lblImage2);\n \n }", "@Override\n public void run() {\n Mat frame = grabFrame();\n // convert and show the frame\n Image imageToShow = FXDIPUtils.mat2Image(frame);\n updateImageView(getCurrentFrame(), imageToShow);\n }", "public void drawImage()\n {\n imageMode(CORNERS);\n //image(grayImgToFit, firstCellPosition[0], firstCellPosition[1]);\n image(canvas, firstCellPosition[0], firstCellPosition[1]);\n //image(tileMiniaturesV[0],10,250);\n //if(avaragedImgs.length > 4)\n // image(avaragedImgs[3],200,200);\n //getTileIntensityAtIndex(15,15);\n //println(tiles[7].getEndBrightness());\n \n }", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tg.drawImage(image, 310, 40, 200, 150, this);\n\t}", "void resetDragImage();", "private void updateContPicture(String path) {\n \t\t// don't update if its already correct!\n \t\tif (imgPath == path) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\ttry {\n \t\t\tImage img = ImageIO.read(new File(path));\n \t\t\tif(img==null)\n \t\t\t\tthrow new IOException();\n \t\t\t// scale the image!\n \t\t\tif (img.getWidth(null) > 200 ||\n \t\t\t\t\timg.getHeight(null) > 200) {\n \t\t\t\timg = img.getScaledInstance(200, 200, Image.SCALE_SMOOTH);\n \t\t\t}\n \t\t\t\n \t\t\t// NO IO errors occured if getting here:\n \t\t\tImageIcon imgD = new ImageIcon(img);\n \t\t\timgDisplay.setIcon(imgD);\n \t\t\timgPath = path;\n \t\t} catch (IOException e) {\n \t\t\tSystem.out.println(\"Exception loading image for contestant \" +\n \t\t\t\t\t\"picture [\" + path + \"]\");\n \t\t\timgDisplay.setIcon(null);\n \t\t\timgDisplay.setText(\"Could not load: \" + path);\n \t\t}\n \t\t\n \t}", "private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }", "@FXML\r\n void reset(ActionEvent event) {\r\n \tclick=0;\r\n \twallRect.setFill(javafx.scene.paint.Color.DODGERBLUE);\r\n \tspaceRect.setFill(javafx.scene.paint.Color.DODGERBLUE);\r\n \tstateLabel.setText(\"Select Image\");\r\n \tsaveButton.setDisable(true);\r\n \tsolveButton.setDisable(true);\r\n \ttry {\r\n\t\t\ttim = new Image(file.toURI().toURL().toString());\r\n\t\t\tiv.setImage(tim);\r\n \t}catch(Exception e) {\r\n \t\te.printStackTrace();\r\n \t}\r\n }", "public void\r UpdatePixmap(CType display_context, ILPix_t pixmap,\r int x_offset, int y_offset, int width, int height);", "private void setPicture(BufferedImage image) {\r\n if (image != null) {\r\n int newHeight;\r\n int newWidth;\r\n if (image.getWidth() > image.getHeight()) {\r\n newWidth = jScrollPane1.getWidth();\r\n newHeight = image.getHeight() * newWidth / image.getWidth();\r\n\r\n if (newHeight > jScrollPane1.getHeight()) {\r\n int tmpWidth = newWidth;\r\n int tmpHeight = newHeight;\r\n newHeight = jScrollPane1.getHeight();\r\n newWidth = tmpWidth * newHeight / tmpHeight;\r\n }\r\n } else {\r\n newHeight = jScrollPane1.getHeight();\r\n newWidth = image.getWidth() * newHeight / image.getHeight();\r\n\r\n if (newWidth > jScrollPane1.getWidth()) {\r\n int tmpWidth = newWidth;\r\n int tmpHeight = newHeight;\r\n newWidth = jScrollPane1.getWidth();\r\n newHeight = tmpHeight * newWidth / tmpWidth;\r\n }\r\n }\r\n Image scaled = image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);\r\n photoScrollPane.setIcon(new ImageIcon(scaled));\r\n } else {\r\n photoScrollPane.setIcon(null);\r\n }\r\n }", "public void changeDirection(int image){\n this.image = image; \n }", "public MakeProfile(){\r\n try{\r\n i = ImageIO.read(new File(\"../images/New Profile.png\"));\r\n repaint();\r\n }\r\n catch(IOException e){\r\n }\r\n \r\n }", "void setIcon(String current) {\n\tif (current != null && (!current.equals(currentName) || mapList == null)) {\n mapList = main.myData.getGridLinks(current);\n\n removeAll();\n if (mapList == null) {\n revalidate();\n return;\n }\n\n\t currentName = current;\n\n TreeSet ts = new TreeSet(Collator.getInstance(Locale.FRANCE));\n ts.addAll(mapList.keySet());\n Iterator iter = ts.iterator();\n ArrayList panels = new ArrayList();\n int idx = 0;\n int x = 0;\n int y = 0;\n while (iter.hasNext()) {\n String gridid = (String) iter.next();\n String[] refmap = (String[]) mapList.get(gridid);\n ImagePanel p = new ImagePanel(refmap);\n\n if (gridid.matches(\"[0-9],[0-9]\")) {\n x = Integer.parseInt\n (gridid.substring(0, gridid.indexOf(',')));\n y = Integer.parseInt\n (gridid.substring(gridid.indexOf(',')+1));\n }\n else {\n x = idx%4;\n y = idx/4;\n idx++;\n }\n\n // Prepare y-panels\n for (int i = panels.size(); i <= y; i++)\n panels.add(new ArrayList());\n\n // Prepare x-panels\n ArrayList al = (ArrayList) panels.get(y);\n for (int i = al.size(); i <= x; i++)\n al.add(null);\n\n al.set(x, p);\n }\n\n GridBagConstraints constr = new GridBagConstraints();\n constr.fill = GridBagConstraints.BOTH;\n constr.weightx = constr.weighty = 1;\n constr.insets = new Insets(5,5,5,5);\n for (int i = 0; i < panels.size(); i++) {\n ArrayList al = (ArrayList) panels.get(i);\n for (int j = 0; j < al.size(); j++) {\n JComponent px = new JPanel();\n constr.gridx = j;\n constr.gridy = i;\n if (al.get(j) != null)\n px = (ImagePanel)al.get(j);\n add(px, constr);\n }\n }\n\n\t // Adapt the display\n\t revalidate();\n\t}\n }", "public void resetImageToFaceState() {\n String iconPath = Global.IMAGE_PATH;\n switch (game.getFinished()) {\n case 0:\n iconPath += \"face-normal.png\";\n break;\n\n case 1:\n iconPath += \"face-win.png\";\n break;\n\n case 2:\n iconPath += \"face-lose.png\";\n break;\n\n default:\n iconPath += \"face-normal.png\";\n break;\n }\n face.setIcon(new ImageIcon(iconPath));\n }", "@Override\r\n public void paintComponent(Graphics2D g) {\r\n g.drawImage(img, x, y, null);\r\n }", "public void update(ImagePlus imp) {\n if (this.isVisible()) {\n if (imp == null) {\n imageMetadataModel_.setMetadata(null);\n summaryCommentsTextArea.setText(null);\n } else {\n AcquisitionVirtualStack stack = getAcquisitionStack(imp);\n if (stack != null) {\n int slice = imp.getCurrentSlice();\n TaggedImage taggedImg = stack.getTaggedImage(slice);\n if (taggedImg == null) {\n imageMetadataModel_.setMetadata(null);\n } else {\n Map<String,String> md = stack.getTaggedImage(slice).tags;\n if (!showUnchangingKeys_)\n md = selectChangingTags(md);\n imageMetadataModel_.setMetadata(md);\n }\n if (imp instanceof CompositeImage) {\n CompositeImage cimp = (CompositeImage) imp;\n displayModeCombo.setSelectedIndex(cimp.getMode()-1);\n }\n } else {\n imageMetadataModel_.setMetadata(null);\n }\n \n }\n }\n }", "void drawStuff () {drawStuff (img.getGraphics ());}", "public void setImage(Image itemImg) \n {\n img = itemImg;\n }", "public void updateImage(GameObject.Direction direction) {\n switch (direction) {\n case NORTH:\n currentImage = north;\n break;\n\n case SOUTH:\n currentImage = south;\n break;\n\n case WEST:\n currentImage = west;\n break;\n\n case EAST:\n currentImage = east;\n break;\n }\n }" ]
[ "0.69487625", "0.6948533", "0.6889022", "0.6725734", "0.6703419", "0.6679517", "0.66723627", "0.66458666", "0.6616979", "0.6566386", "0.65286374", "0.64294475", "0.64161235", "0.6399291", "0.6372893", "0.63451123", "0.6332102", "0.6329812", "0.63038844", "0.6299314", "0.6297778", "0.6285804", "0.6279669", "0.6278743", "0.62662876", "0.6263617", "0.626127", "0.6260053", "0.62583715", "0.625447", "0.6230654", "0.6229111", "0.6222198", "0.6214823", "0.6195367", "0.61837333", "0.616237", "0.6141518", "0.6132306", "0.6087412", "0.6080719", "0.6060755", "0.6052875", "0.60468984", "0.6032639", "0.60256624", "0.6018258", "0.6006795", "0.600465", "0.60035974", "0.59974474", "0.5995918", "0.5994823", "0.5987847", "0.5985168", "0.5971178", "0.5940001", "0.593405", "0.59317315", "0.5924524", "0.59180725", "0.591745", "0.5917237", "0.5912029", "0.5905515", "0.59000844", "0.58952045", "0.5891243", "0.5889252", "0.5887082", "0.5886075", "0.5860733", "0.58568144", "0.58548224", "0.58499223", "0.5843639", "0.58427", "0.58322084", "0.5829184", "0.5795655", "0.5794374", "0.57938117", "0.578676", "0.57858723", "0.5782532", "0.57813483", "0.5770978", "0.5769922", "0.5757202", "0.5750512", "0.57502526", "0.5744218", "0.5732514", "0.572316", "0.57218605", "0.5721803", "0.5719303", "0.57175124", "0.5716549", "0.57154524" ]
0.678881
3
Extract the tuple and its contribution ratio.
private static Contributor createContributor( Entry<MultiKeyFeature, Double> entry, ScoreAggregationRecordDetails scoreAggregationRecordDetails, ScoredDataReaderViewer scoredDataReaderViewer) { MultiKeyFeature tuple = entry.getKey(); double contributionRatio = entry.getValue(); // Get the first and the last underlying scored records with this tuple. TimeRange timeRange = scoreAggregationRecordDetails.getTimeRange(); String scoredRecordAdeEventType = scoreAggregationRecordDetails.getScoredRecordAdeEventType(); MultiKeyFeature context = scoreAggregationRecordDetails.getContextFieldNameToValueMap(); AdeScoredRecord firstScoredRecord = scoredDataReaderViewer.getFirstScoredRecord( timeRange, scoredRecordAdeEventType, context, tuple); AdeScoredRecord lastScoredRecord = scoredDataReaderViewer.getLastScoredRecord( timeRange, scoredRecordAdeEventType, context, tuple); // Create a new Contributor instance. return new Contributor(tuple, contributionRatio, firstScoredRecord, lastScoredRecord); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Tuple3<Long, Long, Double> getResult(Tuple3<Long, Double, Double> tuple) {\n return new Tuple3<>((long) random.nextInt(FlinkConfig.PARALLELISM), tuple.f0, tuple.f1 * wa + tuple.f2 * wb);\n }", "public abstract double getasDouble(int tuple, int val);", "double getRatio();", "org.hl7.fhir.Ratio getValueRatio();", "public abstract float getasFloat(int tuple, int val);", "public TupleDesc getTupleDesc();", "@VTID(13)\r\n java.lang.String getTuple();", "public abstract T getTuple(Record record);", "public abstract double[] getasDouble(int tuple);", "static ProjectedTuple castNumbers(ProjectedTuple tuple) {\n List<Object> newVaues = new ArrayList<>();\n for (int i = 0; i < tuple.values().size(); i++) {\n newVaues.add(convert(tuple.values().get(i), tuple.paths().get(i).returnType()));\n }\n\n return ProjectedTuple.of(tuple.paths(), newVaues);\n }", "public double getUtility(double ratio) {\n\t\treturn ratio*linearUtility;\r\n\t}", "double sim(Tuple tup, Connection dbConn) throws SQLException {\n\tdouble count = 0;\n\tTuple thisTuple = this;\n\tTuple thatTuple = tup;\n\tint size = this.schema.size();\n\tfor (int i = 0; i < thisTuple.getSchema().size(); i++) {\n\n\t /*\n\t * get the attribute name: - only tranlate columns in result tables\n\t * - ignore __ROWID\n\t */\n\t String tup1Att = \"\";\n\t if (thisTuple.source.startsWith(Parameters.QUERY_RESULT_PREFIX)\n\t\t && thisTuple.source\n\t\t\t .endsWith(Parameters.QUERY_RESULT_SUFFIX)\n\t\t && !thisTuple.getSchema().get(i)\n\t\t\t .equals(Parameters.ROWID_ATT_NAME)) {\n\t\ttup1Att = ColumnInfo.getOriginalTableColumnName(\n\t\t\tthisTuple.source, thisTuple.getSchema().get(i), dbConn);\n\t } else {\n\t\ttup1Att = thisTuple.getSchema().get(i);\n\t }\n\n\t for (int j = 0; j < thatTuple.getSchema().size(); j++) {\n\n\t\t// get the attribute name\n\t\tString tup2Att = \"\";\n\t\tif (thatTuple.source.startsWith(Parameters.QUERY_RESULT_PREFIX)\n\t\t\t&& thatTuple.source\n\t\t\t\t.endsWith(Parameters.QUERY_RESULT_SUFFIX)\n\t\t\t&& !thatTuple.getSchema().get(j)\n\t\t\t\t.equals(Parameters.ROWID_ATT_NAME)) {\n\t\t tup2Att = ColumnInfo.getOriginalTableColumnName(\n\t\t\t thatTuple.source, thatTuple.getSchema().get(j),\n\t\t\t dbConn);\n\t\t} else {\n\t\t tup2Att = thatTuple.getSchema().get(j);\n\t\t}\n\n\t\tAttribute att1 = new Attribute(tup1Att);\n\t\tAttribute att2 = new Attribute(tup2Att);\n\t\tif (((tup1Att.equals(tup2Att)) || (Metric\n\t\t\t.isInSameForeignKeyChain(att1, att2)))\n\t\t\t&& (this.values.get(i).equals(tup.values.get(j)))) {\n\t\t count++;\n\t\t break;\n\t\t}\n\n\t }\n\t}\n\tif (this.schema.contains(Parameters.ROWID_ATT_NAME)) {\n\t size -= 1;\n\t}\n\treturn count / size;\n }", "int getRatioQuantity();", "public String get_fraction_part();", "public float getProgress() {\n // Depends on the total number of tuples\n return 0;\n }", "private TupleDesc generalTupleDesc(){\n \tType[] typeArr;\n \tString[] nameArr;\n \tif(gbField == NO_GROUPING && gbFieldType == Type.INT_TYPE){\n \t\ttypeArr = new Type[]{Type.INT_TYPE};\n \t\tnameArr = new String[]{\"aggregateValue\"};\n \t}else if(gbField == NO_GROUPING){ //gbFieldType == Type.STRING_TYPE\n \t\ttypeArr = new Type[]{Type.STRING_TYPE};\n \t\tnameArr = new String[]{\"aggregateValue\"};\n \t} else {\n \t\ttypeArr = new Type[]{gbFieldType, Type.INT_TYPE};\n \t\tnameArr = new String[]{\"groupValue\", \"aggregateValue\"};\n \t}\n \treturn new TupleDesc(typeArr, nameArr);\n }", "public Relation project(Tuple t) throws RelationException;", "private TupleDesc generateTupleDesc(){\n \tif(this.childTD == null){ //no tuples merged yet\n \t\t//return a general tupleDesc\n \t\treturn generalTupleDesc();\n \t} else {\n \t\t//generate a helpful, well-named TupleDesc\n \t\tType[] typeArr;\n \tString[] nameArr;\n \tString aggName = operator.toString() + \"(\" + childTD.getFieldName(aggField) + \")\";\n \tif(gbField == NO_GROUPING && gbFieldType == Type.INT_TYPE){\n \t\ttypeArr = new Type[]{Type.INT_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t}else if(gbField == NO_GROUPING){ //gbFieldType == Type.STRING_TYPE\n \t\ttypeArr = new Type[]{Type.STRING_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t} else {\n \t\ttypeArr = new Type[]{gbFieldType, Type.INT_TYPE};\n \t\tString groupName = \"group by(\" + childTD.getFieldName(gbField) + \")\";\n \t\tnameArr = new String[]{groupName, aggName};\n \t}\n \treturn new TupleDesc(typeArr, nameArr);\n \t}\n }", "private final Tuples<Integer, Integer> m137836a() {\n int i;\n int measuredWidth = getMeasuredWidth() / getChildCount();\n if (getChildCount() == 1 || LPFit.f99531a.mo120373a()) {\n i = getMeasuredHeight();\n } else {\n i = (int) (((float) measuredWidth) / VideoParams.f96577a.mo116006l());\n }\n return new Tuples<>(Integer.valueOf(measuredWidth), Integer.valueOf(i));\n }", "@Override\n public String getValueFromTuple(ITuple tuple) {\n return tuple.getStringByField(\"top_n_words\");\n\t\t// End\n }", "private Tuple<PatternCoordinates, Mat> pair(){\n mCamera.takePicture(null, null, jpegCallBack);\n\n Tuple<PatternCoordinates, Mat> patternAndImagePair = null;\n switch(GlobalResources.getInstance().getImageSettings().getBackgroundMode()){\n case ImageSettings.BACKGROUND_MODE_RGB:\n patternAndImagePair = patternDetectorAlgorithm.find(rgba, binary, false);\n break;\n case ImageSettings.BACKGROUND_MODE_GRAYSCALE:\n patternAndImagePair = patternDetectorAlgorithm.find(grey, binary, true);\n break;\n case ImageSettings.BACKGROUND_MODE_BINARY:\n patternAndImagePair = patternDetectorAlgorithm.find(binary, binary, true);\n }\n GlobalResources.getInstance().updateImage(patternAndImagePair.element2);\n return patternAndImagePair;\n }", "public abstract float[] getasFloat(int tuple);", "public DurationFactor getTupletFactor ()\r\n {\r\n return tupletFactor;\r\n }", "public Double getProtein() {\n return product.getProtein() * weight / 100;\n }", "public Integer getRatio() {\n return ratio;\n }", "private int getPercentageValue(String elem){\n String query = \"declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' $this//a:\" + elem;\n\n XmlObject[] obj;\n\n // first ask the context color and if not found, ask the actual color bean\n if(_phClr != null){\n obj = _phClr.selectPath(query);\n if(obj.length == 1){\n Node attr = obj[0].getDomNode().getAttributes().getNamedItem(\"val\");\n if(attr != null) {\n return Integer.parseInt(attr.getNodeValue()) / 1000;\n }\n }\n }\n\n obj = _xmlObject.selectPath(query);\n if(obj.length == 1){\n Node attr = obj[0].getDomNode().getAttributes().getNamedItem(\"val\");\n if(attr != null) {\n return Integer.parseInt(attr.getNodeValue()) / 1000;\n }\n }\n\n\n return -1;\n }", "public TupleDesc getTupleDesc() {\n // some code goes here\n return td;\n }", "@Override\r\n public Tuple2<List<String>, Tuple2<List<String>, Double>> map(Tuple2<Tuple2<List<String>, Integer>, List<String>> value) {\r\n List<String> subsets = value.f1;\r\n Tuple2<List<String>,Integer> supportResult = countItem(subsets, transactions);\r\n double supportSub = (double) supportResult.f1;\r\n double supportOrg = (double) value.f0.f1;\r\n double confidence = supportOrg/supportSub;\r\n return new Tuple2<List<String>, Tuple2<List<String>, Double>>(value.f0.f0, new Tuple2<List<String>, Double>(subsets, confidence));\r\n }", "@Override\n\t\tpublic TupleDesc getTupleDesc() {\n\t\t\treturn td;\n\t\t}", "private Double computeRatio(final Collection<?> partial, final Collection<?> complete) {\n\r\n\t\tif (partial.isEmpty() || complete.isEmpty())\r\n\t\t\treturn 0.0;\r\n\t\telse\r\n\t\t\treturn (partial.size() * 1.0) / (complete.size() * 1.0);\r\n\r\n\t}", "List<Pair<Member, BigDecimal>> getGrossProductPerMember(StatisticalDTO dto) throws DaoException;", "public TupleDesc getTupleDesc() {\n // some code goes here\n \treturn m_td;\n }", "private static void displayProgression(int progressionType, double firstElement,\n double commonDifOrRatio, int memberCount) {\n if (progressionType == 0) {\n System.out.print(\"\\nArithmetic progression:\");\n printIntOrDouble(firstElement);\n for (int i = 2; i <= memberCount; i++) {\n double curElement = firstElement + commonDifOrRatio * (i - 1);\n printIntOrDouble(curElement);\n }\n } else if (progressionType == 1) {\n System.out.print(\"\\nGeometric progression:\");\n printIntOrDouble(firstElement);\n double curElement = firstElement;\n for (int i = 2; i <= memberCount; i++) {\n curElement *= commonDifOrRatio;\n printIntOrDouble(curElement);\n }\n }\n }", "public abstract T getTuple(int aPosition);", "public abstract double getFractionMultiplier();", "public static Double extract(final Stmt statement) {\n\t\tfinal List<BalItem> balanceItems = statement.getBal();\n\t\tbalanceItems.sort(WithYearMonthDays.comparator());\n\t\tfinal BalItem startingBalanceItem = FluentIterable.from(balanceItems).first().get();\n\t\treturn AmountBasedOnCreditOrDebit.extract(startingBalanceItem.getAmt().getValueAsDouble(), startingBalanceItem.getCdtDbtInd());\n\t}", "public BigDecimal getPercentageProfitPLimit();", "protected Tuple cleanTuple(Tuple result)\n {\n return result;\n }", "@Override\n public void process(HashMap<K, V> tuple)\n {\n for (Map.Entry<K, V> e: tuple.entrySet()) {\n MutableDouble val = basemap.get(e.getKey());\n if (!doprocessKey(e.getKey())) {\n continue;\n }\n if (val == null) { // Only process keys that are in the basemap\n val = new MutableDouble(e.getValue().doubleValue());\n basemap.put(cloneKey(e.getKey()), val);\n continue;\n }\n double change = e.getValue().doubleValue() - val.value;\n double percent = (change/val.value)*100;\n if (percent < 0.0) {\n percent = 0.0 - percent;\n }\n if (percent > percentThreshold) {\n HashMap<V,Double> dmap = new HashMap<V,Double>(1);\n dmap.put(cloneValue(e.getValue()), percent);\n HashMap<K,HashMap<V,Double>> otuple = new HashMap<K,HashMap<V,Double>>(1);\n otuple.put(cloneKey(e.getKey()), dmap);\n alert.emit(otuple);\n }\n val.value = e.getValue().doubleValue();\n }\n }", "public int getRatio() {\r\n\t\treturn ratio;\r\n\t}", "private double parseEquityRatio(ArrayList<String> balanceSheetYears) {\n Pattern eigenkapitalquotePattern = Pattern.compile(\"<tr>\\\\s*<td[^/]*Eigenkapitalquote</td>((?!</tr>).)*</tr>\");\n matcher = eigenkapitalquotePattern.matcher(html);\n ArrayList<String> equityRatioArray = new ArrayList<>();\n\n while (matcher.find()) {\n log.info(\"Matches gefunden!\");\n\n log.info(matcher.group(0));\n String eigenkapitalquoteOut = matcher.group(0);\n eigenkapitalquotePattern = Pattern.compile(\"(\\\\s*<td class=\\\"ZAHL\\\">(((?!</).)*)</td>\\\\s*)\");\n matcher = eigenkapitalquotePattern.matcher(eigenkapitalquoteOut);\n while (matcher.find()) {\n log.debug(matcher.group(2));\n equityRatioArray.add(matcher.group(2).trim());\n }\n }\n\n log.info(equityRatioArray.toString());\n\n if (balanceSheetYears.size() != equityRatioArray.size()) {\n throw new RuntimeException(\"ebitArray und profitabilityYears sind nicht gleich gross\");\n }\n\n Map<String, String> equityRatioMap = new HashMap<>();\n for (int i = 0; i < balanceSheetYears.size(); i++) {\n equityRatioMap.put(balanceSheetYears.get(i), equityRatioArray.get(i));\n }\n\n log.info(\"equity ratio last year: \" + equityRatioMap.get(fundamentalData.getLastYear()));\n\n String equityRatio = equityRatioMap.get(fundamentalData.getLastYear());\n if (equityRatio == null || !isOnvistaNumber(equityRatio)) {\n log.info(\"Trying \" + fundamentalData.getLastYear() + \"e as last year...\");\n equityRatio = equityRatioMap.get(fundamentalData.getLastYear() + \"e\");\n if (equityRatio == null || !isOnvistaNumber(equityRatio)) {\n log.info(\"equity ratio two years ago: \" + equityRatioMap.get(fundamentalData.getTwoYearsAgo()));\n equityRatio = equityRatioMap.get(fundamentalData.getTwoYearsAgo());\n }\n }\n return Double.parseDouble(equityRatio.replace(\"%\", \"\").replace(\",\", \".\"));\n }", "float getDistinctValues(Object elementID) throws Exception;", "public TupleDesc getTupleDesc() {\n return td;\n }", "public String getLoserVotePercent(String state) {\r\n result = table.get(state);\r\n String loserVotePercentage = result.get(3);//getting loser percentage from array list\r\n \r\n \r\n return loserVotePercentage;\r\n }", "private double extractWeight(String item) {\n Pattern p = Pattern.compile(\",(.*?),\");\n Matcher m = p.matcher(item);\n if(m.find()) {\n return Double.parseDouble(m.group(1));\n }\n throw new IllegalArgumentException(\"Weight is wrongly formatted in: \" + item);\n }", "public abstract String getFraction();", "private Object[] computeKeyValuePairOfTuple(AttrName asName, Entry<List<Object>, ? extends Aggregator<?>> item, AttrList byNameAttrs){\n List<Object> list = new ArrayList<Object>();\n List<AttrName> attrs = byNameAttrs.toList();\n for(int i = 0; i < attrs.size(); i++){\n list.add(attrs.get(i).getName());\n list.add((item.getKey().get(i)));\n }\n Aggregator<?> value = item.getValue();\n list.add(asName);\n list.add(value.finish());\n return list.stream().toArray();\n }", "public TupleDesc getTupleDesc() {\n \treturn tupleDesc;\n }", "TupleExpr createTupleExpr();", "@Override\n\tpublic Object evaluate(Row buffer) {\n\t\tlong totalTimeSpent = buffer.getLong(1);\n\n\t\tString userDeviceString = buffer.getString(0);\n\n\t\tString[] userDevice = userDeviceString.split(\",\");\n\n\t\tGson gson = new Gson();\n\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\n\t\tfor (String userDeviceInstance : userDevice) {\n\t\t\tString device = userDeviceInstance.split(\":\")[0];\n\t\t\tInteger timeSpentOnDeivce = Integer.parseInt(userDeviceInstance.split(\":\")[1]);\n\t\t\tfloat distribution = 0;\n\n\t\t\tif (totalTimeSpent == 0) {\n\t\t\t\tdistribution = 0;\n\t\t\t} else {\n\t\t\t\tdistribution = ((float) timeSpentOnDeivce / totalTimeSpent) * 100;\n\t\t\t}\n\n\t\t\tmap.put(device, String.format(\"%.2f\", distribution) + \"%\");\n\n\t\t}\n\n\t\tString json = gson.toJson(map);\n\n\t\treturn new Tuple3<String, Long, Long>(json, totalTimeSpent, buffer.getLong(2));\n\t}", "public TupleDesc getTupleDesc() {\n\t\treturn childOperator.getTupleDesc();\n\t}", "private Tuple avgGradeReduce(List<Tuple> input) {\n int sum = 0;\n String className = input.get(0).fst();\n \n for(Tuple classAndGrade : input) {\n sum += Integer.parseInt(classAndGrade.snd());\n }\n \n Integer average = Math.round((float) sum / input.size());\n \n lolligag();\n \n // output <same class, average grade from all kids>\n return new Tuple(className, average.toString());\n }", "float getMatch();", "java.lang.String getPercentage();", "public double getPerimiter(){return (2*height +2*width);}", "public static ScoredTuple fromIntermediateTuple(Tuple intermediateTuple) throws ExecException\n {\n try {\n Double score = (Double)intermediateTuple.get(0);\n Tuple originalTuple = (Tuple)intermediateTuple.get(1);\n return new ScoredTuple(score, originalTuple);\n } catch (Exception e) {\n throw new RuntimeException(\"Cannot deserialize intermediate tuple: \"+intermediateTuple.toString(), e);\n }\n }", "public BigDecimal getPercentageProfitPList();", "Tuple extract(int[] pos) {\n Tuple results = new Tuple();\n\n for (int i : pos)\n results.add(elements.set(i, null));\n\n return results;\n }", "private Double getProzent(Double points)\r\n \t{\r\n \t\treturn points / totalPoints;\r\n \t}", "public void mergeTupleIntoGroup(Tuple tup) {\n \tif(this.childTD == null){\n \t\t//get the child TupleDesc on the first merge\n \t\tthis.childTD = tup.getTupleDesc();\n \t}\n if(gbField == NO_GROUPING){\n \tif(tupleCounts.keySet().size() == 0){ // first entry\n \t\ttupleCounts.put(null, 1);\n \t} else {\n \t\ttupleCounts.put(null, tupleCounts.get(null)+1);\n \t}\n } else {\n \tField index = tup.getField(gbField);\n \tif(!tupleCounts.containsKey(index)){ // first entry\n \t\ttupleCounts.put(index, 1);\n \t} else {\n \t\tInteger newVal = tupleCounts.get(index)+1;\n \t\ttupleCounts.put(index, newVal);\n \t}\n \t\n }\n }", "@Override\n public Tuple3<Long, Double, Double> add(Tuple3<Long, Double, Double> tuple, Tuple3<Long, Double, Double> acc) {\n acc.f0 = tuple.f0;\n acc.f1 += tuple.f1;\n acc.f2 += tuple.f2;\n return acc;\n }", "public void extractPolyPyInfo() { \n\t\tfinal int bpsEnd = this.intron.lastIndexOf( getBPS() ) + getBPS().length(); \n\t\tthis.BPSThreeSSDistance = (this.intron.length() - ( bpsEnd ));\n\t\tthis.polyPyGCContent = getGCFraction( intron.substring( bpsEnd ) ); \n\t}", "public Contribution getContribution(SqlRowSet rowSet)\n {\n rowSet.next();\n\n return new Contribution(rowSet.getInt(1), rowSet.getString(2),\n rowSet.getDouble(3),rowSet.getDate(4));\n }", "double getPerimetro(){\n return 2 * 3.14 * raggio;\n }", "double getPerimetro();", "Pair<Double, Integer> bid();", "com.google.wireless.android.sdk.stats.LldbPercentileEstimator.Metric getMetric();", "public Rational getDuration ()\r\n {\r\n if (this.isWholeDuration()) {\r\n return null;\r\n } else {\r\n Rational raw = getRawDuration();\r\n\r\n if (tupletFactor == null) {\r\n return raw;\r\n } else {\r\n return raw.times(tupletFactor);\r\n }\r\n }\r\n }", "public interface CoordTupleString {\n\n /**\n * Accessor for the max tuple index\n * \n * @return the max tuple index\n */\n public abstract int maxIndex();\n\n /**\n * Accessor to determine the actual type managed.\n * \n * @return a Number the most directly corresponds to the\n * underlying managed type (Float for a float tuplestring,\n * Double for a double tuplestring, etc)\n */\n public abstract Number getPrimitiveType();\n\n /**\n * Accessor to retrieve a tuple\n * \n * @param tuple the tuple to retrieve (the first tuple is index 0)\n * @return the tuple at index <code>tuple</code>, coereced into\n * a float[]\n */\n public abstract float[] getasFloat(int tuple);\n\n /**\n * Accessor to retrieve a tuple\n * \n * @param tuple the tuple to retrieve (the first tuple is index 0)\n * @return the tuple at index <code>tuple</code>, coereced into\n * a double[]\n */\n public abstract double[] getasDouble(int tuple);\n\n /**\n * Accessor to retrieve a single value in a tuple\n * \n * @param tuple the tuple to retrieve (the first tuple is index 0)\n * @param val the index of the value in the tuple (the first val\n * is index 0)\n * @return the tuple at index <code>tuple</code>, coereced into\n * a float\n */\n public abstract float getasFloat(int tuple, int val);\n\n /**\n * Accessor to retrieve a single value in a tuple\n * \n * @param tuple the tuple to retrieve (the first tuple is index 0)\n * @param val the index of the value in the tuple (the first val\n * is index 0)\n * @return the tuple at index <code>tuple</code>, coereced into\n * a double\n */\n public abstract double getasDouble(int tuple, int val);\n}", "Pair<Rectangle, Rectangle> getRectangles();", "public Tuple nextTuple() {\n\t\ttry {\n\t\t\treturn tr.read();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public BigDecimal getPercentageProfitPStd();", "private Tuple createTuple(Tuple tup) {\n\t\tTuple t = new Tuple(td);\n\t\tif (this.gbfieldtype == null) {\n\t\t\tt.setField(0, new IntField(1));\n\t\t} else {\n\t\t\tt.setField(0, tup.getField(gbfield));\n\t\t\tt.setField(1, new IntField(1));\n\t\t}\n\t\treturn t;\n\t}", "public void merge(Tuple tup) {\n\t\tHashEntry he;\n\t\tif(gbfield!=-1)\n\t\t\the = AggreMap.get(tup.getField(gbfield));\n\t\telse\n\t\t\the = AggreMap.get(new IntField(0));\n\t\tif (op.name() == \"MIN\") {\n\t\t\tif (he == null) {\n\t\t\t\the = new HashEntry();\n\t\t\t\the.totalEntries = 0;\n\t\t\t\the.result = Double.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\the.totalEntries++; // no semantic meaning for minimum, only for\n\t\t\t// consistency\n\t\t\tint temp = ((IntField) tup.getField(afield)).getValue(); // min is\n\t\t\t// defined only for int-field\n\t\t\tif (temp < he.result)\n\t\t\t\the.result = temp;\n\t\t}\n\t\tif (op.name() == \"MAX\") {\n\t\t\tif (he == null) {\n\t\t\t\the = new HashEntry();\n\t\t\t\the.totalEntries = 0;\n\t\t\t\the.result = Double.NEGATIVE_INFINITY;\n\t\t\t}\n\t\t\the.totalEntries++; // again, no semantic meaning\n\t\t\tint temp = ((IntField) tup.getField(afield)).getValue();\n\t\t\tif (temp > he.result)\n\t\t\t\the.result = temp;\n\t\t}\n\t\tif (op.name() == \"COUNT\") {\n\t\t\tif (he == null) {\n\t\t\t\the = new HashEntry();\n\t\t\t\the.totalEntries = 0;\n\t\t\t\the.result = 0;\n\t\t\t}\n\t\t\the.totalEntries++;\n\t\t\the.result++;\n\t\t}\n\t\tif (op.name() == \"SUM\") {\n\t\t\tif (he == null) {\n\t\t\t\the = new HashEntry();\n\t\t\t\the.totalEntries = 0;\n\t\t\t\the.result = 0;\n\t\t\t}\n\t\t\the.totalEntries++;\n\t\t\the.result += ((IntField) tup.getField(afield)).getValue();\n\t\t}\n\t\tif (op.name() == \"AVG\") {\n\t\t\tif (he == null) {\n\t\t\t\the = new HashEntry();\n\t\t\t\the.totalEntries = 0;\n\t\t\t\the.result = 0;\n\t\t\t}\n\t\t\tint temp = he.totalEntries;\n\t\t\tdouble total = he.result;\n\t\t\tdouble sum = temp * total;\n\t\t\the.totalEntries++;\n\t\t\the.result = (sum + ((IntField) tup.getField(afield)).getValue())\n\t\t\t\t\t/ he.totalEntries;\n\t\t}\n\t\tif(gbfield!=-1)\n\t\t\tAggreMap.put(tup.getField(gbfield), he);\n\t\telse\n\t\t\tAggreMap.put(new IntField(0), he);\n\t}", "@Override\n public Tuple2<String, Long> call(Tuple2<String, String> tuple) throws Exception {\n String[] logSplited = tuple._2.split(\" \");\n String timeMinute = DateUtils.formatTimeMinute(new Date(Long.valueOf(logSplited[0])));\n long adid = Long.valueOf(logSplited[4]);\n return new Tuple2<String, Long>(timeMinute+\"_\"+adid,1L);\n }", "public Double getProb(T element) {\n\t\treturn itemProbs_.get(element);\n\t}", "public String select(NumberFormatTestData tuple) {\n return null;\n }", "public Tuple get(Key k) throws RelationException;", "public double getBMI(){\n bmi = weight * KG_PER_POUND / (height * METERS_PER_INCH *height * METERS_PER_INCH);\n return (bmi);\n}", "public HashGroupifyEntry getEntry(int[] tuple) {\n final int hash = dataOutput.hashCode(tuple);\n int index = hash & (hashTableBuckets.length - 1);\n HashGroupifyEntry m = hashTableBuckets[index];\n while ((m != null) && ((m.hashcode != hash) || !dataOutput.equals(m.row, tuple))) {\n m = m.next;\n }\n return m;\n }", "public Hashtable<String, Double> promoPercChange(){\n\t\tHashtable<String, Double> percChange = new Hashtable<String, Double>();\n\t\tpercChange.put(\"Sales %Chg.\", (this.getSalesByPromo().get(\"Total Sales\")/this.getSalesByPromo().get(\"Total Sales YA\"))-1);\n\t\tpercChange.put(\"Feat %Chg.\", (this.getSalesByPromo().get(\"Feature\")/this.getSalesByPromo().get(\"Feature YA\"))-1);\n\t\tpercChange.put(\"Display %Chg.\", (this.getSalesByPromo().get(\"Display\")/this.getSalesByPromo().get(\"Display YA\"))-1);\n\t\tpercChange.put(\"Quality %Chg.\", (this.getSalesByPromo().get(\"Quality\")/this.getSalesByPromo().get(\"Quality YA\"))-1);\n\t\tpercChange.put(\"Price Disc. %Chg.\", (this.getSalesByPromo().get(\"Price Disc.\")/this.getSalesByPromo().get(\"Price Disc.YA\"))-1);\n\t\treturn percChange;\n\t}", "@Override\n\tpublic double perimetro() {\n\t\treturn getBase()*4;\n\t}", "public double calculateRatio() {\n \tdouble ratioCalc = new Double(0);\n \tif(this.count_human_dna > 0) {\n \t\tratioCalc = (double) this.count_mutant_dna / this.count_human_dna;\n \t}\n \tthis.setRatio(ratioCalc);\n \treturn ratioCalc;\n }", "public List<Double> bindingPercent() {\n List<Double> subtraction = subtractTablesElement(standardsCPM, zero);\n List<Double> multiplication = multiplyList(100.0, subtraction);\n List<Double> result = divideTableCeilElements(binding, multiplication);\n if (result != null) {\n Double pointer;\n for (int i = 0; i < result.size(); i++) {\n pointer = result.get(i);\n if (pointer.isNaN() || pointer.isInfinite()) {\n LOGGER.warn(\"Binding percent has infinite or NaN points;\");\n } else {\n LOGGER.info(\"Binding percent: \" + i + \": \" + pointer);\n }\n }\n }\n return result;\n }", "@Override\n\tpublic Object visitTuple(Tuple tuple, Object arg) throws Exception {\n\t\tList<Expression> explist = tuple.getExprList();\n\t\tfor (Expression exp : explist) {\n\t\t\texp.visit(this, arg);\n\t\t}\n\t\treturn null;\n\t}", "public double getProgress(java.lang.CharSequence uuid) throws android.os.RemoteException;", "private String individualCalculationResupply(String[] valuesConsumables, String mglt, int Distance, int hours){\n return String.valueOf(Math.floor((Distance/Float.parseFloat(mglt))/\n ((Float.parseFloat(valuesConsumables[0]) * hours))));\n }", "double getRating();", "public double getPercepcion(){\n return localPercepcion;\n }", "protected Object getSplValue(Attribute attribute, Tuple tuple) {\r\n\r\n\t\tType splType = attribute.getType();\r\n\t\tint index = attribute.getIndex();\r\n\t\t\r\n\t\tif (splType.getMetaType() == MetaType.INT8)\r\n\t\t\treturn tuple.getByte(index);\r\n\t\tif (splType.getMetaType() == MetaType.INT16)\r\n\t\t\treturn tuple.getShort(index);\r\n\t\tif (splType.getMetaType() == MetaType.INT32)\r\n\t\t\treturn tuple.getInt(index);\r\n\t\tif (splType.getMetaType() == MetaType.INT64)\r\n\t\t\treturn tuple.getLong(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.UINT8)\r\n\t\t\treturn tuple.getByte(index);\r\n\t\tif (splType.getMetaType() == MetaType.UINT16)\r\n\t\t\treturn tuple.getShort(index);\r\n\t\tif (splType.getMetaType() == MetaType.UINT32)\r\n\t\t\treturn tuple.getInt(index);\r\n\t\tif (splType.getMetaType() == MetaType.UINT64)\r\n\t\t\treturn tuple.getLong(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.BLOB)\r\n\t\t\treturn tuple.getBlob(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.BOOLEAN)\r\n\t\t\treturn tuple.getBoolean(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.DECIMAL32)\r\n\t\t\treturn tuple.getBigDecimal(index);\r\n\t\tif (splType.getMetaType() == MetaType.DECIMAL64)\r\n\t\t\treturn tuple.getBigDecimal(index);\r\n\t\tif (splType.getMetaType() == MetaType.DECIMAL128)\r\n\t\t\treturn tuple.getBigDecimal(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.FLOAT32)\r\n\t\t\treturn tuple.getFloat(index);\r\n\t\tif (splType.getMetaType() == MetaType.FLOAT64)\r\n\t\t\treturn tuple.getDouble(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.RSTRING)\r\n\t\t\treturn tuple.getString(index);\r\n\t\tif (splType.getMetaType() == MetaType.USTRING)\r\n\t\t\treturn tuple.getString(index);\r\n\r\n\t\tif (splType.getMetaType() == MetaType.TIMESTAMP)\r\n\t\t\treturn tuple.getTimestamp(index).getSQLTimestamp();\r\n\r\n\t\tif (splType.getMetaType() == MetaType.XML)\r\n\t\t\treturn tuple.getXML(index);\r\n\r\n\t\t// Task 39870 Update JDBC toolkit with respect to optional data type support\r\n\t\t// it compares the contain of SPL type delivers by SPL application with data types \r\n\t\t// The \"MetaType.OPTIONAL)\" and \"tuple.getOptional\" was not used due of \r\n\t\t// compatibility with older Streams Version without optional type\r\n\t\tif(splType.getLanguageType().toUpperCase().contains(\"OPTIONAL\"))\r\n\t\t\treturn tuple.getObject(index);\r\n/*\r\n\t\tif (splType.getMetaType() == MetaType.OPTIONAL)\r\n\t\t{\r\n\t\t\tif ((tuple.getOptional(index, attribute.getType().getAsCompositeElementType()).isPresent()))\r\n\t\t {\r\n\t\t \treturn tuple.getOptional(index, attribute.getType().getAsCompositeElementType()).get();\r\n\t\t }\r\n\t\t else\r\n\t\t \treturn null;\r\n\t\t}\r\n*/\t\t\t\t\t\r\n\t\tLOGGER.log(LogLevel.ERROR, Messages.getString(\"JDBC_SPL_TYPE_NOT_SUPPORT\"), splType.getMetaType()); \r\n\t\treturn null;\r\n\r\n\t}", "public static void addTupleAsOneCell(List<Cell> result,\n Tuple tuple,\n TupleProjector tupleProjector,\n ImmutableBytesWritable ptr) {\n byte[] value =\n tupleProjector.getSchema().toBytes(tuple, tupleProjector.getExpressions(),\n tupleProjector.getValueBitSet(), ptr);\n Cell firstCell = result.get(0);\n Cell keyValue =\n PhoenixKeyValueUtil.newKeyValue(firstCell.getRowArray(),\n firstCell.getRowOffset(),firstCell.getRowLength(), VALUE_COLUMN_FAMILY,\n VALUE_COLUMN_QUALIFIER, firstCell.getTimestamp(), value, 0, value.length);\n result.add(keyValue);\n }", "public MeasureData(Tuple tuple) {\n mtype = tuple.getStringByField(StormUtils.STORM.FIELDS.MEASURE_TYPE);\n caseid = tuple.getStringByField(StormUtils.STORM.FIELDS.CASE_ID);\n mid = tuple.getIntegerByField(StormUtils.STORM.FIELDS.MEASURE_ID);\n mvalue = tuple.getDoubleByField(StormUtils.STORM.FIELDS.MEASURE_VALUE);\n }", "public double getMargeParProduit(Produit p) {\n\t\tdouble m;\n\t\tif (p.getNomProduit()==\"50%\") {\n\t\t\tm = 0.1;\t\n\t\t}\n\t\telse {\n\t\t\tif (p.getNomProduit()==\"60%\") {\n\t\t\t\tm = 0.05;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm = 0.2;\n\t\t\t}\n\t\t} return m;\n\t}", "@Override\n\tpublic double percentualeGruppiCompletati () throws DAOException{\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tdouble numeroGruppiCompletati = 0.0;\n\t\ttry {\n\t\t\tconnection = DataSource.getInstance().getConnection();\n\t\t\tstatement = connection.prepareStatement(\"SELECT COUNT (GRUPPO.ID)*100/(SELECT COUNT(ID) FROM GRUPPO) FROM GRUPPO WHERE COMPLETO = 1 GROUP BY(GRUPPO.COMPLETO)\");\n\t\t\tresultSet = statement.executeQuery();\n\t\t\tif (resultSet.next()) {\n\t\t\t\tnumeroGruppiCompletati = BigDecimal.valueOf(resultSet.getDouble(1)).setScale(2, RoundingMode.HALF_UP).doubleValue();\n\t\t\t}\n\t\t} catch (SQLException | DAOException e) {\n\t\t\tthrow new DAOException(\"ERRORE percentualeGruppiCompletati utenteAdmin\" + e.getMessage(), e);\n\t\t} finally {\n\t\t\tDataSource.getInstance().close(resultSet);\n\t\t\tDataSource.getInstance().close(statement);\n\t\t\tDataSource.getInstance().close(connection);\n\t\t}\n\t\treturn numeroGruppiCompletati;\n\t}", "public int getMinuteFraction()\n {\n return (((int)(hours*100.0)%100)*60)/100;\n }", "public TupleDesc getTupleDesc() {\n // some code goes here\n // throw new UnsupportedOperationException(\"implement this\");\n return this.td;\n }", "public ArrayList<Tuple> getResults() {\n ArrayList<Tuple> result = new ArrayList<Tuple>();\n\n switch (this.ag) {\n case COUNT:\n if (!gb) {\n int res = 0;\n for (Tuple a : tupleList) {\n res++;\n }\n Tuple newTup = new Tuple(this.tdc);\n newTup.setField(0, new IntField(res));\n result.add(newTup);\n } else {\n for (Tuple ca : compareList) {\n int res = 0;\n for (Tuple tl : tupleList) {\n if (tl.equals(ca))\n res++;\n }\n Tuple newTup = new Tuple(this.tdc);\n newTup.setField(0, ca.getField(0));\n newTup.setField(1, new IntField(res));\n result.add(newTup);\n }\n }\n break;\n\n case MAX:\n if (!gb) {\n int max = Integer.MIN_VALUE;\n boolean whetherInt = false;\n String firstVal = \"\";\n\n if (tupleList.get(0).getField(0).getType().equals(Type.INT)) {\n whetherInt = true;\n }\n if (!whetherInt) {\n StringField first = (StringField) tupleList.get(0).getField(0);\n firstVal = first.toString();\n }\n\n for (Tuple tp : tupleList) {\n if (tp.getDesc().getType(0).equals(Type.STRING)) {\n StringField val = (StringField) tp.getField(0);\n String actualv = val.toString();\n\n if (actualv.compareTo(firstVal) == 1) { // if the new string is supposed to be lexicographically greater than the cu\n // max, set the cur max to be the new\n firstVal = actualv;\n }\n\n\n } else {\n IntField intFl = new IntField(tp.getField(0).toByteArray());\n int actualVal = intFl.getValue();\n if (actualVal > max) {\n max = actualVal;\n }\n }\n }\n if (whetherInt) {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, new IntField(max));\n result.add(maxTup);\n } else {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, new StringField(firstVal));\n result.add(maxTup);\n }\n\n } else {\n int max = Integer.MIN_VALUE;\n boolean whetherInt = false;\n\n String firstVal = \"\";\n\n if (compareList.get(0).getField(0).getType().equals(Type.INT)) {\n whetherInt = true;\n }\n if (!whetherInt) {\n StringField first = (StringField) tupleList.get(0).getField(1);\n firstVal = first.toString();\n }\n\n for (Tuple a : compareList) {\n Type aTp = a.getDesc().getType(0);\n IntField intVal = (IntField) a.getField(0);\n int actualVal = intVal.getValue();\n\n for (Tuple b : tupleList) {\n if (b.getDesc().getType(0) == Type.INT) {\n IntField intVal1 = (IntField) b.getField(0);\n int actualVal1 = intVal1.getValue();\n if (actualVal1 == actualVal) {\n IntField compareVal = (IntField) b.getField(1);\n int valueb = compareVal.getValue();\n if (valueb > max) {\n max = valueb;\n }\n }\n\n } else {\n StringField val = (StringField) b.getField(1);\n String actualv = val.toString();\n\n if (actualv.compareTo(firstVal) == 1) { // if the new string is supposed to be lexicographically greater than the cu\n // max, set the cur max to be the new\n firstVal = actualv;\n }\n }\n }\n if (whetherInt) {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, a.getField(0));\n maxTup.setField(1, new IntField(max));\n result.add(maxTup);\n } else {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, a.getField(0));\n maxTup.setField(1,new StringField(firstVal));\n result.add(maxTup);\n }\n }\n }\n break;\n case MIN:\n if (!gb) {\n int min = Integer.MAX_VALUE;\n boolean whetherInt = false;\n String firstVal = \"\";\n if (tupleList.get(0).getField(0).getType().equals(Type.INT)) {\n whetherInt = true;\n }\n if (!whetherInt) {\n StringField first = (StringField) tupleList.get(0).getField(0);\n firstVal = first.toString();\n\n }\n for (Tuple tp : tupleList) {\n if (tp.getDesc().getType(0).equals(Type.STRING)) {\n StringField val = (StringField) tp.getField(0);\n String actualv = val.toString();\n\n if (actualv.compareTo(firstVal) == -1) { // if the new string is supposed to be lexicographically SMALLER than the cu\n // max, set the cur mIN to be the new\n firstVal = actualv;\n }\n\n } else {\n IntField intFl = new IntField(tp.getField(0).toByteArray());\n int actualVal = intFl.getValue();\n if (actualVal < min) {\n min = actualVal;\n }\n }\n }\n if (whetherInt) {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, new IntField(min));\n result.add(maxTup);\n } else {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, new StringField(firstVal));\n result.add(maxTup);\n }\n } else {\n int min = Integer.MAX_VALUE;\n boolean whetherInt = false;\n\n String firstVal = \"\";\n\n if (compareList.get(0).getField(0).getType().equals(Type.INT)) {\n whetherInt = true;\n }\n if (!whetherInt) {\n StringField first = (StringField) tupleList.get(0).getField(1);\n firstVal = first.toString();\n\n }\n for (Tuple a : compareList) {\n Type aTp = a.getDesc().getType(0);\n\n\n IntField intVal = (IntField) a.getField(0);\n int actualVal = intVal.getValue();\n\n for (Tuple b : tupleList) {\n if (b.getDesc().getType(0) == Type.INT) {\n IntField intVal1 = (IntField) b.getField(0);\n int actualVal1 = intVal1.getValue();\n if (actualVal1 == actualVal) {\n IntField compareVal = (IntField) b.getField(1);\n int valueb = compareVal.getValue();\n if (valueb > min) {\n min = valueb;\n }\n }\n } else {\n StringField val = (StringField) b.getField(1);\n String actualv = val.toString();\n\n if (actualv.compareTo(firstVal) == 1) { // if the new string is supposed to be lexicographically greater than the cu\n // max, set the cur max to be the new\n firstVal = actualv;\n }\n\n }\n }\n if (whetherInt) {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, a.getField(0));\n maxTup.setField(1, new IntField(min));\n result.add(maxTup);\n } else {\n Tuple maxTup = new Tuple(this.tdc);\n maxTup.setField(0, a.getField(0));\n maxTup.setField(1,new StringField(firstVal));\n result.add(maxTup);\n }\n }\n }\n break;\n case AVG:\n int sum = 0;\n\n if (!gb) {\n for (Tuple tp : tupleList) {\n if (tp.getDesc().getType(0).equals(Type.STRING)) {\n System.out.println(\"cannot call avg on string\");\n } else {\n int val = ((IntField) tp.getField(0)).getValue();\n sum += val;\n\n }\n\n\n }\n int avgValue = sum / tupleList.size();\n // not sure what the new tuple's pid and id should be\n Tuple avgTup = new Tuple(this.tdc);\n avgTup.setField(0, new IntField(avgValue));\n\n } else {\n // now it is group by avg\n for (Tuple a : compareList) {\n Type aTp = a.getDesc().getType(0);\n int sumt = 0;\n int ct = 0;\n if (aTp.equals(Type.STRING)) {\n System.out.println(\"cannot call avg on string\");\n\n } else {\n IntField intVal = (IntField) a.getField(0);\n int actualVal = intVal.getValue();\n\n for (Tuple b : tupleList) {\n if (b.getDesc().getType(0) == Type.INT) {\n IntField intVal1 = (IntField) b.getField(0);\n int actualVal1 = intVal1.getValue();\n if (actualVal1 == actualVal) {\n IntField compareVal = (IntField) b.getField(1);\n int valueb = compareVal.getValue();\n sum += valueb;\n ct++;\n }\n } else {\n System.out.println(\"cannot call group by avg on string \");\n }\n }\n }\n int trueAvg = sum / ct;\n Tuple avgTup = new Tuple(this.tdc);\n avgTup.setField(0, a.getField(0));\n avgTup.setField(1, new IntField(trueAvg));\n result.add(avgTup);\n }\n }\n\n break;\n case SUM:\n int sumA = 0;\n if (!gb) {\n for (Tuple tp : tupleList) {\n if (tp.getDesc().getType(0).equals(Type.STRING)) {\n System.out.println(\"cannot call sUM on string\");\n } else {\n int val = ((IntField) tp.getField(0)).getValue();\n sumA += val;\n }\n }\n\n // not sure what the new tuple's pid and id should be\n Tuple avgTup = new Tuple(this.tdc);\n avgTup.setField(0, new IntField(sumA));\n result.add(avgTup);\n\n } else {\n // now it is group by sum\n int sumt = 0;\n for (Tuple a : compareList) {\n sumt = 0;\n Type aTp = a.getDesc().getType(0);\n\n if (aTp.equals(Type.STRING)) {\n System.out.println(\"cannot call sum on string\");\n\n } else {\n IntField intVal = (IntField) a.getField(0);\n int actualVal = intVal.getValue();\n\n for (Tuple b : tupleList) {\n if (b.getDesc().getType(0) == Type.INT) {\n IntField intVal1 = (IntField) b.getField(0);\n int actualVal1 = intVal1.getValue();\n if (actualVal1 == actualVal) {\n IntField compareVal = (IntField) b.getField(1);\n int valueb = compareVal.getValue();\n sumt += valueb;\n }\n\n } else {\n System.out.println(\"cannot call SUM on string \");\n }\n\n }\n }\n Tuple avgTup = new Tuple(this.tdc);\n avgTup.setField(0, a.getField(0));\n avgTup.setField(1, new IntField(sumt));\n if (!result.contains(avgTup)) {\n result.add(avgTup);\n }\n }\n\n }\n break;\n }// this is the closing for switch\n return result;\n }", "float getSteamSupplyRating2();", "public T getMetadataEntityFromTuple(ITupleReference tuple) throws MetadataException, IOException;", "public static String extract_measurement(byte[] bytes) {\n\t\tint weight = Integer.parseInt(String.format(\"%x\", bytes[2]));\n\t\tint frac = Integer.parseInt(String.format(\"%x\", bytes[3]));\n\t\t\n\t\tif (weightsArrayPosition > 8 || weightsArrayPosition == -1)\n\t\t\tweightsArrayPosition = 0;\n\t\telse\n\t\t\tweightsArrayPosition++;\n\t\t\n\t\tweights[weightsArrayPosition] = weight;\n\t\tfracs[weightsArrayPosition] = frac;\n\t\t\n\t\t/* weight data is added to weights array, and \n\t\t * we return current value for screen updating etc. */\n\t\treturn String.format(\"%x\", bytes[2])+\",\"+String.format(\"%x\", bytes[3]);\n\t}", "Astro tuple(AstroArg args);" ]
[ "0.55256045", "0.5465183", "0.53665257", "0.52792066", "0.52451366", "0.5223424", "0.5209399", "0.51968837", "0.5124365", "0.50929075", "0.5083887", "0.5076836", "0.50469536", "0.5017535", "0.50053364", "0.49844813", "0.49411514", "0.4938004", "0.48969826", "0.48700798", "0.48634902", "0.48406225", "0.48357117", "0.48239213", "0.4812229", "0.4798211", "0.4793118", "0.47714502", "0.47556958", "0.47526708", "0.47418365", "0.47109044", "0.47063485", "0.4702786", "0.46930525", "0.46906045", "0.46789917", "0.46788234", "0.46775058", "0.4657417", "0.4631307", "0.4624261", "0.46229696", "0.46201813", "0.46080822", "0.45972112", "0.459191", "0.45901552", "0.4571588", "0.45705602", "0.4570063", "0.45641404", "0.4551775", "0.45318717", "0.45278588", "0.45278385", "0.45084342", "0.45070106", "0.45001346", "0.44948015", "0.44919962", "0.4485336", "0.44822878", "0.44746682", "0.4453275", "0.44531512", "0.44447", "0.44379634", "0.4434694", "0.4430832", "0.44140995", "0.44138518", "0.44125986", "0.44056848", "0.43962595", "0.43958545", "0.4394501", "0.43810013", "0.43804964", "0.4377204", "0.43749008", "0.43734908", "0.43707076", "0.43670437", "0.4363945", "0.436293", "0.43613023", "0.4358829", "0.43573213", "0.43532285", "0.43502524", "0.43452692", "0.43337646", "0.43336973", "0.4331131", "0.4327675", "0.43262148", "0.43257487", "0.4323464", "0.43214244", "0.43126863" ]
0.0
-1
Direct constructor calls are not supported.
private DatabaseWriteResult(UploadStrategy strategy) { savedEntries = new ArrayList<>(1000); databaseSize = -1L; error = null; uploadStrategy = strategy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void __sep__Constructors__() {}", "defaultConstructor(){}", "Reproducible newInstance();", "protected abstract void construct();", "public native void constructor();", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "void DefaultConstructor(){}", "public Constructor(){\n\t\t\n\t}", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "private Instantiation(){}", "private SingleObject()\r\n {\r\n }", "public static void copyConstructor(){\n\t}", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "private static Constructor getZeroArgumentConstructor(Class cls) {\n \t\treturn ClassUtils.getConstructor(cls, new Class[] { }, zeroArgumentConstructors);\n \t}", "@DISPID(-2147417603)\n @PropGet\n com4j.Com4jObject constructor();", "private SingleObject(){}", "Constructor() {\r\n\t\t \r\n\t }", "private Constructor getConstructor() throws Exception {\r\n return type.getConstructor(Contact.class, label, Format.class);\r\n }", "private void translateConstructor( ) {\n \n Set<MethodInfoFlags> flags = EnumSet.noneOf( MethodInfoFlags.class );\n \n AVM2Method method = new AVM2Method( null, flags );\n avm2Class.avm2Class.constructor = method;\n \n AVM2MethodBody body = method.methodBody;\n body.maxStack = 1;\n body.maxRegisters = 1;\n body.maxScope = 11;\n body.scopeDepth = 10;\n \n InstructionList il = body.instructions;\n \n// il.append( OP_getlocal0 );\n// il.append( OP_pushscope );\n il.append( OP_getlocal0 );\n il.append( OP_constructsuper, 0 );\n \n// il.append( OP_findpropstrict, new AVM2QName( PUBLIC_NAMESPACE, \"drawTest\" ));\n il.append( OP_getlocal0 );\n \n il.append( OP_callpropvoid, new AVM2QName( EmptyPackage.namespace, \"drawTest\" ), 0 );\n\n il.append( OP_returnvoid );\n }", "public CyanSus() {\n\n }", "public static NewExpression new_(Constructor constructor) { throw Extensions.todo(); }", "private ChainingMethods() {\n // private constructor\n\n }", "private ObjectFactory() { }", "public Employee()\n\t{\n\t\tthis(\"(2)Invoke Employee's overload constructor\");\n\t\tSystem.out.println(\"(3)Employee's no-arg constructor is invoked\");\n\t}", "private SingleObject(){\n }", "private SystemInfo() {\r\n // forbid object construction \r\n }", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public Clade() {}", "@Test( expected = IllegalStateException.class )\n\tpublic void constructorShouldNotBeInstantiable() {\n\t\tnew ReflectionUtil() {\n\t\t\t// constructor is protected\n\t\t};\n\t}", "protected ForConstructor(Constructor<?> constructor) {\n this.constructor = constructor;\n }", "public ObjectFactory() {\n\t}", "@Test\n void constructorTest() {\n super.checkConstruction();\n }", "DefaultConstructor(int a){}", "public ObjectFactory() {\r\n\t}", "public MethodEx2() {\n \n }", "public StubPrivateConstructorPair() {\r\n this(null, null);\r\n }", "public ObjectUtils() {\n super();\n }", "@Override\r\n\tpublic CMObject newInstance()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn this.getClass().getDeclaredConstructor().newInstance();\r\n\t\t}\r\n\t\tcatch(final Exception e)\r\n\t\t{\r\n\t\t\tLog.errOut(ID(),e);\r\n\t\t}\r\n\t\treturn new StdBehavior();\r\n\t}", "public CSSTidier() {\n\t}", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "Constructor<T> newConstructor();", "public AbstractClass() { //Sobrecarga del constructor AbstractClass ya que se puede inicializar de 2 maneras\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private Converter()\n\t{\n\t\tsuper();\n\t}", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "private Composite() {\n }", "@SuppressWarnings(\"unchecked\")\n public T newInstance()\n throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n if (constructor_ == null) {\n constructor_ = getRawClass().getConstructor();\n }\n\n return (T)constructor_.newInstance();\n }", "@NotNull\n protected Supplier<AbstractReadablePacket> createConstructor() {\n final Constructor<AbstractReadablePacket> constructor = requireNonNull(ClassUtils.getConstructor(getClass()));\n return () -> ClassUtils.newInstance(constructor);\n }", "private CLUtil()\n {\n }", "private void addConstructors() {\n\t\tthis.rootBindingClass.getConstructor().body.line(\"super({}.class);\\n\", this.name.getTypeWithoutGenerics());\n\t\tGMethod constructor = this.rootBindingClass.getConstructor(this.name.get() + \" value\");\n\t\tconstructor.body.line(\"super({}.class);\", this.name.getTypeWithoutGenerics());\n\t\tconstructor.body.line(\"this.set(value);\");\n\t}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "public Car(){\n\t\t\n\t}", "protected IPCGCallDetailCreator()\r\n {\r\n // empty\r\n }", "private StubPrivateConstructorPair(Object firstObject, Object secondObject) {\r\n super(firstObject, secondObject);\r\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "MyEncodeableWithoutPublicNoArgConstructor() {}", "public JavaClassAsNativeDirectConstructorCallbackEnhancer(JavaClassAsNativeDirectConstructorCallbackImpl javaClass,EnhancerSharedContext ctx)\n {\n super(javaClass,ctx); \n }", "@Test\n public void testConstructorReference() {\n final Car car = Car.create(Car::new);\n }", "ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}", "private ClassUtil() {}", "public void testConstructor() {\r\n assertNotNull(\"unable to create instance\", instance);\r\n }", "private Driver() {\n\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 }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.7430832", "0.7360719", "0.72464174", "0.71756554", "0.71080995", "0.70971537", "0.70601654", "0.7054592", "0.7042289", "0.6989217", "0.6943871", "0.69414824", "0.6846907", "0.6725728", "0.6697158", "0.66858184", "0.6675136", "0.66583526", "0.66576844", "0.6604966", "0.6567171", "0.6514507", "0.6508227", "0.6500992", "0.6491087", "0.6465616", "0.6465264", "0.64463", "0.64307535", "0.6413647", "0.6410346", "0.64070225", "0.63379663", "0.63183236", "0.63172525", "0.6317197", "0.6306357", "0.6303319", "0.6290461", "0.627931", "0.6271942", "0.62706316", "0.6261485", "0.6258986", "0.6258286", "0.62563604", "0.6232503", "0.6232305", "0.6232305", "0.6232305", "0.62263834", "0.6215821", "0.6209499", "0.6206659", "0.620502", "0.62035376", "0.6202597", "0.6196609", "0.61908346", "0.61853695", "0.61853695", "0.61853695", "0.61815274", "0.6175094", "0.6174854", "0.6173368", "0.6169492", "0.6168664", "0.61547434", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318", "0.6147318" ]
0.0
-1
Factory method for getting a new DatabaseWriteResult. Direct constructor calls are not supported.
static DatabaseWriteResult create(UploadStrategy uploadStrategy) { return new DatabaseWriteResult(uploadStrategy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract ODatabaseInternal<?> newDatabase();", "public ResultHandlerDao getObject() {\n final ResultHandlerDao result;\n if (writer == null) {\n result = new JDBCBatchResultHandlerDao(datasource);\n } else {\n result = new WriterResultHandlerDao(itemWriter, writer, datasource);\n }\n result.init();\n return result;\n }", "public DBObject createNew() {\n DBObjectImpl obj = (DBObjectImpl) getNewObject();\n obj.DELETE_STMT_STR = DELETE_STMT_STR;\n obj.INSERT_STMT_STR = INSERT_STMT_STR;\n obj.UPDATE_STMT_STR = UPDATE_STMT_STR;\n obj.QUERY_STMT_STR = QUERY_STMT_STR;\n\n return obj;\n }", "protected DaoRWImpl() {\r\n super();\r\n }", "private DatabaseWriteResult(UploadStrategy strategy) {\n savedEntries = new ArrayList<>(1000);\n databaseSize = -1L;\n error = null;\n uploadStrategy = strategy;\n }", "protected abstract DBObject getNewObject();", "Write createWrite();", "public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter) {\n this(datasource, itemWriter, (Writer) null);\n }", "public interface DatabaseFactory {\r\n\r\n Database makeDatabase();\r\n}", "@Override\n protected Resource createDTO(ResultSet resultSet) throws FHIRPersistenceDataAccessException {\n final String METHODNAME = \"createDTO\";\n log.entering(CLASSNAME, METHODNAME);\n\n Resource resource = new Resource();\n\n try {\n resource.setData(resultSet.getBytes(\"DATA\"));\n resource.setId(resultSet.getLong(\"RESOURCE_ID\"));\n resource.setLastUpdated(resultSet.getTimestamp(\"LAST_UPDATED\"));\n resource.setLogicalId(resultSet.getString(\"LOGICAL_ID\"));\n resource.setVersionId(resultSet.getInt(\"VERSION_ID\"));\n resource.setDeleted(resultSet.getString(\"IS_DELETED\").equals(\"Y\") ? true : false);\n } catch (Throwable e) {\n FHIRPersistenceDataAccessException fx = new FHIRPersistenceDataAccessException(\"Failure creating Resource DTO.\");\n throw severe(log, fx, e);\n } finally {\n log.exiting(CLASSNAME, METHODNAME);\n }\n\n return resource;\n }", "protected abstract T createEntityFromResult (final ResultSet result) throws SQLException;", "public DatabaseConnection newConnection();", "public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter, Writer writer) {\n setDatasource(datasource);\n setItemWriter(itemWriter);\n setWriter(writer);\n }", "private <T> T createObject(ResultSet resultSet, Class<T> destinationClass, Map<String, Field> fields) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n logger.trace(\"Constructing new {} instance\", destinationClass);\n final T dto = destinationClass.getConstructor().newInstance();\n\n for (Map.Entry<String, Field> entry : fields.entrySet()) {\n final String key = entry.getKey();\n final Field field = entry.getValue();\n\n try {\n logger.trace(\"Retrieving '{}' from the ResultSet\", key);\n final Object value = resultSet.getObject(key);\n logger.debug(\"Retrieval of '{}' has resulted to: {}\", key, value);\n\n logger.trace(\"Setting the value '{}' to the field: {}\", value, field.getName());\n field.set(dto, tryConvertValue(field, value));\n logger.trace(\"Value set successfully.\");\n } catch (SQLException ex) {\n final boolean fieldWarningsNotSuppressed = !(hasClassLevelWarningSuppression || field.isAnnotationPresent(SuppressWarnings.class));\n\n if (fieldWarningsNotSuppressed) {\n logger.warn(ex.getMessage());\n }\n }\n }\n\n return dto;\n }", "public Database<T> getDatabase();", "public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter, String outputFilePath) {\n setDatasource(datasource);\n setItemWriter(itemWriter);\n setOutputFilePath(outputFilePath);\n }", "public T create(T object) throws SQLException;", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ODatabaseDocumentTx getOrCreateDB();", "protected TestResult createResult() {\n return new TestResult();\n }", "public ResultHandlerDaoFactory(DataSource datasource) {\n this(datasource, null, (Writer) null);\n }", "public interface DBWritable {\r\n\t/**\r\n\t * @return current object converted to DBObject\r\n\t */\r\n\tpublic DBObject asDBObject();\r\n}", "public DatabaseOperations(){\n\n }", "public static QueryResult build() {\n return new QueryResult(ImmutableList.of());\n }", "void newResult(Result result);", "public ResultFactoryImpl() {\n\t\tsuper();\n\t}", "public sqlDatabase() {\n }", "private DatabaseOperations() {\n }", "@Override\n\tpublic Legacydb create(long legacydbid) {\n\t\tLegacydb legacydb = new LegacydbImpl();\n\n\t\tlegacydb.setNew(true);\n\t\tlegacydb.setPrimaryKey(legacydbid);\n\n\t\treturn legacydb;\n\t}", "@Override\r\n protected CassandraEmbDatabase createDatabaseInternal(final String theDB) {\r\n return new CassandraEmbDatabase(this, theDB);\r\n }", "public abstract ODatabaseInternal<?> openDatabase();", "@Override\n\tpublic Database createDatabase(Type type) throws FSException {\n\t\treturn new DummyDatabase();\n\t}", "private DbQuery() {}", "public DBMaker readonly() {\n readonly = true;\n return this;\n }", "Object getDB();", "Database createDatabase();", "protected abstract DatabaseInitializer createInitializer();", "public static DBMaker openMemory(){\n return new DBMaker();\n }", "public UnaryCallSettings.Builder<CreateDatabaseRequest, Database> createDatabaseSettings() {\n return createDatabaseSettings;\n }", "public Statement newStatement() {\r\n Statement result = null;\r\n try {\r\n result = connection.createStatement();\r\n } catch (SQLException e) {\r\n log.warning(e.getMessage());\r\n }\r\n return result;\r\n }", "public UnaryCallSettings<CreateDatabaseRequest, Database> createDatabaseSettings() {\n return createDatabaseSettings;\n }", "public interface JdbcFactory {\n\n void create();\n}", "public com.mongodb.WriteResult getWriteResult() {\n return writeResult;\n }", "@SuppressWarnings(\"unused\")\n private CreateOrUpdateTemplateResult() {\n }", "static protected <T extends DbConnection<T>> T create(String connectionString, CreateDBFn<T> fn) {\r\n try {\r\n T result = fn.create();\r\n\r\n result.connectionString = connectionString;\r\n\r\n result.connection = DriverManager.getConnection(connectionString);\r\n\r\n synchronized (migratedConnections) {\r\n migratedConnections.add(result.getClass());\r\n }\r\n\r\n result.migrate();\r\n\r\n result.init();\r\n\r\n return result;\r\n } catch (SQLException e) {\r\n throw new DbException(e);\r\n }\r\n }", "DatabaseClient newFinalClient();", "public Result() {\n }", "public Result() {\n }", "public DbUtil() {}", "public static DynamoOperation createAndGetInstance(Context context, int myAddress, int nodeCount, int replicationCount, int readQuorum, int writeQuorum){\n\t\tdynamoOperation = new DynamoOperation(context, myAddress, nodeCount, replicationCount, readQuorum, writeQuorum);\n\t\treturn dynamoOperation;\n\t}", "private Db() {\n super(Ke.getDatabase(), null);\n }", "private DBHandler getTestHandler() {\n DBHandler handler = null;\n try {\n Connection c = DriverManager.getConnection(\"jdbc:derby:test_db;create=true\");\n handler = new DBHandler(c);\n } catch(SQLException e) {\n e.printStackTrace();\n fail(e.getMessage());\n }\n return handler;\n }", "public abstract String createDBString();", "public Result(){\n\t}", "Snapshot create();", "protected abstract Object newTransaction(int isolationLevel) throws TransactionInfrastructureException;", "@Override\n public MTableStoreResponse newResponse() {\n return new MTableStoreResponse();\n }", "@Override\n\tpublic StudentDao createDao() {\n\t\treturn new SqliteStudentDaoImpl();\n\t}", "JavaStatement createJavaStatement();", "public interface PersistenceFactory {\n /* Fields */\n\n /**\n * The property name for all classes stored at the column:row level to introspect the entity that contains the\n * properties persisted in a row's columns\n */\n String CLASS_PROPERTY = \"___class\";\n\n /* Misc */\n\n /**\n * Deletes columns by name from column family\n *\n * @param columnFamily the column family\n * @param key the key\n * @param columns the columns to be deleted by name\n */\n void deleteColumns(String columnFamily, String key, String... columns);\n\n /**\n * Executes a query\n *\n * @param expectedResult the result expected from the query execution\n * @param query the query\n * @param <T> the result type\n * @return the result\n */\n <T> T executeQuery(Class<T> expectedResult, Query query);\n\n /**\n * @param entityClass the class\n * @param key the id\n * @param <T> the entity type\n * @return an entity from the data store looked up by its id\n */\n <T> T get(Class<T> entityClass, String key);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param reversed if the order should be reversed\n * @param columns the column names\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, boolean reversed, String... columns);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param limit of columns\n * @param reversed if the order should be reversed\n * @param fromColumn from column\n * @param toColumn to column\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, int limit, boolean reversed, String fromColumn, String toColumn);\n\n /**\n * @return the default consistency level\n */\n ConsistencyLevel getDefaultConsistencyLevel();\n\n /**\n * @return the default keyspace\n */\n String getDefaultKeySpace();\n\n /**\n * @param entityClass the class type for this instance\n * @param <T> the type of class to be returned\n * @return an instance of this type after transformation of its accessors to notify the persistence context that there are ongoing changes\n */\n <T> T getInstance(Class<T> entityClass);\n\n /**\n * Obtains an entity key\n *\n * @param entity the entity\n * @return the key\n */\n String getKey(Object entity);\n\n /**\n * The list of managed class by this factory\n *\n * @return The list of managed class by this factory\n */\n List<Class<?>> getManagedClasses();\n\n /**\n * Get a list of entities given a query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the result type\n * @return the list of entities\n */\n <T> List<T> getResultList(Class<T> type, Query query);\n\n /**\n * Get a single result from a CQL query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the entity type\n * @return the resulting entity\n */\n <T> T getSingleResult(Class<T> type, Query query);\n\n /**\n * Inserts columns based on a map representing keys with properties and their corresponding values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param keyValuePairs the map with keys and values\n */\n void insertColumns(String columnFamily, String key, Map<String, Object> keyValuePairs);\n\n /**\n * Entry point method to persist and arbitrary list of objects into the datastore\n *\n * @param entities the entities to be persisted\n */\n <T> void persist(T... entities);\n\n /**\n * @param entities the entities to be removed from the data store\n */\n <T> void remove(T... entities);\n \n /**\n * return cluster\n */\n Cluster getCluster(); \n}", "T createEntity(ResultSet resultSet)\n throws CreatorException;", "private DatabaseContract() {}", "public interface DatabaseWrapper {\n long insert(String table, String nullColumnHack, ContentValues values);\n}", "public XmlResultSetWriter(Writer underlyingWriter) {\n super(underlyingWriter);\n }", "T create() throws PersistException;", "Statement createStatement();", "Statement createStatement();", "Statement createStatement();", "private DatabaseManager() {\n // Default constructor\n }", "CreateDatabase getService() {\n\t\t\t\t return CreateDatabase.this;\n\t\t\t\t }", "<DB extends ODatabase> DB getUnderlying();", "@SuppressWarnings(\"unused\")\n private CreateOrUpdateObjectTypeResult() {\n }", "ReturnStatement createReturnStatement();", "private DatabaseManager() {}", "@SuppressWarnings(\"unused\")\n private CreateOrUpdateUnitResult() {\n }", "@Override\n protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException {\n Sequence seq = super.newSequence(sequenceMeta);\n seq.setIdentifier(DBIdentifier.trim(seq.getIdentifier()));\n return seq;\n }", "public ResultSet construct(String szQuery) {\n\t\treturn null;\n\t}", "@SuppressWarnings(\"unused\")\n private CreateOrUpdateObjectAttributeResult() {\n }", "@Nonnull\n public static UBL23WriterBuilder <StatementType> statement ()\n {\n return UBL23WriterBuilder.create (StatementType.class);\n }", "@Override\n protected PreparedStatement getObject() {\n try {\n return this.proxy.prepareStatement(\"SELECT * FROM country\");\n } catch (SQLException sex) {\n throw new UnsupportedOperationException(\"cannot provide object for testing\", sex);\n }\n }", "@SuppressWarnings(\"unused\")\n private CreateOrUpdateTemplateRelationResult() {\n }", "public void writeDatabase();", "@Override\n public Result makeNewResult(SqlNode node, Collection<Clause> clauses, String neededAlias,\n RelDataType neededType, Map<String, RelDataType> aliases) {\n return new Result(node, clauses, neededAlias, neededType, aliases);\n }", "public interface QueryResultBuilder <T>{\n\t\n\t/**\n\t * Apply the given filter to the underlying query.\n\t * \n\t * @param filter The filter to apply.\n\t * @param params Filter parameters\n\t * @return Builder for chaining\n\t */\n\tpublic QueryResultBuilder<T> applyFilter(Option<QueryFilter<T>> filter, Option<Map<String, Object>> params);\n\t\n\t/**\n\t * Apply the given filter to the underlying query.\n\t * \n\t * @param filters The filter to apply\n\t * @return Builder for chaining\n\t */\n\tpublic QueryResultBuilder<T> applyFilters(Option<Filters> filters);\n\t\n\t/**\n\t * Apply the given search to the underlying query.\n\t * \n\t * @param search The search to apply\n\t * @return Builder for chaining\n\t */\n\tpublic QueryResultBuilder<T> applySearch(Option<Search> search);\n\t\n\t/**\n\t * Set the given page for the underlying query.\n\t * \n\t * @param page The page to apply\n\t * @return Builder for chaining\n\t */\n\tpublic QueryResultBuilder<T> setPage(Option<Page> page);\n\t\n\t/**\n\t * Apply the given sort to the underlying query.\n\t * \n\t * @param sort The sort to apply\n\t * @return Builder for chaining\n\t */\n\tpublic QueryResultBuilder<T> applySort(Option<Sort> sort);\n\t\n\t/**\n\t * Get the final result\n\t * @return\n\t */\n\tpublic QueryResult<T> getResult();\n}", "@Override\n public Log map(ResultSet rs, StatementContext ctx) throws SQLException {\n var application = applicationRepository.findById(rs.getInt(1)).orElseThrow();\n return new Log(rs.getInt(1),application.getApp(),application.getPortApp(),application.getPortService(),application.getDockerInstance(),rs.getString(2),rs.getTimestamp(3).toInstant());\n }", "public DB() {\r\n\t\r\n\t}", "public static DatabaseConnection create(String... args) {\n\t\treturn new DatabaseConnection(args);\n\t}", "public abstract FHIRPersistence getPersistenceImpl() throws Exception;", "@GET\n @Path(\"/database/get\")\n public Response getDatabase() throws JsonGenerationException, JsonMappingException, IOException{\n return Response.status(200).entity(Json.newObjectMapper(true).writeValueAsString(Database2.get())).build();\n }", "public static Result instance() {\n\t\t\n\t\tif (result == null) result = new Result();\n\t\t\n\t\treturn result;\n\t\t\n\t}", "public interface DatabaseAPI {\n\n /**\n * Подключиться к базе данных.\n * Этот метод должен использоваться единожды и его результат нужно хранить, как зеницу ока.\n * @param host адрес\n * @param port порт\n * @param username имя пользователя\n * @param password пароль\n * @param databaseName имя базы данных\n * @param threads максимальное количество потоков, которое может использоваться для асинхронного доступа\n * к базе данных. Этот параметр может быть проигнорирован на серверах, где мы не предусматриваем\n * многопоточного доступа к базе данных.\n * Если не уверены, что сюда ставить, пишите двойку.\n * @return держатель подключения к базе данных.\n */\n DatabaseConnectionHolder getDatabaseConnection(String host, int port, String username, String password, String databaseName, int threads);\n\n}", "public LdSqlExecutionCreator createSqlExecutionCreator() {\r\n assertStatus(\"createSqlExecutionCreator\");\r\n return new LdSqlExecutionCreator() {\r\n public LdSqlExecution createSqlExecution() {\r\n final BeanMetaData bmd = createBeanMetaData();\r\n return createBatchDeleteEntitySqlExecution(bmd);\r\n }\r\n };\r\n }", "static SchemaBuilder newInstance() {\n return new SchemaBuilderImpl();\n }", "public DB returnDB(String database) {\r\n return mongo.getDB(database);\r\n }", "public static void provideDAOsConnectionAndConstructor(\n final FileWriterWrapper writer,\n final String className)\n throws IOException {\n writer.write(\" private Connection connection = null;\\n\\n\");\n\n writer.write(\" public \" + className\n + \"(final Connection databaseConnection) {\\n\");\n writer.write(\" connection = databaseConnection;\\n\");\n writer.write(\" }\\n\\n\");\n }", "public DynamoDB_Wrapper() {/* Empty */}", "public LdPublisher newMyEntity() {\r\n return new LdPublisher();\r\n }", "public abstract DataType<T> newInstance();", "public IndexWriter getIndexWriter(boolean create) throws IOException {\n // Followed online tutorial\n if(indexWriter == null) {\n try {\n // Make sure and store to /var/lib/lucene/ per the spec\n Directory indexDir = FSDirectory.open(new File(\"/var/lib/lucene/index1\"));\n IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_4_10_2, new StandardAnalyzer());\n indexWriter = new IndexWriter(indexDir, config);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return indexWriter;\n }", "public Entity newEntity() { return newMyEntity(); }" ]
[ "0.6174043", "0.58719087", "0.5692641", "0.566445", "0.56527036", "0.5645124", "0.563832", "0.56218404", "0.5618906", "0.5590257", "0.5524633", "0.53809685", "0.52983385", "0.527822", "0.52574515", "0.5236347", "0.521507", "0.5172019", "0.51377255", "0.51285297", "0.51162076", "0.5110913", "0.5100309", "0.5099085", "0.5084139", "0.50768226", "0.5075307", "0.50722545", "0.5054653", "0.50340694", "0.50251156", "0.5021401", "0.5002004", "0.50011677", "0.49861678", "0.49688944", "0.4967403", "0.49641246", "0.49491256", "0.49124748", "0.49030775", "0.4901845", "0.48958156", "0.48941588", "0.48777807", "0.4869558", "0.48624685", "0.48624685", "0.48264074", "0.48253453", "0.4818052", "0.4813166", "0.4812801", "0.4810064", "0.4805773", "0.48025063", "0.47928667", "0.47868907", "0.47823343", "0.47823185", "0.477983", "0.4777155", "0.4763528", "0.4745013", "0.47407717", "0.47343332", "0.47343332", "0.47343332", "0.47338882", "0.47224733", "0.4716452", "0.47107044", "0.47044408", "0.4702087", "0.47009498", "0.47003755", "0.46973708", "0.4695659", "0.46955732", "0.4695033", "0.46893975", "0.46878955", "0.4685222", "0.46750647", "0.46625507", "0.46621662", "0.46594134", "0.46562925", "0.46472842", "0.4647134", "0.46415362", "0.4617636", "0.4617479", "0.46137068", "0.46135378", "0.46098506", "0.45919338", "0.45898312", "0.45867482", "0.45861155" ]
0.6894927
0
Sets the exception encountered during database access
void setError(@Nullable Exception error) { this.error = error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setException(Exception e)\n {\n this.exception = e;\n }", "TransactionContext setException(Exception exception);", "protected void setWriteException(Exception e) {\n\tif (writeException == null) writeException = e;\n }", "protected void connectionException(Exception exception) {}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\tdbme = new DBManagerException(dbme.getMessage());\r\n\t}", "public void setException(java.lang.String exception) {\n this.exception = exception;\n }", "public void setException(Exception e){\r\n //build message\r\n String dialog = e+\"\\n\\n\";\r\n StackTraceElement[] trace = e.getStackTrace();\r\n for(int i=0;i<trace.length;i++)\r\n dialog += \" \" + trace[i] + \"\\n\";\r\n //dialog\r\n setMessage(\"Internal error caught.\", dialog);\r\n }", "private void sqlException(SQLException e) {\n System.err.println(\"SQLException: \" + e.getMessage());\n System.err.println(\"SQLState: \" + e.getSQLState());\n System.err.println(\"VendorError: \" + e.getErrorCode());\n e.printStackTrace();\n// System.exit(-1);\n }", "public sparqles.avro.discovery.DGETInfo.Builder setException(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.Exception = value;\n fieldSetFlags()[3] = true;\n return this; \n }", "public void setException(LoadException exception) {\n\t\tloadProgress.setException(exception);\n\t}", "public void setException(java.lang.CharSequence value) {\n this.Exception = value;\n }", "private void handleJdbcDataAccessException(org.springframework.dao.DataAccessException dae)\n throws DataAccessException {\n log.error(\"Jdbc Data access exception occurred: \" + dae.getRootCause().getMessage());\n dae.printStackTrace();\n throw dae;\n }", "void queryError(String queryId, Exception e);", "public void setExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXCEPTIONS_PROP.get(), value);\n }", "public void onException(Exception ex) {\n \t\t\t}", "protected void setStatus(LDBException e) throws LRException\n\t{\n\t\tgetBackground();\n\t\tbackground.setStatus(e);\n\t}", "public void setExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXCEPTIONS_PROP.get(), value);\n }", "private void logException(TestStepRunner testStepRunner)\n\t\t\tthrows AFTException {\n\t\tLOGGER.error(errorMessage);\n\n\t\tString onDbErrorValue = setOnDbErrorValue(testStepRunner);\n\n\t\tLOGGER.info(\"User has defined '\"\n\t\t\t\t+ ConfigProperties.ONERROR_DB_CONNECTION\n\t\t\t\t+ \"' to [\"\n\t\t\t\t+ onDbErrorValue\n\t\t\t\t+ \"]. This test case execution will be stopped and test execution will continue as per '\"\n\t\t\t\t+ ConfigProperties.ONERROR_DB_CONNECTION + \"' configuration.\");\n\t\tthrow new AFTException(errorMessage);\n\t}", "public void setExceptionOn(boolean flag)\n {\n this.setProperty(GUILoggerSeverityProperty.EXCEPTION, flag);\n }", "public void testupdateAddress_PersistenceException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").updateAddress(address, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public DAOException(String reason) {\n super(reason);\n }", "public static void handleException(final Throwable t, final Database currDb) {\n\t\tBaseOpenLogItem ol = new BaseOpenLogItem();\n\t\tol.setCurrentDatabase(currDb);\n\t\tol.logError(t);\n\t}", "public CassandraDataException(Exception e){\r\n\t\tsuper(e);\r\n\t}", "public DataAccessException(Throwable exception) {\n super(exception);\n }", "protected void handleInvocationException(SQLException se) {\n\t\t\t\t\tif (m_connection.getDatabase().equals(Database.MYSQL)) {\n\t\t\t\t\t\tString errmsg = se.getMessage();\n\t\t\t\t\t\tif (errmsg != null && (errmsg.indexOf(\"errno: 150\") >= 0)\n\t\t\t\t\t\t\t\t&& sql_cmd.indexOf(\"CREATE TABLE\") >= 0 && sql_cmd.indexOf(\"FOREIGN KEY\") >= 0) {\n\t\t\t\t\t\t\tStringBuffer msg = new StringBuffer();\n\t\t\t\t\t\t\tmsg.append(errmsg);\n\t\t\t\t\t\t\tmsg.append('\\n');\n\t\t\t\t\t\t\tmsg.append(I18N.getLocalizedMessage(\"mysql_create_table_error\"));\n\t\t\t\t\t\t\tse = new SQLException(msg.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tm_connection.getMetaDataConnection().rollback();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tTSUtils.printException(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tshowSQLError(this, se, null);\n\t\t\t\t}", "@Override\r\n\tpublic void doException() {\n\r\n\t}", "@Override\n public void exception(NHttpServerConnection conn, Exception ex) {\n this.handler.exception(conn, ex);\n }", "@Override\n\t\tpublic void onException(Exception arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onException(Exception arg0) {\n\n\t\t\t}", "private void manejaExcepcion(HibernateException he) throws HibernateException\r\n\t{\n\t tx.rollback();\r\n\t throw new HibernateException(\"Ocurrió un error en la capa de acceso a datos\", he);\r\n\t}", "public OpenXdataDataAccessException() {\r\n \tsuper(\"A Data Base Access Exception occurred.\");\r\n }", "public DAOException()\r\n {\r\n super();\r\n }", "public static void throwException(Throwable throwable)\r\n throws DatabaseException {\r\n throw new DatabaseException(\"Erreur lors de l'accès à la base de données\", throwable);\r\n }", "public ImagingMigratorException(int exceptionCode) {\n this.errorCode = exceptionCode;\n }", "public void checkExcn() throws Exception\n { This is called from the main thread context to re-throw any saved\n // exception.\n //\n if (ex != null) {\n throw ex;\n }\n }", "void checkExcn() throws Exception\n { This is called from the main thread context to re-throw any saved\n // exception.\n //\n if (ex != null) {\n throw ex;\n }\n }", "public DaoException() {\r\n\t\tsuper();\r\n\t}", "public DAOException(Integer errorCode)\r\n {\r\n super(errorCode);\r\n }", "protected void setLastException(ActionExecutionException exception) {\n Util.checkNull(exception, \"exception\");\n\n this.lastException = exception;\n }", "static void logSQLError(SQLException e) {\n log.log(Level.SEVERE, \"SQL Error\", e);\n }", "public QueryException(){\n\t\tsuper();\n\t}", "public void queryError()\r\n {\r\n myFailedQueryCountProvider.setValue(Integer.valueOf(myFailedQueryCounter.incrementAndGet()));\r\n }", "@Override\r\n\tpublic void setException(Throwable throwable) {\r\n super.setException(throwable);\r\n if ( getFutureListenerProcessor() != null ) {\r\n getFutureListenerProcessor().futureSetException(this, throwable);\r\n }\r\n }", "public void testRetrieveAddress_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").retrieveAddress(1);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public DAOException(Throwable cause) {\r\n super(cause);\r\n }", "public void testGetAllCountries_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllCountries();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Test(expected = DBManagerException.class)\r\n\tpublic void testDBManagerException() throws DBManagerException {\r\n\t\ttry {\r\n\t\t\tString CONTROLADOR = \"MAL\";\r\n\t\t\tString URL = \"MAL\";\r\n\t\t\tString USUARIO = \"MAL\";\r\n\t\t\tString CONTRASENA = \"MAL\";\r\n\r\n\t\t\tClass.forName(CONTROLADOR);\r\n\t\t\tDriverManager.getConnection(URL, USUARIO, CONTRASENA);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new DBManagerException(\"Mensaje y causa\", e);\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tString CONTROLADOR = \"MAL\";\r\n\t\t\tString URL = \"MAL\";\r\n\t\t\tString USUARIO = \"MAL\";\r\n\t\t\tString CONTRASENA = \"MAL\";\r\n\r\n\t\t\tClass.forName(CONTROLADOR);\r\n\t\t\tDriverManager.getConnection(URL, USUARIO, CONTRASENA);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new DBManagerException(\"Solo mensaje\");\r\n\t\t}\r\n\t}", "public void testupdateAddresses_PersistenceException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").updateAddresses(new Address[]{address}, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Override\n public void onError(DatabaseError e) {\n }", "public void testGetAllStates_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllStates();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testassociate_PersistenceException() throws Exception {\r\n Address address = this.getAddress();\r\n address.setId(1);\r\n address.setCreationDate(new Date());\r\n address.setModificationDate(new Date());\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").associate(address, 1, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "public void testRetrieveAddresses_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").retrieveAddresses(new long[]{1});\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.w(TAG, \"levels:onCancelled\", databaseError.toException());\n // ...\n }", "public DBException(String message) {\n\t\tsuper(message);\n\t}", "public DAOException(Throwable cause)\r\n {\r\n super(cause);\r\n }", "protected abstract void setErrorCode();", "@Override\r\n public void onCancelled(DatabaseError databaseError) {\n System.out.println(databaseError.toException());\r\n // ...\r\n }", "public void set(Throwable e) {\n this.classType = e.getClass().getName();\n this.objectId = System.identityHashCode(e);\n StackTraceElement[] stack = e.getStackTrace();\n if ( stack != null && stack.length > 0 ) {\n this.path = stack[0].getFileName();\n this.lineNumber = stack[0].getLineNumber();\n }\n this.message = e.getMessage();\n }", "public void updateException(Transaction transaction, String exception) {\r\n\t\ttry {\r\n\t\t\tdao.updateException(transaction, exception);\r\n\t } catch (Exception e) {\r\n\t \tlog.error(\"Exception trying to updateException\",e);\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic void onException(Exception e) {\n\n\t}", "public BDException() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "public ResultProxy addStandardException(Exception e){\n\t\taddRecordToDataset(\"exceptions\", new RecordProxy()\n\t\t\t.addParam(\"opstatus\", 10500)\n\t\t\t.addParam(\"httpStatusCode\", 500)\n\t\t\t.addParam(\"message\", e.getMessage())\n\t\t\t.addParam(\"class\", e.getClass().getCanonicalName())\n\t\t\t.addParam(\"stack\", ExceptionUtils.getStackTrace(e))\n\t\t);\n\t\t//\t)\n\t\t//);\n\n\t\treturn this;\n\t}", "private void exceptionCaught(Throwable cause) {\n log.debug(\"Caught exception\", cause);\n closeConnection(cause);\n Handler<Throwable> exceptionHandler = this.exceptionHandler;\n if (exceptionHandler != null) {\n exceptionHandler.handle(cause);\n }\n }", "public void errorWhenCommitting();", "public TeWeinigGeldException(Exception e) {this.e = e;}", "public DAOException() {\r\n }", "public void addException(Exception exception);", "private RuntimeException getSqlException(HiveSQLException e) throws ExploreException, SQLException {\n if (e.getSQLState() != null) {\n throw e;\n }\n throw new ExploreException(e);\n }", "public void onWriteError(Exception ex, Object item) {\n logger.error(\"Encountered error on write\");\n }", "public void error(SAXParseException e) throws SAXException {\r\n\t\tif (DATASOURCE_ERROR_CODE == -1) {\r\n\t\t\tstack.clear();\r\n\t\t\tstack.push(new EFGString(e.getMessage()));\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t}", "public DataAccessException(String message, Throwable exception) {\n super(message, exception);\n }", "void setStageExceptionMode(StageExceptionMode mode);", "void onFetchDataError(Throwable e);", "public Exception getException ()\n {\n return exception;\n }", "void onException(Exception e);", "@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(TAG, \"Database error occurred\", databaseError.toException());\n }", "protected abstract void onException(final Exception exception);", "public Exception getException() {\n return transactionFailure;\n }", "public void testGetAllAddresses_PersistenceException() throws Exception {\r\n try {\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").getAllAddresses();\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }", "private void tryUpdateDbConnection() {\n try {\n updateDbConnection();\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "public static void setExceptionOnTimeout(boolean bException)\n\t{\n\t\tAJAX.bException = bException;\n\t}", "public void onException(JMSException e) {\n\t\tif (logger == null) {\n\t\t\tlogger = Logger.getLogger(NodeBase.class);\n\t\t}\n\t\t// Don't log these as they might also be ok, for example when sending\n\t\t// to a deleted temp topic\n\t\t// logger.error(e, e);\n\t}", "public DataAccessLayerException(final Throwable cause) {\n super(cause);\n }", "private DatabasePreemptedException(String message, DatabasePreemptedException cause) {\n super(message, cause);\n dbName = cause.dbName;\n dbHandle = cause.dbHandle;\n }", "public Exception getException() {\n return exception;\n }", "public void setConsecutiveExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(CONSECUTIVEEXCEPTIONS_PROP.get(), value);\n }", "public DAOException(String message)\r\n {\r\n super(message);\r\n }", "private void showAlertDBError() {\n showAlertSelectionFail(\"Database error\", \"Could not establish a connection to the database. Please visit the database settings to verify your connection.\");\n }", "public Exception getException() {\r\n return exception;\r\n }", "public Exception getException()\n\t{\n\t\treturn exception;\n\t}", "public DataAccessLayerException() {\n }", "public abstract void onException(Exception e);", "private void MinorException(Exception ex) {\n logger.logException(ex);\n }", "@Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\" + databaseError.toString());\n }", "public Exception getException() {\n return exception;\n }", "private void test() throws SQLException {\n\n\t}", "public void setConsecutiveExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(CONSECUTIVEEXCEPTIONS_PROP.get(), value);\n }", "public Exception getException ()\r\n {\r\n return exception_;\r\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.d(\"loadPost:onCancelled\", String.valueOf(databaseError.toException()));\n // ...\n }", "@Test\n public void testRegister_connectionException() throws SQLException {\n SignUpRequest request = new SignUpRequest(UNIQUE, PASSWORD);\n\n doThrow(SQLException.class).when(connection).register(request);\n\n dao.register(request);\n\n verify(controller).connectionFailed();\n }" ]
[ "0.7215012", "0.7043974", "0.65309817", "0.64291424", "0.61688155", "0.6104575", "0.60263103", "0.59575075", "0.59486663", "0.5940839", "0.59104747", "0.5845136", "0.58068347", "0.5746433", "0.573532", "0.57147855", "0.57070905", "0.5628726", "0.5613691", "0.5605134", "0.55971587", "0.5584292", "0.55839014", "0.5547224", "0.55379397", "0.5533967", "0.5517378", "0.55168396", "0.55124074", "0.55081385", "0.5492152", "0.5487022", "0.5479393", "0.5478469", "0.54740316", "0.5471232", "0.547111", "0.5464861", "0.54536206", "0.54467124", "0.54286045", "0.5415543", "0.54097295", "0.5397648", "0.53951335", "0.5385412", "0.53831947", "0.53785557", "0.5378358", "0.5376759", "0.53713274", "0.5364113", "0.5363786", "0.53625554", "0.53589964", "0.53578424", "0.5357837", "0.53576887", "0.5353014", "0.5352222", "0.5349368", "0.5334368", "0.5327911", "0.53247577", "0.53219616", "0.5306615", "0.53049445", "0.5300456", "0.5299176", "0.52948236", "0.5292871", "0.52910036", "0.52885413", "0.52785873", "0.52742225", "0.5273463", "0.5264391", "0.5260034", "0.5259267", "0.5252364", "0.52426314", "0.52413154", "0.52412033", "0.5239237", "0.5231937", "0.52271515", "0.5217652", "0.52140516", "0.52120686", "0.5210354", "0.520912", "0.52089584", "0.52074414", "0.51987284", "0.51894975", "0.5186036", "0.51842", "0.5178958", "0.51775765", "0.516738" ]
0.5547203
24
Returns a Collection of ids whose entries were successfully written to the backing database
Collection<String> getSavedEntries() { return Collections.unmodifiableCollection(savedEntries); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection getPersistedObjectIds() {\n if (_payload != PAYLOAD_OIDS_WITH_ADDS) {\n if (_payload == PAYLOAD_OIDS)\n throw new UserException(s_loc.get(\"no-added-oids\"));\n throw new UserException(s_loc.get(\"extent-only-event\"));\n }\n return (_addIds == null) ? Collections.EMPTY_LIST : _addIds;\n }", "public List<K> getSavedIds() {\n if (dbObjects.length > 0 && dbObjects[0] instanceof JacksonDBObject) {\n throw new UnsupportedOperationException(\n \"Generated _id retrieval not supported when using stream serialization\");\n }\n\n List<K> ids = new ArrayList<K>();\n for (DBObject dbObject : dbObjects) {\n ids.add(jacksonDBCollection.convertFromDbId(dbObject.get(\"_id\")));\n }\n\n return ids;\n }", "public Collection getUpdatedObjectIds() {\n if (_payload == PAYLOAD_EXTENTS)\n throw new UserException(s_loc.get(\"extent-only-event\"));\n return (_updates == null) ? Collections.EMPTY_LIST : _updates;\n }", "Collection<EntityUpdateRequest> pendingUpdates();", "public String [] _truncatable_ids()\r\n {\r\n return _ids_list;\r\n }", "@Override\n public List<Integer> getAllWorklogIds() {\n List<Integer> worklogIds;\n\n try (Connection connection = database.connect();\n PreparedStatement stmt = connection.prepareStatement(GET_ALL_WORKLOG_IDS_SQL)) {\n worklogIds = worklogIdDataMapper.toDTO(stmt.executeQuery());\n } catch (SQLException e) {\n logger.logToDatabase(getClass().getName(), \"getAllWorklogIds\", e);\n throw new InternalServerErrorException(e.getMessage());\n }\n return worklogIds;\n }", "public List<T> getSuccesses() {\n return successes;\n }", "public Long getIntegrityErrors() {\n\t\treturn integrityErrors;\n\t}", "int entries() {\r\n return journal_entries;\r\n }", "Collection<E> save(Iterable<E> entities);", "public long getUniqueEntitiesInCollection() \n\tthrows DataAccessException;", "Collection<?> idValues();", "private TreeSet<Long> getIds(Connection connection) throws Exception {\n\t\tTreeSet<Long> result = new TreeSet<Long>();\n\t\tPreparedStatement ps = null;\n\t\ttry {\n\t\t\tps = connection\n\t\t\t\t\t.prepareStatement(\"select review_feedback_id from \\\"informix\\\".review_feedback\");\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tresult.add(rs.getLong(1));\n\t\t\t}\n\t\t} finally {\n\t\t\tps.close();\n\t\t}\n\t\treturn result;\n\t}", "public int[] executeBatch() throws SQLException {\n return null;\r\n }", "String[] _truncatable_ids();", "public ArrayList<Integer> getAllTransactionsID(){\n return allTransactionsID;\n }", "public Collection getDeletedObjectIds() {\n if (_payload == PAYLOAD_EXTENTS)\n throw new UserException(s_loc.get(\"extent-only-event\"));\n return (_deletes == null) ? Collections.EMPTY_LIST : _deletes;\n }", "Map retrievePreparedTransactions();", "public Set<T> getSaveEntities() {\n return unmodifiableSet(saveEntities);\n }", "@Override\n public boolean save(List<FeedbackResource> feedbackResourceList) throws RemoteException{\n AtomicInteger success = new AtomicInteger();\n feedbackResourceList.forEach(feedbackResource -> {\n if (feedbackRepository.save(feedbackResource))\n success.getAndIncrement();\n });\n return feedbackResourceList.size() == success.get();\n }", "java.util.List<java.lang.Long> getUpdateCountsList();", "public int getEntriesSet() {\r\n return entriesSet;\r\n }", "public List<Integer> getAccessedTransaction() {\n return new ArrayList<Integer>(_accessedTransactions);\n }", "public Set<T> getUpdateEntities() {\n return unmodifiableSet(updateEntities);\n }", "public <T> Collection<T> saveAll(Collection<T> entities);", "Map<Date, Integer> getFullUniques(Step step) throws SQLException;", "<S extends T> Collection<S> save(Iterable<S> entities);", "public synchronized long getEntries() {\n return entries;\n }", "private List<E> snapshot() {\n\t\tList<E> list = Lists.newArrayListWithExpectedSize(size());\n\t\tfor (Multiset.Entry<E> entry : entrySet()) {\n\t\t\tE element = entry.getElement();\n\t\t\tfor (int i = entry.getCount(); i > 0; i--) {\n\t\t\t\tlist.add(element);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public int[] getSavedConfigurations() {\r\n return savedConfigurations;\r\n }", "public int getSuccesses() {\n return successes.get();\n }", "@Override\n public int bathSave(List<T> entitys) throws Exception {\n return mapper.insertList(entitys);\n }", "private List<String> getAllPageIdsForUpdate()\n {\n List<String> pageIds = new ArrayList<String>();\n pageIds.add(pageId);\n for (GWikiElement depPageId : getDepObjects()) {\n pageIds.add(depPageId.getElementInfo().getId());\n }\n return pageIds;\n }", "@java.lang.Override\n public int getSuccesses() {\n return successes_;\n }", "public String[] getSavingTransactions(){\n return savingTransactions;\n }", "private List<Multiset.Entry<E>> snapshot() {\n\t\t\tList<Multiset.Entry<E>> list = Lists\n\t\t\t\t\t.newArrayListWithExpectedSize(size());\n\t\t\tfor (Multiset.Entry<E> entry : this) {\n\t\t\t\tlist.add(entry);\n\t\t\t}\n\t\t\treturn list;\n\t\t}", "@java.lang.Override\n public int getSuccesses() {\n return successes_;\n }", "public Collection<Integer> pesquisarIdsSetorParaGerarHistoricoParaEncerrarFaturamento()\n\t\t\tthrows ErroRepositorioException;", "boolean hasStableIds();", "public String getIds() {\n return ids;\n }", "public String getIds() {\n return ids;\n }", "@Override\n\tpublic int swriteGetCount() throws SQLException {\n\t\treturn sqlSession.selectOne(\"as_writeGetCount\");\n\t}", "private List<Integer> determineItemIds() {\n List<Integer> ids = null;\n try {\n ids = mDatabaseAccess.itemsDAO().selectAllItemIds();\n } catch (Exception ex) {\n Log.e(TAG, \"A general failure has occurred while trying to determine all item IDs.\",\n ex);\n }\n return ids;\n }", "private void saveList() throws Exception {\n JournalEntries.saveList(JournalList,ReconcileCur.ReconcileNum);\n }", "public Collection pesquisarIdsLocalidades() throws ErroRepositorioException;", "long getIds(int index);", "public java.util.List<String> getIds() {\n return ids;\n }", "long getFlushes() {\n return flushes.get();\n }", "public int getValueListCount() {\n InsertStatement insertStatement = getSqlStatement();\n return InsertStatementHandler.getSetAssignmentSegment(insertStatement).isPresent() ? 1 : insertStatement.getValues().size();\n }", "public int getIdSet() {\r\n return idSet;\r\n }", "private void saveLocations(){\n\n final LocationsDialog frame = this;\n WorkletContext context = WorkletContext.getInstance();\n\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n final HashMap<Integer, Location> dirty = model.getDirty();\n\n\n for(Integer id : dirty.keySet()) {\n Location location = dirty.get(id);\n\n\n if (!Helper.insert(location, \"Locations\", context)) {\n System.out.print(\"insert failed!\");\n }\n\n }// end for\n\n model.refresh();\n\n }", "boolean hasTransactionChangesPending() {\n// System.out.println(transaction_mod_list);\n return transaction_mod_list.size() > 0;\n }", "public Collection eleicoesAbertaID(){\n return this.eleicaoDB.eleicoesAbertaID();\n }", "@Override\n\tpublic <S extends Audit> List<S> saveAll(Iterable<S> entities) {\n\t\treturn null;\n\t}", "public String[] getIDs() {\n return impl.getIDs();\n }", "public JSObject executeSet(SQLiteDatabase db, JSArray set) throws Exception {\n long lastId = Long.valueOf(-1);\n int changes = 0;\n JSObject retObj = new JSObject();\n for (int i = 0; i < set.length(); i++) {\n JSONObject row = set.getJSONObject(i);\n String statement = row.getString(\"statement\");\n JSONArray valuesJson = row.getJSONArray(\"values\");\n JSArray values = new JSArray();\n for (int j = 0; j < valuesJson.length(); j++) {\n values.put(valuesJson.get(j));\n }\n lastId = prepareSQL(db, statement, values);\n if (lastId == -1) {\n Log.v(TAG, \"*** breaking lastId -1\");\n break;\n } else {\n changes += 1;\n }\n }\n if (lastId != -1) {\n retObj.put(\"changes\", uSqlite.dbChanges(db));\n retObj.put(\"lastId\", lastId);\n } else {\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"lastId\", lastId);\n }\n return retObj;\n }", "public DataSourceVector getInsertRows() throws IllegalStateException {\r\n DataSourceVector dataInserted = new DataSourceVector();\r\n dataInserted.setColumnName(columnNames);\r\n dataInserted.flagAddStatusRow = false;\r\n /*Read data from data Vector*/\r\n for (int row = 0; row < data.size(); row++) {\r\n if (((Vector) data.elementAt(row)).elementAt(numberOfcolumns).\r\n equals(new Integer(IS_INSERTED))) {\r\n dataInserted.addNewRow((Vector)data.elementAt(row));\r\n }\r\n }\r\n return dataInserted;\r\n }", "public Map<String, Object> getIds() {\n return ids;\n }", "public String[] getRecordIDs() throws RemoteException\n\t{\n\t\treturn StaffRecords.getRecordIDs();\n\t}", "@Override\n public int[] executeBatch() {\n if (this.batchPos == 0) {\n return new int[0];\n }\n try {\n int[] arrn = this.db.executeBatch(this.pointer, this.batchPos / this.paramCount, this.batch);\n return arrn;\n }\n finally {\n this.clearBatch();\n }\n }", "public List getAllIds();", "public List<SSTableReader> finished()\n {\n assert state() == State.COMMITTED || state() == State.READY_TO_COMMIT;\n return preparedForCommit;\n }", "private Set<Integer> A00() {\n HashSet hashSet = new HashSet();\n AnonymousClass0FX r3 = this.A00;\n Cursor A002 = r3.A05.A00(new C03370cB(\"SELECT * FROM room_table_modification_log WHERE invalidated = 1;\"));\n while (A002.moveToNext()) {\n try {\n hashSet.add(Integer.valueOf(A002.getInt(0)));\n } catch (Throwable th) {\n A002.close();\n throw th;\n }\n }\n A002.close();\n if (!hashSet.isEmpty()) {\n r3.A09.A2S();\n }\n return hashSet;\n }", "Integer insertBatch(List<RolePermission> rolePermissions);", "public JSObject execSet(JSArray set) throws Exception {\n JSObject retObj = new JSObject();\n // Open the database for writing\n SQLiteDatabase db = null;\n long lastId = Long.valueOf(-1);\n int changes = 0;\n if (set.length() > 0) {\n try {\n db = getConnection(false, secret);\n db.beginTransaction();\n for (int i = 0; i < set.length(); i++) {\n JSONObject row = set.getJSONObject(i);\n String statement = row.getString(\"statement\");\n JSONArray valuesJson = row.getJSONArray(\"values\");\n JSArray values = new JSArray();\n for (int j = 0; j < valuesJson.length(); j++) {\n values.put(valuesJson.get(j));\n }\n lastId = prepareSQL(db, statement, values);\n if (lastId == -1) {\n changes = Integer.valueOf(-1);\n Log.v(TAG, \"*** breaking lastId -1\");\n break;\n } else {\n changes += 1;\n }\n }\n if (changes > 0) {\n db.setTransactionSuccessful();\n retObj.put(\"changes\", dbChanges(db));\n retObj.put(\"lastId\", lastId);\n return retObj;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error: ExecSet failed: \", e);\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet failed: \" + e);\n return retObj;\n } finally {\n db.endTransaction();\n if (db != null) db.close();\n }\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet wrong statement\");\n return retObj;\n } else {\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet no Set given\");\n return retObj;\n }\n }", "public Collection<BaseDocument> getUnsavedDocuments() {\n\t\tVector<BaseDocument> ret = new Vector<BaseDocument>();\n\t\tif (theStructures.hasChanged())\n\t\t\tret.add(theStructures);\n\t\treturn ret;\n\t}", "void saveAll(Collection<?> entities);", "public List<Integer> selectPosAllId() {\n\t\treturn postDao.selectPosAllId();\r\n\t}", "public ArrayList<Xid> getPreparedTransactions() {\n ArrayList<Xid> preparedBranches = new ArrayList<>();\n\n for (DtxBranch dtxBranch : branches.values()) {\n if (dtxBranch.getState() == DtxBranch.State.PREPARED) {\n preparedBranches.add(dtxBranch.getXid());\n }\n }\n\n return preparedBranches;\n }", "private Boolean persistRecords() {\n\t\t//Declarations\n\t\tBoolean persisted = false;\n\t\t\n\t\ttry{\t\t\t\t\t\n\t\t\t//Create the DB Handler\n\t\t\tDBHandler dbHandler = new DBHandler();\t\t\t\n\t\t\tDate date = new Date();\n\t\t\t\t\t\t\n\t\t\t//Set the updated time\n\t\t\t_medicalData.setUpdatedOn(date.toString());\n\t\t\t\n\t\t\t//Store the data to data store\n\t\t\tpersisted = dbHandler.storeData(_medicalData);\t\t\t\t\t\t\n\t\t}catch(Exception ex){\n\t\t\tpersisted = false;\n\t\t}\n\t\t\n\t\treturn persisted;\t\t\n\t}", "@Override\n public int[] executeBatch() throws SQLException {\n throw new SQLException(\"tinySQL does not support executeBatch.\");\n }", "public Collection<GlobalIdEntry> getAllEntries();", "int getIdsCount();", "private static Map<String, List<String>> getDbIdToStableIds(ResultSet stableIdResults) throws SQLException {\n\t\tMap<String, List<String>> dbIdToStableIds = new HashMap<>();\n\n\t\t// Iterate through returned results of DB IDs and stable IDs\n\t\twhile (stableIdResults.next()) {\n\t\t\tString stableId = stableIdResults.getString(1);\n\t\t\tString dbId = stableIdResults.getString(2);\n\n\t\t\tdbIdToStableIds.computeIfAbsent(dbId, k -> new ArrayList<>()).add(stableId);\n\t\t}\n\t\treturn dbIdToStableIds;\n\t}", "java.util.List<java.lang.Long> getIdsList();", "public int size() {\n\t\treturn db.size();\n\t}", "public String getIds() {\n return this.ids;\n }", "public boolean containsChanges() {\n return genClient.containsChanges();\n }", "@Override\r\n public Set<String> getObjectIdList() throws HarvesterException {\r\n Set<String> objectIdList = new HashSet<String>();\r\n try {\r\n String[] row = null;\r\n int rowCount = 0;\r\n boolean done = false;\r\n while (!done && (row = csvReader.readNext()) != null) {\r\n rowCount++;\r\n currentRow++;\r\n objectIdList.add(createRecord(row));\r\n if (rowCount % batchSize == 0) {\r\n log.debug(\"Batch size reached at row {}\", currentRow);\r\n break;\r\n }\r\n done = (maxRows > 0) && (currentRow < maxRows);\r\n }\r\n hasMore = (row != null);\r\n } catch (IOException ioe) {\r\n throw new HarvesterException(ioe);\r\n }\r\n if (objectIdList.size() > 0) {\r\n log.debug(\"Created {} objects\", objectIdList.size());\r\n }\r\n return objectIdList;\r\n }", "public Collection<BundleEntry> getDuplicates() {\n return duplicates;\n }", "long getChangeset();", "@Test\r\n\tpublic void testPLFM_1978_createOrUpdateBatch(){\n\t\tList<DBOFileHandle> list = new LinkedList<DBOFileHandle>();\r\n\t\t// pass the empty list should return an empty result\r\n\t\tList<Long> results = migratableTableDAO.createOrUpdateBatch(list);\r\n\t\tassertNotNull(results);\r\n\t\tassertEquals(0, results.size());\r\n\t}", "List<Long> getTransmissionIds();", "public Collection<IgniteTxEntry> optimisticLockEntries();", "public void commitChanges(){\r\n try{\r\n //Record the state of unfinished set in unfinished.dat\r\n unfinishedFileOutputStream = new FileOutputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetOutputStream = new ObjectOutputStream(unfinishedFileOutputStream);\r\n unfinishedSetOutputStream.writeObject(unfinished);\r\n unfinishedSetOutputStream.close();\r\n unfinishedFileOutputStream.close();\r\n\r\n //Record the state of finished list in finished.dat\r\n finishedFileOutputStream = new FileOutputStream(FINISHED_FILE_PATH);\r\n finishedListOutputStream = new ObjectOutputStream(finishedFileOutputStream);\r\n finishedListOutputStream.writeObject(finished);\r\n finishedListOutputStream.close();\r\n finishedFileOutputStream.close();\r\n\r\n //Record the state of activities list in activities.dat\r\n activitiesFileOutputStream = new FileOutputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListOutputStream = new ObjectOutputStream(activitiesFileOutputStream);\r\n activitiesListOutputStream.writeObject(activities);\r\n activitiesListOutputStream.close();\r\n activitiesFileOutputStream.close();\r\n }\r\n catch(Exception e){\r\n System.out.println(\"Stress in commiting changes: \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n\tpublic List<String> getAttach() throws Exception {\n\t\treturn dao.getAttach();\n\t}", "public SaveState save() {\n\t\tSaveState saveState = new SaveState(\"COLUMN_TABLE_FILTER\");\n\t\tsaveState.putString(\"NAME\", name);\n\t\tsaveState.putInt(\"COLUMN_FILTER_COUNT\", constraintSets.size());\n\t\tfor (int i = 0; i < constraintSets.size(); i++) {\n\t\t\tColumnConstraintSet<R, ?> constraintSet = constraintSets.get(i);\n\t\t\tSaveState save = constraintSet.save();\n\t\t\tsaveState.putXmlElement(\"COLUMN_FILTER_\" + i, save.saveToXml());\n\t\t}\n\t\treturn saveState;\n\t}", "Set<II> getIds();", "@Override\n\tpublic Object[] getIds() {\n\t\treturn null;\n\t}", "CommitIndex getCommittedIndex() {\n return committed;\n }", "private DatabaseWriteResult(UploadStrategy strategy) {\n savedEntries = new ArrayList<>(1000);\n databaseSize = -1L;\n error = null;\n uploadStrategy = strategy;\n }", "public static ImmutableSet<Integer> getIds(){\n\t\t\treturn m_namesMap.rightSet();\n\t\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}" ]
[ "0.5983108", "0.5810724", "0.5571087", "0.5517677", "0.5492873", "0.5386038", "0.53766894", "0.5356476", "0.53355294", "0.52989763", "0.52227724", "0.52205724", "0.52114534", "0.5192148", "0.5145322", "0.51443154", "0.5132575", "0.51310223", "0.5125873", "0.5113404", "0.5042196", "0.50380754", "0.5031019", "0.5001315", "0.4982133", "0.49820638", "0.49494523", "0.4944653", "0.49353465", "0.49240243", "0.491618", "0.49097368", "0.4896639", "0.48909333", "0.48898175", "0.4883438", "0.48804897", "0.48735183", "0.4869375", "0.48692763", "0.48692763", "0.48689282", "0.48541144", "0.4852396", "0.4849127", "0.48470566", "0.48330185", "0.48182407", "0.48104626", "0.48084697", "0.48042393", "0.4799623", "0.4793754", "0.47932056", "0.4786871", "0.47783667", "0.4778341", "0.47781685", "0.47750032", "0.47699922", "0.4760364", "0.4754879", "0.47528785", "0.47486204", "0.47422045", "0.47374073", "0.473736", "0.4735205", "0.47324407", "0.47254863", "0.47204506", "0.47185743", "0.47152513", "0.47115144", "0.4710715", "0.47092408", "0.47027898", "0.47014442", "0.46978486", "0.46941876", "0.4691731", "0.46875682", "0.4684533", "0.46817866", "0.4674923", "0.4669391", "0.4667356", "0.46667078", "0.46660948", "0.4665271", "0.46629232", "0.4656604", "0.46284676", "0.46284676", "0.46284676", "0.46284676", "0.46284676", "0.46284676", "0.46284676", "0.46284676" ]
0.5527568
3
Sets the collection of ids of cache entries that were successfully written to the backing database
void setSavedEntries(Collection<String> savedEntries) { this.savedEntries = Collections.unmodifiableCollection(savedEntries); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flush() {\n final Collection<MappedPage> cachedPages = cache.getValues();\n for (final MappedPage mappedPage : cachedPages)\n mappedPage.flush();\n }", "@Override\n protected void set(java.util.Collection<org.tair.db.locusdetail.ILocusDetail> list) {\n loci = list;\n // Add the primary keys to the serialized key list if there are any.\n if (loci != null) {\n for (com.poesys.db.dto.IDbDto object : loci) {\n lociKeys.add(object.getPrimaryKey());\n }\n }\n }", "public void commitChanges(){\r\n try{\r\n //Record the state of unfinished set in unfinished.dat\r\n unfinishedFileOutputStream = new FileOutputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetOutputStream = new ObjectOutputStream(unfinishedFileOutputStream);\r\n unfinishedSetOutputStream.writeObject(unfinished);\r\n unfinishedSetOutputStream.close();\r\n unfinishedFileOutputStream.close();\r\n\r\n //Record the state of finished list in finished.dat\r\n finishedFileOutputStream = new FileOutputStream(FINISHED_FILE_PATH);\r\n finishedListOutputStream = new ObjectOutputStream(finishedFileOutputStream);\r\n finishedListOutputStream.writeObject(finished);\r\n finishedListOutputStream.close();\r\n finishedFileOutputStream.close();\r\n\r\n //Record the state of activities list in activities.dat\r\n activitiesFileOutputStream = new FileOutputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListOutputStream = new ObjectOutputStream(activitiesFileOutputStream);\r\n activitiesListOutputStream.writeObject(activities);\r\n activitiesListOutputStream.close();\r\n activitiesFileOutputStream.close();\r\n }\r\n catch(Exception e){\r\n System.out.println(\"Stress in commiting changes: \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "StoreResponse set(CACHE_ELEMENT e);", "public void storeInCache() {\r\n lockValueStored = IN_CACHE;\r\n }", "@Override\n public List<Result> storeResults(List<Result> results, String homeworkId) {\n\n // added all results and got the ids backs with the results\n List<Result> allResults = addAllResults(results);\n\n // Getting the assignmentCollection to update assignment\n MongoCollection<Assignment> assignmentMongoCollection = mongoDatabase.getCollection(\"assignment\", Assignment.class);\n\n\n // gets the assignment\n Assignment assignment1 = assignmentMongoCollection.find(eq(\"_id\", new ObjectId(homeworkId)), Assignment.class).first();\n\n\n List<String> allResultsIds = assignment1.getResultsId();\n for (Result result : allResults) {\n allResultsIds.add(result.getHexId());\n }\n assignment1.setResultsId(allResultsIds);\n // add all results to table\n MongoCollection<Document> collectionAssignment = mongoDatabase.getCollection(\"assignment\");\n Bson updateOperationDocument = new Document(\"$set\", assignment1);\n collectionAssignment.updateOne(eq(\"_id\", new ObjectId(homeworkId)), updateOperationDocument);\n\n return allResults;\n }", "@Override\n\tpublic void cacheResult(List<Paper> papers) {\n\t\tfor (Paper paper : papers) {\n\t\t\tif (entityCache.getResult(PaperModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tPaperImpl.class, paper.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(paper);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpaper.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void syncCache() {\n for (String s : this.cache.keySet()) {\n JsonDocument document = this.cache.get(s);\n document.save(new File(directory, s + \".json\"));\n }\n }", "public void cacheResult(java.util.List<DataEntry> dataEntries);", "public void markRefreshed() {\n tozAdCampaignRetrievalCounter = 0;\n }", "protected void prepareSave() {\r\n EObject cur;\r\n for (Iterator<EObject> iter = getAllContents(); iter.hasNext();) {\r\n cur = iter.next();\r\n \r\n EStructuralFeature idAttr = cur.eClass().getEIDAttribute();\r\n if (idAttr != null && !cur.eIsSet(idAttr)) {\r\n cur.eSet(idAttr, EcoreUtil.generateUUID());\r\n }\r\n }\r\n }", "public void flushEntityCache() {\n super.flushEntityCache();\n }", "public void flush() {\n new Thread() {\n @Override\n public void run() {\n Log.d(TAG, \"Erasing the cache ...\");\n // erase the existing cache\n String where = CachedValue.ITEM + \" = ?\";\n String[] selectionArgs = new String[] {\n String.valueOf(mVehicle.getId())\n };\n mContext.getContentResolver().delete(CacheTable.BASE_URI, where, selectionArgs);\n\n Log.d(TAG, \"Building new values ...\");\n // write the new cache\n ContentValues[] values = new ContentValues[Statistics.STATISTICS.size()];\n final int length = mObjects.size();\n final long vehicleId = mVehicle.getId();\n int num = 0;\n for (int i = 0; i < length; i++) {\n StatisticHolder holder = mObjects.get(i);\n if (holder.type == TYPE_STATISTIC) {\n ContentValues v = new ContentValues();\n v.put(CachedValue.ITEM, vehicleId);\n v.put(CachedValue.VALID, true);\n v.put(CachedValue.VALUE, mValues.get(holder.key));\n v.put(CachedValue.KEY, holder.key);\n values[num++] = v;\n }\n }\n if (num != values.length) {\n Log.d(TAG, \"Not writing to the database because we don't have all the stats\");\n } else {\n Log.d(TAG, \"Writing \" + num + \" records to the database ...\");\n long start = System.currentTimeMillis();\n mContext.getContentResolver().bulkInsert(CacheTable.BASE_URI, values);\n long diff = System.currentTimeMillis() - start;\n double seconds = diff / 1000D;\n Log.d(TAG, \"Caching of \" + num + \" records complete! (\" + seconds + \" seconds)\");\n }\n }\n }.start();\n }", "public long commit(Map<String, OperationalSets> sets) {\n sets.forEach((table, set) -> {\n this.writesPerTable.putIfAbsent(table, new HashMap<>());\n this.writesPerTable.get(table).put(this.timestamp, set);\n });\n try {\n rwl.writeLock().lock();\n this.timestamp++;\n return this.timestamp;\n }finally {\n rwl.writeLock().unlock();\n }\n }", "private void updateDictionary(Collection<String> writtenFiles) {\n if(logger.isDebugEnabled()){\n logger.debug(\"updating VFSCache with files written: \" + writtenFiles);\n }\n Cache cache = CacheFactory.getVFSCache();\n for(String path : writtenFiles){\n cache.put(new Element(path, path));\n }\n }", "@Override\n\tpublic void cacheResult(List<ScienceAppExecute> scienceAppExecutes) {\n\t\tfor (ScienceAppExecute scienceAppExecute : scienceAppExecutes) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tScienceAppExecuteModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tScienceAppExecuteImpl.class,\n\t\t\t\t\t\tscienceAppExecute.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(scienceAppExecute);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tscienceAppExecute.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "private void saveSettings() throws SQLException {\n\t\tsetSetting(\"requests\", Integer.toString(requestCount));\n\t}", "public void saveAll(){\n // Store postings\n for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) {\n saveJSON(\"postings/t\"+hash(entry.getKey())+\".json\", entry.getValue());\n System.err.println(\"postings/t\"+hash(entry.getKey())+\".json\");\n count++;\n if (count%1000==0)\n System.err.println(\"storing \"+ count);\n }\n // Store mapping ID<->document names mapping\n this.saveJSON(\"postings/docIDs.json\", this.docIDs);\n this.saveJSON(\"postings/docLengths.json\", this.docLengths);\n }", "public JSObject execSet(JSArray set) throws Exception {\n JSObject retObj = new JSObject();\n // Open the database for writing\n SQLiteDatabase db = null;\n long lastId = Long.valueOf(-1);\n int changes = 0;\n if (set.length() > 0) {\n try {\n db = getConnection(false, secret);\n db.beginTransaction();\n for (int i = 0; i < set.length(); i++) {\n JSONObject row = set.getJSONObject(i);\n String statement = row.getString(\"statement\");\n JSONArray valuesJson = row.getJSONArray(\"values\");\n JSArray values = new JSArray();\n for (int j = 0; j < valuesJson.length(); j++) {\n values.put(valuesJson.get(j));\n }\n lastId = prepareSQL(db, statement, values);\n if (lastId == -1) {\n changes = Integer.valueOf(-1);\n Log.v(TAG, \"*** breaking lastId -1\");\n break;\n } else {\n changes += 1;\n }\n }\n if (changes > 0) {\n db.setTransactionSuccessful();\n retObj.put(\"changes\", dbChanges(db));\n retObj.put(\"lastId\", lastId);\n return retObj;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error: ExecSet failed: \", e);\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet failed: \" + e);\n return retObj;\n } finally {\n db.endTransaction();\n if (db != null) db.close();\n }\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet wrong statement\");\n return retObj;\n } else {\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"message\", \"Error: ExecSet no Set given\");\n return retObj;\n }\n }", "private void persistFactions(Set<FactionWorth> factions) throws SQLException {\n Set<FactionWorth> createdFactions = insertFactions(factions);\n\n // Add newly created chunk positions to the identity cache.\n cacheFactionIds(createdFactions);\n }", "public void registerCacheHits(ResultSet<V> resultSet) {\n threadPoolExecutor.execute(() -> resultSet.stream()\n .forEach(v -> {\n if (!cache.isClosed()) {\n cache.get(cacheKeyMaker.makeKey(v));\n }\n }));\n }", "public void putBatch(String key, Collection<Long> batch) {\n Collection<Long> oldBatch = index.get(key);\n if (oldBatch==null) {\n oldBatch = new HashSet<Long>(batch);\n index.put(key, oldBatch);\n }\n oldBatch.addAll(batch);\n }", "private void saveList() throws Exception {\n JournalEntries.saveList(JournalList,ReconcileCur.ReconcileNum);\n }", "public void flush() {\n\t\tupdateCounter++;\n//\t\trules.update();\n\t}", "protected abstract void setIdListToCache(List<Long> inActivityIds, StreamView inCompositeStream, long inUserId);", "public void saveAllEntities() {\n for (T entity : getEntities()) {\n if (entity.getId() < 0) {\n entity.setId(null);\n getService().save(entity);\n }\n else {\n getService().save(entity);\n }\n }\n for (T removedEntity : getRemovedEntities()) {\n getService().delete(removedEntity.getId());\n }\n setRemovedEntities(new ArrayList<T>());\n }", "public void markEverythingDirty() {\n fullUpdate = true;\n }", "public void setCached() {\n }", "@Override\n public void onSuccess(Void aVoid) {\n WriteBatch batch = getFirestoreInstance().batch();\n\n DocumentReference contributorsRef = getListCollectionReference().document(email).collection(\"contributors\").document();\n batch.set(contributorsRef, new HashMap<>());\n DocumentReference friendsRef = getListCollectionReference().document(email).collection(\"friends\").document();\n batch.set(friendsRef, new HashMap<>());\n DocumentReference itemsRef = getListCollectionReference().document(email).collection(\"items\").document();\n batch.set(itemsRef, new HashMap<>());\n\n // Commit the batch\n batch.commit().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n // ...\n }\n });\n }", "@Override\n\t\t\t\tprotected void setCache(List<E> cache) {\n\t\t\t\t}", "@Override\r\n\tpublic void flushAll() {\n\t\t\r\n\t}", "void committed() {\n\t\t\tfor (Entry<Integer, Object> entry : newData.entrySet())\n\t\t\t\toriginalData.put(entry.getKey(), entry.getValue());\n\t\t\treset();\n\t\t\taction = RowAction.UPDATE;\n\t\t}", "@Override\n\tpublic void actualizarIds(JSONArray array) {\n\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void onSuccess(List<Integer> rowIds) {\n\t\t\t\t\t\t\t\t\t\t\t\tList<CacheItem> cacheItems = new ArrayList<CacheItem>();\n\t\t\t\t\t\t\t\t\t\t\t\tcacheItems.add(new CacheItem(Tables.STATIONS, System.currentTimeMillis()));\n\t\t\t\t\t\t\t\t\t\t\t\tdbService.updateCachesTable(cacheItems, new VoidCallback() {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onFailure(DataServiceException error) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Get all the stations and data just inserted.\n\t\t\t\t\t\t\t\t\t\t\t\t \tdbService.getStations(new ListCallback<GenericRow>() {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onFailure(DataServiceException error) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void onSuccess(List<GenericRow> result) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetStations(result);\n\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\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\n public <T extends IEntity> void persist(Iterable<T> entityIterable) {\n startCallContext(ConnectionReason.forUpdate);\n try {\n if (entityIterable.iterator().hasNext()) {\n for (T entity : entityIterable) {\n persist(tableModel(entity.getEntityMeta()), entity);\n }\n }\n } finally {\n endCallContext();\n }\n }", "public void save(XmlWriter w) throws Throwable {\n if (_entries != null && !_entries.isEmpty()) {\n for (Entry entry : _entries) {\n entry.save(w);\n }\n }\n }", "@Override\n\tpublic void cacheResult(List<Answer> answers) {\n\t\tfor (Answer answer : answers) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\tentityCacheEnabled, AnswerImpl.class,\n\t\t\t\t\tanswer.getPrimaryKey()) == null) {\n\n\t\t\t\tcacheResult(answer);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tanswer.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public static void commit(Context context) {\n HashMap<String, Object> pending = new HashMap<>();\r\n synchronized(Cacher.class) {\r\n pending.putAll(Cacher.pending);\r\n Cacher.pending.clear();\r\n }\r\n Log.d(TAG, \"Starting commit of \" + pending.size() + \" changes\");\r\n // Prepare root dir\r\n File rootDir = new File(context.getCacheDir(), CACHE_NAME);\r\n if(!rootDir.exists())\r\n rootDir.mkdirs();\r\n // Write all\r\n for(Map.Entry<String, Object> e : pending.entrySet()) {\r\n String name = e.getKey();\r\n Object value = e.getValue();\r\n NamedLock lock = lock(name);\r\n File file = new File(context.getCacheDir(), CACHE_PREFIX + Integer.toHexString(name.hashCode()));\r\n try {\r\n HashMap<String, String> map;\r\n try {\r\n if(!file.exists())\r\n map = new HashMap<>();\r\n else {\r\n String data = readFile(file);\r\n if(data.length() == 0 || ((map = gson.fromJson(data, HashMap.class)) == null))\r\n map = new HashMap<>(); // new cache\r\n }\r\n } catch (Throwable t) {\r\n Log.e(TAG, \"Unable to open cache for writing: \" + file.getPath(), t);\r\n map = new HashMap<>(); // create empty cache\r\n }\r\n if (value == null) {\r\n if(map.remove(name) == null)\r\n return; // nothing was removed, no changes\r\n if (map.size() == 0) {\r\n if(lastCacheSize != -1)\r\n lastCacheSize -= file.length();\r\n file.delete(); // no more data here\r\n }\r\n } else {\r\n if(lastCacheSize != -1)\r\n lastCacheSize -= file.length();\r\n map.put(name, gson.toJson(value));\r\n writeFile(file, gson.toJson(map));\r\n file.setLastModified(System.currentTimeMillis());\r\n if(lastCacheSize != -1)\r\n lastCacheSize += file.length();\r\n }\r\n } catch (Throwable t) {\r\n Log.e(TAG, \"Unable to write cache \" + file.getPath() + \" for \" + name, t);\r\n // ignore\r\n } finally {\r\n lock.unlock();\r\n }\r\n }\r\n // Next cleanup cache\r\n if(lastCacheSize != -1 && lastCacheSize < CACHE_SIZE)\r\n return; // no need to cleanup cache\r\n lastCacheSize = 0; // reset\r\n File[] files = rootDir.listFiles();\r\n long[] timestamps = new long[files.length];\r\n long[] size = new long[files.length];\r\n // Collect all data\r\n for (int c = 0; c < files.length; c++) {\r\n File file = files[c];\r\n if (file.isDirectory()) {\r\n files[c] = null;\r\n timestamps[c] = Long.MAX_VALUE;\r\n size[c] = 0;\r\n } else {\r\n timestamps[c] = file.lastModified();\r\n size[c] = file.length();\r\n }\r\n lastCacheSize += size[c];\r\n }\r\n // Keep trimming as needed\r\n while (lastCacheSize > CACHE_SIZE) {\r\n // Select oldest file\r\n int oldest = -1;\r\n long oldestTimestamp = Long.MAX_VALUE;\r\n for (int c = 0; c < files.length; c++) {\r\n if (timestamps[c] < oldestTimestamp) {\r\n oldest = c;\r\n oldestTimestamp = timestamps[c];\r\n }\r\n }\r\n // Delete this file\r\n lastCacheSize -= size[oldest];\r\n files[oldest].delete();\r\n timestamps[oldest] = Long.MAX_VALUE;\r\n }\r\n Log.d(TAG, \"Trimmed cache to \" + lastCacheSize + \" bytes\");\r\n // Done\r\n }", "void updateLastAccessed(int id);", "@Override\n\tpublic void saveOrUpdateAll(Collection<Export> entitys) {\n\t\t\n\t}", "public void resetIds()\r\n {\r\n this.ids = null;\r\n }", "private void commitAll(){\n if(isDiskBufferEnabled && persistenceService != null){\n persistenceService.commit(WIKIDATA_SYNONYMY_BUFFER);\n persistenceService.commit(WIKIDATA_HYPERNYMY_BUFFER);\n persistenceService.commit(WIKIDATA_ASK_BUFFER);\n }\n }", "public void flush() throws SolrServerException, IOException {\n if (adds > 0) {\n Map<Integer, Map<String, SolrInputDocument>> maps = writeBuffers.asMap();\n for (Map.Entry<Integer, Map<String, SolrInputDocument>> entry : maps.entrySet()) {\n if (entry.getValue().size() > 0) {\n delegateWriter.add(entry.getKey(), ImmutableMap.copyOf(entry.getValue()));\n }\n }\n docOutputCounter.increment(adds);\n docBatchCounter.increment(1L);\n adds = 0;\n writeBuffers.invalidateAll();\n }\n }", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "private void incrementCounter(Entry<String, Integer> entrySet) {\n if (entrySet.getValue() < Integer.MAX_VALUE) {\n entrySet.setValue(entrySet.getValue() + 1);\n }\n logger.debug(\"[{}] - Reader reported dead. Iteration #{}\", entrySet.getKey(), entrySet.getValue());\n }", "public void setLast(Set<F> keys) {\n\t\tfor(F s : keys) {\n\t\t\tthis.backingStore.get(s).k = this.count;\n\t\t}\n\t}", "synchronized private void flushPendingUpdates() throws SailException {\n\t\tif (!isActiveOperation()\n\t\t\t\t|| isActive() && !getTransactionIsolation().isCompatibleWith(IsolationLevels.SNAPSHOT_READ)) {\n\t\t\tflush();\n\t\t\tpendingAdds = false;\n\t\t\tpendingRemovals = false;\n\t\t}\n\t}", "@Test\n public void testSaveUpdatedDatasets() throws Exception {\n // generate SyncResult, including a single updated Dataset\n SyncResult syncResult = synchroniser.syncInstallation(installation, Lists.newArrayList(dataset));\n\n // update Dataset in Registry\n updater.saveUpdatedDatasets(syncResult);\n\n // update dataset 1 time\n verify(updater.getDatasetService(), times(1)).update(any(Dataset.class));\n\n // delete 1 existing machine tag, add 2 new\n verify(updater.getDatasetService(), times(1)).deleteMachineTag(any(UUID.class), anyInt());\n verify(updater.getDatasetService(), times(2)).addMachineTag(any(UUID.class), any(MachineTag.class));\n\n // delete 1 existing contact, add 2 new\n verify(updater.getDatasetService(), times(1)).deleteContact(any(UUID.class), anyInt());\n verify(updater.getDatasetService(), times(2)).addContact(any(UUID.class), any(Contact.class));\n\n // delete 1 endpoint, add 1 endpoint\n verify(updater.getDatasetService(), times(1)).deleteEndpoint(any(UUID.class), anyInt());\n verify(updater.getDatasetService(), times(1)).addEndpoint(any(UUID.class), any(Endpoint.class));\n\n // delete 0 identifiers, add 0 identifiers\n verify(updater.getDatasetService(), times(0)).deleteIdentifier(any(UUID.class), anyInt());\n verify(updater.getDatasetService(), times(0)).addIdentifier(any(UUID.class), any(Identifier.class));\n\n // delete 0 tags, add 0 tags\n verify(updater.getDatasetService(), times(0)).deleteTag(any(UUID.class), anyInt());\n verify(updater.getDatasetService(), times(0)).addTag(any(UUID.class), any(Tag.class));\n }", "public void saveManyHistory() {\n Map<String, String> status = new HashMap<>();\n String userID = \"15\";\n List<User> allUsers = dumpDao.getAllUsers();\n Random random = new Random();\n for (int x = 0; x < 1000; x++) {\n System.out.println(\"Loop Counter : \" + x);\n userID = allUsers.get(random.nextInt(allUsers.size() - 1)).getId().toString();\n int numberOfHistory = random.nextInt(20);\n for (int y = 0; y < numberOfHistory + 1; y++) {\n System.out.println(\"\\nHistory Save\\n\");\n History history = new History();\n history.setUserId(userID);//will be set from service.\n history.setDate(DateUtil.getDate().toString());\n history.setLocation(DumpData.getLocation());\n history.setPatientDescription(DumpData.getPatientDescription());\n history.setRefferedBy(DumpData.getRefferedBy());\n history.setNote(DumpData.getNote());\n history.setUserId(userID);\n dao_history_i.save(history);\n System.out.println(history.getId());\n }//for\n }\n// bug : data are not being save\n// for (int x = 0; x < 100; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n// }\n\n// bug : data are not being save\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n //working, insertion of history, just for one.\n// for (int x = 0; x < 10; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// dao_history_i.save(history);\n// System.out.println(history.getId());\n// }//for\n }", "public void cacheResult(DataEntry dataEntry);", "void flush() {\r\n synchronized (sync) {\r\n updatedFiles.clear();\r\n }\r\n }", "@Override\n public void cacheResult(List<EntityDealer> entityDealers) {\n for (EntityDealer entityDealer : entityDealers) {\n if (EntityCacheUtil.getResult(\n EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey()) == null) {\n cacheResult(entityDealer);\n } else {\n entityDealer.resetOriginalValues();\n }\n }\n }", "@Override\n public void run() {\n long[] saved = AppDatabase.getInstance().modelByName(name).insertAll((List) response);\n updateProgressDownload(1, name);\n }", "public void updateCache() {\n\n log.info(\"Updating solar flare cache\");\n Date fallbackStartDate = DateHelper.getFallbackDate();\n solarFlareRepository.count()\n .map(total -> {\n if (total > 0) {\n solarFlareRepository.findTopByBeginTimeIsNotNullOrderByBeginTimeDesc()\n .map(solarFlare -> {\n log.info(\"Entries exist, performing incremental update\");\n log.info(\n \"Last entry found at {}\",\n DateHelper.getPrintableString(solarFlare.getBeginTime())\n );\n collectForRange(solarFlare.getBeginTime(), null);\n return solarFlare;\n })\n .subscribe();\n } else {\n log.info(\"No entries found, performing a full import\");\n collectForRange(fallbackStartDate, null);\n }\n return total;\n })\n .subscribe();\n }", "public void updateIdentities() {\n // get a list of the internal conversation addresses\n ArrayList<String> addresses = new ArrayList<>();\n for (int i = 0; i < size(); i++)\n addresses.add(get(i).getFromAddress());\n\n // retrieve and set the identities of the internal addresses\n ArrayList<String> identities = retrieveIdentities(addresses);\n for (int i = 0; i < size(); i++)\n get(i).setIdentity(identities.get(i));\n }", "public void mraiExpire() {\n for (int tDest : this.dirtyDest) {\n this.sendUpdate(tDest);\n }\n this.dirtyDest.clear();\n }", "@Override\n public void appendCache(List<FavoriteEntity> ltEntity)\n {\n for (FavoriteEntity entity : ltEntity)\n {\n addWithCheckExistID(entity);\n }\n }", "public void cacheResult(\n\t\tjava.util.List<ua.org.gostroy.guestbook.model.Entry3> entry3s);", "private Status batchSet(String table, String key, HashMap<String, ByteIterator> values) {\n try {\n List<SetItem> setItemList = new ArrayList<>();\n byte[] hashKey = key.getBytes();\n byte[] value = toJson(values);\n for (byte[] sortKey : sortKeys) {\n setItemList.add(new SetItem(hashKey, sortKey, value));\n }\n client.batchSet(table, setItemList);\n return Status.OK;\n } catch (Exception e) {\n logger.error(\"Error batch inserting value to table[\" + table + \"] with key: \" + key, e);\n return Status.ERROR;\n }\n }", "protected void resetCache() {\n if (cacheResults && initialized) {\n dataCache.clear();\n }\n }", "@Override\n\tpublic void cacheResult(\n\t\tList<StepDefsCompositeStepDefDBE> stepDefsCompositeStepDefDBEs) {\n\t\tfor (StepDefsCompositeStepDefDBE stepDefsCompositeStepDefDBE : stepDefsCompositeStepDefDBEs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tStepDefsCompositeStepDefDBEModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tStepDefsCompositeStepDefDBEImpl.class,\n\t\t\t\t\t\tstepDefsCompositeStepDefDBE.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(stepDefsCompositeStepDefDBE);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstepDefsCompositeStepDefDBE.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public int getEntriesSet() {\r\n return entriesSet;\r\n }", "@Override\n public boolean save(List<FeedbackResource> feedbackResourceList) throws RemoteException{\n AtomicInteger success = new AtomicInteger();\n feedbackResourceList.forEach(feedbackResource -> {\n if (feedbackRepository.save(feedbackResource))\n success.getAndIncrement();\n });\n return feedbackResourceList.size() == success.get();\n }", "int updateByPrimaryKey(FileSet record);", "@Override\n public Set keySet() {\n if ((System.currentTimeMillis() - this.lastCheck) > this.CACHE_TIME) {\n update();\n }\n return super.keySet();\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "public JSObject executeSet(SQLiteDatabase db, JSArray set) throws Exception {\n long lastId = Long.valueOf(-1);\n int changes = 0;\n JSObject retObj = new JSObject();\n for (int i = 0; i < set.length(); i++) {\n JSONObject row = set.getJSONObject(i);\n String statement = row.getString(\"statement\");\n JSONArray valuesJson = row.getJSONArray(\"values\");\n JSArray values = new JSArray();\n for (int j = 0; j < valuesJson.length(); j++) {\n values.put(valuesJson.get(j));\n }\n lastId = prepareSQL(db, statement, values);\n if (lastId == -1) {\n Log.v(TAG, \"*** breaking lastId -1\");\n break;\n } else {\n changes += 1;\n }\n }\n if (lastId != -1) {\n retObj.put(\"changes\", uSqlite.dbChanges(db));\n retObj.put(\"lastId\", lastId);\n } else {\n retObj.put(\"changes\", Integer.valueOf(-1));\n retObj.put(\"lastId\", lastId);\n }\n return retObj;\n }", "public void flush() {\n wasFlushed = true;\n }", "protected void saveKeys()\r\n {\r\n try\r\n {\r\n log.info(\"{0}: Saving keys to: {1}, key count: {2}\",\r\n () -> logCacheName, () -> fileName, keyHash::size);\r\n\r\n keyFile.reset();\r\n\r\n final HashMap<K, IndexedDiskElementDescriptor> keys = new HashMap<>(keyHash);\r\n if (!keys.isEmpty())\r\n {\r\n keyFile.writeObject(keys, 0);\r\n }\r\n\r\n log.info(\"{0}: Finished saving keys.\", logCacheName);\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"{0}: Problem storing keys.\", logCacheName, e);\r\n }\r\n }", "private void updateFarmIDs() {\n farms = FXCollections.observableList(report.farmIDlog());\n }", "public void save() {\n\t\tList<EmbeddedEntity> embeddedEntities = new ArrayList<>();\n\t\tfor (FeedItem item : items)\n\t\t\tembeddedEntities.add(item.getEntity());\n\t\tEntity feed = new Entity(getKey());\n\t\tfeed.setUnindexedProperty(\"items\", embeddedEntities); //NOI18N\n\t\tdatastore.put(feed);\n\t}", "void setNewerRevisionSeen() {\n\n // If we have previously written something, then we've detected a write conflict; fail early.\n if ( !this.versionedItemsWritten.isEmpty() ) {\n throw new WriteConflictException();\n }\n\n // Track the newer revision number to fail early if we subsequently write something.\n this.newerRevisionSeen = true;\n\n }", "private void persistUserDataIfNeeded() throws IOException {\n int amountdatasets = 0;\n for (Transaction t : buffer) {\n amountdatasets += t.getDatasets().size();\n }\n //more than 5 datasets in write buffer --> write committed transactions\n if (amountdatasets >= 5) {\n Set<Transaction> todelete = new HashSet<>();\n\n //only one thread at a time should enter this block\n synchronized (this) {\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" entered persistUserDataIfNeeded sync block\");\n for (Transaction t : buffer) {\n if (t.isCommitted()) {\n for (UserData data : t.getDatasets()) {\n persistData(data);\n }\n todelete.add(t);\n }\n }\n\n //here the deletion happens. Comment out if Abnahme is n�rgeling... :)\n for (Transaction t : todelete) {\n System.out.println(\"removing transaction \" + t.getId() + \" from buffer\");\n buffer.remove(t);\n }\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" left persistUserDataIfNeeded sync block\");\n }\n }\n }", "@Override\n\tpublic void cacheResult(List<UserStatistics> userStatisticses) {\n\t\tfor (UserStatistics userStatistics : userStatisticses) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\t\tUserStatisticsModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tUserStatisticsImpl.class, userStatistics.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(userStatistics);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuserStatistics.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void indexPersistable() {\n searchIndexService.indexAllResourcesInCollectionSubTreeAsync(getPersistable());\n }", "@Override\n\tpublic void cacheResult(List<Campus> campuses) {\n\t\tfor (Campus campus : campuses) {\n\t\t\tif (entityCache.getResult(CampusModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCampusImpl.class, campus.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(campus);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcampus.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tprotected void set(final int... recordIds) {\n\t\tArrays.sort(recordIds);\n\t\tbitmap = bitmap.or(EWAHCompressedBitmap.bitmapOf(recordIds));\n\t}", "@Test\n\t public void testUpdateCollection(){\n\t\t try{\n\t\t\t List<Users> users = new ArrayList<Users>();\n\t\t\t users.add( BaseData.getUsers());\n\t\t\t\tusers.add(BaseData.getDBUsers());\n\t\t\t\tdoAnswer(new Answer() {\n\t\t\t \t public Object answer(InvocationOnMock invocation) {\n\t\t\t \t Object[] args = invocation.getArguments();\n\t\t\t \t EntityManager mock = (EntityManager) invocation.getMock();\n\t\t\t \t\t return null;\n\t\t\t \t }\n\t\t\t \t }).when(entityManager).persist(users);\n\t\t\t\tuserDao.update(users);\n\t\t }catch(DataAcessException se){\n\t\t\t logger.error(\"error at service layer while testing update:.\",se);\n\t\t }\n\t }", "public void setResults(ArrayList<Integer> results){\n this.results = results;\n }", "public void markDestroyed() {\n\t\tsetupResult = environmentStatus;\n\t\tenvironmentStatus = State.DESTROYED.name();\n\t\tdestroyedAt = System.currentTimeMillis();\n\t\tBasicDBObject updateQuery = new BasicDBObject(); \n\t\tBasicDBObject fieldSets = new BasicDBObject(); \n\t\tfieldSets.put(\"environmentStatus\", environmentStatus); \n\t\tfieldSets.put(\"destroyedAt\", destroyedAt); \n\t\tfieldSets.put(\"numDestroyed\", numDestroyed); \n\t\tfieldSets.put(\"destroyError\", destroyError); \n\t\tfieldSets.put(\"setupResult\", setupResult); \n\t\tupdateQuery.put( \"$set\", fieldSets); \n\t\tappendData(updateQuery);\n\t}", "public void addAllSuccesses(Collection<T> c) {\n successes.addAll(c);\n }", "private void save(MyContext myContext) {\n if (isMember.unknown || group.actorId == 0 || memberId == 0 || myContext == null ||\n myContext.getDatabase() == null) return;\n\n for (int pass=0; pass<5; pass++) {\n try {\n tryToUpdate(myContext, isMember.toBoolean(false));\n break;\n } catch (SQLiteDatabaseLockedException e) {\n MyLog.i(this, \"update, Database is locked, pass=\" + pass, e);\n if (DbUtils.waitBetweenRetries(\"update\")) {\n break;\n }\n }\n }\n }", "public void cacheResult(List<VCal> vCals) {\n\t\tfor (VCal vCal : vCals) {\n\t\t\tif (EntityCacheUtil.getResult(VCalModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tVCalImpl.class, vCal.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(vCal);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvCal.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void cacheResult(java.util.List<wsihash> wsihashs);", "@PostPersist\n\t@PostUpdate\n\tprivate void storeChangesToDw() {\n\t}", "void flushAll() {\n dirtyS = true;\n dirtyD = true;\n modelRoot.incrementNumberOfDirtySNodes();\n modelRoot.incrementNumberOfDirtyDNodes();\n }", "public void setCompleteMD(byte[] cachedata);", "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "public void cacheResult(List<AnnotationInfo> annotationInfos) {\n\t\tfor (AnnotationInfo annotationInfo : annotationInfos) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tAnnotationInfoModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tAnnotationInfoImpl.class, annotationInfo.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(annotationInfo);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tannotationInfo.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void writeIDs() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/ids.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(ids);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "Set keySet(final TCServerMap map) throws AbortedOperationException;", "public void commit() {\n\t\tcommitted = true;\n\t}", "@Override\n\tpublic final void beforeExecutions() throws CacheException {\n\t\tif ( persister.hasCache() ) {\n\t\t\tfinal CollectionRegionAccessStrategy cache = persister.getCacheAccessStrategy();\n\t\t\tfinal Object ck = cache.generateCacheKey(\n\t\t\t\t\tkey,\n\t\t\t\t\tpersister,\n\t\t\t\t\tsession.getFactory(),\n\t\t\t\t\tsession.getTenantIdentifier()\n\t\t\t);\n\t\t\tfinal SoftLock lock = cache.lockItem( session, ck, null );\n\t\t\t// the old behavior used key as opposed to getKey()\n\t\t\tafterTransactionProcess = new CacheCleanupProcess( key, persister, lock );\n\t\t}\n\t}", "@Override public void store(SQLiteDatabase db, List<TimelineItemDTOKey> items)\n {\n }", "public void flush() {\n synchronized (getLock()) {\n sIndexWritersCache.flush(this);\n sIndexReadersCache.removeIndexReader(this);\n }\n }", "@Override\r\n\tpublic void cacheResult(List<Share> shares) {\r\n\t\tfor (Share share : shares) {\r\n\t\t\tif (entityCache.getResult(ShareModelImpl.ENTITY_CACHE_ENABLED,\r\n\t\t\t\t\t\tShareImpl.class, share.getPrimaryKey()) == null) {\r\n\t\t\t\tcacheResult(share);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tshare.resetOriginalValues();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private DatabaseWriteResult(UploadStrategy strategy) {\n savedEntries = new ArrayList<>(1000);\n databaseSize = -1L;\n error = null;\n uploadStrategy = strategy;\n }", "@Override\r\n\tpublic void updateAll() throws IOException {\n\t}", "@Override\n\tpublic void cacheResult(List<PhatVay> phatVaies) {\n\t\tfor (PhatVay phatVay : phatVaies) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\tPhatVayModelImpl.ENTITY_CACHE_ENABLED, PhatVayImpl.class,\n\t\t\t\t\tphatVay.getPrimaryKey()) == null) {\n\n\t\t\t\tcacheResult(phatVay);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tphatVay.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@SuppressWarnings(\"serial\")\n\t@Test\n\tpublic void updateCollection() {\n\t\tdb.close();\n\t\tEmbeddedConfiguration config = Db4oEmbedded.newConfiguration();\n\t\tconfig.common().objectClass(Car.class).cascadeOnUpdate(true);\n\t\tdb = Db4oEmbedded.openFile(config, DB4OFILENAME);\n\t\tObjectSet<Car> results = db.query(new Predicate<Car>() {\n\t\t\tpublic boolean match(Car candidate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\n\t\tAssert.assertTrue(results.hasNext());\n\n\t\tCar car = results.next();\n\n\t\tcar.getHistory().remove(0);\n\t\tdb.store(car.getHistory());\n\t\tresults = db.query(new Predicate<Car>() {\n\t\t\tpublic boolean match(Car candidate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\n\t\twhile (results.hasNext()) {\n\t\t\tcar = results.next();\n\t\t\tfor (int idx = 0; idx < car.getHistory().size(); idx++) {\n\t\t\t\tSystem.out.println(car.getHistory().get(idx));\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.5439774", "0.5327516", "0.5307061", "0.5253005", "0.518987", "0.5179571", "0.5138537", "0.5046326", "0.50364625", "0.5025016", "0.501307", "0.5008314", "0.50058794", "0.49979433", "0.49864295", "0.49863058", "0.49784175", "0.49439812", "0.4932383", "0.49308965", "0.49294186", "0.49278498", "0.49256608", "0.49085233", "0.48949814", "0.4894737", "0.4878601", "0.48783064", "0.4875413", "0.4872338", "0.48484176", "0.48302656", "0.48301774", "0.48036367", "0.480279", "0.4802579", "0.47959155", "0.47954988", "0.47812304", "0.4780876", "0.47781163", "0.47658995", "0.47653013", "0.4755461", "0.47477648", "0.4738938", "0.47369635", "0.47304055", "0.47253913", "0.47246286", "0.47237113", "0.47220594", "0.47202465", "0.47093105", "0.4698777", "0.4697388", "0.46963555", "0.46937287", "0.46878505", "0.46874273", "0.4687257", "0.4682975", "0.46750486", "0.46699563", "0.46591035", "0.46584913", "0.46558833", "0.46497235", "0.46474454", "0.46436134", "0.46409222", "0.46377593", "0.463185", "0.4631548", "0.4630671", "0.463031", "0.46262836", "0.46217418", "0.46191958", "0.4613329", "0.46128651", "0.46070015", "0.46055272", "0.46030983", "0.4596165", "0.45912954", "0.4589285", "0.45857957", "0.4581425", "0.45813945", "0.45812985", "0.4580962", "0.45728877", "0.4566204", "0.45623198", "0.45508808", "0.45499212", "0.45496637", "0.4541266", "0.45372918" ]
0.50976956
7
This bad boy just does some good old logging ;)
public void log(String fmt, Object... args) { Log.d("Dexedrine", String.format(fmt, args)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getLogHandled();", "void log();", "@Override\n public void logs() {\n \n }", "@Override\n public void log()\n {\n }", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "private static final void log(String msg) {\n\t\tlog.println(msg);\n\t}", "void initializeLogging();", "private void logika_rozpocznij(){\n\t}", "abstract protected void logInternal(int level, String message);", "private void doIt() {\n\t\tlogger.debug(\"hellow this is the first time I use Logback\");\n\t\t\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "private static void writeLog(String log) {\n\t\twriteLog(log, true);\n\t}", "private void logToFile() {\n }", "private static void log(String aMsg){\n\t System.out.println(aMsg);\n\t }", "protected void log(Object msg) {\n\t\n\t\tSystem.out.println(\"MusicDataAccessor: \" + msg);\n\t}", "Appendable getLog();", "abstract protected void _log(Source src, OpLevel sev, String msg, Object... args) throws Exception;", "public static void main(String []args) {\n\t\tlog.trace(\"111---\");\n\t\tlog.debug(\"2222\");\n\t\tlog.info(\"333\");\n\t\tlog.warn(\"444\");\n\t\tlog.error(\"555\");\n\t}", "public abstract void logd(String str);", "public String getLog();", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "abstract protected void _log(TrackingEvent event) throws Exception;", "private static void log(String msg) {\n System.out.println(msg);\n }", "@Override\n public void log(String message) {\n }", "@Override\n\tpublic void log(String msg) throws IOException {\n\t\t\n\t}", "abstract protected void _log(Snapshot snapshot) throws Exception;", "abstract protected void _log(TrackingActivity activity) throws Exception;", "@SuppressWarnings({\"UNUSED_SYMBOL\"})\r\n private void plog(String m) {\n }", "private void Log(String action) {\r\n\t}", "void log(String string);", "public void log(String msg) {\n\n\t}", "private void log(String msg) {\n\t\tSystem.out.println(new Date() + \": \" + msg);\n\t}", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "private Log() {\r\n\t}", "void log(Log log);", "final void out (String msg) { if (m_debugMode) { Logger.println (msg); } }", "private TypicalLogEntries() {}", "void log(String line);", "abstract void initiateLog();", "private void log(String s) {\n RlogEx.i(TAG, s);\n }", "public static void log(String str)\r\n\t{\n\t}", "private void log(String msg) {\r\n\t\tif (logger != null) {\r\n\t\t\tlogger.append(msg);\r\n\t\t\tlogger.println();\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "void setupFileLogging();", "protected void log(String s ) {\r\n\tmessageSB.append( s ).append(\"\\r\\n\");\r\n }", "private void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "public void log(String txt);", "void log() {\n\t\tm_drivetrain.log();\n\t\tm_forklift.log();\n\t}", "private static final void log(org.jetbrains.anko.AnkoLogger r2, java.lang.Object r3, java.lang.Throwable r4, int r5, kotlin.jvm.functions.Function2<? super java.lang.String, ? super java.lang.String, kotlin.Unit> r6, kotlin.jvm.functions.Function3<? super java.lang.String, ? super java.lang.String, ? super java.lang.Throwable, kotlin.Unit> r7) {\n /*\n r0 = r2.getLoggerTag();\n r1 = android.util.Log.isLoggable(r0, r5);\n if (r1 == 0) goto L_0x0017;\n L_0x000a:\n if (r4 == 0) goto L_0x001c;\n L_0x000c:\n if (r3 == 0) goto L_0x0018;\n L_0x000e:\n r1 = r3.toString();\n if (r1 == 0) goto L_0x0018;\n L_0x0014:\n r7.invoke(r0, r1, r4);\n L_0x0017:\n return;\n L_0x0018:\n r1 = \"null\";\n goto L_0x0014;\n L_0x001c:\n if (r3 == 0) goto L_0x0028;\n L_0x001e:\n r1 = r3.toString();\n if (r1 == 0) goto L_0x0028;\n L_0x0024:\n r6.invoke(r0, r1);\n goto L_0x0017;\n L_0x0028:\n r1 = \"null\";\n goto L_0x0024;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.log(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable, int, kotlin.jvm.functions.Function2, kotlin.jvm.functions.Function3):void\");\n }", "String getLogExhausted();", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "private void log(String s) {\n Rlog.i(TAG, s);\n }", "void log(Message message);", "private void logIt(String msg) {\n\tSystem.out.println(\"PLATINUM-SYNC-LOG: \" + msg);\n}", "void printLog(String str)\n { printLog(str,Log.LEVEL_HIGH);\n }", "@Override\r\n\tprotected void logMessage(String message) {\n\t\t\r\n\t}", "public void enableLogging();", "public void logData(){\n }", "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 }", "protected void log(String msg) {\n\t\tif(isLogging) {\n\t\t\tSystem.out.println(\"[TRACKER \" + id() + \"] \" + msg);\n\t\t}\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void log(String msg, int level, Date date, StackTraceElement trace) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "private static void writeLog(String s) {\n if (logFile == null) createLogFile();\n LogTools.println(s);\n LogTools.flush();\n }", "private JavaUtilLogHandlers() { }", "public void log(String text) {\n }", "public final void Log2(String s) {\n //System.err.println(s);\n //if (win != null)\n // win.Log(s); // For detailed debug purposes\n }", "private void log(String l) {\n if (LOG) {\n System.out.println(\"RotationMatrixTest.\" + l);\n }\n }", "void log(String source, String line);", "private static void log(String message) {\n System.out.println(message);\n }", "final void out (String msg1, String msg2) { if (m_debugMode) { Logger.print (msg1); Logger.println (msg2); } }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void log(String message) {\n\t}", "private void log(String message) {\n System.out.println( message );\n sb.append( message ).append( \"\\n\" );\n }", "private void log(String msg) {\r\n\t\tif(this.out != null) {\r\n\t\t\tthis.out.println(msg);\r\n\t\t\tthis.out.flush();\r\n\t\t}\r\n\t}", "private void logMessage(String msg) {\n\n\t\tlog.logMsg(\"(L\" + lexAnalyser.getLineCount() + \")\" + msg + \"\\n\");\n\n\t\t// System.out.println(\"(L\" + lexAnalyser.getLineCount() + \")\" + msg);\n\n\t}", "private static void log_d( String msg ) {\n\t if (D) Log.d( TAG, TAG_SUB + \" \" + msg );\n}", "IFileLogger log();", "private void log(String message) {\n System.out.println(message);\n }", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "private static void log(String msg) {\n Log.d(LOG_TAG, msg);\n }", "public void viewLogs() {\n\t}", "private void logUser() {\n }", "abstract protected String getLogFileName();", "String getLogContinued();", "public synchronized void log(String msg) {\n\t\tSystem.err.println(msg);\n\t}", "public void logDebug(String str) {\n }", "@Override\n protected void log(String tag, String msg) {\n Log.i(tag, \"[you can use your custom logger here \\\"]\" + msg);\n }", "private static void log(IStatus status) {\n\t getDefault().getLog().log(status);\n\t}", "private void debugLog(String msg)\n {\n m_log.log(\"[\" + m_appName + \"] :\" + msg);\n }", "public void logDebug()\n\t{\n\t\tLogHandler handlerList[];\n\t\tLogHandler handler = null;\n\n\t\tSystem.out.println(\"Logger = \"+logger);\n\t\tSystem.out.println(\"Logger log level is: \"+logger.getLogLevel());\n\t\tSystem.out.println(\"Logger log filter is: \"+logger.getFilter());\n\t\thandlerList = logger.getHandlers();\n\t\tfor(int i = 0; i < handlerList.length; i++)\n\t\t{\n\t\t\thandler = handlerList[i];\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" is:\"+handler+\" and called \"+handler.getName());\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" has filter:\"+handler.getFilter());\n\t\t\tSystem.out.println(\"Logger handler \"+i+\" has log level:\"+handler.getLogLevel());\n\t\t}\n\t}", "private void log_d( String msg ) {\n\t if (D) Log.d( TAG, TAG_SUB + \" \" + msg );\n}", "private void log(String message) {\n System.out.println(message);\n }", "private void printLog(String str, int level)\n { if (log!=null) log.println(\"AudioApp: \"+str, LoopbackMediaApp.LOG_OFFSET+level);\n if (level<=Log.LEVEL_HIGH) System.out.println(\"AudioApp: \"+str);\n }", "private static final void log(Throwable e) {\n\t\tlog.println(e);\n\t}", "public static final void verbose(@org.jetbrains.annotations.NotNull org.jetbrains.anko.AnkoLogger r4, @org.jetbrains.annotations.Nullable java.lang.Object r5, @org.jetbrains.annotations.Nullable java.lang.Throwable r6) {\n /*\n r3 = \"$receiver\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r3);\n r0 = 2;\n r2 = r4.getLoggerTag();\n r3 = android.util.Log.isLoggable(r2, r0);\n if (r3 == 0) goto L_0x0025;\n L_0x0011:\n if (r6 == 0) goto L_0x002a;\n L_0x0013:\n if (r5 == 0) goto L_0x0026;\n L_0x0015:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x0026;\n L_0x001b:\n r6 = (java.lang.Throwable) r6;\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.v(r1, r3, r6);\n L_0x0025:\n return;\n L_0x0026:\n r3 = \"null\";\n goto L_0x001b;\n L_0x002a:\n if (r5 == 0) goto L_0x003b;\n L_0x002c:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x003b;\n L_0x0032:\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.v(r1, r3);\n goto L_0x0025;\n L_0x003b:\n r3 = \"null\";\n goto L_0x0032;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.verbose(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable):void\");\n }", "private void logDeviceInfo() {\n logDeviceLevel();\n }", "private void logDeviceInfo() {\n logDeviceLevel();\n }", "private void loggerEinrichten() {\n\t\tlogger.setLevel(Level.INFO);\n//\t\tHandler handler = new FileHandler(\"/home/programmieren/TestFiles/iCalender/temp.log\");\n\t\tHandler handler = new ConsoleHandler();\n\t\thandler.setLevel(Level.FINEST);\n\t\thandler.setFormatter(new Formatter() {\n\t\t\t@Override\n\t\t\tpublic String format(LogRecord record) {\n\t\t\t\treturn record.getSourceClassName() + \".\" + record.getSourceMethodName() + \": \" + record.getMessage()\n\t\t\t\t\t\t+ \"\\n\";\n\t\t\t}\n\t\t});\n\t\tlogger.addHandler(handler);\n\t\tlogger.setUseParentHandlers(false);\n\t\tlogger.finest(\"begonnen\");\n\t}", "static void log(String s) {\n System.out.println(s);\n }", "public static final void info(@org.jetbrains.annotations.NotNull org.jetbrains.anko.AnkoLogger r4, @org.jetbrains.annotations.Nullable java.lang.Object r5, @org.jetbrains.annotations.Nullable java.lang.Throwable r6) {\n /*\n r3 = \"$receiver\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r3);\n r0 = 4;\n r2 = r4.getLoggerTag();\n r3 = android.util.Log.isLoggable(r2, r0);\n if (r3 == 0) goto L_0x0025;\n L_0x0011:\n if (r6 == 0) goto L_0x002a;\n L_0x0013:\n if (r5 == 0) goto L_0x0026;\n L_0x0015:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x0026;\n L_0x001b:\n r6 = (java.lang.Throwable) r6;\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.i(r1, r3, r6);\n L_0x0025:\n return;\n L_0x0026:\n r3 = \"null\";\n goto L_0x001b;\n L_0x002a:\n if (r5 == 0) goto L_0x003b;\n L_0x002c:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x003b;\n L_0x0032:\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.i(r1, r3);\n goto L_0x0025;\n L_0x003b:\n r3 = \"null\";\n goto L_0x0032;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.info(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable):void\");\n }" ]
[ "0.7427163", "0.7385502", "0.69815695", "0.6971445", "0.6960275", "0.68831986", "0.67705286", "0.67643434", "0.6739346", "0.6732828", "0.6704252", "0.6704252", "0.6704252", "0.67000115", "0.6646799", "0.66281784", "0.6621653", "0.66182923", "0.66141164", "0.6611664", "0.65942276", "0.65833783", "0.65749955", "0.6573238", "0.65618855", "0.6557361", "0.65540975", "0.65463835", "0.6543038", "0.6542851", "0.6521715", "0.6520197", "0.65068877", "0.6503307", "0.6499161", "0.6470282", "0.64651", "0.6462236", "0.6452837", "0.64435923", "0.64072406", "0.6406377", "0.64035326", "0.63992894", "0.6396622", "0.6388809", "0.63785976", "0.63735515", "0.6367596", "0.63588613", "0.63321626", "0.63172746", "0.63150775", "0.6308255", "0.63076216", "0.63057595", "0.63023615", "0.62983614", "0.62606317", "0.62559766", "0.62433743", "0.6241598", "0.62382454", "0.6236655", "0.62299323", "0.6216687", "0.621444", "0.62065643", "0.61916596", "0.6178158", "0.61778253", "0.61758906", "0.6175831", "0.6155135", "0.61481434", "0.6146828", "0.61331606", "0.6132151", "0.6128963", "0.6127949", "0.61199814", "0.61187154", "0.6104546", "0.60890627", "0.6079619", "0.6071911", "0.6067479", "0.6065583", "0.6064757", "0.6064357", "0.6059644", "0.60568166", "0.6055863", "0.6048763", "0.60471034", "0.6042589", "0.60372984", "0.60372984", "0.60261214", "0.60209996", "0.6019179" ]
0.0
-1
Create a new OptionDialog dialog.
public OptionDialog(String title, String prompt, String option1Text, String option2Text) { super(title); // initialize variables and display GUI controls choice = 0; c.gridwidth = 2; JLabel promptLabel = new JLabel(prompt); getContentPane().add(promptLabel, c); c.gridwidth = 1; c.gridy++; // Button to select option one and close dialog final CustomButton option1Button = new CustomButton(option1Text) { private static final long serialVersionUID = 1L; public void buttonPressed() { choice = 1; dispose(); } }; getContentPane().add(option1Button, c); c.gridx++; // Button to select option two and close dialog final CustomButton option2Button = new CustomButton(option2Text) { private static final long serialVersionUID = 1L; public void buttonPressed() { choice = 2; dispose(); } }; getContentPane().add(option2Button, c); refresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}", "public abstract Dialog createDialog(DialogDescriptor descriptor);", "public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().add(type);\n\t\treturn dialog;\n\t}", "protected abstract JDialog createDialog();", "public StandardDialog() {\n super();\n init();\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n Dialog dialog = null;\n switch (id) {\n case CHOOSE_METHOD_DIALOG:\n return chooseActionContextMenu.createMenu(this.getString(R.string.choose_action_title));\n case ABOUT_DIALOG:\n dialog = createAboutDialog();\n break;\n default:\n dialog = null;\n break;\n }\n return dialog;\n }", "public Dialog() {\n\t}", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n // Use the Builder class for convenient dialog construction\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.title_add_to_shopping);\n\n // initialize itemcreation\n m_createItemDlg = new CreateItemDialog(this);\n\n // create item selection\n builder.setView(createItemSelection());\n\n // set buttonss\n builder.setPositiveButton(R.string.button_add, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if(m_callback != null) {\n m_callback.readAddToShoppingDlgAndUpdate();\n }\n }\n });\n builder.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) { }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }", "private void initDialog() {\n }", "public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }", "public static JDialog createDialog(JFrame owner) {\n PlatformInfoPanel panel = new PlatformInfoPanel();\n JDialog dialog = new JDialog(owner, ResourceManager.getResource(PlatformInfoPanel.class, \"Dialog_title\"));\n dialog.getContentPane().add(panel);\n dialog.setSize(panel.getWidth() + 10, panel.getHeight() + 30);\n return dialog;\n}", "void optionsDialog(){\r\n\t\tString title = getString(R.string.select_option);\r\n\t\tString[] options = getResources().getStringArray(R.array.options);\r\n\t\t\r\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n\t \r\n\t\t// set the dialog title\r\n\t builder.setTitle(title);\r\n\t \r\n\t // specify the list array\r\n\t builder.setItems(options, new DialogInterface.OnClickListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tswitch(which){\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\t// open update dialog\r\n\t\t\t\t\tupdateDialog();\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\t// open delete dialog\r\n\t\t\t\t\tdeleteDialog();\r\n\t\t\t\t\tdialog.dismiss();\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 \r\n\r\n\t // show dialog\r\n\t\tAlertDialog alert = builder.create();\r\n\t\talert.show();\r\n\t}", "public abstract void initDialog();", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n filename = getArguments().getString(\"filename\");\n username = getArguments().getString(\"username\");\n workingDIR = getArguments().getString(\"workingDIR\");\n builder.setTitle(R.string.copy_move_file_select_options_title)\n .setItems(R.array.file__move_copy_dialog_options, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n onSelect(which);\n }\n });\n return builder.create();\n }", "private DialogJoinOptions showOptionsDialog() {\n DialogJoinOptions optionsDialog = new DialogJoinOptions();\n\n // Load and init dialog options from preferences\n optionsDialog.setGlue(Preferences.getJoinGlue());\n\n optionsDialog.addComponentListener(new ComponentListenerDialog(Preferences.ID_DIALOG_JOIN));\n UtilsEnvironment.setDialogVisible(editor, Preferences.ID_DIALOG_JOIN, optionsDialog, StaticTexts.MESSAGE_TITLE_JOIN);\n\n return optionsDialog;\n }", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n builder.setItems(items, new DialogInterface.OnClickListener(){\n @Override\n public void onClick(DialogInterface dialog, int which) {\n mListener.onPinOptionsItemSelected(PinOptionsDialogFragment.this, items[which].toString());\n }\n });\n return builder.create();\n }", "private JDialog getPomocDialog() {\n\t\tif (pomocDialog == null) {\n\t\t\tpomocDialog = new JDialog(getHlavneOkno());\n\t\t\tpomocDialog.setSize(new Dimension(460, 180));\n\t\t\tpomocDialog.setMinimumSize(new Dimension(400, 150));\n\t\t\tpomocDialog.setPreferredSize(new Dimension(480, 220));\n\t\t\tpomocDialog.setLocation(new Point(200, 100));\n\t\t\tpomocDialog.setContentPane(getJContentPane());\n\t\t}\n\t\treturn pomocDialog;\n\t}", "public SelectionDialog(HarmonyModel harmonyModel, Integer mode)\r\n\t{\r\n\t\tsuper((mode==SELECT ? \"Select\" : \"Remove\") + \" Links\");\r\n\t\tthis.harmonyModel = harmonyModel;\r\n\t\tthis.mode = mode;\r\n\t\t\r\n\t\t// Initialize the type filter\r\n\t\ttypeFilter = new OptionPane(\"Type\",new String[]{\"All\",\"User\",\"System\"});\r\n\t\ttypeFilter.setBorder(new EmptyBorder(0,20,0,0));\r\n\t\ttypeFilter.setSelectedButton(\"All\");\r\n\t\t\r\n\t\t// Initialize the focus filter\r\n\t\tfocusFilter = new OptionPane(\"Focus\",new String[]{\"All\",\"Focused\",\"Unfocused\"});\r\n\t\tfocusFilter.setBorder(new EmptyBorder(0,13,0,0));\r\n\t\tfocusFilter.setSelectedButton(mode==SELECT ? \"Focused\" : \"All\");\r\n\t\tfocusFilter.setEnabled(mode==DELETE);\r\n\r\n\t\t// Initialize the visibility filter\r\n\t\tvisibilityFilter = new OptionPane(\"Visibility\",new String[]{\"All\",\"Visible\",\"Hidden\"});\t\t\r\n\t\tvisibilityFilter.setSelectedButton(mode==SELECT ? \"Visible\" : \"All\");\r\n\t\tvisibilityFilter.setEnabled(mode==DELETE);\r\n\t\t\r\n\t\t// Create the info pane\r\n\t\tJPanel infoPane = new JPanel();\r\n\t\tinfoPane.setBorder(new CompoundBorder(new EmptyBorder(5,5,0,5),new CompoundBorder(new LineBorder(Color.gray),new EmptyBorder(5,5,5,5))));\r\n\t\tinfoPane.setLayout(new GridLayout(3,1));\r\n\t\tinfoPane.add(typeFilter);\r\n\t\tinfoPane.add(focusFilter);\r\n\t\tinfoPane.add(visibilityFilter);\r\n\t\t\r\n\t\t// Generate the main dialog pane\r\n\t\tJPanel pane = new JPanel();\r\n\t\tpane.setBorder(BorderFactory.createLineBorder(Color.black));\r\n\t\tpane.setLayout(new BorderLayout());\r\n\t\tpane.add(infoPane,BorderLayout.CENTER);\r\n\t\tpane.add(new ButtonPane(),BorderLayout.SOUTH);\r\n\t\t\r\n\t\t// Initialize the dialog parameters\r\n\t\tsetContentPane(pane);\r\n\t\tsetSize(200,250);\r\n\t\tpack();\r\n\t\tsetVisible(true);\r\n\t}", "@Override\n protected Dialog onCreateDialog(int id) {\n \tswitch (id) {\n\t\tcase DLG_PROGRESSBAR:\n\t\t\treturn dialogoProgressBar();\n\t\tcase DLG_BUTTONS:\n\t\t\treturn dialogButtons();\n\t\tcase DLG_LIST:\n\t\t\treturn dialogLista();\n\t\tcase DLG_LIST_SELECT:\n\t\t\treturn dialogListaSelect();\n\t\tdefault:\n\t\t\treturn dialogButtons();\n\t\t}\n }", "OPTION createOPTION();", "public void crearDialogo() {\r\n final PantallaCompletaDialog a2 = PantallaCompletaDialog.a(getString(R.string.hubo_error), getString(R.string.no_hay_internet), getString(R.string.cerrar).toUpperCase(), R.drawable.ic_error);\r\n a2.f4589b = new a() {\r\n public void onClick(View view) {\r\n a2.dismiss();\r\n }\r\n };\r\n a2.show(getParentFragmentManager(), \"TAG\");\r\n }", "public ACLPropertyDialog() {\n this.setModal(true);\n try {\n jbInit();\n pack();\n }\n catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public PreferencesDialog() {\r\n\t\tWindow window;\r\n\t\t// if is mac\r\n\t\tif (SystemInfo.isMac()) {\r\n\t\t\twindow = new JFrame(ResourceManager.getString(\"preferences.title\"));\r\n\t\t\t// dispose this dialog if presse close button\r\n\t\t\t((JFrame) window).setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n\t\t\t// no resizable\r\n\t\t\t((JFrame) window).setResizable(false);\r\n\t\t} else {\r\n\t\t\twindow = new JDialog(MainWindow.getInstance(), ResourceManager.getString(\"preferences.title\"), true);\r\n\t\t\t// dispose this dialog if presse close button\r\n\t\t\t((JDialog) window).setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\r\n\t\t\t// no resizable\r\n\t\t\t((JDialog) window).setResizable(false);\r\n\t\t}\r\n\r\n\t\t// set dialog icon\r\n\t\twindow.setIconImage(ResourceManager.getIcon(\"/icons/16x16/preferences.png\").getImage());\r\n\t\t// contruct dialog UI\r\n\t\tinitComponents(window);\r\n\t\twindow.setMinimumSize(new Dimension(300, 300));\r\n\t\t// adjust window preferred size\r\n\t\twindow.pack();\r\n\t\t// center of screen\r\n\t\twindow.setLocationRelativeTo(null);\r\n\t\t// show\r\n\t\twindow.setVisible(true);\r\n\t}", "private void initDialog() {\n dialog = new Dialog(context);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_custom_ok);\n }", "public FiltroGirosDialog() {\n \n }", "@Override\n\tprotected Dialog onCreateDialog(int id)\n\t{\n\t\tsuper.onCreateDialog(id);\n\t\treturn visitor.instantiateDialog(id);\n\t}", "public interface DialogFactory {\n MessageDialog createMessageDialog();\n ListDialog createListDialog();\n SingleChoiceDialog createSingleChoiceDialog();\n MultiChoiceDialog createMultiChoiceDialog();\n}", "private JDialog getJDialog() {\r\n\t\tif (jDialog == null) {\r\n\t\t\tjDialog = new JDialog(this);\r\n\t\t\tjDialog.setSize(new Dimension(227, 154));\r\n\t\t\tjDialog.setTitle(\"Add Proxy\");\r\n\r\n\t\t\tjDialog.setContentPane(getJContentPane1());\r\n\r\n\t\t}\r\n\t\treturn jDialog;\r\n\t}", "public IOHandlerDialog()\n {\n panel = new JOptionPane();\n }", "public Dialog(String text) {\n initComponents( text);\n }", "public static JDialog createTeamDialog(final ChampionSelectGUI t) {\n\t\tfinal JPanel contentPanel = new JPanel();\n\t\tJLabel request = new JLabel(\"Please select your team\");\n\t\tcontentPanel.add(request);\n\t\trequest.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal Choice input = new Choice();\n\t\tinput.add(\"---Select Team---\");\n\t\tinput.add(\"Blue\");\n\t\tinput.add(\"Red\");\n\t\tcontentPanel.add(input);\n\t\tJButton ok = new JButton(\"ok\");\n\t\tcontentPanel.add(ok);\n\t\tok.setSize(200, 150);\n\t\tok.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal JDialog d = new JDialog(t, \"Team\", true);\n\t\td.setContentPane(contentPanel);\n\t\td.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);\n\t\td.setSize(400, 100);\n\t\td.setLocationRelativeTo(t);\n\t\td.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));\n\t\td.addWindowListener(new WindowListener() {\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tint ret = JOptionPane.showConfirmDialog(contentPanel, \"Are you sure you want to exit?\", \"Choose an option\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif (ret == 0) {\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void windowOpened(WindowEvent e) {}\n\t\t\tpublic void windowClosed(WindowEvent e) {}\n\t\t\tpublic void windowIconified(WindowEvent e) { }\n\t\t\tpublic void windowDeiconified(WindowEvent e) { }\n\t\t\tpublic void windowActivated(WindowEvent e) { }\n\t\t\tpublic void windowDeactivated(WindowEvent e) { }\n\t\t});\n\t\tok.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (input.getSelectedItem().equals(\"---Select Team---\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(contentPanel, \"Please select a Team.\", \"Message\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tif (input.getSelectedItem().equals(\"Blue\")) {\n\t\t\t\t\t\tt.teamArr[0] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt.teamArr[0] = false;\n\t\t\t\t\t}\n\t\t\t\t\td.setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn d;\n\t}", "@Override\n\tprotected Dialog onCreateDialog(int id) {\n\t\treturn buildDialog(MainActivity.this);\n\t\t\n\t}", "@Override\n\t\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\t\treturn mDialog;\n\t\t}", "private static AlertDialog createDialog(\n Context context, MenuDialogListenerHandler listenerHandler) {\n Resources resources = context.getResources();\n String[] menuDialogItems = resources.getStringArray(R.array.menu_dialog_items);\n String appName = resources.getString(R.string.app_name);\n for (int i = 0; i < menuDialogItems.length; ++i) {\n menuDialogItems[i] = String.format(menuDialogItems[i], appName);\n }\n\n AlertDialog dialog = new AlertDialog.Builder(context)\n .setTitle(R.string.menu_dialog_title)\n .setAdapter(new MenuDialogAdapter(context, menuDialogItems), listenerHandler)\n .create();\n dialog.setOnDismissListener(listenerHandler);\n return dialog;\n }", "public DriftSwing() {\n initComponents();\n \n // Create an invisible options dialog to initialize options\n options = new OptionsDialog(this);\n }", "private void dialog() {\n\t\tGenericDialog gd = new GenericDialog(\"Bildart\");\n\t\t\n\t\tgd.addChoice(\"Bildtyp\", choices, choices[0]);\n\t\t\n\t\t\n\t\tgd.showDialog();\t// generiere Eingabefenster\n\t\t\n\t\tchoice = gd.getNextChoice(); // Auswahl uebernehmen\n\t\t\n\t\tif (gd.wasCanceled())\n\t\t\tSystem.exit(0);\n\t}", "protected Dialog onCreateDialog(int id) {\r\n switch(id) {\r\n case PROGRESS_DIALOG:\r\n progressDialog = new ProgressDialog(Suggestions.this);\r\n progressDialog.setMessage(\"Loading. Please wait.\");\r\n progressThread = new ProgressThread(handler);\r\n progressThread.start();\r\n return progressDialog;\r\n default:\r\n return null;\r\n }\r\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n switch (id) {\n // create a new TimePickerDialog with values you want to show\n case TIME_DIALOG_ID:\n return new TimePickerDialog(this, mTimeSetListener, mHour, mMinute, false);\n }\n return null;\n }", "public ClassChoiceDialog(Context context) {\n // 通过LayoutInflater来加载一个xml的布局文件作为一个View对象\n this.context = context;\n initialView();\n dialog = builder.create();\n initListener();\n\n }", "public PHConstDialog() {\n\t\tinitComponents();\n\t}", "@SuppressWarnings(\"deprecation\")\n @Override\n protected Dialog onCreateDialog(int id) {\n return MenuView.onCreateDialog(this, id);\n }", "protected Dialog onCreateDialog(int id) {\n if (id == 1) {\n AlertDialog.Builder adb = new AlertDialog.Builder(this);\n // заголовок\n adb.setTitle(\"PIN Removed\");\n // сообщение\n adb.setMessage(\"There will be no PIN entry screen when Application starts up.\");\n // иконка\n adb.setIcon(android.R.drawable.ic_dialog_info);\n adb.setNeutralButton(\"Ok\", myClickListener);\n // создаем диалог\n return adb.create();\n }\n return super.onCreateDialog(id);\n }", "public NewItemDlg(Bundle args) {\n this.setArguments(args);}", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }", "public Dialog onCreateDialog(Bundle savedInstanceState) {\r\n\t return mDialog;\r\n\t }", "public Dialog createAddPersonDialog(String title, String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getMyAcitivty());\n builder.setTitle(title);\n builder.setMessage(msg);\n\n // Use an EditText view to get user input.\n final EditText input = new EditText(getMyAcitivty());\n input.setText(\"\");\n builder.setView(input);\n\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n String value = input.getText().toString();\n Log.d(TAG, \"user input: \" + value);\n inputDialogResult = value;\n launchTrainingActivity();\n// AlertDialog dg =\n// SelectServerAlertDialog.createDialog(\n// getContext(),\n// \"Pick a Server\",\n// getAllIps(),\n// launchTrainingActivityAction,\n// cancelAction,\n// true);\n// dg.show();\n }\n });\n builder.setNegativeButton(\"Cancel\", SelectServerAlertDialog.cancelAction);\n return builder.create();\n }", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n builder.setMessage(msg)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n return;\n }\n });\n\n Dialog dialog = builder.create();\n\n // Create the AlertDialog object and return it\n return dialog;\n }", "public InfoDialog() {\r\n\t\tcreateContents();\r\n\t}", "private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}", "public static JDialog createRegionDialog(final ChampionSelectGUI t) {\n\t\tfinal JPanel contentPanel = new JPanel();\n\t\tJLabel request = new JLabel(\"Please select your region\");\n\t\tcontentPanel.add(request);\n\t\trequest.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal Choice input = new Choice();\n\t\tinput.add(\"---Select Region---\");\n\t\tinput.add(\"NA\");\n\t\tinput.add(\"EUW\");\n\t\tinput.add(\"KR\");\n\t\tinput.add(\"EUNE\");\n\t\tinput.add(\"BR\");\n\t\tinput.add(\"RU\");\n\t\tinput.add(\"TR\");\n\t\tinput.add(\"OCE\");\n\t\tinput.add(\"LAN\");\n\t\tinput.add(\"LAS\");\n\t\tcontentPanel.add(input);\n\t\tJButton ok = new JButton(\"ok\");\n\t\tcontentPanel.add(ok);\n\t\tok.setSize(200, 150);\n\t\tok.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal JDialog d = new JDialog(t, \"Region\", true);\n\t\td.setContentPane(contentPanel);\n\t\td.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);\n\t\td.setSize(400, 100);\n\t\td.setLocationRelativeTo(t);\n\t\td.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));\n\t\td.addWindowListener(new WindowListener() {\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tint ret = JOptionPane.showConfirmDialog(contentPanel, \"Are you sure you want to exit?\", \"Choose an option\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif (ret == 0) {\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void windowOpened(WindowEvent e) {}\n\t\t\tpublic void windowClosed(WindowEvent e) {}\n\t\t\tpublic void windowIconified(WindowEvent e) {}\n\t\t\tpublic void windowDeiconified(WindowEvent e) {}\n\t\t\tpublic void windowActivated(WindowEvent e) {}\n\t\t\tpublic void windowDeactivated(WindowEvent e) {}\n\t\t});\n\t\tok.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (input.getSelectedItem().equals(\"---Select Region---\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(contentPanel, \"Please select a region.\", \"Message\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tt.regionArr[0] = input.getSelectedItem();\n\t\t\t\t\td.setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn d;\n\t}", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.app_help_title);\n builder.setMessage(R.string.app_help_message)\n .setPositiveButton(R.string.app_help_ok, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n return builder.create();\n }", "public NewEmployeeDialog(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n currentEmployeeCode = \"\";\n populatePositionComboBox ();\n putDialogToCenter();\n }", "@Override\r\n protected Dialog onCreateDialog(int id) {\r\n switch (id) {\r\n case DATE_DIALOG_ID:\r\n return new DatePickerDialog(this, \r\n pDateSetListener,\r\n pYear, pMonth, pDay);\r\n\t\tcase DATE_DIALOG1_ID:\r\n return new DatePickerDialog(this, \r\n pDateSetListener1,\r\n pYear, pMonth, pDay);\r\n }\r\n return null;\r\n }", "public void addRelationshipDialog() { new RelationshipDialog(); }", "public Dialog onCreateDialog(Bundle savedInstanceState){\n AlertDialog.Builder sample_builder = new AlertDialog.Builder(getActivity());\n sample_builder.setView(\"activity_main\");\n sample_builder.setMessage(\"This is a sample prompt. No new networks should be scanned while this prompt is up\");\n sample_builder.setCancelable(true);\n sample_builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogPositiveClick(StationFragment.this);\n }\n });\n sample_builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogNegativeClick(StationFragment.this);\n }\n });\n return sample_builder.create();\n\n }", "public NewDialog() {\n\t\t\t// super((java.awt.Frame)null, \"New Document\");\n\t\t\tsuper(\"JFLAP 7.0\");\n\t\t\tgetContentPane().setLayout(new GridLayout(0, 1));\n\t\t\tinitMenu();\n\t\t\tinitComponents();\n\t\t\tsetResizable(false);\n\t\t\tpack();\n\t\t\tthis.setLocation(50, 50);\n\n\t\t\taddWindowListener(new WindowAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void windowClosing(final WindowEvent event) {\n\t\t\t\t\tif (Universe.numberOfFrames() > 0) {\n\t\t\t\t\t\tNewDialog.this.setVisible(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tQuitAction.beginQuit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }", "@Override\n\tpublic Fragment createFragment() {\n\t\treturn new SelectDialogFragment();\n\t}", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = requireActivity().getLayoutInflater();\n final View view = inflater.inflate(R.layout.on_click_dialog, null);\n builder.setView(view);\n\n\n\n\n\n\n\n\n return builder.create();\n }", "public JDialogParticleAnalysisNew() { }", "public OptionPane() {\n\t\t\n\t\tinit();\n\t}", "@Override\r\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n \r\n LayoutInflater inflater = getActivity().getLayoutInflater();\r\n builder.setTitle(\"New Wallet\");\r\n \r\n\t final View view = inflater.inflate(R.layout.new_wallet_dialog, null);\r\n\t \r\n\t final EditText name = (EditText) view.findViewById(R.id.newWallet_text);\r\n\t \r\n builder.setPositiveButton(R.string.confirmRecord, new DialogInterface.OnClickListener() {\r\n \r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.comfirmPressed(name.getText().toString());\t\r\n \t\t}\r\n });\r\n builder.setNegativeButton(R.string.cancelRecord, new DialogInterface.OnClickListener() {\r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.cancelPressed();\r\n \t\t}\r\n \t});\r\n // Create the AlertDialog object and return it\r\n return builder.create();\r\n }", "static public ConnectionCodeKeyDialog newInstance() {\n ConnectionCodeKeyDialog dialog = new ConnectionCodeKeyDialog();\n return dialog;\n }", "private Dialogs () {\r\n\t}", "private void jMenuItemControlAsistenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemControlAsistenciaActionPerformed\n JDialogControlAsistencia vca = new JDialogControlAsistencia(this, modal, listaDeportes);\n LOG.info(\"Launching JDialogControlAsistencia...\");\n vca.setLocationRelativeTo(this);\n vca.setVisible(true);\n}", "public DialogManager() {\n }", "private ListSelectionDialogFactory() {\n }", "public TestDialog(java.awt.Frame parent,boolean modal) {\n super (parent, modal);\n initComponents ();\n pack ();\n }", "public void openDialogCreateVisual(){\n DataHeader[] tabHeader = dataset.getListDataHeaderDouble(true);\n TypeVisualization[] tabVis = getListTypeVisualization(tabHeader.length);\n DataHeader[] tabHeaderLabel = dataset.getListDataHeaderDouble(false);\n CreateDataVisualDialog dialog = new CreateDataVisualDialog(this, tabVis, tabHeader, tabHeaderLabel);\n dialog.setVisible(true);\n }", "public Dialog onCreateDialog(Bundle savedInstanceState) {\n final Calendar c = Calendar.getInstance();\n int hour = c.get(Calendar.HOUR_OF_DAY);\n int minute = c.get(Calendar.MINUTE);\n\n // Create a new instance of TimePickerDialog and return it\n return new TimePickerDialog(getActivity(), this, hour, minute,\n DateFormat.is24HourFormat(getActivity()));\n }", "public static JDialog createRoleDialog(final ChampionSelectGUI t) {\n\t\tfinal JPanel contentPanel = new JPanel();\n\t\tJLabel request = new JLabel(\"Please select your role\");\n\t\tcontentPanel.add(request);\n\t\trequest.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal Choice input = new Choice();\n\t\tinput.add(\"---Select Role---\");\n\t\tinput.add(\"Top\");\n\t\tinput.add(\"Jungle\");\n\t\tinput.add(\"Mid\");\n\t\tinput.add(\"ADC\");\n\t\tinput.add(\"Support\");\n\t\tcontentPanel.add(input);\n\t\tJButton ok = new JButton(\"ok\");\n\t\tcontentPanel.add(ok);\n\t\tok.setSize(200, 150);\n\t\tok.setAlignmentX(Component.CENTER_ALIGNMENT);\n\t\tfinal JDialog d = new JDialog(t, \"Role\", true);\n\t\td.setContentPane(contentPanel);\n\t\td.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);\n\t\td.setSize(400, 100);\n\t\td.setLocationRelativeTo(t);\n\t\td.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));\n\t\td.addWindowListener(new WindowListener() {\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\tint ret = JOptionPane.showConfirmDialog(contentPanel, \"Are you sure you want to exit?\", \"Choose an option\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif (ret == 0) {\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void windowOpened(WindowEvent e) {}\n\t\t\tpublic void windowClosed(WindowEvent e) {}\n\t\t\tpublic void windowIconified(WindowEvent e) { }\n\t\t\tpublic void windowDeiconified(WindowEvent e) { }\n\t\t\tpublic void windowActivated(WindowEvent e) { }\n\t\t\tpublic void windowDeactivated(WindowEvent e) { }\n\t\t});\n\t\tok.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (input.getSelectedItem().equals(\"---Select Role---\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(contentPanel, \"Please select a role.\", \"Message\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tt.roleArr[0] = input.getSelectedItem();\n\t\t\t\t\td.setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn d;\n\t}", "public Dialog(Window owner, Modality modality, StageStyle style) {\n\t\tthis(owner, modality, style, null);\n\t}", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n //set new View to the builder and create the Dialog\n Dialog dialog = builder.setView(new View(getActivity())).create();\n\n //get WindowManager.LayoutParams, copy attributes from Dialog to LayoutParams and override them with MATCH_PARENT\n WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();\n layoutParams.copyFrom(dialog.getWindow().getAttributes());\n layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;\n layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;\n //show the Dialog before setting new LayoutParams to the Dialog\n dialog.show();\n dialog.getWindow().setAttributes(layoutParams);\n\n return dialog;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this, myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this, myDateListener, year, month, day);\n }\n return null;\n }", "private Dialog recreateDialog() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(OptionActivity.this);\n builder.setMessage(\"Do you want to change your profile?\")\n .setPositiveButton(\"Yah!\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent intent = new Intent(OptionActivity.this, amountscreen.class);\n startActivity(intent);\n }\n })\n .setNegativeButton(\"Nope\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }", "public DialogPrompt(String title)\n {\n value = new PromptValueString(\"\",\"\");\n initUI(title,10);\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "@Override\n protected Dialog onCreateDialog(int id) {\n if (id == 999) {\n return new DatePickerDialog(this,\n myDateListener, year, month, day);\n }\n return null;\n }", "protected Dialog onCreateDialog(int id) {\n\t\n\t// Arg value corresponds to showDialog(0)\n\t\tif (id != 0)\n\t\t\treturn null;\n\t\tmyProgressDialog = new ProgressDialog(this); \n\t\tmyProgressDialog.setMessage(\"Loading ...\"); \n\t\tmyProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); \n\t\tmyProgressDialog.setCancelable(false);\n\t\treturn myProgressDialog ;\n\t}", "protected void createDialogSize ()\n {\n }", "public Dialog onCreateDialog(Bundle savedInstanceState) {\n final Calendar c = Calendar.getInstance();\n int year = c.get(Calendar.YEAR);\n int month = c.get(Calendar.MONTH);\n int day = c.get(Calendar.DAY_OF_MONTH);\n\n // Create a new instance of DatePickerDialog and return it\n DatePickerDialog dialog = new DatePickerDialog(getActivity(), this, year, month, day);\n if(this.getMinDate() != null){\n dialog.getDatePicker().setMinDate(this.getMinDate().getTime());\n }\n\n if(this.getMaxDate() != null){\n dialog.getDatePicker().setMaxDate(this.getMaxDate().getTime());\n }\n\n if(getPositiveClickListner() != null){\n dialog.setButton(DialogInterface.BUTTON_POSITIVE, \"OK\", getPositiveClickListner());\n }\n return dialog;\n }", "public OptionsMenu() {\n\t\tsuper(OPTIONS_WINDOW_TITLE);\n\t\tQ = new Quoridor();\n\t\tinitialize();\n\t\tsetVisible(true);\n\t}", "private AlertDialog createAboutDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this).setTitle(R.string.license_title)\n .setMessage(R.string.license).setIcon(R.drawable.about)\n .setNeutralButton(R.string.about_button, null);\n AlertDialog alert = builder.create();\n return alert;\n }", "protected Dialog onCreateDialog(int id) {\n ProgressDialog progressDialog;\n\n switch(id) {\n /** Define an dialog for PROGRESS_DIALOG dialog. */\n case PROGRESS_DIALOG:\n progressDialog = new ProgressDialog(Transport.this);\n progressDialog.setIndeterminate(true);\n progressDialog.setMessage(getString(R.string.loading_map));\n return progressDialog;\n default:\n return null;\n }\n }", "private AssignFSADialog() {\r\n super(Hub.getMainWindow(), Hub.string(\"TD_assignFSATitle\"));\r\n addWindowListener(new WindowAdapter() {\r\n @Override\r\n public void windowClosing(WindowEvent e) {\r\n onEscapeEvent();\r\n }\r\n });\r\n this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r\n this.setMinimumSize(new Dimension(300, 10));\r\n\r\n Box mainBox = Box.createHorizontalBox();\r\n mainBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n Box newBox = Box.createVerticalBox();\r\n newBox.add(new JLabel(\" \"));\r\n newBox.add(new JButton(new NewFSAAction()));\r\n mainBox.add(newBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n openModelsCombo = new JComboBox();\r\n openModelsCombo.setRenderer(new JLabelListRenderer());\r\n Box modelsBox = Box.createVerticalBox();\r\n Box titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_openModels\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n modelsBox.add(titleBox);\r\n modelsBox.add(openModelsCombo);\r\n mainBox.add(modelsBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n templatesCombo = new JComboBox();\r\n templatesCombo.setRenderer(new JLabelListRenderer());\r\n Box templatesBox = Box.createVerticalBox();\r\n titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_templates\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n templatesBox.add(titleBox);\r\n templatesBox.add(templatesCombo);\r\n mainBox.add(templatesBox);\r\n\r\n getContentPane().add(mainBox);\r\n\r\n }", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),\n R.style.RedButtonAlertDialog);\n\n builder.setTitle(\"Add new profile\").setView(R.layout.dialog_add_player)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n EditText profileNameEditText =\n (EditText) getDialog().findViewById(R.id.add_player_edit_text);\n String name = profileNameEditText.getText().toString();\n DartLogDatabaseHelper dbHelper = new DartLogDatabaseHelper(getContext());\n dbHelper.addPlayer(name);\n getProfilesAdapter().updateDataSetFromDatabase();\n }\n })\n .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }", "private void createForumDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(Objects.requireNonNull(this),\n R.style.AlertDialogTheme);\n dialog.setTitle(R.string.add_new_forum_title);\n dialog.setMessage(R.string.add_new_forum_description);\n\n View newForumDialog = getLayoutInflater().inflate(R.layout.new_forum_dialog, null);\n dialog.setView(newForumDialog);\n\n AlertDialog alertDialog = dialog.create();\n setAddForumButtonListener(alertDialog, newForumDialog);\n\n alertDialog.show();\n }", "@Override\n\t\tpublic final Dialog onCreateDialog(final Bundle savedInstanceState) {\n\t\t\tint title = getArguments().getInt(\"title\");\n\n\t\t\treturn new AlertDialog.Builder(getActivity())\n\t\t\t\t\t.setIcon(R.drawable.alert_dialog_icon)\n\t\t\t\t\t.setTitle(title)\n\t\t\t\t\t.setPositiveButton(R.string.alert_dialog_ok,\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tfinal DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tfinal int whichButton) {\n\t\t\t\t\t\t\t\t\t((AddingActivity) getActivity())\n\t\t\t\t\t\t\t\t\t\t\t.doPositiveClick();\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t.setNegativeButton(R.string.alert_dialog_cancel,\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tfinal DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tfinal int whichButton) {\n\t\t\t\t\t\t\t\t\t((AddingActivity) getActivity())\n\t\t\t\t\t\t\t\t\t\t\t.doNegativeClick();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}).create();\n\t\t}", "@Override\r\n protected Dialog onCreateDialog(int id) {\r\n switch (id) {\r\n case START_DATE_DIALOG_ID:\r\n return new DatePickerDialog(this,\r\n \t\t\tstartDateSetListener,\r\n \t\t\tstartYear_dp, startMonth_dp-1, startDay_dp); \r\n case START_TIME_DIALOG_ID:\r\n return new TimePickerDialog(this,\r\n \t\t\tstartTimeSetListener, startHour_dp, startMinute_dp, false); \r\n case END_DATE_DIALOG_ID:\r\n return new DatePickerDialog(this,\r\n endDateSetListener,\r\n endYear_dp, endMonth_dp-1, endDay_dp);\r\n case END_TIME_DIALOG_ID:\r\n return new TimePickerDialog(this,\r\n \t\t\tendTimeSetListener, endHour_dp, endMinute_dp, false);\r\n }\r\n return null;\r\n }", "public Khoa_Dialog(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n }", "private void createResultPopup() {\r\n resultDialog = new JDialog(parentFrame);\r\n resultDialog.setLayout(new BoxLayout(resultDialog.getContentPane(), BoxLayout.Y_AXIS));\r\n resultDialog.setAlwaysOnTop(true);\r\n Utilities.centerWindowTo(resultDialog, parentFrame);\r\n resultDialog.add(createResultLabel());\r\n resultDialog.add(createButtonDescription());\r\n resultDialog.add(createConfirmationButtons());\r\n resultDialog.pack();\r\n resultDialog.setVisible(true);\r\n }", "private static void showSingleOptionDialog(Context c, int titleID, int messageID, int buttonID, OnClickListener listener){\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(c);\n\t\tbuilder.setTitle(titleID)\n\t\t.setNegativeButton(buttonID, listener);\n\t\tif(messageID > -1){\n\t\t\tbuilder.setMessage(messageID);\n\t\t}\n\n\t\tbuilder.create().show();\n\t}", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n setRetainInstance(true);\n\n Dialog dialog = new Dialog(getContext(), R.style.DialogTheme);\n dialog.setContentView(R.layout.add_sale_item_dialog);\n\n return dialog;\n }", "public SimulatorHelpDialog() {\n super((Frame)null, true);\n initComponents();\n initialize();\n }", "private JDialog getAboutDialog() {\n\t\tif (aboutDialog == null) {\n\t\t\taboutDialog = new JDialog(getHlavneOkno(), true);\n\t\t\taboutDialog.setTitle(\"O aplikácii SluchAnal\");\n\t\t\taboutDialog.setSize(new Dimension(100, 100));\n\t\t\taboutDialog.setResizable(false);\n\t\t\taboutDialog.setContentPane(getAboutObsah());\n\t\t}\n\t\treturn aboutDialog;\n\t}" ]
[ "0.7377455", "0.7203483", "0.71908677", "0.6964816", "0.6787753", "0.65184903", "0.6464168", "0.6403093", "0.6372941", "0.6358311", "0.6357005", "0.6338724", "0.63169926", "0.62724537", "0.62411964", "0.62162966", "0.6204363", "0.6165101", "0.61620796", "0.6157469", "0.6139345", "0.6135137", "0.61170936", "0.6098866", "0.6073888", "0.6065306", "0.60401636", "0.60247624", "0.60243654", "0.60174483", "0.60126454", "0.60071963", "0.6003375", "0.6001529", "0.5999792", "0.5994725", "0.59918237", "0.598769", "0.5975796", "0.5966796", "0.5955672", "0.59395987", "0.59305817", "0.5918497", "0.59157103", "0.5902124", "0.5898325", "0.58971524", "0.58966523", "0.58854425", "0.5883534", "0.5878208", "0.5875699", "0.58720064", "0.58674306", "0.5860629", "0.5852402", "0.58488953", "0.58474386", "0.5841506", "0.5841328", "0.58355045", "0.5825693", "0.5823599", "0.58161", "0.5814447", "0.5800633", "0.57967347", "0.57911146", "0.57905245", "0.57904774", "0.5788463", "0.5788145", "0.5778954", "0.5778954", "0.57770175", "0.5771831", "0.576701", "0.576701", "0.576701", "0.576701", "0.576701", "0.576701", "0.57614267", "0.5753642", "0.5744017", "0.5742314", "0.57392454", "0.57337147", "0.57282454", "0.57265985", "0.5713976", "0.5709488", "0.57087564", "0.5705555", "0.56954545", "0.5692271", "0.5691737", "0.56861556", "0.568519" ]
0.6005202
32
Returns the number of the choice the user made.
public int getChoice() { return choice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getOfYourChoiceInput() {\n return ofYourChoiceInput;\n }", "public static int getUserChoice(){\r\n return Input.getInt(\"Enter 1 to add a song, 2 to display all songs, or 3 to quit the program: \");\r\n }", "public java.lang.String getChoice_num() {\n return choice_num;\n }", "private static int getUserChoice() {\n System.out.println(\"Please choose your operation: \");\n return intScanner.nextInt();\n }", "private int choice (String playerchoice){\n if(playerchoice.equals(\"rock\")){\n return 1;\n }\n else if(playerchoice.equals(\"paper\")){\n return 2;\n }\n else if(playerchoice.equals(\"scissors\")){\n return 3;\n }\n return 0;\n }", "public int getOfYourChoiceOutput() {\n return ofYourChoiceOutput;\n }", "public int getCurrentChoice() {\n return currentChoice;\n }", "private int getChoice() {\n\t\tif (vsComputer) {\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Enter choice: \");\n\t\t\t\tint ch;\n\t\t\t\ttry {\n\t\t\t\t\tch = sc.nextInt();\n\t\t\t\t} catch (InputMismatchException e) {\n\t\t\t\t\tSystem.out.println(\"Invalid Choice\\n\");\n\t\t\t\t\tsc.nextLine();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase 1, 2, 3 -> {\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\treturn ch-1;\n\t\t\t\t\t}\n\t\t\t\t\tdefault -> System.out.println(\"Invalid Choice\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn random.nextInt(3);\n\t\t}\n\t}", "public int getChoice()\n {\n super.setVisible(true);\n return this.choice;\n }", "public static int getMenuChoice() {\n String line;\n int option = -1;\n\n System.out.print(\">\");\n if (Menus.reader.hasNext()) {\n line = Menus.reader.nextLine().strip();\n\n try {\n option = Integer.parseInt(line);\n } catch (NumberFormatException e) {\n option = -1;\n }\n }\n\n return option;\n }", "public int getGuess() {\n\t\tif (accusation) {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make an accusation:\", JOptionPane.PLAIN_MESSAGE);\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(parent, panel, \"Make a suggestion:\", JOptionPane.PLAIN_MESSAGE);\n\t\t}\n\t\treturn CluedoUI.asInt(characters.getSelectedItem().toString()) \n\t\t\t\t+ CluedoUI.asInt(weapons.getSelectedItem().toString())\n\t\t\t\t + CluedoUI.asInt(rooms.getSelectedItem().toString());\n\t}", "static int askProductType() {\n\n int choice; // initialize return variable\n\n choice = Validate.readInt(ASK_PRODUCT_TYPE, 2); // display options to user for products and store result if valid choice\n\n return choice; // return users choice\n }", "public int getNumAnswer() {\n return numAnswer;\n }", "@Override\n protected int getMaxPossibleAttempts(){\n int choiceCt = questionData.getChoices().size();\n //if there's one choice, it's intentionally obvious\n return (choiceCt == 1 ? 1 : choiceCt - 1);\n }", "private static int getCombo() {\n return generator.nextInt(COMBOS) + 1;\n }", "Integer getNumQuestions();", "public static int getMenu() {\n\t\tSystem.out.println(\"Choose Options from menu:\");\n\t\tint option = scanner.nextInt();\n\n\t\treturn option;\n\t}", "public void numberOfChoices() {\n\t\tcommon.waitForElement(mcqChoices, 60);\n\t\tchoicesinMCQ = mcqChoices.getText();\n\t\tarr = choicesinMCQ.split(\"\\\\W+\");\n\t\tnumberOfChoicesinMCQ = arr[3];\n\t\tlastOption = numberOfChoicesinMCQ.charAt(0);\n\t\tint a = 1;\n\t\tfor (char x = firstOption; x < lastOption; x++) {\n\t\t\tfirstOption += 1;\n\t\t\ta += 1;\n\t\t}\n\t\tfor (choice = 0; choice < a; choice++) {\n\t\t\tcommon.waitForElement(mcqChoices, 60);\n\t\t\tanswerChoice.get(choice).click();\n\t\t}\n\t\tchoice = 0;\n\t\ta = 1;\n\t\tfirstOption = 'A';\n\t}", "public int displayMenuAndGetUserSelection(){\n view.promptInt(\"1. Create a Character\");\n view.promptInt(\"2. Update a Character\");\n view.promptInt(\"3. Display all Characters\");\n view.promptInt(\"4. Search for a Character\");\n view.promptInt(\"5. Delete a Character\");\n view.promptInt(\"6. Exit\");\n return view.promptInt(\"Select from one of the above choices\");\n }", "private int getPreferredNumberOfQuestions() {\n\t\tSharedPreferences prefs = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tint num = Integer.parseInt(prefs.getString(\n\t\t\t\tgetString(R.string.number_pref), \"6\"));\n\t\treturn num;\n\t}", "int getNumberOfQuestions();", "@Override\n\tpublic int getAnswerNum() {\n\t\treturn 1;\n\t}", "int getQuestCount();", "public static int getMenuOption() {\n\t Scanner input = new Scanner(System.in);\t// Create a Scanner object\r\n\t \r\n\t boolean invalid = true; \r\n\t int choice = 0;\r\n\t while(invalid){\r\n\t System.out.println(\"Menu\\n1. Add\\n2. Subtract\\n3. Multiply\\n4. Divide\\n5. Clear\\n6. Quit\"); // Prints out menu of options\r\n\t System.out.print(\"What would you like to do? \");\r\n\t choice = input.nextInt();\r\n\t invalid = (choice >= 1 && choice <=6) ? false : true; // checks if choice is valid\r\n\t if (invalid){\r\n\t System.out.println(\"I'm sorry, \" + choice + \" wasn't one of the options\\n\");\r\n\t }\r\n\r\n\t }\r\n\t return choice;\r\n\t }", "public int askHowManyUsers() {\r\n\t\tint userAmount = 0;\r\n\t\tboolean correctInput = false;\r\n\r\n\t\twhile (correctInput == false) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"How many players would like to participate in the game?\\nPlease type 1,2,3 or 4. If you type 1 a virtual user will automatically be created. Otherwise have fun playing with your human friends!\");\r\n\t\t\ttry {\r\n\t\t\t\tuserAmount = input.nextInt();\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tif (userAmount == 1 || userAmount == 2 || userAmount == 3 || userAmount == 4 || userAmount == 5) {\r\n\t\t\t\t\tcorrectInput = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (userAmount > 5) {\r\n\t\t\t\t\t\tSystem.out.println(\"Five players is the maximum!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (userAmount == 0) {\r\n\t\t\t\t\t\tSystem.out.println(\"At least one person should play!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\tSystem.out.println(\"Please type a number\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn userAmount;\r\n\t}", "public int chooseFromReservationMenu() {\n\t\tfinal int NEW_RESERVATION =1;\t\t\t\t\t\t\t\t\t//option from the reservations sub menu\n\t\tfinal int VIEW_RESERVATION =2;\n\t\tfinal int CANCEL_RESERVATION =3;\n\n\t\tuserChoice = keyboard.nextInt();\n\n\t\tint scenario = 0; \n\t\tif (userChoice == NEW_RESERVATION)\n\t\t\tscenario = 1;\n\t\telse if(userChoice == VIEW_RESERVATION)\n\t\t\tscenario = 2;\n\t\telse if(userChoice == CANCEL_RESERVATION)\n\t\t\tscenario = 3;\n\t\telse\n\t\t\tscenario = 4;\n\n\t\treturn scenario;\t\t\t\t\t\t\t\t\t\t\t\t\t//int scenario returned is entered into a 'switch'\n\t}", "public static int getUserOption(){\n\n String numberAsString;\n int userOption;\n java.util.Scanner scanner = new java.util.Scanner(System.in);\n\n listMenuOptions();\n numberAsString = scanner.nextLine();\n userOption = Integer.parseInt(numberAsString); // Convert string to a integer\n while ( ( userOption < 0 )|| (userOption > 4 ) ) { // check if input is valid\n System.out.println(\"You did not enter a valid option. Try again.\");\n listMenuOptions();\n numberAsString = scanner.nextLine();\n userOption = Integer.parseInt(numberAsString); // Convert string to a integer\n }\n return userOption;\n }", "public String modeOfChoice() {\r\n try {\r\n return choice.take();\r\n } catch (Exception e){\r\n return \"\";\r\n }\r\n }", "private int getSelectedCount() {\r\n\t int count = 0;\r\n\t for (int i = 0; i < _selectedList.size(); ++i) {\r\n\t count += _selectedList.get(i) ? 1 : 0;\r\n\t }\r\n\t return count;\r\n\t}", "public Integer getAnswerCount() {\n return answerCount;\n }", "public int getPlayerAnswer()\r\n\t{\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter your answer (0-3): \");\r\n\t\treturn in.nextInt();\r\n\t}", "@Override\r\n\tpublic int selectCount() {\n\t\treturn userdao.selectCount();\r\n\t}", "protected int getOptionNumber(FacesContext context, UIComponent component) {\r\n Iterator items = getSelectItems(context, component);\r\n int itemCount = 0;\r\n // count the children items\r\n while (items.hasNext()) {\r\n itemCount++;\r\n SelectItem item = (SelectItem) items.next();\r\n if (item instanceof SelectItemGroup) {\r\n int optionsLength = ((SelectItemGroup) item).getSelectItems().length;\r\n itemCount = itemCount + optionsLength;\r\n }\r\n }\r\n return itemCount;\r\n }", "private static int getUserOption () {\n\t\tBufferedReader myReader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint input;\n\t\t\n\t\tdo {\n\t\t\tlistMainMenuOptions();\n\n\t\t\ttry {\n\t\t\t\tinput = Integer.parseInt(myReader.readLine());\n\n\t\t\t\tif ((input < 1) || (input>9)) {\n\t\t\t\t\tSystem.out.println(\"Please type in a number between 1-9 according to your choice\");\n\t\t\t\t}\n\n\t\t\t}catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Character invalid. Please enter a number from 1-9 according to your choice\");\n\t\t\t\tinput = 0;\n\t\t\t}\n\t\t\t\n\t\t}while ((input < 1) || (input>9));\n\n\t\treturn input;\n\t\t\n\t}", "public static int Menu(){\n \n String StrOp=JOptionPane.showInputDialog(null, \"Ingrese una opcion:\\n\"+\"0.- Salir\\n\"+\n \"1-Calificacion de notas\\n\"+\n \"2-Promedio de la clase\");\n return(Integer.parseInt(StrOp));\n }", "static int choiceToInt(String choice) throws Exception {\n\t\tswitch(choice) {\n\t\t\tcase \"R\":\n\t\t\t\treturn 0;\n\t\t\tcase \"P\":\n\t\t\t\treturn 1;\n\t\t\tcase \"S\":\n\t\t\t\treturn 2;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(\"I don't know how you did this\");\n\t\t}\n\t}", "private int getNumberCorrect() {\n RadioButton rb1 = (RadioButton) findViewById(R.id.question_1_correct);\n RadioButton rb2 = (RadioButton) findViewById(R.id.question_2_correct);\n RadioButton rb3 = (RadioButton) findViewById(R.id.question_3_correct);\n RadioButton rb4 = (RadioButton) findViewById(R.id.question_4_correct);\n boolean q5Answer = checkQuestion5();\n boolean q6answer = checkQuestion6();\n ToggleButton tb7 = (ToggleButton) findViewById(R.id.question_7);\n ToggleButton tb8 = (ToggleButton) findViewById(R.id.question_8);\n boolean bool8 = !tb8.isChecked();\n ToggleButton tb9 = (ToggleButton) findViewById(R.id.question_9);\n ToggleButton tb10 = (ToggleButton) findViewById(R.id.question_10);\n\n boolean answers[] = new boolean[]{rb1.isChecked(), rb2.isChecked(), rb3.isChecked(), rb4.isChecked(),\n q5Answer, q6answer, tb7.isChecked(), bool8, tb9.isChecked(),\n tb10.isChecked()};\n return countCorrectAnswers(answers);\n }", "public int getBasedOnChoice(int choice) {\n switch (choice) {\n case 1:\n return this.ones;\n case 2:\n return this.twos;\n case 3:\n return this.threes;\n case 4:\n return this.fours;\n case 5:\n return this.fives;\n case 6:\n return this.sixes;\n case 7:\n return this.threeOfAKind;\n case 8:\n return this.fourOfAKind;\n case 9:\n return this.smallStraight;\n case 10:\n return this.longStraight;\n case 11:\n return this.fullHouse;\n case 12:\n return this.yahtzee;\n }\n return 0;\n }", "public static int getMenuOption() {\n Scanner input = new Scanner(System.in);\n\n menuOption = input.next().toLowerCase().charAt(0);\n\n while (menuOption != 'a' && menuOption != 'r' && menuOption != 'f' && menuOption != 'i' && menuOption != 'n' && menuOption != 'q') {\n System.out.print(\"Enter a valid choice: \");\n menuOption = input.next().toLowerCase().charAt(0);\n }\n\n if (menuOption == 'a') {\n return 1;\n } else if (menuOption == 'r') {\n return 2;\n } else if (menuOption == 'f') {\n return 3;\n } else if (menuOption == 'i') {\n return 4;\n } else if (menuOption == 'n') {\n return 5;\n } else {\n return 6;\n }\n }", "public static int choicedialog() {\r\n List<String> choices = new ArrayList<>();\r\n choices.add(\"1a\");\r\n choices.add(\"1b\");\r\n choices.add(\"2\");\r\n choices.add(\"2u\");\r\n choices.add(\"3\");\r\n choices.add(\"3u\");\r\n choices.add(\"4\");\r\n choices.add(\"5\");\r\n\r\n ChoiceDialog<String> dialog = new ChoiceDialog<>(\"SET ZONE HERE\", choices);\r\n dialog.setTitle(\"Zone Selector\");\r\n dialog.setHeaderText(null);\r\n dialog.setContentText(\"Select Zone:\");\r\n \r\n Optional<String> result = dialog.showAndWait();\r\n if (result.isPresent()){\r\n if(result.get() == \"1a\") return 1;\r\n else if (result.get() == \"1b\") return 2;\r\n else if (result.get() == \"2\") return 3;\r\n else if (result.get() == \"2u\") return 4;\r\n else if (result.get() == \"3\") return 5;\r\n else if (result.get() == \"3u\") return 6;\r\n else if (result.get() == \"4\") return 7;\r\n else if (result.get() == \"5\") return 8;\r\n else return 0;\r\n } else return 0;\r\n }", "private int getChoice() throws IOException {\n\n int input;\n\n do {\n try {\n Thread.sleep(100);\n stdErr.println();\n\n stdErr.print(\"[0] Quit\\n\"\n + \"[1] Display student's information\\n\"\n + \"[2] Display student's ranking according their grade\\n\"\n + \"[3] Display student's information by thier name\\n\"\n + \"[4] Display all scholarship information\\n\"\n + \"[5] Display scholarship information according their name\\n\"\n + \"[6] Apply for scholarship\\n\"\n + \"[7] Display student's scholarship\\n\"\n + \"choice> \");\n\n stdErr.flush();\n\n input = Integer.parseInt(stdIn.readLine());\n\n stdErr.println();\n\n if (0 <= input && input <= 7) {\n break;\n } else {\n stdErr.println(\"Invalid choice: \" + input);\n }\n } catch (NumberFormatException nfe) {\n stdErr.println(nfe);\n } catch (InterruptedException e) {\n\n }\n } while (true);\n\n return input;\n }", "private static int menu() {\r\n\t\tSystem.out.println(\"Elige opcion de jugada:\");\r\n\t\tSystem.out.println(\"1-Piedra\");\r\n\t\tSystem.out.println(\"2-Papel\");\r\n\t\tSystem.out.println(\"3-Tijera\");\r\n\t\tSystem.out.println(\"0-Salir\");\r\n\t\tSystem.out.print(\"Opcion: \");\r\n\t\treturn Teclado.leerInt();\r\n\t}", "public SUDecision getlastChoice() {\r\n\t\treturn m_lastChoice;\r\n\t}", "public int getSelectNum() {\n\t\treturn comboBox.getItemAt(comboBox.getSelectedIndex()).intValue();\n\t}", "@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}", "public int getNumAttemptsOfGeneOption() {\n return m_NumAttemptsOfGene;\n }", "private int numOnglet(){\n int selIndex = jTabPane_Accueil.getSelectedIndex();\n return selIndex;\n }", "public Choice getChoice() {\n return choice;\n }", "public static int computerChoice(Random generator){\n int randNumber;\n \n randNumber = generator.nextInt(5);\n return randNumber;\n }", "public void getChoice()\n {\n }", "private int inputNumPlayers() {\n\t\t\t// set up dialog box\n\t\t\tString[] options = {\"OK\"};\n\t\t\tJPanel panel = new JPanel(new GridLayout(0, 1));\n\t\t\tJLabel lbl = new JLabel(\"How many players? (2-6)\");\n\t\t\tJTextField txt = new JTextField(10);\n\t\t\tpanel.add(lbl);\n\t\t\tpanel.add(txt);\n\t\t\t\n\t\t\t// show dialog box\n\t\t\tJOptionPane.showOptionDialog(frame, panel, \"# Players\",\n\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\t\tString numPlayersResponse = txt.getText();\n\t\t\t\n\t\t\t// determine input validity\n\t\t\tint numPlayers = 0;\n\t\t\ttry{\n\t\t\t\tnumPlayers = Integer.parseInt(numPlayersResponse);\n\t\t\t\t// check for out of bounds number\n\t\t\t\twhile(numPlayers < 2 || numPlayers > 6){\n\t\t\t\t\tpanel.remove(lbl);\n\t\t\t\t\ttxt.setText(\"\");\n\t\t\t\t\tlbl = new JLabel(\"Invalid number. Must be 2-6 players.\");\n\t\t\t\t\tpanel.add(lbl);\n\t\t\t\t\tJOptionPane.showOptionDialog(frame, panel, \"# Players\",\n\t\t\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\t\t\t\tnumPlayersResponse = txt.getText();\n\t\t\t\t\tnumPlayers = Integer.parseInt(numPlayersResponse);\n\t\t\t\t}\n\t\t\t} catch(NumberFormatException e){\n\t\t\t\t// player entered nothing or a non-numeric string\n\t\t\t\treturn inputNumPlayers();\n\t\t\t}\n\t\t\treturn numPlayers;\n\t\t}", "int getOptionsCount();", "int getOptionsCount();", "int getOptionsCount();", "int getNewlyAvailableQuestsCount();", "private int getMenuSelection() {\n return view.printMenuAndGetSelection();\n }", "public int getAnswer() {\n\t\treturn answer;\n\t}", "private int getResult(){\n\t\t\t\tButtonModel\tbtnModel = btnGroup.getSelection();\r\n \t\t\tif(btnModel!=null){\r\n \t\t\t\treturn Integer.parseInt(btnModel.getActionCommand());\r\n\t\t\t\t}\r\n\t\t\t\treturn -10; //return -10 if user did not fill selection\r\n\t\t\t}", "private static int getNumberOfPlayers() {\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Enter the number of kids: \");\n return scanner.nextInt();\n }", "private static int getUserOption()\n {\n\t// Reads the users input.\n\tBufferedReader optionReader = new BufferedReader(new InputStreamReader(System.in));\n\n\ttry\n\t {\n\t\treturn(Integer.parseInt(optionReader.readLine()));\n\t }\n\tcatch(Exception ex)\n\t {\n\t\treturn(-1);\n\t }\n }", "public int getAnswer() {\n return answer;\n }", "private static int HQmenu() {\n\t\tlogger.info(\"Entering HQmenu method -->\");\n\t\tint choice = 0;\n\t\tboolean ok;\n\t\tdo {\n\t\t\tok = true;\n\t\t\tSystem.out.println(\"Money Service HQ\");\n\t\t\tSystem.out.println(\"----------------\");\n\t\t\tSystem.out.println(\"What would you like to do?\");\n\t\t\tSystem.out.println(\"1 - Register a new exchange office\");\n\t\t\tSystem.out.println(\"2 - Get statistics for registered offices\");\n\t\t\tSystem.out.println(\"0 - Exit the HQ application\");\n\n\t\t\tSystem.out.print(\"Enter your choice: \");\n\t\t\tString userChoice = CLIHelper.input.next();\n\n\t\t\ttry {\n\t\t\t\tchoice = Integer.parseInt(userChoice);\n\t\t\t}catch(NumberFormatException e) {\n\t\t\t\tlogger.log(Level.WARNING, \"choice: \" + choice + \" made exception! \" + e);\n\t\t\t\tSystem.out.format(\"Your choice %s is not accepted!\\n\", userChoice);\n\t\t\t\tok = false;\n\t\t\t}\n\t\t}while(!ok);\n\n\t\tlogger.info(\"Exiting HQmenu method <--\");\n\t\treturn choice;\n\t}", "public int getAnswer() {\n return myMinCoins;\n }", "public int getCoinsPickedUp() {\n return coinsPickedUp;\n }", "private void countSelections(){\n\t\tfor(Student student: students){\n\t\t\tArrayList<Character> studentAnswers = student.getAnswers();\n\t\t\tSystem.out.print(\"student: \"+student.toString() + \"\\n\");\n\t\t\tfor(Character answer: studentAnswers){\n\t\t\t\tint timesSelected = selections.get(q.getPossibleAnswers().indexOf(answer));\n\t\t\t\tselections.set(q.getPossibleAnswers().indexOf(answer), timesSelected+1);\n\t\t\t}\n\t\t}\n\t}", "public int getChoiceDepth() {\n return choiceDepth;\n }", "void askForNumber(String spieler,String playerChoices) throws IOException;", "public int getAnswer()\n {\n return answer;\n }", "private static int getN ()\n\t{\n\t int inputInt = 1;\n\t BufferedReader in = new BufferedReader (new InputStreamReader (System.in));\n\t String inStr = new String();\n\n\t try\n\t {\n\t inStr = in.readLine ();\n\t inputInt = Integer.parseInt(inStr);\n\t }\n\t catch (IOException e)\n\t {\n\t System.out.println (\"Could not read input, choosing 1.\");\n\t }\n\t catch (NumberFormatException e)\n\t {\n\t System.out.println (\"Entry must be a number, choosing 1.\");\n\t }\n\n\t return (inputInt);\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "public int getChoice(String prompt) {\n System.out.print(prompt);\n try {\n return Integer.valueOf(scanner.nextLine());\n } catch (Exception e) {\n // if user does not enter a valid integer, -1 is returned to indicate invalid input\n return -1;\n }\n }", "@Override\n\tpublic int getCsclPollsChoicesCount() {\n\t\treturn csclPollsChoicePersistence.countAll();\n\t}", "@Override\r\n\tpublic int selectUserCount() {\n\t\treturn userMapper.selectUserCount();\r\n\t}", "public static int chooseCardFromCollection(Collection collection) {\n System.out.println(\"Please select the pokemons numbers you want. (beetween 1 and \" + collection.getAlCardsCollection().size() + \")\");\n return keyboardChoice.nextInt();\n }", "public int printChoicesForShowtimes() {\n\t\tint i=0;\n\t\tint N = this.getDataLength();\n\t\twhile(i<N) {\n\t\t\tif (this.dataList.get(i).isComingSoon())\n\t\t\t\tbreak;\n\t\t\tSystem.out.println(i+\" : \"+this.dataList.get(i).toString());\n\t\t\t++i;\n\t\t}\n\t\t\n\t\treturn i;\n\t}", "public int getNumberOfSelectedPlayers() {\n\t\treturn tmpTeam.size();\n\t}", "public static int getAutoAnswerItemCount(SIPCommMenu menu)\n {\n int count = 0;\n for(int i = 0; i < menu.getItemCount(); i++)\n {\n if(menu.getItem(i) instanceof AutoAnswerMenuItem)\n count++;\n }\n\n return count;\n }", "private int insertEditMenuAnswer()\n {\n boolean valid = false;\n String choice = \"\";\n Scanner content = new Scanner(System.in);\n \n while (!valid)\n {\n menu.editOptions();\n choice = content.nextLine().trim();\n valid = validation.integerValidation(choice, 1, 4);\n }\n \n int ans = Integer.parseInt(choice);\n \n return ans;\n }", "public int questionOne() {\n RadioButton answerOne = findViewById ( R.id.q1_a1 );\n\n if (answerOne.isChecked ()) {\n score = 1;\n } else score = 0;\n return score;\n }", "public String getChoice(int choiceNum) {\r\n\t\treturn choices[choiceNum].getChoice();\r\n\t}", "public int getNoOfPlayers()\r\n\t{\r\n\t\tString noOfPlayers = JOptionPane.showInputDialog(null, \"Please enter the number of players from 1-6\", \"Number of Players\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t//Check to see if the entry was invalid\r\n\t\twhile(!isNumber(noOfPlayers) || Integer.parseInt(noOfPlayers) < 1 || Integer.parseInt(noOfPlayers) > 6)\r\n\t\t{\r\n\t\t\tif(!isNumber(noOfPlayers))\r\n\t\t\t\tnoOfPlayers = JOptionPane.showInputDialog(null, \"You must enter a NUMBER. Please re-enter the number of players from 1-6\", \"NUMBER of Players\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\telse\r\n\t\t\t\tnoOfPlayers = JOptionPane.showInputDialog(null, \"Please re-enter the number of players from 1-6\", \"Players must be between 1 and 6\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t\t\r\n\t\treturn Integer.parseInt(noOfPlayers);\r\n\t}", "public int SelectCount() {\n return this.StudentDao.SelectCount();\n }", "int getNumber(boolean playerA, String playerChoice) throws IOException;", "private int ManagerChoose() {\n\t\tint input = 0;\n\t\tSystem.out.println(\"1: View All Animals\");\n\t\tSystem.out.println(\"2: View All Zoo Keeper\");\n\t\tSystem.out.println(\"3: Add Zoo Keeper\");\n\t\tSystem.out.println(\"4: Delete Zoo Keeper\");\n\t\tSystem.out.println(\"5: Allocate Zoo Keepers to Ainimals\");\n\t\tSystem.out.println(\"9: Back to Start\");\n\t\tSystem.out.println(\"0: Exit\");\n\t\tinput = intKeyboardInput();\n\t\treturn input;\n\t}", "@Override\n\tpublic Integer getNumberOfPossibleAnswers() {\n\t\treturn null;\n\t}", "int promptNumber();", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public int getCoinsNum();", "public static int getStrategyChoice() {\r\n\t\tint strategy = -1;\r\n\t\tgetStrategyScanner = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Choose the strategy of your opponent:\" +\r\n\t\t\t\t\"\\n\\t(\" + RANDOM + \") - Random player\" +\r\n\t\t\t\t\"\\n\\t(\" + DEFENSIVE + \") - Defensive player\" +\r\n\t\t\t\t\"\\n\\t(\" + SIDES + \") - To-the-Sides player player\");\r\n\t\twhile (strategy != RANDOM & strategy != DEFENSIVE\r\n\t\t\t\t& strategy != SIDES) {\r\n\t\t\tstrategy=getStrategyScanner.nextInt();\r\n\t\t}\r\n\t\treturn strategy;\r\n\t}", "public int getQuestCount() {\n if (questBuilder_ == null) {\n return quest_.size();\n } else {\n return questBuilder_.getCount();\n }\n }", "int getPickupsCount();", "private int getCBAnswers() {\n CheckBox cbAns1 = findViewById(R.id.multiplication);\n CheckBox cbAns2 = findViewById(R.id.subtraction);\n CheckBox cbAns3 = findViewById(R.id.addition);\n CheckBox cbAns4 = findViewById(R.id.division);\n if (cbAns2.isChecked() && cbAns3.isChecked() && cbAns4.isChecked() && !cbAns1.isChecked()) {\n return 1;\n } else {\n return 0;\n }\n }", "public int promptClassSelect()\n\t{\n\t\t\t\t\n\t\tString tempClassSelection = JOptionPane.showInputDialog(\"Please type 1 for first class or 2 for economy: \");\n\t\t\t\n\t\t//handles a cancel\t\n\t\tif(tempClassSelection == null)\n\t\t{\n\t\t\tpromptExit();\n\t\t}\n\t\t\t\t\n\t\tif(!validate(tempClassSelection) || tempClassSelection.isEmpty()) \n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"You have not made a valid entry\");\n\t\t\tstart();\n\t\t}\n\t\t\n\t\tint classSelection = Integer.parseInt(tempClassSelection);\n\t\t\n\t\tif(classSelection != 1 && classSelection != 2)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"You have not made a valid entry\");\n\t\t\tstart();\n\t\t}\n\t\n\t\treturn classSelection;\n\t\t\n\t}", "public java.lang.String getChoice_max() {\n return choice_max;\n }", "public static int readChoice() {\n int input;\n // returns only if a correct value is given.\n do {\n System.out.print(\"Please make your choice: \");\n try { // read the integer, parse it and break.\n input = Integer.parseInt(in.readLine());\n break;\n }catch (Exception e) {\n System.out.println(\"Your input is invalid!\");\n continue;\n }//end try\n }while (true);\n return input;\n }", "public static int inputOptions() {\n\t\tSystem.out.println(PROMPT);\n\t\tint responseNum = -1;\n\t\tin = new Scanner(System.in);\n\t\t// Ensure that response is 0 or 1\n\t\twhile (in.hasNext()) {\n\t\t\tString rawResponse = in.nextLine();\n\t\t\tString response = rawResponse.trim();\n\t\t\tresponseNum = Integer.parseInt(response);\n\t\t\tif (responseNum == 0 || responseNum == 1) {\n\t\t\t\treturn responseNum;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(INVALID_ENTRY_MSG);\n\t\t\t}\n\t\t}\n\t\treturn responseNum;\n\t}", "int getNumberOfServeyQuestions(Survey survey);", "public long getSelectionLimit()\n {\n if (this.selLimitCount == 0L) {\n this.selLimitCount = 1L;\n }\n return this.selLimitCount;\n }", "public java.lang.Object getChoiceValue() {\n return this._choiceValue;\n }", "public int get_howmany() {\n return how_many;\n }" ]
[ "0.71723324", "0.70808685", "0.690683", "0.6801934", "0.6774104", "0.6760965", "0.6702622", "0.6685817", "0.6637095", "0.64218885", "0.63923436", "0.6341609", "0.63263184", "0.6312856", "0.62917554", "0.62663746", "0.6263158", "0.6220553", "0.619559", "0.61361533", "0.6121545", "0.60751265", "0.6072597", "0.6050666", "0.604746", "0.60402906", "0.6034658", "0.60327893", "0.60305285", "0.6026586", "0.60085094", "0.59949505", "0.5974807", "0.5969911", "0.5960197", "0.59571373", "0.5947718", "0.5938982", "0.59322524", "0.59168226", "0.5905115", "0.58746725", "0.5866277", "0.58633596", "0.58524305", "0.5843289", "0.58308643", "0.58207166", "0.5810679", "0.5808613", "0.58065766", "0.5805806", "0.5805806", "0.5805806", "0.5804462", "0.5798934", "0.57802624", "0.57778203", "0.57761675", "0.5760545", "0.5756779", "0.5751882", "0.5740652", "0.5739488", "0.57362854", "0.57275057", "0.57039183", "0.57032955", "0.57000816", "0.56976223", "0.5691128", "0.5681204", "0.56790084", "0.56720656", "0.5671234", "0.5670359", "0.5668443", "0.5664647", "0.5662757", "0.5657465", "0.5649564", "0.56268984", "0.56259984", "0.5623021", "0.56109023", "0.5602778", "0.5598425", "0.5597987", "0.5595648", "0.55951464", "0.55931425", "0.55921364", "0.558821", "0.5584252", "0.5575586", "0.55603206", "0.5544415", "0.5538391", "0.55361867", "0.5535497" ]
0.74427855
0
12:48:42 934 main:1>call 1 2 12:48:42 935 main:1>call 3 3 12:48:42 935 main:1>call 6 4 12:48:42 935 main:1>call 10 5 12:48:42 936 main:1>call 15 6 12:48:42 936 main:1>call 21 7 12:48:42 936 main:1>call 28 8 12:48:42 936 main:1>call 36 9 12:48:42 937 main:1>call 45 10 12:48:42 938 main:1>onNext 55 12:48:42 938 main:1>onCompleted
public static void reduceDemo() { Observable.range(1, 10).reduce(new Func2<Integer, Integer, Integer>() { @Override public Integer call(Integer integer, Integer integer2) { RxDemo.log(RxDemo.getMethodName() + " " + integer + " " + integer2); return integer + integer2; } }).subscribe(new RxCreateOperator.Sub()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args){\n Observable myObservable = Observable.create(new Observable.OnSubscribe(){\n\n @Override\n public void call(Object subscriber) {\n Subscriber mySubscriber = (Subscriber)subscriber;\n\n for(int i = 0 ; i < 10; i++){\n //if my subscriber was subscribed\n if(!mySubscriber.isUnsubscribed()){\n mySubscriber.onNext(\"Pushed value \" + i);\n }\n }\n\n if(!mySubscriber.isUnsubscribed()){\n mySubscriber.onCompleted();\n }\n\n }\n });\n\n //subscribe to your Observable\n myObservable.subscribe(new Action1<String>() {\n @Override\n public void call(String s) {\n System.out.println(s);\n }\n },\n new Action1<Throwable>() {\n @Override\n public void call(Throwable throwable) {\n System.out.println(\"Something went wrong the observable\");\n }\n },\n new Action0() {\n @Override\n public void call() {\n System.out.println(\"No more values will be pushed.\");\n }\n });\n\n }", "@Override\n public void subscribe(ObservableEmitter<Integer> e) throws Exception {\n\n e.onNext(1);\n SystemClock.sleep(1000);\n e.onNext(2);\n SystemClock.sleep(1000);\n e.onNext(3);\n SystemClock.sleep(1000);\n e.onNext(4);\n\n //Once the Observable has emitted all items in the sequence, call onComplete//\n e.onComplete();\n //e.onError(new Throwable(\"Some Error!!\"));\n }", "public static void test013()\r\n {\r\n System.out.println(\"RxJavaTest04::test013\");\r\n log(\"Starting\");\r\n final Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n\r\n obs\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '1')\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '2')\r\n .subscribeOn(schedulerA)\r\n .doOnNext(RxJavaTest04::log)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n poolA.shutdown();\r\n }", "private void test() {\n Observable<String> observable = Observable.create(new ObservableOnSubscribe<String>() {\n\n @Override\n public void subscribe(ObservableEmitter<String> e) throws Exception {\n e.onNext(\"hello\");\n e.onNext(\"RXJAVA\");\n e.onComplete();\n }\n }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());\n\n Observer<String> observer = new Observer<String>() {\n @Override\n public void onSubscribe(Disposable d) {\n Log.d(TAG, \"onSubscribe\");\n }\n\n @Override\n public void onNext(String s) {\n Log.d(TAG, \"onNext:\" + s);\n }\n\n @Override\n public void onError(Throwable e) {\n Log.d(TAG, \"onError\");\n }\n\n @Override\n public void onComplete() {\n Log.d(TAG, \"onComplete\");\n }\n };\n observable.subscribe(observer);\n }", "public abstract void onNext();", "public static void scan() {\n Observable.range(1, 10)\n .scan((previous, current) -> {\n System.out.println(\"previous = \" + previous);\n System.out.println(\"current = \" + current);\n return previous + current;\n }).subscribe(new MyObserver<>());\n }", "@Override\n\t\tpublic void onNext(String t) {\n\t\t\tSystem.out.println(\"Observer : \"+ t);\n\t\t}", "public void onNext(T r10) {\n /*\n r9 = this;\n r1 = 0;\n r8 = 1;\n r0 = r9.terminated;\n if (r0 == 0) goto L_0x0007;\n L_0x0006:\n return;\n L_0x0007:\n monitor-enter(r9);\n r0 = r9.terminated;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x0011;\n L_0x000c:\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x000e:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n throw r0;\n L_0x0011:\n r0 = r9.emitting;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x002b;\n L_0x0015:\n r0 = r9.queue;\t Catch:{ all -> 0x000e }\n if (r0 != 0) goto L_0x0020;\n L_0x0019:\n r0 = new rx.observers.SerializedObserver$FastList;\t Catch:{ all -> 0x000e }\n r0.<init>();\t Catch:{ all -> 0x000e }\n r9.queue = r0;\t Catch:{ all -> 0x000e }\n L_0x0020:\n r1 = r9.nl;\t Catch:{ all -> 0x000e }\n r1 = r1.next(r10);\t Catch:{ all -> 0x000e }\n r0.add(r1);\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x002b:\n r0 = 1;\n r9.emitting = r0;\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n r0 = r9.actual;\t Catch:{ Throwable -> 0x0046 }\n r0.onNext(r10);\t Catch:{ Throwable -> 0x0046 }\n L_0x0034:\n r2 = r1;\n L_0x0035:\n r0 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n if (r2 >= r0) goto L_0x0034;\n L_0x0039:\n monitor-enter(r9);\n r0 = r9.queue;\t Catch:{ all -> 0x0043 }\n if (r0 != 0) goto L_0x004f;\n L_0x003e:\n r0 = 0;\n r9.emitting = r0;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n goto L_0x0006;\n L_0x0043:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n throw r0;\n L_0x0046:\n r0 = move-exception;\n r9.terminated = r8;\n r1 = r9.actual;\n rx.exceptions.Exceptions.throwOrReport(r0, r1, r10);\n goto L_0x0006;\n L_0x004f:\n r3 = 0;\n r9.queue = r3;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n r3 = r0.array;\n r4 = r3.length;\n r0 = r1;\n L_0x0057:\n if (r0 >= r4) goto L_0x007e;\n L_0x0059:\n r5 = r3[r0];\n if (r5 == 0) goto L_0x007e;\n L_0x005d:\n r6 = r9.nl;\t Catch:{ Throwable -> 0x006b }\n r7 = r9.actual;\t Catch:{ Throwable -> 0x006b }\n r5 = r6.accept(r7, r5);\t Catch:{ Throwable -> 0x006b }\n if (r5 == 0) goto L_0x007b;\n L_0x0067:\n r0 = 1;\n r9.terminated = r0;\t Catch:{ Throwable -> 0x006b }\n goto L_0x0006;\n L_0x006b:\n r0 = move-exception;\n r9.terminated = r8;\n rx.exceptions.Exceptions.throwIfFatal(r0);\n r1 = r9.actual;\n r0 = rx.exceptions.OnErrorThrowable.addValueAsLastCause(r0, r10);\n r1.onError(r0);\n goto L_0x0006;\n L_0x007b:\n r0 = r0 + 1;\n goto L_0x0057;\n L_0x007e:\n r0 = r2 + 1;\n r2 = r0;\n goto L_0x0035;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.observers.SerializedObserver.onNext(java.lang.Object):void\");\n }", "private static void scenario() {\n\n Observable<String> stringObservable = Observable.just(\"One\",\"Two\",\"Three\",\"Four\",\"Five\",\"Six\",\"Seven\",\"Eight\",\"Nine\");\n\n Observable<String> stringProcessor = stringObservable.concatMap(data -> Observable.just(data).delay(randomSleepTime(),\n TimeUnit.MILLISECONDS));\n\n stringProcessor.subscribe(System.out::println);\n\n sleep(20000);\n\n /* OUTPUT :\n One\n Two\n Three\n Four\n Five\n Six\n Seven\n Eight\n Nine\n */\n }", "@Override\r\n public Subscription onSubscribe(final Observer<? super String> observer) {\n final Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n for (int i = 0; i < 75; i++) {\r\n observer.onNext(\"anotherValue_\" + i);\r\n }\r\n // After sending all values we complete the sequence\r\n observer.onCompleted();\r\n }\r\n });\r\n t.start();\r\n \r\n return new Subscription() {\r\n @Override\r\n public void unsubscribe() {\r\n // Ask the thread to stop doing work.\r\n // For this simple example it just interrupts.\r\n t.interrupt();\r\n }\r\n };\r\n }", "public static void test018()\r\n {\r\n System.out.println(\"RxJavaTest04::test018\");\r\n log(\"Starting\");\r\n final Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n ExecutorService poolB = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-B-%d\"));\r\n Scheduler schedulerB = Schedulers.from(poolB);\r\n\r\n obs\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '1')\r\n .observeOn(schedulerB)\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '2')\r\n .doOnNext(RxJavaTest04::log)\r\n .subscribeOn(schedulerA)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n myWait(2000);\r\n poolA.shutdown();\r\n poolB.shutdown();\r\n }", "@Test\n public void shouldEmitEvents() {\n Observable.just('A', 'B', 'C')\n .subscribeOn(scheduler)\n .subscribe(subscriber);\n\n scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);\n subscriber.assertCompleted();\n subscriber.assertValueCount(3);\n subscriber.assertValues('A', 'B', 'C');\n\n TimeDelayer.sleepForOneSecond();\n }", "public static void main(String[] args) throws Exception {\n\t\tFlowable<String> obs4 = Flowable.just(\"un\", \"deux\", \"trois\", \"quatre\", \"sank\", \"six\", \"sept\", \"huit\", \"neuf\", \"deese\");\n//\t\tobs4.map(mapper -> {\n//\t\t\tif (\"deux\".equals(mapper))\n//\t\t\t\tThread.sleep(2000);\n//\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t})\t\n//\t\t.subscribe(System.out::println);\n\t\t\n\t\tObserver<String> observer1 = new Observer<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"Completed...\");\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\targ0.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onSubscribe(Disposable arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"on next -- \"+arg0);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\t\tList<String> list1 = Arrays.asList(\"un\",\"deux\",\"trois\",\"quatre\",\"sank\");\n\t\t\n\t\tObservable obs5 = Observable.fromIterable(list1);\n\t\t\n\t\t//obs5.subscribe(observer1);\n\t\t\n\t\t//Flowable.range(3, 10).subscribe(System.out::println);\n\t\t\n\t\tnew Thread(\n\t\t()->{\n\t\t\tobs4\n\t\t\t.map(mapper ->{\n\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n\t\t\t\t\tThread.sleep(2000);\n\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n\t\t\t})\n\t\t\t.subscribe(System.out::println);\n\t\t\t\n\t\t}).start();\n\t\t\n//\t\tnew Thread() {\n//\t\t\tpublic void run() {\n//\t\t\t\tobs4\n//\t\t\t\t\t.map(mapper ->{\n//\t\t\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n//\t\t\t\t\t\t\tThread.sleep(2000);\n//\t\t\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t\t\t\t})\n//\t\t\t\t\t.subscribe(System.out::println);\n//\t\t\t}\n//\t\t}.start();\n\t\t\n//\t\tExecutor exe = Executors.newCachedThreadPool();\n//\t\t\n//\t\texe.execute(()->{\n//\t\t\t\n//\t\t\tobs4\n//\t\t\t.map(mapper ->{\n//\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n//\t\t\t\t\tThread.sleep(2000);\n//\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t\t})\n//\t\t\t.subscribe(System.out::println);\n\t\t\t\n//\t\t\tobs4.subscribe();\n//\t\t\tFlowable.zip(obs4, Flowable.interval(2, TimeUnit.SECONDS),(k,v)->k)\n//\t\t\t.subscribe((data)->{\n//\t\t\t\tSystem.out.println(\" \"+data+\" -- \"+Thread.currentThread().getName());\n//\t\t\t});\n//\t\t\tFlowable.interval(1, TimeUnit.SECONDS)\n//\t\t\t.map(mapper -> {\n//\t\t\t\tif (mapper == 3)\n//\t\t\t\t\tthrow new Exception(\" Time is Over !!! \");\n//\t\t\t\treturn mapper;\n//\t\t\t})\n//\t\t\t.subscribe((data)->{\n//\t\t\t\tSystem.out.println(data +\" -- \"+Thread.currentThread().getName());\n//\t\t\t},(e)->{\n//\t\t\t\te.printStackTrace();\n//\t\t\t});\n\t\t\t\n\t\t//});\n\t\t\n//\t\t//Thread.sleep(5000);\t\n//\t\tFlowable<String> flw1 = Flowable.just(\"un\",\"deux\",\"trois\",\"quatre\",\"sank\",\"six\",\"sept\");\n//\t\tflw1\n//\t\t//.subscribeOn(Schedulers.from(Executors.newFixedThreadPool(4)))\n//\t\t.map(mapper ->{\n//\t\t\tif (\"deux\".equals(mapper))\n//\t\t\t\tThread.sleep(1000);\n//\t\t\tif (\"quatre\".equals(mapper))\n//\t\t\t\tThread.sleep(500);\n//\t\t\treturn mapper +\" -- \"+Thread.currentThread().getName();\n//\t\t})\n//\t\t.subscribe(System.out::println);\n//\t\t\n//\t\tThread.sleep(2000);\n\t}", "@Override\n\t\t\t\t\tpublic void onNext(Object p1) {\n\t\t\t\t\t}", "@Test\n public void async_2() throws InterruptedException {\n Func1<Integer, Observable<String>> wsKald = param -> Observable.<String>create(s -> {\n s.onStart();\n s.onNext(\"called with \" + param);\n s.onCompleted();\n }).subscribeOn(Schedulers.io());\n\n Func1<Long, Observable<Integer>> multi = param -> Observable.<Integer>create(s -> {\n s.onStart();\n IntStream.range(1, param.intValue()).forEach(s::onNext);\n s.onCompleted();\n }).subscribeOn(Schedulers.io());\n\n // asynkron tæller, hvert ½ sekund\n Observable<Long> ticker = Observable.interval(500, TimeUnit.MILLISECONDS);\n\n ticker.take(10)\n .flatMap(multi)\n .flatMap(wsKald)\n .toBlocking()\n .subscribe(log::info);\n }", "@Override\n public void onNext(Void aVoid) {\n }", "public static void test010()\r\n {\r\n System.out.println(\"RxJavaTest04::test010\");\r\n Observable<String> txtMessages =\r\n myObserve();\r\n Disposable disposable = txtMessages\r\n .subscribe(System.out::println);\r\n \r\n myWait(5000);\r\n disposable.dispose();\r\n myWait(2000);\r\n }", "public static void main(String... args) {\n\n\t\tObservable<String[]> testObs = Observable.create(new Observable.OnSubscribe<String[]>() {\n\t\t\tpublic void call(Subscriber<? super String[]> sub) {\n\t\t\t\tString[] aString = new String[] { \"aaa\", \"bbb\", \"ccc\" };\n\t\t\t\tsub.onNext(aString);\n\t\t\t\tsub.onCompleted();\n\t\t\t}\n\t\t});\n\t\tObservable<String> testOb = Observable.just(\"abc just\");\n\t\t Subscriber<String> mySub = new Subscriber<String>(){\n\t\t public void onNext(String s){\n\t\t System.out.println(\"Test finish : \" + s);\n\t\t }\n\t\t\n\t\t public void onCompleted() {\n\t\t // TODO Auto-generated method stub\n\t\t\n\t\t }\n\t\t\n\t\t public void onError(Throwable arg0) {\n\t\t // TODO Auto-generated method stub\n\t\t\n\t\t }\n\t\t };\n\n\t\ttestObs.subscribe(s -> System.out.println(\"lambda : \" + s[0]));\n\t\tString[] bString = new String[] { \"aa\", \"bb\", \"cc\" };\n\t\tint i = 0;\n\t\tfor (String s : bString) {\n\t\t\ti++;\n\t\t\tSystem.out.println(\"Loop \" + Integer.toString(i) + \" \" + s);\n\t\t}\n\n\t\toperaterTest();\n\t\toperaterTestStringToHash();\n\n\t\tRunnable r = () -> System.out.println(\"test runnable lambda\");\n\t\tr.run();\n\n\t\tComparator<String> c = (a, b) -> a.compareTo(b);\n\t\tSystem.out.println(Integer.toString(c.compare(\"AAA\", \"AAA\")));\n\n\t\tHello h = new Hello();\n\t\th.r.run();\n\t\th.r2.run();\n\n\t\tString message = \"Test effective final\";\n\n\t\tRunnable r3 = () -> System.out.println(message);\n\n\t\tr3.run();\n\n\t\tStringBuilder messageB = new StringBuilder(\"aa\");\n\t\tmessageB.append(\"aa\");\n\t\tRunnable r4 = () -> System.out.println(messageB);\n\t\tr4.run();\n\t\tmessageB.append(\"AA\");\n\n\t\tPerson[] people = new Person[] { new Person(\"ted\", \"new\", 41), new Person(\"wayne\", \"wang\", 18),\n\t\t\t\tnew Person(\"adm\", \"zcho\", 22) };\n\t\tArrays.sort(people, Person.compareFirstName);\n\t\tArrays.sort(people, Person::compareLastName);\n\t\tfor( Person p : people)\n\t\t\tSystem.out.println(p);\n\t\t\n\t\tNamedCache<Long,String> cache = CacheFactory.getCache(\"st\");\n\t\tcache.put(3L, \"3\");\n\t\tcache.put(2L, \"2\");\n\t\tcache.put(1L, \"1\");\n\t\tcache.put(4L, \"4\");\n\t\tcache.put(5L, \"5\");\n\t\tRxNamedCache<Long,String> rxcache = RxNamedCache.rx(cache);\n//\t\trxcache.values().buffer(2).subscribe(productList -> System.out.println(\"List :\" + productList));\n\t\trxcache.values().subscribe(product -> System.out.println(\"rxCache : \" + product));\n\t\t\n\t\tObservableMapListener<Long,String> listener = ObservableMapListener.create();\n\t\tlistener.filter(evt -> evt.getId() == MapEvent.ENTRY_INSERTED).map(MapEvent::getNewValue)\n\t\t.subscribe(new Subscriber<String>(){\n\t\t\tpublic void onNext(String s){\n\t\t\t\tSystem.out.println(\"xxx\" + s);\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onCompleted() {\n\t\t\t\tSystem.out.println(\"completed\");\n\t\t\t\t\n\t\t\t}\n\t\t\tpublic void onError(Throwable e){\n\t\t\t\tSystem.out.println(\"aaaaahhhh\");\n\t\t\t}\n\t\t\t\n\t\t});\n//\t\tlistener.filter(evt -> evt.getId() == MapEvent.ENTRY_INSERTED).map(MapEvent::getNewValue).buffer(2,TimeUnit.SECONDS)\n//\t\t.subscribe(ppp -> System.out.println(\"Trades placed in the last 10 seconds: \" + ppp));\n\t\tcache.addMapListener(listener);\n\t\tcache.remove(3L);\n\t\t\n\t\tcache.put(6L, \"test6\");\n\t\tcache.put(7L, \"test7\");\n\t\ttry {\n\t\t\tThread.sleep(200);\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}", "public static void test011()\r\n {\r\n System.out.println(\"RxJavaTest04::test011\");\r\n Scheduler scheduler = Schedulers.trampoline();\r\n Scheduler.Worker worker = scheduler.createWorker();\r\n \r\n log(\"Main start\");\r\n Disposable disposable;\r\n disposable = worker.schedule(() -> {\r\n log(\" Outer start\");\r\n sleepOneSecond();\r\n worker.schedule(() -> {\r\n log(\" Inner start\");\r\n sleepOneSecond();\r\n log(\" Inner end\");\r\n });\r\n log(\" Outer end\");\r\n });\r\n log(\"Main end\");\r\n disposable.dispose();\r\n }", "@Test\r\n\tpublic void exerciseMovingAverage() {\n\t\tList<Integer> temparaturArray = Arrays.asList(8, 7, 6, 6, 7, 7, 8, 10, 13, 16, 10, 20, 23, 26, 30, 29, 27, 45, 24, 23, 20, 18, 15, 11);\r\n\t\tObservable<Integer> temparaturSequence = Observable\r\n\t\t\t\t.interval(0, 1L, TimeUnit.HOURS, testScheduler)\r\n\t\t\t\t.take(temparaturArray.size())\r\n\t\t\t\t.map(i -> temparaturArray.get(i.intValue()));\r\n\t\t\r\n\t\t// TODO: calculate the moving average (SMA) of the given temperature sequence (each hour of a single day).\r\n\t\t// use the previous three values for each data point.\r\n // HINT: use a suitable overload of the same method used in \"Batching\"\r\n // and then calculate the average of each batch using LINQ\r\n // HINT: don't forget to pass the scheduler\r\n\t\tObservable<Double> movingAverage = Observable.empty();\r\n\r\n\t\t// verify\r\n\t\tTestSubscriber<Double> testSubscriber = new TestSubscriber<>();\r\n\t\tmovingAverage.subscribe(testSubscriber);\r\n\r\n\t\t// let the time elapse until completion\r\n\t\ttestScheduler.advanceTimeBy(1, TimeUnit.DAYS);\r\n\t\t\r\n\t\tlog(testSubscriber.getOnNextEvents());\r\n\t\t\r\n\t\ttestSubscriber.assertNoErrors();\r\n\t\ttestSubscriber.assertCompleted();\r\n\t\t\r\n\t\t// expected values:\r\n\t\tList<Double> expected = Arrays.asList(\r\n\t\t\t\t7.0, 6.333333333333333, 6.333333333333333, 6.666666666666667, 7.333333333333333, \r\n\t\t\t\t8.333333333333334, 10.333333333333334, 13.0, 13.0, 15.333333333333334, \r\n\t\t\t\t17.666666666666668, 23.0, 26.333333333333332, 28.333333333333332, \r\n\t\t\t\t28.666666666666668, 33.666666666666664, 32.0, 30.666666666666668, \r\n\t\t\t\t22.333333333333332, 20.333333333333332, 17.666666666666668, 14.666666666666666, \r\n\t\t\t\t// the last two values have limited input, i.e.\r\n\t\t\t\t// (15+11)/2 and (11)/1\r\n\t\t\t\t13.0, 11.0);\r\n\t\ttestSubscriber.assertReceivedOnNext(expected);\r\n\t\t\r\n\t}", "public void scan(){\r\n\t\tObservable<Integer> range = Observable.range(1,5);\r\n\t\trange.scan((t1,t2)->t1+t2).subscribe(t->System.out.println(\"scan \"+t));\r\n\t}", "@Test\r\n\tpublic void exerciseInterruptible() {\n\t\t\r\n\t\tList<String> articlesTopicA = Arrays.asList(\"Article A-1\",\"Article A-2\",\"Article A-3\");\r\n\t\tList<String> articlesTopicB = Arrays.asList(\"Article B-1\",\"Article B-2\",\"Article B-3\");\r\n\t\tList<String> articlesTopicC = Arrays.asList(\"Article C-1\",\"Article C-2\",\"Article C-3\");\r\n\t\t\r\n\t\tList<Observable<String>> topicObservables = Arrays.asList(\r\n\t\t\t\tObservable.interval(0, 80L, TimeUnit.MILLISECONDS, testScheduler)\r\n\t\t\t\t.take(3)\r\n\t\t\t\t.map(i -> articlesTopicA.get(i.intValue())),\r\n\t\t\t\tObservable.interval(50, 60L, TimeUnit.MILLISECONDS, testScheduler)\r\n\t\t\t\t.take(3)\r\n\t\t\t\t.map(i -> articlesTopicB.get(i.intValue())),\r\n\t\t\t\tObservable.interval(0, 40L, TimeUnit.MILLISECONDS, testScheduler)\r\n\t\t\t\t.take(3)\r\n\t\t\t\t.map(i -> articlesTopicC.get(i.intValue())));\r\n\t\t\r\n\t\tObservable<Observable<String>> topics = Observable.interval(0, 100L, TimeUnit.MILLISECONDS, testScheduler)\r\n\t\t\t\t.take(3)\r\n\t\t\t\t.map(i -> topicObservables.get(i.intValue()));\r\n\t\t\r\n\t\t//\t\t t[ms]: 0 100 200 300\r\n\t\t//\t\ttopics: A---------B---------C---------| \r\n\t\t//\t\t A: 1-------2-|-----3---|---------|\r\n\t\t//\t\t B: |---------|----1----|2-----3--|\r\n\t\t//\t\t C: |---------|---------1---2---3-|\r\n\t\t//\t\tResult: A-1 A-2 B-1 C-1 C-2 C-3\r\n\t\t\t\t\r\n\t\t// TODO: always switch to the latest topic\r\n\t\t// HINT: http://reactivex.io/documentation/operators/switch.html\r\n\t\tObservable<String> latestInteresting = Observable.empty();\r\n\r\n\t\t// verify\r\n\t\tTestSubscriber<String> testSubscriber = new TestSubscriber<>();\r\n\t\tlatestInteresting\r\n\t\t\t.doOnNext(article -> log(String.format(\" doOnNext(): %s Time: %d\", article, testScheduler.now())))\r\n\t\t\t.subscribe(testSubscriber);\r\n\t\t\r\n\t\t// let the time elapse until completion\r\n\t\ttestScheduler.advanceTimeBy(300, TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\ttestSubscriber.assertCompleted();\r\n\t\ttestSubscriber.assertNoErrors();\r\n\t\tList<String> expectedArticles = Arrays.asList(\r\n\t\t\t\t\"Article A-1\",\"Article A-2\", \r\n\t\t\t\t\"Article B-1\", \r\n\t\t\t\t\"Article C-1\", \"Article C-2\", \"Article C-3\");\r\n\t\ttestSubscriber.assertReceivedOnNext(expectedArticles);\r\n\t\t\r\n\t}", "public static void switchOnNext(CountDownLatch latch) {\n\n List<Observable<Long>> collectionOfObservable = new ArrayList<>();\n\n Observable<Long> first = Observable.interval(1L, TimeUnit.SECONDS).take(5)\n .doOnNext((item) -> System.out.println(\"first doOnNext item = \" + item));\n\n Observable<Long> second = Observable.interval(1L, TimeUnit.SECONDS)\n .map(item -> item + 100).take(10);\n\n collectionOfObservable.add(first);\n collectionOfObservable.add(second);\n\n Observable.switchOnNext(Observable.fromIterable(collectionOfObservable))\n .subscribeOn(Schedulers.io()).subscribe(new MyObserver<>(latch));\n }", "public static void test012()\r\n {\r\n System.out.println(\"RxJavaTest04::test012\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n log(\"Starting\");\r\n Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n obs\r\n .subscribeOn(schedulerA)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n log(\"After subscribe\");\r\n myWait(2000);\r\n log(\"Shutting down\");\r\n poolA.shutdown();\r\n }", "@Override\n public void onFailure(Call call, IOException e) {\n emitter.onNext(e+\"\");\n }", "public static void main(String[] args) {\n doOnEachObserver().subscribe(i -> {\n System.out.println(\"do: \" + i);\n });\n\n doOnErrorObserver().subscribe(new Subscriber<Integer>() {\n @Override\n public void onCompleted() {\n System.out.println(\"onCompleted\");\n }\n\n @Override\n public void onError(Throwable e) {\n System.out.println(\"onError: \" + e.getMessage());\n }\n\n @Override\n public void onNext(Integer integer) {\n System.out.println(\"subscriber onNext: \" + integer);\n }\n });\n }", "public static void main(String[] args) {\n\t\tObservable<String> mObservable = Observable.create(new Observable.OnSubscribe<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(Subscriber<? super String> subscriber) {\n\t\t\t\tsubscriber.onNext(\"hello world\");\n\t\t\t\tsubscriber.onCompleted();\n\t\t\t}\n\t\t}) ;\n\n\t\tSubscriber<String> mSubscriber = new Subscriber<String>() {\n\t\t\t@Override\n\t\t\tpublic void onCompleted() {}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable e) {}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String s) {System.out.println(s);}\n\t\t} ;\n\n\t\tmObservable.subscribe(mSubscriber);\n\t\t//1.2 abbreviate\n\t\t// TODO: 7/2/15 myObservable.subscribe(onNextAction, onErrorAction, onCompleteAction);\n\t\tObservable<String> mObservable2 = Observable.just(\"Hello RxJava\") ;\n\t\tAction1<String> onNextAction = new Action1<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(String s) {\n\t\t\t\tSystem.out.println(s) ;\n\t\t\t}\n\t\t} ;\n\t\tmObservable2.subscribe(onNextAction);\n\t\t//1.3 simpler code\n\t\tObservable.just(\"simpler code\").subscribe(new Action1<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(String s) {\n\t\t\t\tSystem.out.println(s) ;\n\t\t\t}\n\t\t});\n\t\t//1.4. Java8 lambda\n\t\tObservable.just(\"Hello Rx and lambda\").subscribe(s -> System.out.println(s)) ;\n\t\t//2. transformation\n\t\tObservable.just(\"Hello trans\").subscribe(s -> System.out.println(s+\"formation\")) ;\n\t\t//2.1 map()\n\t\tObservable.just(\"Hello trans\").map(new Func1<String, String>() {\n\t\t\t@Override\n\t\t\tpublic String call(String s) {\n\t\t\t\treturn s+\"formation\";\n\t\t\t}\n\t\t}).subscribe(s -> System.out.println(s));\n//\t\t}).subscribe(System.out::println);\n\t\t//2.2 trans + lambda\n\t\tObservable.just(\"Hello trans\").map(s -> s+\"fromation\").subscribe(s -> System.out.println(s));\n\t\t//or\n\t\tObservable.just(\"Hello trans\").map(s -> s+\"fromation\").subscribe(System.out::println);\n\t\t//2.3 trans String to Integer\n\t\tObservable.just(\"Hello trans!\").map(new Func1<String, Integer>() {\n\t\t\t@Override\n\t\t\tpublic Integer call(String s) {\n\t\t\t\treturn s.hashCode();\n\t\t\t}\n\t\t}).subscribe(i-> System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(s -> s.hashCode())\n\t\t\t\t.subscribe(i -> System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(String::hashCode)\n\t\t\t\t.subscribe(i->System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(String::hashCode).map(i->Integer.toString(i))\n\t\t\t\t.subscribe(System.out::println);\n\t}", "public static void test017()\r\n {\r\n System.out.println(\"RxJavaTest04::test017\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries store = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .just(\"bread\", \"butter\", \"egg\", \"milk\", \"tomato\",\r\n \"cheese\", \"tomato\", \"egg\", \"egg\")\r\n .groupBy(prod -> prod)\r\n .flatMapSingle(grouped -> grouped\r\n .count()\r\n .map(quantity -> {\r\n String productName = grouped.getKey();\r\n return Pair.of(productName, quantity);\r\n })\r\n )\r\n .flatMap(order -> store\r\n .purchase(order.getLeft(), (int)order.getRight().longValue())\r\n .subscribeOn(schedulerA)\r\n )\r\n .reduce(BigDecimal::add);\r\n\r\n totalPrice\r\n .subscribe(System.out::println);\r\n myWait(2000);\r\n poolA.shutdown();\r\n }", "public static void test015()\r\n {\r\n System.out.println(\"RxJavaTest04::test015\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries rxGroceries = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .fromIterable(Arrays.asList(\"bread\", \"butter\", \"milk\", \"tomato\", \"cheese\"))\r\n .subscribeOn(schedulerA)\r\n .flatMap(prod -> rxGroceries.purchase(prod, 1))\r\n .reduce(BigDecimal::add);\r\n totalPrice\r\n .subscribe(System.out::println);\r\n poolA.shutdown();\r\n }", "public static void test001()\r\n {\r\n System.out.println(\"RxJavaTest04::test001\");\r\n Observable<String> peopleStream = myListPeople();\r\n Single<List<String>> peopleList = peopleStream.toList();\r\n List<String> people = peopleList.blockingGet();\r\n for (String person : people) {\r\n System.out.println(person);\r\n }\r\n }", "public static void combineLatest() {\n\n System.out.println(\"# 1\");\n\n /*\n Emits item every second\n */\n Observable sourceInterval = Observable.interval(1L, TimeUnit.MILLISECONDS).take(10);\n\n /*\n Emits string items\n */\n Observable sourceString = Observable.fromIterable(sData);\n\n Observable<?> combined = Observable.combineLatest((objects) -> {\n StringBuilder stringBuilder = new StringBuilder();\n Stream.of(objects).forEach(stringBuilder::append);\n return stringBuilder.toString();\n }, 1, sourceInterval, sourceString);\n\n combined.subscribe(new MyObserver<>());\n\n System.out.println(\"# 2\");\n\n /*\n Because empty observable immediately terminates hence whole sequence terminates.\n */\n combined = Observable.combineLatest((objects) -> {\n StringBuilder stringBuilder = new StringBuilder();\n Stream.of(objects).forEach(stringBuilder::append);\n return stringBuilder.toString();\n }, 1, sourceInterval, sourceString, Observable.empty());\n combined.subscribe(new MyObserver<>());\n\n System.out.println(\"# 3\");\n /*\n Same as above but instead collection of sources are used.\n */\n List<Observable<?>> collection = new ArrayList<>();\n collection.add(sourceInterval);\n collection.add(sourceString.repeat(1));\n combined = Observable.combineLatest(collection, (objects) -> {\n StringBuilder stringBuilder = new StringBuilder();\n Stream.of(objects).forEach(stringBuilder::append);\n return stringBuilder.toString();\n });\n combined.subscribe(new MyObserver<>());\n\n System.out.println(\"# 4\");\n /*\n Explicitly combine 2 sources, similarly it can be done up to 10 sources\n */\n combined = Observable.combineLatest(sourceInterval, sourceString.repeat(1),\n (first, second) -> first + \"-\" + second);\n combined.subscribe(new MyObserver<>());\n }", "private void test1() {\n Observable observable = Observable.create(new ObservableOnSubscribe<QuoteBean>() {\n @Override\n public void subscribe(ObservableEmitter<QuoteBean> e) throws Exception {\n e.onNext(Request.stringRequest(url, com.android.volley.Request.Method.GET, HomeActivity.class.getSimpleName()));\n }\n }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());\n\n Observer<QuoteBean> observer = new Observer<QuoteBean>() {\n @Override\n public void onSubscribe(Disposable d) {\n Log.d(TAG, \"test1 onSubscribe\");\n }\n\n @Override\n public void onNext(QuoteBean s) {\n Log.d(TAG, \"onNext:\" + s.toString());\n }\n\n @Override\n public void onError(Throwable e) {\n Log.d(TAG, \"onError\");\n }\n\n @Override\n public void onComplete() {\n Log.d(TAG, \"onComplete\");\n }\n };\n observable.subscribe(observer);\n }", "public static void sample() {\n System.out.println(\"# 1\");\n Observable.fromIterable(sData)\n .timestamp()\n .sample(1000, TimeUnit.MICROSECONDS)\n .subscribe(new MyObserver<>());\n\n /*\n Emission controlled by sampler inner observable\n */\n System.out.println(\"# 2\");\n Observable.fromIterable(sData)\n .sample((observer) -> {\n System.out.println(\"emitter\");\n Observable.just(\"123\").subscribe(observer);\n }, true).subscribe(new MyObserver<>());\n }", "public void subscribe(p019io.reactivex.Observer<? super T> r6) {\n /*\n r5 = this;\n L_0x0000:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r0 = r5.curr\n java.lang.Object r0 = r0.get()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r0 = (p019io.reactivex.internal.operators.observable.ObservableReplay.ReplayObserver) r0\n if (r0 != 0) goto L_0x0020\n io.reactivex.internal.operators.observable.ObservableReplay$BufferSupplier<T> r1 = r5.bufferFactory\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer r1 = r1.call()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r2 = new io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver\n r2.<init>(r1)\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r3 = r5.curr\n r4 = 0\n boolean r3 = r3.compareAndSet(r4, r2)\n if (r3 != 0) goto L_0x001f\n goto L_0x0000\n L_0x001f:\n r0 = r2\n L_0x0020:\n io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable r1 = new io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable\n r1.<init>(r0, r6)\n r6.onSubscribe(r1)\n r0.add(r1)\n boolean r2 = r1.isDisposed()\n if (r2 == 0) goto L_0x0035\n r0.remove(r1)\n return\n L_0x0035:\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer<T> r2 = r0.buffer\n r2.replay(r1)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p019io.reactivex.internal.operators.observable.ObservableReplay.ReplaySource.subscribe(io.reactivex.Observer):void\");\n }", "public static void test019()\r\n {\r\n System.out.println(\"RxJavaTest04::test019\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n ExecutorService poolB = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-B-%d\"));\r\n Scheduler schedulerB = Schedulers.from(poolB);\r\n ExecutorService poolC = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-C-%d\"));\r\n Scheduler schedulerC = Schedulers.from(poolC);\r\n\r\n log(\"Starting\");\r\n Observable<String> obs = Observable.create(subscriber -> {\r\n log(\"Subscribed\");\r\n subscriber.onNext(\"A\");\r\n subscriber.onNext(\"B\");\r\n subscriber.onNext(\"C\");\r\n subscriber.onNext(\"D\");\r\n subscriber.onComplete();\r\n });\r\n log(\"Created\");\r\n obs\r\n .subscribeOn(schedulerA)\r\n .flatMap(record -> myStore(record).subscribeOn(schedulerB))\r\n .observeOn(schedulerC)\r\n .subscribe(\r\n x -> log(\"Got: \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n log(\"Exiting\");\r\n \r\n myWait(5000);\r\n poolA.shutdown();\r\n poolB.shutdown();\r\n poolC.shutdown();\r\n }", "private static void exKeepingAppAliveTwo() {\n\n Observable.interval(1, TimeUnit.SECONDS)\n .take(3)\n .blockingSubscribe(System.out::println);\n\n\n\n /* OUTPUT :\n 0\n 1\n 2\n */\n }", "public static void test014()\r\n {\r\n System.out.println(\"RxJavaTest04::test014\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries rxGroceries = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .fromIterable(Arrays.asList(\"bread\", \"butter\", \"milk\", \"tomato\", \"cheese\"))\r\n .subscribeOn(schedulerA)\r\n .map(prod -> rxGroceries.doPurchase(prod, 1))\r\n .reduce(BigDecimal::add);\r\n totalPrice\r\n .subscribe(System.out::println);\r\n poolA.shutdown();\r\n }", "public void emitLoop() {\n /*\n r14 = this;\n L_0x0000:\n monitor-enter(r14)\n long r0 = r14.missedRequested // Catch:{ all -> 0x0061 }\n long r2 = r14.missedProduced // Catch:{ all -> 0x0061 }\n rx.Producer r4 = r14.missedProducer // Catch:{ all -> 0x0061 }\n r5 = 0\n int r7 = (r0 > r5 ? 1 : (r0 == r5 ? 0 : -1))\n if (r7 != 0) goto L_0x0018\n int r8 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))\n if (r8 != 0) goto L_0x0018\n if (r4 != 0) goto L_0x0018\n r0 = 0\n r14.emitting = r0 // Catch:{ all -> 0x0061 }\n monitor-exit(r14) // Catch:{ all -> 0x0061 }\n return\n L_0x0018:\n r14.missedRequested = r5 // Catch:{ all -> 0x0061 }\n r14.missedProduced = r5 // Catch:{ all -> 0x0061 }\n r8 = 0\n r14.missedProducer = r8 // Catch:{ all -> 0x0061 }\n monitor-exit(r14) // Catch:{ all -> 0x0061 }\n long r9 = r14.requested\n r11 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r13 = (r9 > r11 ? 1 : (r9 == r11 ? 0 : -1))\n if (r13 == 0) goto L_0x0048\n long r9 = r9 + r0\n int r13 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1))\n if (r13 < 0) goto L_0x0045\n int r13 = (r9 > r11 ? 1 : (r9 == r11 ? 0 : -1))\n if (r13 != 0) goto L_0x0035\n goto L_0x0045\n L_0x0035:\n long r9 = r9 - r2\n int r2 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1))\n if (r2 < 0) goto L_0x003d\n r14.requested = r9\n goto L_0x0048\n L_0x003d:\n java.lang.IllegalStateException r0 = new java.lang.IllegalStateException\n java.lang.String r1 = \"more produced than requested\"\n r0.<init>(r1)\n throw r0\n L_0x0045:\n r14.requested = r11\n r9 = r11\n L_0x0048:\n if (r4 == 0) goto L_0x0057\n rx.Producer r0 = NULL_PRODUCER\n if (r4 != r0) goto L_0x0051\n r14.currentProducer = r8\n goto L_0x0000\n L_0x0051:\n r14.currentProducer = r4\n r4.request(r9)\n goto L_0x0000\n L_0x0057:\n rx.Producer r2 = r14.currentProducer\n if (r2 == 0) goto L_0x0000\n if (r7 == 0) goto L_0x0000\n r2.request(r0)\n goto L_0x0000\n L_0x0061:\n r0 = move-exception\n monitor-exit(r14) // Catch:{ all -> 0x0061 }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p030rx.internal.producers.ProducerArbiter.emitLoop():void\");\n }", "public static void main(String[] args) {\n System.out.println(\"Example of Observable.just()****\");\n Observable<String> justObs = Observable.just(\"one\", \"two\", \"three\", \"four\");\n justObs.subscribe(v -> System.out.println(\"Received:\" + v), e -> System.out.println(e), () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nExample of Observable.create()****\");\n Observable<String> createdObs = Observable.create(o -> {\n o.onNext(\"Hello\");\n o.onCompleted();\n });\n createdObs.subscribe(System.out::println, e -> System.out.println(e), () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nConverting FutureTask into Observable****\");\n FutureTask<Integer> task = new FutureTask<>(() -> {\n Thread.sleep(3000);\n return 28;\n });\n new Thread(task).start();\n\n Observable<Integer> futureObs = Observable.from(task);\n Subscription subscription = futureObs.subscribe(v -> System.out.println(\"Received :\" + v), e -> System.out.println(\"Error :\" + e),\n () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nConverting Integer array into Observable****\");\n Integer[] in = new Integer[] { 1, 2, 3 };\n\n Observable<Integer> integerObs = Observable.from(in);\n Subscription arraySub = integerObs.subscribe(v -> System.out.println(\"Received :\" + v), e -> System.out.println(\"Error :\" + e),\n () -> System.out.println(\"Completed\"));\n }", "private static void exSwitchMapThree(){\n Observable<String> intense =\n Observable.just(\"Savi\",\"Healer\",\"Three\",\"Four\",\"Wednesday\",\"Friday\",\"You\",\"Me\")\n .concatMap(result -> Observable.just(result).delay(randomSleepTime(),TimeUnit.MILLISECONDS))\n .doOnDispose(() -> System.out.println(\" * * Disposed * *\"));\n\n //Observable to execute intense task every 5 seconds\n Observable.interval(5,TimeUnit.SECONDS)\n .switchMap(r -> intense)\n .subscribe(System.out::println);\n\n //Sleep the main thread for few seconds\n Take.sleep(20000);\n\n /*\n After every 5 seconds it will dispose the ongoing intense (variable name) process and\n start the same process again.\n */\n\n //Output\n /*\n Savi\n Healer\n Three\n Four\n * * Disposed * *\n Savi\n Healer\n Three\n Four\n Wednesday\n Friday\n You\n * * Disposed * *\n Savi\n Healer\n Three\n Four\n Wednesday\n * * Disposed * *\n */\n }", "@Override\n public void subscribe(FlowableEmitter<Integer> e) throws Exception {\n for (int i = 0; i < 128; i++) {\n Log.e(TAG, \"emit \" + i);\n e.onNext(i);\n }\n }", "void onPsubscribe(String pattern, int no);", "public static void test016()\r\n {\r\n System.out.println(\"RxJavaTest04::test016\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries rxGroceries = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .fromIterable(Arrays.asList(\"bread\", \"butter\", \"milk\", \"tomato\", \"cheese\"))\r\n .subscribeOn(schedulerA)\r\n .flatMap(prod -> rxGroceries\r\n .purchase(prod, 1)\r\n .subscribeOn(schedulerA)\r\n )\r\n .reduce(BigDecimal::add);\r\n totalPrice\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n myWait(2000); // We have to wait before shutting down the pool,\r\n // otherwise it will throw exception \r\n // [java] io.reactivex.exceptions.UndeliverableException:\r\n // java.util.concurrent.RejectedExecutionException:\r\n // Task java.util.concurrent.FutureTask@38d8f9d0 rejected\r\n // from java.util.concurrent.ThreadPoolExecutor@6a724a6c\r\n // [Shutting down, pool size = 1, active threads = 1, queued\r\n // tasks = 0, completed tasks = 0]\r\n poolA.shutdown();\r\n }", "@Test\n public void testDefer() throws InterruptedException {\n Observable<LocalTime> localTimeObservable =\n Observable.defer(\n () -> Observable\n .just(LocalTime.now()))\n .repeat(3);\n localTimeObservable.subscribe(System.out::println);\n Thread.sleep(3000);\n System.out.println(\"Next Subscriber\");\n localTimeObservable.subscribe(System.out::println);\n }", "public static void stackTrace() {\n Observable<String> myObservable = Observable.fromCallable(() -> {\n Object value = null;\n return value.toString();\n });\n myObservable.subscribe(item -> System.out.println(\"output = \" + item));\n }", "void onNext(T item);", "private static void createColdObservable() {\n var observable = Observable.just(1, 2, 3, 4, 5);\n\n observable.subscribe(item -> LOG.info(\"Observer 1: {}\", item));\n\n pause(1000);\n\n observable.subscribe(item -> LOG.info(\"Observer 2: {}\", item));\n }", "private ObservableOnSubscribe<Object> receiveLoop() {\n return emitter -> {\n Message message;\n try {\n while ( ( message = consumer.receive( jmsDelegate.receiveTimeout ) ) != null ) {\n streamStep.logDebug( message.toString() );\n emitter.onNext( message.getBody( Object.class ) );\n }\n } catch ( JMSRuntimeException jmsException ) {\n emitter.onError( jmsException );\n }\n emitter.onComplete();\n };\n }", "public static void main(String[] args) {\n\n Multi.createFrom().range(0, 100)\n .select().where(n -> n % 2 == 0)\n .skip().first(40)\n .onItem().transform(n -> \"@\" + n)\n .subscribe().with(System.out::println);\n }", "public void emitAndComplete(rx.Subscriber<T> r5, rx.Subscriber<?> r6) {\n /*\n r4 = this;\n monitor-enter(r4);\n r3 = r4.emitting;\t Catch:{ all -> 0x0021 }\n if (r3 == 0) goto L_0x000a;\n L_0x0005:\n r3 = 1;\n r4.terminate = r3;\t Catch:{ all -> 0x0021 }\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n L_0x0009:\n return;\n L_0x000a:\n r2 = r4.value;\t Catch:{ all -> 0x0021 }\n r1 = r4.hasValue;\t Catch:{ all -> 0x0021 }\n r3 = 0;\n r4.value = r3;\t Catch:{ all -> 0x0021 }\n r3 = 0;\n r4.hasValue = r3;\t Catch:{ all -> 0x0021 }\n r3 = 1;\n r4.emitting = r3;\t Catch:{ all -> 0x0021 }\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n if (r1 == 0) goto L_0x001d;\n L_0x001a:\n r5.onNext(r2);\t Catch:{ Throwable -> 0x0024 }\n L_0x001d:\n r5.onCompleted();\n goto L_0x0009;\n L_0x0021:\n r3 = move-exception;\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n throw r3;\n L_0x0024:\n r0 = move-exception;\n rx.exceptions.Exceptions.throwOrReport(r0, r6, r2);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.operators.OperatorDebounceWithTime.DebounceState.emitAndComplete(rx.Subscriber, rx.Subscriber):void\");\n }", "public static void zipObservables(CountDownLatch latch) {\n\n Observable<Observable<String>> source = Observable.create(observableEmitter -> {\n System.out.println(\"create\");\n observableEmitter.onNext(Observable.just(\"abc\", \"def\"));\n observableEmitter.onNext(Observable.just(\"123\", \"456\"));\n observableEmitter.onNext(Observable.just(\"alpha\", \"beta\", \"gama\"));\n observableEmitter.onComplete();\n });\n\n source.doOnSubscribe(d -> System.out.println(\"source doOnSubscribe\"));\n source.doOnNext(i -> System.out.println(\"source doOnNext = \" + i.toString()));\n source.doOnComplete(() -> System.out.println(\"source doOnComplete\"));\n\n\n Observable.zip(source, items -> items[0] + \"-\" + items[1] + \"-\" + items[2])\n .doOnSubscribe(d -> System.out.println(\"zip doOnSubscribe\"))\n .doOnNext(i -> System.out.println(\"zip doOnNext\"))\n .subscribe(new MyObserver<>(latch));\n }", "@Override\r\n public void next() {\r\n\r\n LogEntryBuffer l_observable = new LogEntryBuffer();\r\n LogFile l_observer = new LogFile();\r\n l_observable.addObserver(l_observer);\r\n\r\n for(String l_player: d_playerList.keySet())\r\n {\r\n if (d_playerList.get(l_player).d_owned.size()==0)\r\n {\r\n d_playerList.remove(l_player);\r\n d_message = l_player+\" you have lost the game. So you're out of the game!!!\";\r\n System.out.println(d_message);\r\n l_observable.setMsg(d_message);\r\n break;\r\n }\r\n }\r\n if(d_playerList.size()==1)\r\n {\r\n for(String player: d_playerList.keySet()) {\r\n d_message = player + \" is the winner of the game!!!!!!!!\";\r\n System.out.println(d_message);\r\n l_observable.setMsg(d_message);\r\n }\r\n d_ge1.setPhase(new End(d_ge1));\r\n }\r\n else\r\n {\r\n d_ge1.setPhase(new OrderIssuePhase(d_playerList, d_country, d_ge1));\r\n }\r\n }", "@Test\n public void example() {\n Func1<Integer, Observable<Integer>> db1 = param -> Observable.range(1, param);\n\n // ws-kald som funktion der returner en Observable\n Func1<Integer, Observable<Integer>> ws1 = param -> Observable.just(param);\n\n // ws-kald som funktion der returner en Observable\n Func1<Integer, Observable<Integer>> ws2 = param -> Observable.just(param);\n\n // ws-kald som funktion der returner en Observable\n Func1<List<Integer>, Observable<Object>> ws3 = param -> Observable.empty();\n\n db1.call(5)\n .flatMap(row -> {\n if (row % 2 == 0) {\n // ws2 kaldes kun, hvis ws1 ikke var tom\n return Observable.concat(ws1.call(row), ws2.call(row)).first();\n } else {\n // ws1 og ws2 udføres parallelt\n return Observable.zip(ws1.call(10), ws2.call(20), (e1, e2) -> e1 + e2);\n }\n })\n .onErrorResumeNext(err -> {\n log.error(\"error - resume next \", err);\n return Observable.empty();\n })\n .doOnNext(n -> log.info(\"element {}\", n))\n // samle/batche 2 elementer i en liste (men højst vente 1 sekund)\n .buffer(2, 1, TimeUnit.SECONDS)\n // output sendes til en ws3\n .flatMap(ws3)\n // subscribe starter kæden\n .subscribe();\n }", "@Override\n public void onNext(String value) {\n\n }", "private static void exSwitchMapTwo() {\n\n Observable.interval(5,TimeUnit.SECONDS)\n .switchMap(call -> Observable.just(getResponse()).doOnDispose(() -> System.out.println(\"Disposed\")))\n .subscribe(System.out::println);\n\n //An Observable which performs network call.\n sleep(40000);\n\n\n /* OUTPUT :\n 6\n 10\n 13\n 17\n 26\n 32\n 35\n 42\n\n */\n }", "private static void backPressureChallenge() {\n\t\tObservable.range(1, 1000000)\n\t\t//below map will run in sequential\n\t\t//since sequential it has to complete whole task then only it can allow consumer to start\n\t\t\t.map(item -> {\n\t\t\t\tSystem.out.println(\"Produced item \"+item +\" using thread \"+Thread.currentThread().getName());\n\t\t\t\treturn item;\n\t\t\t})\n\t\t\t.observeOn(Schedulers.io())\n\t\t\t//.subscribeOn(Schedulers.io())//with this whole pipelein runs in seprate thread paralleley\n\t\t\t//below will run in concurrent\n\t\t\t.subscribe(item ->{\n\t\t\t\t//mimcing slowness\n\t\t\t\tThreadUtil.sleep(300);\n\t\t\t\tSystem.out.println(\"Consumed item \"+item +\" using thread \"+Thread.currentThread().getName());\n\t\t\t})\n\t\t\t\n\t\t\t;\n\t\t\n\t\t//since running in async we need to sleep\n\t\tThreadUtil.sleep(10000000);\n\t}", "public void emit(int r4, rx.Subscriber<T> r5, rx.Subscriber<?> r6) {\n /*\n r3 = this;\n monitor-enter(r3);\n r2 = r3.emitting;\t Catch:{ all -> 0x002b }\n if (r2 != 0) goto L_0x000d;\n L_0x0005:\n r2 = r3.hasValue;\t Catch:{ all -> 0x002b }\n if (r2 == 0) goto L_0x000d;\n L_0x0009:\n r2 = r3.index;\t Catch:{ all -> 0x002b }\n if (r4 == r2) goto L_0x000f;\n L_0x000d:\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n L_0x000e:\n return;\n L_0x000f:\n r1 = r3.value;\t Catch:{ all -> 0x002b }\n r2 = 0;\n r3.value = r2;\t Catch:{ all -> 0x002b }\n r2 = 0;\n r3.hasValue = r2;\t Catch:{ all -> 0x002b }\n r2 = 1;\n r3.emitting = r2;\t Catch:{ all -> 0x002b }\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n r5.onNext(r1);\t Catch:{ Throwable -> 0x002e }\n monitor-enter(r3);\n r2 = r3.terminate;\t Catch:{ all -> 0x0028 }\n if (r2 != 0) goto L_0x0033;\n L_0x0023:\n r2 = 0;\n r3.emitting = r2;\t Catch:{ all -> 0x0028 }\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n goto L_0x000e;\n L_0x0028:\n r2 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n throw r2;\n L_0x002b:\n r2 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n throw r2;\n L_0x002e:\n r0 = move-exception;\n rx.exceptions.Exceptions.throwOrReport(r0, r6, r1);\n goto L_0x000e;\n L_0x0033:\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n r5.onCompleted();\n goto L_0x000e;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.operators.OperatorDebounceWithTime.DebounceState.emit(int, rx.Subscriber, rx.Subscriber):void\");\n }", "public static void test005()\r\n {\r\n System.out.println(\"RxJavaTest04::test005\");\r\n Observable<String> flight = myRxLookupFlight(\"Amsterdam\");\r\n Observable<String> passenger = myRxFindPassenger(1001);\r\n Observable<String> ticket =\r\n flight.zipWith(passenger, (f, p) -> myBookTicket(f, p));\r\n ticket.subscribe(RxJavaTest04::mySendEmail);\r\n }", "@Override\n public void run() {\n for (int i = 1; i < 6; i++) {\n source.schedule(i); //schedule integer 1 to 5 to the callback source\n }\n }", "public static void buffer() {\n\n List<String> data = Utils.getData();\n\n int numberOfBuffers = 11;\n\n CountDownLatch latch = new CountDownLatch(numberOfBuffers);\n\n\n Observable.fromIterable(data).buffer(3).subscribe(new MyObserver<>(latch));\n\n Observable.fromIterable(data).buffer(2, 3).subscribe(new MyObserver<>(latch));\n\n Observable.fromIterable(data).buffer(2, 3, ArrayList::new).subscribe(new MyObserver<>(latch));\n\n Observable.fromIterable(data).buffer(2, HashSet::new).subscribe(new MyObserver<>(latch));\n\n /*\n Opening and closing windows defined\n */\n Observable.fromIterable(data).buffer((observer) -> {\n System.out.println(\"opening\");\n // Starts buffer collection window\n // For every onNext a buffer window is created.\n observer.onNext(\"opening-1\");\n observer.onNext(\"opening-2\");\n }, (value) -> {\n System.out.println(\"closing, value = \" + value);\n // Closes buffer collection window\n // Gets invoked for each onNext in opening indicator\n return Observable.just(value).delay(100L, TimeUnit.MICROSECONDS);\n }, HashSet::new).subscribe(new MyObserver<>(latch));\n\n /*\n Buffer with boundary observable\n */\n Observable.fromIterable(data).buffer((Observer<? super Integer> observer) -> {\n System.out.println(\"onNext - 1\");\n observer.onNext(1);\n observer.onNext(2);\n }).subscribe(new MyObserver<>(latch));\n\n /*\n 1. Buffer with boundary observable by providing some other in built observable\n 2. Create a buffer of 100 Microseconds\n */\n Observable.fromIterable(data)\n .buffer(Observable.interval(100L, TimeUnit.MICROSECONDS))\n .subscribe(new MyObserver<>(latch));\n\n Observable.fromIterable(data)\n .buffer(Observable.interval(100L, TimeUnit.MICROSECONDS), 4)\n .subscribe(new MyObserver<>(latch));\n\n Observable.fromIterable(data)\n .buffer(Observable.interval(100L, TimeUnit.MICROSECONDS), () -> new HashSet<>())\n .subscribe(new MyObserver<>(latch));\n\n\n /*\n Boundary supplier is being passed from callable.\n */\n Observable.fromIterable(data)\n .buffer(() -> Observable.interval(100L, TimeUnit.MICROSECONDS))\n .subscribe(new MyObserver<>(latch));\n\n\n Observable.fromIterable(data)\n .buffer(() -> Observable.interval(100L, TimeUnit.MICROSECONDS), HashSet::new)\n .subscribe(new MyObserver<>(latch));\n\n try {\n latch.await();\n } catch (InterruptedException e) {\n System.out.println(e.getMessage());\n }\n }", "public static void test007()\r\n {\r\n System.out.println(\"RxJavaTest04::test007\");\r\n Observable<String> flight = myRxLookupFlight(\"Vienna\") // Change to \"Amsterdam\" for slow operation.\r\n .subscribeOn(Schedulers.io())\r\n .timeout(1000, TimeUnit.MILLISECONDS);\r\n flight.subscribe(\r\n (f) -> System.out.println(\"Flight: \" + f),\r\n (ex) -> {\r\n System.out.println(\"Error!\");\r\n ex.printStackTrace();\r\n },\r\n () -> System.out.println(\"Done\")\r\n );\r\n myWait(5500);\r\n }", "public void nextTuple() {\n\t\tif(isFirst) {\n\t\t\ttry {\n\t\t\t\tFileReader in = new FileReader(\"query_stream_comp_\"+qSize);\n\t\t\t\tBufferedReader br = new BufferedReader(in);\t\n//\t\t\t\tbr.readLine();\n\t\t\t\tfor(int i=0; i<num; i++) {\n//\t\t\t\t\tUtils.sleep(100);\n\t\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\t\tint edges = Integer.valueOf(br.readLine());\n//\t\t\t\t\tsb.append(edges+\"\\n\");\n//\t\t\t\t\tint edges = br.read();\n\t\t\t\t\tfor(int j=0; j< edges; j++) {\n\t\t\t\t\t\t\n\t//\t\t\t\t\tString edge[] = br.readLine().split(\" \");\n\t\t\t\t\t\tsb.append(br.readLine()+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t_collector.emit(\"qstream\", new Values(sb.toString()));\n\t\t\t\t}\n\t\t\t\tisFirst = !isFirst;\n\t\t\t\tSystem.out.println(\"QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\t\t}else {\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000000);\n\t\t\t\tSystem.exit(0);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void rxPlayView() {\n Button button = new Button(PlaygroundApplication.app());\n\n Observable<OnClickEvent> clickObservable = ViewObservable.clicks(button);\n\n clickObservable\n // Skip first click...\n .skip(1)\n .subscribe(new Action1<OnClickEvent>() {\n @Override\n public void call(OnClickEvent onClickEvent) {\n log(\"Buttonwa Clicketh\");\n }\n });\n\n // Ah, maybe it will...\n button.callOnClick();\n button.callOnClick();\n }", "@Test\n public void sequenceEqual() {\n\n Observable<Long> o1 = Observable.just(1L, 2L, 3L, 4L, 5L)\n .delay(1000, TimeUnit.SECONDS, mTestScheduler);\n Observable<Long> o2 = Observable.interval(20, TimeUnit.SECONDS, mTestScheduler)\n .skip(1)\n .take(5);\n\n Observable.sequenceEqual(o1, o2)\n .subscribe(mList::add);\n\n mTestScheduler.advanceTimeBy(1200, TimeUnit.SECONDS);\n\n assertEquals(mList, Collections.singletonList(true));\n }", "@Test\n public void all() {\n Observable.just(1, 2, 3, 4, 5)\n .doOnNext(System.out::println)\n .all(x -> x < 10)\n .subscribe(mList::add);\n assertEquals(mList, Collections.singletonList(true));\n }", "private void threads()\n {\n {\n Observable myObservable = Observable.create\n (\n new Observable.OnSubscribe<GetArtistQuery>() \n {\n public void call(Subscriber<? super GetArtistQuery> sub) \n { \n //System.out.println(Thread.currentThread().getName());\n sub.onNext(getArtistQuery);\n sub.onCompleted();\n }\n } \n );\n \n Subscriber mySubscriber = new Subscriber<GetArtistQuery>() \n {\n public void onNext(GetArtistQuery s) \n { \n try { \n s.execute();\n } catch (SQLException ex) { System.out.println(ex); }\n }\n public void onCompleted() { \n }\n public void onError(Throwable e) {System.out.println(e); } \n };\n //myObservable.subscribe(mySubscriber); \n try {\n myObservable.\n subscribeOn(Schedulers.io()).\n //observeOn(Schedulers.from(executorService)).\n observeOn(Schedulers.trampoline()).\n subscribe(mySubscriber);\n Thread.sleep(2); \n //executorService.shutdown();\n } catch(InterruptedException ex) {Thread.currentThread().interrupt();}\n }\n \n }", "public static void main(String[] args) {\n // count operator counter number of elements emmitted,\n Observable<Integer> observable = Observable.just(1,2,3,4);\n observable.count().subscribe(s->System.out.println(s));\n\n // conditional opertors\n // all() -> this operator checks condition for all values and returns false if any condition fails\n observable.all(i->i<3).subscribe(s->System.out.println(s));\n\n // any() -> this operator checks condition for all values and returns true if any condition is true\n // empty() -> checks if observable have empty value and returns true/false \n // contains() -> checks if specified item is contained/emmitted by observable\n // sequenceEqual() -> checks if two sequences are equals (sequences contains same values)\n\n observable.any(i->i<3).subscribe(s->System.out.println(s));\n observable.filter(i->i<5).isEmpty().subscribe(s->System.out.println(s));\n }", "void onNext(CorfuStreamEntries results);", "private void timerExample() {\n getObservable()\n //Run on a background thread\n .subscribeOn(Schedulers.io())\n //Be notified on the main thread\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(getLongObserver());\n }", "@Test\r\n public void sequentialHasNextInvocationDoesntAffectRetrievalOrder() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.next(), is(6));\r\n }", "public void nextTuple() {\n\t\t\n\t\tif(index < sentences.length){\n\t\t\tthis.collector.emit(new Values(sentences[index%sentences.length]));\n\t\t\tindex++;\n\t\t\tUtils.waitForMillis(1);\n\t\t}\n\t}", "private void m125715i() {\n RxBus.m86979a().mo84365a(TopicReviewClickEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$ilStsapfhY6AmqXsirZvIVpDyM */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125688a((TopicFragment) ((TopicReviewClickEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n RxBus.m86979a().mo84365a(TopicActiveAnswererShareEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$BjK9qQqNBfZ6wBlmaowQpTV4GyQ */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125687a((TopicFragment) ((TopicActiveAnswererShareEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n RxBus.m86979a().mo84365a(TopicActiveAnswererJumpEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$_g34FcL5FmfymiORzp8CR0wVoH8 */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125686a((TopicFragment) ((TopicActiveAnswererJumpEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n }", "@Test\n public void takeUntil() {\n Observable.just(1, 2, 3, 4)\n .takeUntil(integer -> integer > 2)\n .subscribe(mList::add);\n assertEquals(mList, Arrays.asList(1, 2, 3));\n\n mList.clear();\n Observable.just(1, 2, 3, 4)\n .takeUntil(integer -> integer < 10)\n .subscribe(mList::add);\n assertEquals(mList, Collections.singletonList(1));\n }", "public void next (CallContext context);", "public void next( long time );", "public void run() {\n long num = numEvents.get();\n long lastnum = lastNumEvents.get();\n long evps = (num-lastnum)/App.METRICS_PER_SECOND;\n lastNumEvents.set(num);\n System.out.println(\"Consumer[\"+\n nnaammee+\"]: cursorRestarts=\"+cursorRestarts.get()\n +\" numEvents=\"+num\n +\" events/second=\"+evps\n +\" totalNumEvents=\"+totalNumEvents.get());\n }", "public void emitLoop() {\n Subscriber<? super R> child2 = this.child;\n Queue<Object> queue2 = this.queue;\n NotificationLite<R> nl = NotificationLite.instance();\n AtomicLong requested2 = this.requested;\n long r = requested2.get();\n while (true) {\n boolean max = r == LongCompanionObject.MAX_VALUE;\n if (!checkTerminated(this.done, queue2.isEmpty(), child2)) {\n long e = 0;\n while (r != 0) {\n boolean d = this.done;\n Object o = queue2.poll();\n boolean empty = o == null;\n if (checkTerminated(d, empty, child2)) {\n return;\n }\n if (empty) {\n break;\n }\n R v = nl.getValue(o);\n try {\n child2.onNext(v);\n r--;\n e--;\n } catch (Throwable ex) {\n Exceptions.throwOrReport(ex, child2, v);\n return;\n }\n }\n if (e != 0 && !max) {\n r = requested2.addAndGet(e);\n }\n synchronized (this) {\n if (!this.missed) {\n this.emitting = false;\n return;\n }\n this.missed = false;\n }\n } else {\n return;\n }\n }\n }", "public void testGetNextEvent() throws Exception {\n \n \tint NB_READS = 20;\n \n \t// On lower bound, returns the first event (ts = 1)\n \tTmfContext context = fTrace.seekEvent(new TmfTimestamp(0, SCALE, 0));\n \n \t// Read NB_EVENTS\n \tTmfEvent event;\n for (int i = 0; i < NB_READS; i++) {\n event = fTrace.getNextEvent(context);\n assertEquals(\"Event timestamp\", i + 1, event.getTimestamp().getValue());\n assertEquals(\"Event rank\", i + 1, context.getRank());\n }\n \n // Make sure we stay positioned\n event = fTrace.parseEvent(context);\n assertEquals(\"Event timestamp\", NB_READS + 1, event.getTimestamp().getValue());\n assertEquals(\"Event rank\", NB_READS, context.getRank());\n }", "protected abstract void onNewNext(T t);", "public static void main(String[] args) throws InterruptedException {\n\t\tObservable.just(\"hi\",\"hello\",\"okay\").subscribe(z -> System.out.print(z));\n\t\t\n\t\t// creating observable using create in lambda style[Sync]\n\t\tObservable.create( f ->{\n\t\t\t\t\t\t\tf.onNext(\"hello\");\n\t\t\t\t\t\t\tif( f.isUnsubscribed() ){\n\t\t\t\t\t\t\t\treturn; \n\t\t\t\t\t\t\t}}).subscribe( s -> System.out.println(s));\n\t\t\n\t\t\n\t\tExecutorService executor = Executors.newSingleThreadExecutor();\n\t\tSystem.out.println(\"----\"+Thread.currentThread().getName());\n\t\t\n\t\t// creating observable using create in lambda style[Async]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\t\t\n\t\t// creating observable using create in lambda style[Async + observerOn]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).observeOn(Schedulers.newThread()).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\n\t\t\n\t\t// creating observable using create in lambda style[Async + subscribeOn]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).subscribeOn(Schedulers.newThread()).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\n\t\t\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\t//bulk API simulation\n\t\tObservable<Integer> obs = Observable.just(1,2,3,4,5,6).map(userId ->{\n\t\t\t//make mysql call\n\t\t try { System.out.println(\"---\"+Thread.currentThread().getName());\n\t\t\treturn makeSqlCall(userId);\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn 0;\n\t\t});\n\t\t\t\t\n\t obs.subscribeOn(Schedulers.io()).subscribe(id ->{ result.add(id);System.out.println(Thread.currentThread().getName());});\n\t for(Integer x: result){System.out.print(x+\" - \");}\n\t\t\n\t}", "public void printInfos() {\n this.mSubscribetion = collectInfos().compose(RxUtils.applyIOSchedulers()).doOnSubscribe(new Action0() {\n /* class com.coolapk.market.view.settings.$$Lambda$NetworkDiagnosisFragment$AY9RSQ8MIxPePZBSBAu72rxrfT0 */\n\n @Override // rx.functions.Action0\n public final void call() {\n NetworkDiagnosisFragment.this.lambda$printInfos$0$NetworkDiagnosisFragment();\n }\n }).doOnUnsubscribe(new Action0() {\n /* class com.coolapk.market.view.settings.$$Lambda$NetworkDiagnosisFragment$exZQzWN1eoP6tEwD4jjwQz2DZfc */\n\n @Override // rx.functions.Action0\n public final void call() {\n NetworkDiagnosisFragment.this.restoreStartState();\n }\n }).subscribe((Subscriber<? super R>) new Subscriber<CharSequence>() {\n /* class com.coolapk.market.view.settings.NetworkDiagnosisFragment.AnonymousClass3 */\n\n @Override // rx.Observer\n public void onCompleted() {\n NetworkDiagnosisFragment.this.mBinding.copy.setVisibility(0);\n }\n\n @Override // rx.Observer\n public void onError(Throwable th) {\n NetworkDiagnosisFragment.this.addText(StringUtils.emptyIfNull(th.getMessage()));\n }\n\n public void onNext(CharSequence charSequence) {\n NetworkDiagnosisFragment.this.addText(charSequence);\n }\n\n @Override // rx.Subscriber\n public void onStart() {\n super.onStart();\n NetworkDiagnosisFragment.this.mBinding.copy.setVisibility(4);\n NetworkDiagnosisFragment networkDiagnosisFragment = NetworkDiagnosisFragment.this;\n networkDiagnosisFragment.mConManager = (ConnectivityManager) networkDiagnosisFragment.getActivity().getSystemService(\"connectivity\");\n NetworkDiagnosisFragment networkDiagnosisFragment2 = NetworkDiagnosisFragment.this;\n networkDiagnosisFragment2.mNetInfo = networkDiagnosisFragment2.mConManager.getActiveNetworkInfo();\n NetworkDiagnosisFragment.this.clearText();\n }\n });\n }", "public static void main(String[] args) {\n\t\tDisposableObserver<String> dobs = new DisposableObserver<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"onComplete via DisposableObserver\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\tSystem.out.println(\"onError==\" + arg0);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"onNext via DisposableObserver==\" + arg0);\n\t\t\t}\n\t\t};\n\t\tDisposableObserver<String> dobs2 = new DisposableObserver<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"onComplete via DisposableObserver\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\tSystem.out.println(\"onError==\" + arg0);\n\t\t\t}\n\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"onNext via DisposableObserver==\" + arg0);\n\t\t\t}\n\t\t};\n\n\t\t\n\t\t\n\t\t\n\t\tList<String> al = Arrays.asList(\"first\", \"second\", \"third\");\n\t\tObservable<String> observable = Observable.fromIterable(al);\n\n\t\t/**\n\t\t * CompositeDisposable object helps to dispose multiple disposable observers at once\n\t\t */\n\t\tCompositeDisposable cdis=new CompositeDisposable();\n\t\t\n\t\tcdis.add(dobs);\n\n//\t\tbelow syntax is for adding schedular with composite disposables\n//\t\tcdis.add(\n//\t\t\t\tobservable.subscribeOn(Schedulers.io()).\n//\t\t\t\tobserveOn(Schedulers.io()).\n//\t\t\t\tsubscribeWith(dobs)\n//\t\t\t\t);\n//\t\t\n\t\t\n\t\t\n\t\tobservable.subscribe(dobs);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"cdis size after added dobs=\"+cdis.size());\n\n\t\t/**\n\t\t * cids clear method will clear the existing cdis and can accept\n\t\t * further disposables observers and show correct methods values\n\t\t * like disposable observers is disposed or not \n\t\t */\n\t\tSystem.out.println(\"before cdis clear\");\n//\t\tcdis.clear();\n\t\tSystem.out.println(\"cdis isDisposed==\"+cdis.isDisposed());\n\t\t\n\t\t\n\t\t/**\n\t\t * cdis dispose method dispose the cdis and \n\t\t * change the isDispose method to true\n\t\t * and it can not accept further disposable observers\n\t\t * and it will also show wrong method values like \n\t\t * disposable observers is disposed or not\n\t\t * for say in this example cdis dispose called after only \n\t\t * dobs subscribed , after that dobs2 is added to cids \n\t\t * but still dobs2.isDisposed giving true\n\t\t */\n//\t\tcdis.dispose();\n\n\t\t\n\t\t\n\t\tSystem.out.println(\"after cdis clear \");\n\t\tSystem.out.println(\"cdis size=\"+cdis.size());\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\tSystem.out.println();\n\n\t\t\n\t\t\n\t\tobservable.subscribe(dobs2);\n\n\t\tcdis.add(dobs2);\n\t\t\n\t\t\n//\t\tcdis.add(dobs2);\n//\t\tobservable.subscribe(dobs2);\n\t\t\n\t\t/**\n\t\t * do note if we added dobs2 into cids after cids dispose method\n\t\t * then in that cose even subscription itself will not called\n\t\t * so clear will be better options for clearing particular dobs \n\t\t * rather than dispose method of composite disposable\n\t\t */\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"cdis size after added dobs2=\"+cdis.size());\n\t\t\n\t\tSystem.out.println(\"dobs.isDisposed()==\"+dobs.isDisposed());\n\t\tSystem.out.println(\"dobs2.isDisposed()==\"+dobs2.isDisposed());\n\t\n\t\tcdis.clear();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"after cdis clear\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"dobs.isDisposed()==\"+dobs.isDisposed());\n\t\tSystem.out.println(\"dobs2.isDisposed()==\"+dobs2.isDisposed());\n\t\n\t\t\n\t\t\n\n\t\t\n\t}", "@Override\n public void subscribe(ObservableEmitter<String> emitter) throws Exception {\n Log.e(TAG, \"emitter===\" + emitter);\n Log.e(TAG, Thread.currentThread().getName());\n emitter.onNext(\"AAAAAAAAA\");\n\n }", "public int assertEvents(SerializedObserverTest.TestConcurrencySubscriberEvent expectedEndingEvent) throws IllegalStateException {\n int nextCount = 0;\n boolean finished = false;\n for (SerializedObserverTest.TestConcurrencySubscriberEvent e : events) {\n if (e == (SerializedObserverTest.TestConcurrencySubscriberEvent.onNext)) {\n if (finished) {\n // already finished, we shouldn't get this again\n throw new IllegalStateException(\"Received onNext but we're already finished.\");\n }\n nextCount++;\n } else\n if (e == (SerializedObserverTest.TestConcurrencySubscriberEvent.onError)) {\n if (finished) {\n // already finished, we shouldn't get this again\n throw new IllegalStateException(\"Received onError but we're already finished.\");\n }\n if ((expectedEndingEvent != null) && ((SerializedObserverTest.TestConcurrencySubscriberEvent.onError) != expectedEndingEvent)) {\n throw new IllegalStateException((\"Received onError ending event but expected \" + expectedEndingEvent));\n }\n finished = true;\n } else\n if (e == (SerializedObserverTest.TestConcurrencySubscriberEvent.onComplete)) {\n if (finished) {\n // already finished, we shouldn't get this again\n throw new IllegalStateException(\"Received onComplete but we're already finished.\");\n }\n if ((expectedEndingEvent != null) && ((SerializedObserverTest.TestConcurrencySubscriberEvent.onComplete) != expectedEndingEvent)) {\n throw new IllegalStateException((\"Received onComplete ending event but expected \" + expectedEndingEvent));\n }\n finished = true;\n }\n\n\n }\n return nextCount;\n }", "@Test\n public void skipUntil() {\n\n Observable<Long> o1 = Observable.interval(100, TimeUnit.SECONDS, mTestScheduler)\n .map(num -> num + 1)\n .take(9);\n\n Observable<Integer> o2 = Observable.just(0, 0)\n .delay(550, TimeUnit.SECONDS, mTestScheduler);\n\n o1.skipUntil(o2)\n .subscribe(mList::add);\n\n mTestScheduler.advanceTimeBy(2000, TimeUnit.SECONDS);\n assertEquals(mList, Arrays.asList(6L, 7L, 8L, 9L));\n }", "@Override\n public void onNext(TransportEvent value) {\n LOG.log(Level.FINEST, \"{0}\", value);\n stage.onNext(value);\n }", "private Sampler next2() {\n if (isFirst()) // must be the start of the subtree\n {\n calls = 0;\n noFailingSamples = 0;\n res = new SampleResult();\n res.setSampleLabel(getName());\n // Assume success\n res.setSuccessful(true);\n res.sampleStart();\n prevEndTime = res.getStartTime();//???\n pauseTime = 0;\n }\n boolean isLast = current==super.subControllersAndSamplers.size();\n Sampler returnValue = super.next();\n if (returnValue == null && isLast) // Must be the end of the controller\n {\n if (res != null) {\n // See BUG 55816\n if (!isIncludeTimers()) {\n long processingTimeOfLastChild = res.currentTimeInMillis() - prevEndTime;\n pauseTime += processingTimeOfLastChild;\n }\n res.setIdleTime(pauseTime+res.getIdleTime());\n res.sampleEnd();\n res.setResponseMessage(\"Number of samples in transaction : \" + calls + \", number of failing samples : \" + noFailingSamples);\n if(res.isSuccessful()) {\n res.setResponseCodeOK();\n }\n notifyListeners();\n }\n }\n else {\n // We have sampled one of our children\n calls++;\n }\n \n return returnValue;\n }", "@Test\n public void takeWhile() {\n Observable.interval(100, TimeUnit.SECONDS, mTestScheduler)\n .map(num -> num + 1)\n .take(7)\n .takeWhile(aLong -> aLong != 4)\n .subscribe(mList::add);\n\n mTestScheduler.advanceTimeBy(1000, TimeUnit.SECONDS);\n assertEquals(mList, Arrays.asList(1L, 2L, 3L));\n }", "@Test\n public void amb() {\n Observable<Integer> o1 = Observable.just(20, 40, 60)\n .delay(500, TimeUnit.SECONDS, mTestScheduler);\n\n Observable<Integer> o2 = Observable.just(1, 2, 3)\n .delay(200, TimeUnit.SECONDS, mTestScheduler);\n\n Observable<Integer> o3 = Observable.just(0, 0, 0)\n .delay(1000, TimeUnit.SECONDS, mTestScheduler);\n\n Observable.amb(o1, o2, o3)\n .subscribe(mList::add);\n\n mTestScheduler.advanceTimeBy(1000, TimeUnit.SECONDS);\n assertEquals(mList, Arrays.asList(1, 2, 3));\n }", "@Override\n public void onSubscribe(String s, int i) {\n }", "protected void doSomeWork() {\n\n //PublishSubject就像鼠标事件,不管有没有订阅者,他都按照他的设定发事件,什么时候有订阅者,那么订阅者就从那个时候获取事件。\n //与之相反的是ReplaySubject,不管订阅者什么时候订阅,都能获取完整事件。\n PublishSubject<Integer> source = PublishSubject.create();\n source.onNext(-1);\n source.onNext(0);\n\n source.subscribe(this.<Integer>getObserver(\"First\")); // it will get 1, 2, 3, 4 and onComplete\n\n source.onNext(1);\n source.onNext(2);\n source.onNext(3);\n //source.onComplete();//如果在这里onComplete了,那么后面的订阅者只能收到onComplete事件\n\n /*\n * it will emit 4 and onComplete for second observer also.\n */\n source.subscribe(this.<Integer>getObserver(\"Second\"));\n\n source.onNext(4);\n source.onComplete();\n\n }", "public static void scanWithInitialValue() {\n Observable.range(1, 10)\n .scan(100, (previous, current) -> {\n System.out.println(\"previous = \" + previous);\n System.out.println(\"current = \" + current);\n return previous + current;\n }).subscribe(new MyObserver<>());\n\n System.out.println(\"# 2\");\n\n /*\n Same as above but initial value is returned via callable.\n */\n\n Observable.range(1, 10)\n .scanWith(() -> 1000, (previous, current) -> {\n System.out.println(\"previous = \" + previous);\n System.out.println(\"current = \" + current);\n return previous + current;\n }).subscribe(new MyObserver<>());\n\n }", "Spliterator<Event> subscribe(String origin, String type, Instant since, Consumer<Event> callback);", "private static void exKeepingAppAliveOne() {\n\n Observable.interval(1, TimeUnit.SECONDS)\n .subscribe(System.out::println);\n\n Take.sleep(Long.MAX_VALUE); //Calls Thread.sleep(long milli)\n\n /* OUTPUT :\n\n */\n }", "@Override\n public ObservableSource<? extends String> call() throws Exception {\n SystemClock.sleep(2000);\n return Observable.just(\"one\", \"two\", \"three\", \"four\", \"five\");\n }", "public void a() {\n if (getAndIncrement() == 0) {\n Subscriber<? super Flowable<T>> subscriber = this.a;\n MpscLinkedQueue<Object> mpscLinkedQueue = this.f;\n AtomicThrowable atomicThrowable = this.g;\n long j2 = this.l;\n int i2 = 1;\n while (this.e.get() != 0) {\n UnicastProcessor<T> unicastProcessor = this.k;\n boolean z = this.j;\n if (!z || atomicThrowable.get() == null) {\n Object poll = mpscLinkedQueue.poll();\n boolean z2 = poll == null;\n if (z && z2) {\n Throwable terminate = atomicThrowable.terminate();\n if (terminate == null) {\n if (unicastProcessor != 0) {\n this.k = null;\n unicastProcessor.onComplete();\n }\n subscriber.onComplete();\n return;\n }\n if (unicastProcessor != 0) {\n this.k = null;\n unicastProcessor.onError(terminate);\n }\n subscriber.onError(terminate);\n return;\n } else if (z2) {\n this.l = j2;\n i2 = addAndGet(-i2);\n if (i2 == 0) {\n return;\n }\n } else if (poll != m) {\n unicastProcessor.onNext(poll);\n } else {\n if (unicastProcessor != 0) {\n this.k = null;\n unicastProcessor.onComplete();\n }\n if (!this.h.get()) {\n UnicastProcessor<T> create = UnicastProcessor.create(this.b, this);\n this.k = create;\n this.e.getAndIncrement();\n if (j2 != this.i.get()) {\n j2++;\n s6.a.e.d.c.a.b bVar = new s6.a.e.d.c.a.b(create);\n subscriber.onNext(bVar);\n if (bVar.f()) {\n create.onComplete();\n }\n } else {\n SubscriptionHelper.cancel(this.d);\n this.c.dispose();\n atomicThrowable.tryAddThrowableOrReport(new MissingBackpressureException(\"Could not deliver a window due to lack of requests\"));\n this.j = true;\n }\n }\n }\n } else {\n mpscLinkedQueue.clear();\n Throwable terminate2 = atomicThrowable.terminate();\n if (unicastProcessor != 0) {\n this.k = null;\n unicastProcessor.onError(terminate2);\n }\n subscriber.onError(terminate2);\n return;\n }\n }\n mpscLinkedQueue.clear();\n this.k = null;\n }\n }", "@Test\n public void fluxSubscriberNumbersError(){\n\n Flux<Integer> listaDeNumeros = Flux.range(1, 5) //pubisher publicando, quando for 4 lança exception\n .log()\n .map(integer -> {\n if(integer == 4){\n throw new IndexOutOfBoundsException(\"Index Error\");\n }\n return integer;\n });\n\n listaDeNumeros.subscribe(integer -> log.info(\"Numero {}\", integer), Throwable::printStackTrace,\n () -> log.info(\"Done\"), subscription -> subscription.request(3)); // backpressure 3, antes da exception ser lançada\n //Runnable - void run() Consumer - void accept(T t)\n\n log.info(\"-------------------------------------------------\");\n StepVerifier.create(listaDeNumeros)\n .expectNext(1, 2, 3)\n .expectError(IndexOutOfBoundsException.class)\n .verify();\n }", "public static void test006()\r\n {\r\n System.out.println(\"RxJavaTest04::test006\");\r\n Observable<String> flight = myRxLookupFlight(\"Amsterdam\").subscribeOn(Schedulers.io());\r\n Observable<String> passenger = myRxFindPassenger(1001).subscribeOn(Schedulers.io());\r\n Observable<String> ticket =\r\n flight.zipWith(passenger, (f, p) -> myBookTicket(f, p));\r\n System.out.println(\"Observables created, subscribing\");\r\n ticket.subscribe(RxJavaTest04::mySendEmail);\r\n myWait(10000);\r\n }", "public void basic() {\n\t\tString root = \"c:\\\\\";\n\t\tFile[] files = new File(root).listFiles();\t\t\t\t\t//해당경로의 File객체를 생성하여 listFile() method를 호출하면 파일목록을 File[]배열로 리턴\n\t\tObservable<String> source = Observable.fromArray(files)\t\t\n\t\t\t\t.filter(f -> !f.isDirectory())\t\t\t\t\t\t//Directory를 제외한 File만 필터링\n\t\t\t\t.map(f -> f.getAbsolutePath())\t\t\t\t\t\t//File[]배열에 있는 File의 절대경로를 발행\n\t\t\t\t.subscribeOn(Schedulers.io());\t\t\t\t\t\t//IO스케줄러에서 실행\n\t\t\n\t\tsource.subscribe(Log::i);\n\t\tCommonUtils.sleep(500);\n\t\tCommonUtils.exampleComplete();\n\t}", "@Override\n public void onNext(ExecutionResult executionResult) {\n // as each deferred result arrives, send it to where it needs to go\n //\n try {\n TimeUnit.SECONDS.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n sendResult(session, executionResult);\n subscription.request(1);\n }" ]
[ "0.6504958", "0.63790905", "0.6154607", "0.6077112", "0.6014283", "0.598099", "0.5887391", "0.5853744", "0.5850122", "0.5844712", "0.5837034", "0.57505536", "0.5723923", "0.5714076", "0.5692608", "0.5687388", "0.56531686", "0.56341124", "0.56166273", "0.5584764", "0.55841917", "0.55477095", "0.5536609", "0.55082905", "0.5504616", "0.5496588", "0.5492554", "0.5491713", "0.5468161", "0.54641056", "0.5464015", "0.5444306", "0.54308516", "0.53787076", "0.53758067", "0.53381157", "0.5302533", "0.5272418", "0.5260356", "0.52493685", "0.52291495", "0.52283823", "0.5227335", "0.5215108", "0.51958483", "0.5188284", "0.5169998", "0.5158246", "0.5123028", "0.51154435", "0.5100669", "0.5093891", "0.50890666", "0.5079762", "0.5070099", "0.5057978", "0.50548905", "0.50442785", "0.5041521", "0.50414306", "0.5040575", "0.5028664", "0.5025864", "0.5021844", "0.5017122", "0.49845096", "0.49656868", "0.49618277", "0.4955442", "0.49530697", "0.49501947", "0.49205565", "0.49200377", "0.4914726", "0.49115574", "0.49091575", "0.49069422", "0.49049145", "0.4904639", "0.4902258", "0.48947436", "0.48855835", "0.48633504", "0.48569673", "0.48563117", "0.48366776", "0.4835615", "0.48354676", "0.48351073", "0.48232114", "0.48054433", "0.48031718", "0.47798297", "0.47793025", "0.47766438", "0.47736236", "0.47730643", "0.47636965", "0.47578183", "0.4756891" ]
0.500649
65
Create the commit for the configuration
public void makeCommit(String message) throws RepositoryException, IOException, ClassNotFoundException, ConfigurationException { Configuration config = Configuration.load(); List<String> lastBlobIds = config.head().lastCommit().getCommit().getBlobIds(); List<String> blobIds = new ArrayList<>(config.getIndexBlobs()); if (lastBlobIds.equals(blobIds)) { throw new ConfigurationException("There are no new files in the index"); } config.makeCommit(message, blobIds); config.save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TCommit createCommit();", "public Commit() {\n }", "public Commit() {\n }", "void commit() {\n }", "private static void commit() throws IOException {\n java.io.File out = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION + \".\"\n + Const.FILE_SAVING_FILE_EXTENSION);\n OutputStream str = new FileOutputStream(out);\n // Write the temporary file\n try {\n properties.store(str, \"User configuration\");\n } finally {\n str.flush();\n str.close();\n }\n // Commit with recovery support\n java.io.File finalFile = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION);\n UtilSystem.saveFileWithRecoverySupport(finalFile);\n Log.debug(\"Conf commited to : \" + finalFile.getAbsolutePath());\n }", "public void commit() {\n }", "@Override\n \tpublic void commit(String pathPrefix, CodeGeneratorConfiguration config,\n \t\t\tProgressFunction progressFunction) throws GraphIOException {\n \t\tlong schemaElements = 0, currentCount = 0, interval = 1;\n \t\tif (progressFunction != null) {\n \t\t\tint elements = getNumberOfElements();\n \t\t\tif (config.hasTransactionSupport()) {\n \t\t\t\telements *= 2;\n \t\t\t}\n \t\t\tprogressFunction.init(getNumberOfElements());\n \t\t\tinterval = progressFunction.getUpdateInterval();\n \t\t}\n \n \t\t// ********************* build code **********************\n \t\tif (!pathPrefix.endsWith(File.separator)) {\n \t\t\tpathPrefix += File.separator;\n \t\t}\n \n \t\t// generate schema class\n \t\tCodeGenerator schemaCodeGenerator = new SchemaCodeGenerator(this,\n \t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\tschemaCodeGenerator.createFiles(pathPrefix);\n \n \t\t// generate factory\n \t\tCodeGenerator factoryCodeGenerator = new GraphFactoryGenerator(this,\n \t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\tfactoryCodeGenerator.createFiles(pathPrefix);\n \n \t\t// generate graph class\n \t\tif (graphClass.getQualifiedName().equals(\"Graph\")) {\n \t\t\tthrow new SchemaException(\n \t\t\t\t\t\"The defined GraphClass must not be named Graph!\");\n \t\t}\n \n \t\tcreateFiles(config, pathPrefix, progressFunction, schemaElements,\n \t\t\t\tcurrentCount, interval);\n \n \t\t// finish progress bar\n \t\tif (progressFunction != null) {\n \t\t\tprogressFunction.finished();\n \t\t}\n \t}", "@Override\n\tpublic void commit() {\n\n\t}", "public void commit() {\n doCommit();\n }", "@Override\n public void commit() {\n }", "public void commit();", "void commit();", "void commit();", "public abstract void commit();", "public void commit() {\n tryCommit(true);\n }", "void commit() throws CommitException;", "void commit(IDevTree tree, Map options) throws IOException;", "protected void post_commit_hook() { }", "public void commit(){\n \n }", "void createBranchAtCommit(TCommit commit, String branchName, TRepo repo);", "public void commit(Writer output) throws IOException {\n postData(new StringReader(\"<commit/>\"), output);\n }", "public void commit() {\n\t\tif (commit) {\n\t\t\t// Récupérer le path du JSON\n\t\t\tSystem.out.println(ClassLoader.getSystemResource(jsonFile));\n\t\t\tURL url = ClassLoader.getSystemResource(jsonFile);\n\t\t\t// On ouvre un flux d'écriture vers le fichier JSON\n\t\t\ttry (OutputStream ops = new FileOutputStream(Paths.get(url.toURI()).toFile())) {\n\t\t\t\t// Ecriture du fichier JSON avec formatage\n\t\t\t\t// (WithDefaultPrettyPrinter)\n\t\t\t\tobjectMapper.writerWithDefaultPrettyPrinter().writeValue(ops, database);\n\t\t\t\tlogger.info(\"OK - fichier JSON mis à jour \" + jsonFile);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tlogger.info(\"KO - FILE_NOT_FOUND\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - FILE_NOT_FOUND\", e);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlogger.info(\"KO - I/O ERROR\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - I/O ERROR\", e);\n\t\t\t} catch (URISyntaxException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "protected abstract boolean onSave(CommitBuilder commit)\n throws IOException, ConfigInvalidException;", "public static void commit(Commit proposal)\n {\n logger.debug(\"committing {}\", proposal);\n RowMutation rm = proposal.makeMutation();\n Table.open(rm.getTable()).apply(rm, true);\n\n synchronized (lockFor(proposal.key))\n {\n PaxosState state = SystemTable.loadPaxosState(proposal.key, proposal.update.metadata());\n SystemTable.savePaxosCommit(proposal, !state.inProgressCommit.isAfter(proposal));\n }\n }", "public void commit() {\n\t\tcommitted = true;\n\t}", "@Override\n public void commitTx() {\n \n }", "@Test\r\n\tpublic void testCommit()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(john, email, johnemail,dirgraph);\r\n\t\r\n\t\t\tassertTrue(\"Uncommitted update should be visible to own connection\",\r\n\t\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertFalse(\"Uncommitted update should only be visible to own connection\",\r\n\t\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertThat(testWriterCon.size(), is(equalTo(0L)));\r\n\t\r\n\t\t\ttestAdminCon.commit();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tlogger.debug(e.getMessage());\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tassertThat(testWriterCon.size(), is(equalTo(1L)));\r\n\t\tassertTrue(\"Repository should contain statement after commit\",\r\n\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\tassertTrue(\"Committed update will be visible to all connection\",\r\n\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t}", "public void commit() throws PolicyContextException{\n\n\tsynchronized(refreshLock) {\n\t if(stateIs(DELETED_STATE)){\n String defMsg=\"Cannot perform Operation on a deleted PolicyConfiguration\";\n String msg=localStrings.getLocalString(\"pc.invalid_op_for_state_delete\",defMsg);\n\t\tlogger.log(Level.WARNING,msg);\n\t\tthrow new UnsupportedOperationException(defMsg);\n\n\t } else {\n \n\t\ttry {\n\n\t\t checkSetPolicyPermission();\n\n\t\t if (stateIs(OPEN_STATE)) {\n\n\t\t\tgeneratePermissions();\n\n\t\t\tsetState(INSERVICE_STATE);\n\t\t }\n\t\t} catch(Exception e){\n String defMsg=\"commit fail for contextod \"+CONTEXT_ID;\n String msg=localStrings.getLocalString(\"pc.commit_failure\",defMsg,new Object[]{CONTEXT_ID,e});\n\t\t logger.log(Level.SEVERE,msg);\n\t\t throw new PolicyContextException(e);\n\t\t}\n\t\tif (logger.isLoggable(Level.FINE)){\n\t\t logger.fine(\"JACC Policy Provider: PC.commit \"+CONTEXT_ID);\n\t\t}\n\t }\n\t \n\t}\n }", "boolean shouldCommit();", "void commit(String tpcid);", "R commit(C change);", "default void registerCommit(Commit commit) {\n }", "void onCommitCreatedEvent(T event);", "protected ManifestCommitter createCommitter(\n TaskAttemptContext context) throws IOException {\n return createCommitter(getOutputDir(), context);\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "private String getCommitTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table VCS_COMMIT(\");\n \t\tbuilder.append(\"VCS_COMMIT_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_IDENTIFIER TEXT,\");\n \t\tbuilder.append(\"AFTER_REVISION_IDENTIFIER TEXT\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "private void createConfigFile() {\n\t\tFile configFile = new File(projectRoot, SC_CONFIG_FILENAME);\n\t\tif (configFile.exists())\n\t\t\treturn;\n\n\t\tServiceCutterConfig config = createInitialServiceCutterConfig();\n\t\ttry {\n\t\t\tFileWriter writer = new FileWriter(configFile);\n\t\t\twriter.write(new Yaml().dumpAs(config, Tag.MAP, FlowStyle.BLOCK));\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new ContextMapperApplicationException(\"Could not create '.servicecutter.yml' file!\", e);\n\t\t}\n\t}", "private long commit(byte[] e) throws IOException, ClassNotFoundException, CheatAttemptException {\n\t\t\n\t\tCmtCommitValue val = committer.generateCommitValue(e);\n\t\tlong id = random.nextLong();\n\t\tcommitter.commit(val, id);\n\t\treturn id;\n\t\t\n\t}", "void commit(String workspace);", "@Override\r\n\t\tpublic void commit() throws SQLException {\n\t\t\t\r\n\t\t}", "ManifestCommitter createCommitter(\n TaskAttemptContext context) throws IOException;", "@Override\r\n\tpublic void commit(String tableName) {\n\t}", "private void checkout(){\n Scanner input = new Scanner(System.in);\n System.out.println(\"checkout commit : \");\n System.out.println(\"masukan nama commit : \"); // nama commit bukan kode hash\n String value = input.nextLine();\n \n // overwrite file commit ke file-untuk-git\n overWriteFile(\"file-untuk-git\", value + \".txt\", false);\n \n \n }", "@Test\n public void testClearCommit() throws ConfigurationException {\n helper.setAutoCommit(false);\n final Configuration config = helper.setUpConfig();\n config.clear();\n assertTrue(config.isEmpty());\n }", "public void commit() {\n\t\ttry {\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"完了したコミット/Commit Done\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Commit Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void commit(Transaction transaction);", "private void commitInitialize(String message){\n Scanner input = new Scanner(System.in);\n if(initialize == null) {\n initialize = new GitHead();\n System.out.println(\"tolong bilang saya anda siapa ? \");\n System.out.println(\"tolong isi username dan email\");\n System.out.println(\"masukan username : \");\n String userName = input.nextLine();\n System.out.println(\"masukan email : \");\n String email = input.nextLine();\n initialize.setUserName(userName);\n initialize.setUserEmail(email);\n // pointer.setInitialize(pointer);\n initialize.setHead(initialize);\n initialize.message = message;\n last = initialize;\n }\n overWriteFile(message,\"file-untuk-git.txt\", true);\n }", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "private void processCommit() throws HsqlException {\n tokenizer.isGetThis(Token.T_WORK);\n session.commit();\n }", "void commitTransaction(ConnectionContext context) throws IOException;", "@Override\n\tpublic void commit() throws Throwable {\n\t\tthrow new Warning(\"please use commit(context)\");\n\t}", "TArea checkout(TCommit commit, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "protected void bindCommitter(Configuration conf) {\n conf.set(COMMITTER_FACTORY_CLASS, MANIFEST_COMMITTER_FACTORY);\n }", "public void commit() throws ResourceException;", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "long getCommitID() {\r\n return commit_id;\r\n }", "public CellEditorProyectGit(){}", "@NonNull\n public String getCommitId() {\n return this.commitId;\n }", "public void commit(String logMsg) throws IOException {\n if (Utils.plainFilenamesIn(INDEX).size() == 0\n && Utils.plainFilenamesIn(REMOVAL).size() == 0) {\n System.out.println(\"No changes added to the commit.\");\n System.exit(0);\n }\n File head = new File(Main.DOTFILE, \"head\");\n if (head.exists()) {\n String parentCommit = Utils.readObject(head, String.class);\n Commit newCommit = new Commit(logMsg, parentCommit);\n helperCommit(newCommit);\n }\n }", "public synchronized void writeCommit(Transaction t) {\n\t\tflush();\n\t\tpw.println(t.transactionId() + \" commit\");\t\n\t\tflush();\n\t}", "void commit() throws StorageException, ValidationException, KeyValueStoreException;", "void setAutoCommit(boolean autoCommit) throws StorageException;", "void commit(boolean isMajor);", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "private void processCommitEntry(SensorShell shell, String author, long timestamp, \r\n Date commitTime, int revision, PerforceChangeListData.PerforceFileData fileData)\r\n throws Exception {\r\n if (shell != null) {\r\n String file = this.fileNamePrefix == null ? \"\" : this.fileNamePrefix;\r\n file += fileData.getFileName();\r\n\r\n Map<String, String> pMap = new HashMap<String, String>();\r\n String timestampString = Tstamp.makeTimestamp(timestamp).toString();\r\n pMap.put(\"SensorDataType\", \"Commit\");\r\n pMap.put(\"Resource\", file);\r\n pMap.put(\"Tool\", \"Perforce\");\r\n pMap.put(\"Timestamp\", timestampString);\r\n pMap.put(\"Runtime\", Tstamp.makeTimestamp(commitTime.getTime()).toString());\r\n pMap.put(\"totalLines\", String.valueOf(fileData.getTotalLines()));\r\n pMap.put(\"linesAdded\", String.valueOf(fileData.getLinesAdded()));\r\n pMap.put(\"linesDeleted\", String.valueOf(fileData.getLinesDeleted()));\r\n pMap.put(\"linesModified\", String.valueOf(fileData.getLinesModified()));\r\n shell.add(pMap);\r\n if (this.isVerbose) {\r\n System.out.printf(\"Sending Perforce Commit: Timestamp: %s Resource: %s User: %s%n\", \r\n timestampString, file, shell.getProperties().getSensorBaseUser());\r\n }\r\n }\r\n }", "public static void main(String[] args) {\nSystem.out.println(\"nagarjuna is .................\");\r\n//second commit\r\nSystem.out.println(\"vinay is ..............................\");\r\n//third commit\r\nSystem.out.println(\"vinay is a ?\");\r\n\t}", "byte[] submit() throws CommitException;", "public void setAutoCommit (int value) {\n this.autoCommit = value;\n }", "public void commit() {\n\t\tcommitted = true;\n\t\tbackUp();\n\t\t//back up the current board info at the meanwhile\n\t}", "@Test\n public void testAddPropertyDirectCommit() throws ConfigurationException {\n helper.setAutoCommit(false);\n final DatabaseConfiguration config = helper.setUpConfig();\n config.addPropertyDirect(\"key\", \"value\");\n assertTrue(config.containsKey(\"key\"));\n }", "@Override\r\n\tpublic boolean commit() {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"commit\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.executeUpdate();\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public SfJdDocAudit newCommitFN(SfJdDocAudit qx, RequestMeta requestMeta) {\n String comment=qx.getComment();\r\n qx=saveFN(qx, requestMeta);\r\n wfEngineAdapter.newCommit(comment, qx, requestMeta);\r\n sendMsgAudit(qx,requestMeta);\r\n return selectByPrimaryKey(qx.getJdDocAuditId(),requestMeta);\r\n }", "public void saveFiBcoinPayconfig(FiBcoinPayconfig fiBcoinPayconfig);", "public boolean commit() {\n\t\tif (blocks.size() <= 1) return false;\n\n\t\tHashMap<String, Integer> pairMap = new HashMap<String, Integer>();\n\t\tHashMap<Integer, Integer> countMap = new HashMap<Integer, Integer>();\n\n\t\tListIterator<Transaction> iterator = blocks.listIterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tTransaction block = iterator.next();\n\t\t\tpairMap.putAll((Map<? extends String, ? extends Integer>) block.getNameValue());\n\t\t}\n\n\t\tfor (Entry<String, Integer> entry : pairMap.entrySet()) {\n\t\t\tInteger value = entry.getValue();\n\t\t\tif(countMap.get(value) == null){\n\t\t\t\tcountMap.put(value, new Integer(1));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap.put(value, new Integer(countMap.get(value) + 1));\n\t\t\t}\n\t\t\tpairMap.put(entry.getKey(),entry.getValue());\n\t\t}\t\t\n\n\t\tblocks = new LinkedList<Transaction>();\n\t\tblocks.add(new Transaction(pairMap, countMap));\n\n\t\treturn true;\n\t}", "@Override\n public CommitState commit(CommitMessage message) {\n commitHandler.write(message);\n return CommitState.newBuilder()\n .setTime(clock.currentTime().toEpochMillis())\n .build();\n }", "@Override\n\tpublic void commit(boolean onSave) {\n\t\tsuper.commit(onSave);\n\t}", "public void setCommit(boolean commit) {\n\t\tthis.commit = commit;\n\t}", "void checkoutIntoArea(TCommit commit, TRepo repo, TArea areaToUpdate, ContentFactory<TContent> contentFactory);", "public static slm_notifications.proxies.Commitment initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)\r\n\t{\r\n\t\treturn new slm_notifications.proxies.Commitment(context, mendixObject);\r\n\t}", "void commit( boolean onSave );", "public void commitWriter () {\n try {\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String args[]) throws Exception\n {\n\n DataSourceTransactionManager txManager = (DataSourceTransactionManager)context.getBean(\"txManager\");\n\n DefaultTransactionDefinition definition = new DefaultTransactionDefinition();\n TransactionStatus ts = txManager.getTransaction(definition);\n\n try{\n\n txManager.commit(ts);\n }catch (Exception e){\n txManager.rollback(ts);\n }\n\n }", "public TransactionalElement<E> commit();", "public void commitEntity();", "void commit() throws SoarException\n {\n // if lazy, commit\n if(db != null && params.lazy_commit.get() == LazyCommitChoices.on)\n {\n // Commit and then start next lazy-commit transaction\n try\n {\n db.commitExecuteUpdate( /* soar_module::op_reinit */);\n db.beginExecuteUpdate( /* soar_module::op_reinit */);\n }\n catch(SQLException e)\n {\n throw new SoarException(\"Error while forcing commit: \" + e.getMessage(), e);\n }\n }\n \n }", "public void addCommit(Commit commit) throws IOException {\n String fileName = commit.getShaCode();\n File actualFile = new File(Main.ALL_COMMITS, fileName);\n if (!actualFile.exists()) {\n actualFile.createNewFile();\n }\n Utils.writeObject(actualFile, commit);\n }", "public void commitTransaction() {\n\r\n\t}", "protected ManifestCommitter createCommitter(\n Path outputPath,\n TaskAttemptContext context) throws IOException {\n return new ManifestCommitter(outputPath, context);\n }", "Builder withAutoCommitBufferSizeInKiB(int sizeInKiB);", "public void commitChanges()\n {\n }", "public static void commit(String message) throws IOException {\n stagingArea = Utils.readObject(STAGING_FILE, HashMap.class);\n stagingRemoveArea = Utils.readObject(STAGING_REMOVE_FILE, HashMap.class);\n\n if (stagingArea.size() == 0 && stagingRemoveArea.size() == 0){\n exitWithError(\"No changes added to the commit.\");\n }\n\n //Gets current head commit Object + name\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n //creates a list of parent ids for the new commit object\n ArrayList<String> parentsIDs = new ArrayList<String>(1);\n parentsIDs.add(0, currName);\n\n //creates a new commit with the parent IDs, and the bobs contained in headCommit (curr)\n Commit newCommit = new Commit(message, parentsIDs, curr.fileBlobs);\n\n //Staging area work\n //TODO: move line upwards so you can check if staging area is empty before anything else\n newCommit.updateCommitBlobs(stagingArea, stagingRemoveArea);\n\n //makes a new commitID, and saves new commit with that ID\n String newCommitId = Utils.sha1(Utils.serialize(newCommit));\n newCommit.saveCommit(newCommitId);\n\n stagingArea.clear();\n stagingRemoveArea.clear();\n Utils.writeObject(STAGING_FILE, stagingArea);\n Utils.writeObject(STAGING_REMOVE_FILE, stagingRemoveArea);\n\n //TODO: figure out how to send in the correct branch to head\n commitPointers.updateBranches(commitPointers.readHeadCommit()[0], newCommitId);\n commitPointers.updateHead(commitPointers.readHeadCommit()[0], newCommitId);\n }", "void setCommitID(long commit_id) {\r\n this.commit_id = commit_id;\r\n }", "public void forceCommitTx()\n{\n}" ]
[ "0.7186399", "0.6279241", "0.6279241", "0.62243694", "0.6139334", "0.59712666", "0.5907581", "0.5885043", "0.58691144", "0.5783775", "0.5730513", "0.56865394", "0.56865394", "0.5655236", "0.56346875", "0.56054133", "0.5592019", "0.55720156", "0.55261475", "0.5518569", "0.5494773", "0.5492168", "0.54388446", "0.5410113", "0.54088676", "0.5405128", "0.5390463", "0.5371349", "0.53614324", "0.53496736", "0.53144795", "0.53071654", "0.5300753", "0.52893853", "0.5260046", "0.52546495", "0.52144223", "0.5198957", "0.5197487", "0.5185548", "0.51620674", "0.51606107", "0.51469874", "0.5123435", "0.50955474", "0.5073227", "0.5061639", "0.5058635", "0.5058635", "0.5058635", "0.5058635", "0.5058635", "0.50521463", "0.50465405", "0.5043967", "0.5034944", "0.5029993", "0.5029632", "0.50206137", "0.50206137", "0.50206137", "0.50206137", "0.49847397", "0.49805176", "0.4978212", "0.49609128", "0.49600497", "0.49080378", "0.490791", "0.49073437", "0.49033257", "0.4903169", "0.4900623", "0.4900043", "0.4888756", "0.48843423", "0.48825306", "0.48818398", "0.48731846", "0.4872553", "0.48705214", "0.48685366", "0.48637888", "0.48623496", "0.4853576", "0.48526007", "0.48453188", "0.4841365", "0.48275113", "0.48113838", "0.48072135", "0.48064524", "0.4806181", "0.4797832", "0.4793313", "0.4783252", "0.47828698", "0.47750053", "0.4773694", "0.4772778" ]
0.55161834
20
Created by wuhaijun on 2017/8/22.
public interface UserJpaDao extends JpaRepository<User,Integer> { User findByIdAndName(int id,String name); User findTopByOrderByAgeDesc(); List<User> findTop3ByOrderByAgeDesc(); /** * 自定义SQL查询 */ @Transactional(timeout = 10) @Query("select u from User u where name = ?1") User findByName(String name); @Query("select u from User u where u.age = :age") User findByAge(@Param("age") int age); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "private void init() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo4359a() {\n }", "private void strin() {\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 void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void getExras() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "@Override\n public void init() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "private void init() {\n\n\n\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public void mo6081a() {\n }", "public void gored() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo55254a() {\n }", "@Override\n protected void init() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "Petunia() {\r\n\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private zza.zza()\n\t\t{\n\t\t}", "public Pitonyak_09_02() {\r\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void init(){\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}" ]
[ "0.619333", "0.615737", "0.59925926", "0.5950664", "0.59217024", "0.5919986", "0.5919986", "0.5878495", "0.58667433", "0.5861528", "0.58367074", "0.5825258", "0.58147645", "0.5800459", "0.5790724", "0.57599175", "0.5745617", "0.57368153", "0.5733922", "0.5715858", "0.57144094", "0.57128525", "0.56892484", "0.56802255", "0.56711125", "0.56654036", "0.56654036", "0.56616676", "0.56450623", "0.5640292", "0.5635176", "0.561761", "0.561761", "0.561761", "0.561761", "0.561761", "0.5615942", "0.56085944", "0.56022877", "0.5596071", "0.55885667", "0.55761594", "0.5573048", "0.5571742", "0.5571742", "0.555884", "0.5558806", "0.5558806", "0.5558806", "0.5557525", "0.5549876", "0.5549876", "0.5549876", "0.55424756", "0.5539345", "0.5539345", "0.5539345", "0.55323446", "0.5532109", "0.5531571", "0.5531571", "0.5531571", "0.5531571", "0.5531571", "0.5531571", "0.5531571", "0.5509131", "0.55053854", "0.54975253", "0.5480009", "0.5473661", "0.54728913", "0.5472827", "0.5465988", "0.5465988", "0.5465988", "0.5465988", "0.5465988", "0.5465988", "0.546094", "0.54476845", "0.5442306", "0.544213", "0.54407525", "0.5440364", "0.5440364", "0.5430977", "0.54261", "0.54235286", "0.54231584", "0.5416049", "0.53984815", "0.53949374", "0.53945917", "0.5393391", "0.5392891", "0.53770876", "0.5372947", "0.5364671", "0.5354789", "0.5354789" ]
0.0
-1
Check if the tag matches the selector
public boolean matches(Tag tag) { for (Selector token : selectors) { if (token.matches(tag)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isElementPresent(By cssSelector) {\n\treturn false;\n}", "public boolean containsTag(String tagName);", "boolean hasTag(Tag tag);", "public boolean anyTagFound (Tags selTags) {\n\n boolean tagSelected = false;\n if (selTags == null || selTags.length() == 0) {\n tagSelected = true;\n } else {\n int i = 0;\n String selTag = selTags.getTag(i);\n while (selTag.length() > 0 && (! tagSelected)) {\n tagSelected = tagFound (selTag);\n if (! tagSelected) {\n i++;\n selTag = selTags.getTag(i);\n }\n } // While more item tags for comparision \n } // End if we have selection tags\n return tagSelected;\n }", "public boolean is(String selector) {\n\t\treturn IsFunction.is(this, elements, selector);\n\t}", "public boolean match( ElementExp p ) { return false; }", "static ElementExists containsElement(String cssSelector) {\n return new ElementExists(cssSelector);\n }", "public boolean matchesTag(int tag) {\n if (super.matchesTag(tag)) {\n return true;\n }\n if (this.mLayout != null) {\n Spanned text = (Spanned) this.mLayout.getText();\n for (RCTRawText span : (RCTRawText[]) text.getSpans(0, text.length(), RCTRawText.class)) {\n if (span.getReactTag() == tag) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean contains(String tag){\n return tags.contains(tag);\n }", "protected abstract <T> T match(SelectorModel<T> model, T element);", "public boolean matchesTagPatterns(final String tag) {\n\t\treturn false;\n\t}", "boolean hasTagValue();", "public boolean select(String element) {\n \t\t\t\t\t\t\t\tif (element.startsWith(\"plugin\")) //$NON-NLS-1$\n \t\t\t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\t\treturn false;\n \t\t\t\t\t\t\t}", "public interface Selector {\n \n \t\t/*\n \t\t * Method is called to pre-select a specific xml type. Pre-selected\n \t\t * elements are then fully parsed and result in calls to full\n \t\t * select method.\n \t\t * @return <code>true</code> is the element should be considered,\n \t\t * <code>false</code> otherwise\n \t\t */\n \t\tpublic boolean select(String entry);\n \n \t\t/*\n \t\t * Method is called with a fully parsed element.\n \t\t * @return <code>true</code> to select this element and terminate the parse,\n \t\t * <code>false</code> otherwise\n \t\t */\n \t\tpublic boolean select(String element, HashMap attributes);\n \t}", "boolean isSetTag();", "boolean hasTags();", "public static boolean isElementPresent(By selector,WebDriver driver)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdriver.findElement(selector);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private static boolean hasTag(String value) {\n return value.contains(\"<\") || value.contains(\">\");\n }", "public static boolean isExistHTMLTag(String tag) {\r\n\t\tfinal Matcher matcher = HTML_TAG_PATTERN.matcher(tag);\r\n\t\treturn matcher.matches();\r\n\t}", "public boolean select(String element, HashMap attributes);", "private boolean tagsMatch(Tag target, Tag test) {\n\t\tboolean checkValue = target.getValue() != null;\n\n\t\tif (checkValue) {\n\t\t\tif (test.equalsTypeValue(target))\n\t\t\t\treturn true;\n\n\t\t} else if (test.equalsType(target))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "protected boolean isTargetTag(String tag) {\n\t\treturn this.nlpTagSet.contains(tag);\n\t}", "boolean hasTigTag();", "public boolean hasRuleSelector()\n {\n return (this.ruleSelector != null) && !this.ruleSelector.equals(\"\");\n }", "public static boolean elementAvailiable(String s) { // Check if page contains\n\t\tboolean available=false; \n\t\ttry {\n\t\t\tif(driver.getPageSource().contains(s)){\n\t\t\t\tavailable=true;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn available; \n\t}", "public boolean checkTag(String tagToCheck){\r\n \t\treturn tags.containsKey(tagToCheck);\r\n \t}", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> contains(String field, String propertyValue);", "private boolean endTagRequired(UAElement element) {\n \t\tString elementName = element.getElementName();\n \t\tif (\"a\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"p\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"div\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"script\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"textarea\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\treturn false;\n \t}", "boolean nextSimpleSelector(CSSParser.Selector selector) throws CSSParseException\n {\n if (empty())\n return false;\n\n int start = position;\n CSSParser.Combinator combinator = null;\n CSSParser.SimpleSelector selectorPart = null;\n\n if (!selector.isEmpty())\n {\n if (consume('>')) {\n combinator = CSSParser.Combinator.CHILD;\n skipWhitespace();\n } else if (consume('+')) {\n combinator = CSSParser.Combinator.FOLLOWS;\n skipWhitespace();\n }\n }\n\n if (consume('*')) {\n selectorPart = new CSSParser.SimpleSelector(combinator, null);\n } else {\n String tag = nextIdentifier();\n if (tag != null) {\n selectorPart = new CSSParser.SimpleSelector(combinator, tag);\n selector.addedElement();\n }\n }\n\n while (!empty())\n {\n if (consume('.'))\n {\n // \".foo\" is equivalent to *[class=\"foo\"]\n if (selectorPart == null)\n selectorPart = new CSSParser.SimpleSelector(combinator, null);\n String value = nextIdentifier();\n if (value == null)\n throw new CSSParseException(\"Invalid \\\".class\\\" simpleSelectors\");\n selectorPart.addAttrib(CSSParser.CLASS, CSSParser.AttribOp.EQUALS, value);\n selector.addedAttributeOrPseudo();\n continue;\n }\n\n if (consume('#'))\n {\n // \"#foo\" is equivalent to *[id=\"foo\"]\n if (selectorPart == null)\n selectorPart = new CSSParser.SimpleSelector(combinator, null);\n String value = nextIdentifier();\n if (value == null)\n throw new CSSParseException(\"Invalid \\\"#id\\\" simpleSelectors\");\n selectorPart.addAttrib(CSSParser.ID, CSSParser.AttribOp.EQUALS, value);\n selector.addedIdAttribute();\n continue;\n }\n\n // Now check for attribute selection and pseudo selectors\n if (consume('['))\n {\n if (selectorPart == null)\n selectorPart = new CSSParser.SimpleSelector(combinator, null);\n skipWhitespace();\n String attrName = nextIdentifier();\n String attrValue = null;\n if (attrName == null)\n throw new CSSParseException(\"Invalid attribute simpleSelectors\");\n skipWhitespace();\n CSSParser.AttribOp op = null;\n if (consume('='))\n op = CSSParser.AttribOp.EQUALS;\n else if (consume(\"~=\"))\n op = CSSParser.AttribOp.INCLUDES;\n else if (consume(\"|=\"))\n op = CSSParser.AttribOp.DASHMATCH;\n if (op != null) {\n skipWhitespace();\n attrValue = nextAttribValue();\n if (attrValue == null)\n throw new CSSParseException(\"Invalid attribute simpleSelectors\");\n skipWhitespace();\n }\n if (!consume(']'))\n throw new CSSParseException(\"Invalid attribute simpleSelectors\");\n selectorPart.addAttrib(attrName, (op == null) ? CSSParser.AttribOp.EXISTS : op, attrValue);\n selector.addedAttributeOrPseudo();\n continue;\n }\n\n if (consume(':'))\n {\n if (selectorPart == null)\n selectorPart = new CSSParser.SimpleSelector(combinator, null);\n parsePseudoClass(selector, selectorPart);\n continue;\n }\n\n break;\n }\n\n if (selectorPart != null)\n {\n selector.add(selectorPart);\n return true;\n }\n\n // Otherwise 'fail'\n position = start;\n return false;\n }", "private boolean isIgnoredByTag(ExtensionContext context) {\n AnnotatedElement element = context.getElement().get();\n return isIgnoredByTag(element);\n }", "protected boolean selectionIsAppropriate(Element selection) {\n return selection.getName().equals(FormatType.EMPTY.getElementName());\n }", "public static Predicate<BiomeSelectionContext> tag(TagKey<Biome> tag) {\n\t\treturn context -> context.hasTag(tag);\n\t}", "private Boolean isTag(String tagID) {\n\t\t\n\t\tif (tagManager.resolve(tagID) != null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tlog.warn(DEBUG_PREFIX + \"Tag ID passed in tags argument is invalid: \" + tagID);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "boolean hasElement();", "boolean hasMatchedElements();", "public boolean isSelectorNeeded() {\n if (!m_selectChecked) {\n if (m_selectorType != NestingCustomBase.SELECTION_UNCHECKED) {\n \n // before reporting selector needed, make sure at least once child is going to be present\n for (int i = 0; i < m_values.size(); i++) {\n DataNode node = (DataNode)m_values.get(i);\n if (!node.isIgnored()) {\n m_selectNeeded = true;\n break;\n }\n }\n \n }\n m_selectChecked = true;\n }\n return m_selectNeeded;\n }", "public boolean anyTagFound (String tags2) {\n return anyTagFound (new Tags (tags2));\n }", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> equals(String field, String propertyValue);", "private boolean isTag(String item) {\n return storiesToTags.keySet().contains(item);\n }", "@Override\r\n public boolean equals(Object obj) {\r\n return obj != null\r\n && getClass() == obj.getClass()\r\n && Objects.equals(tagName, obj.toString());\r\n }", "public boolean is(String expr) {\r\n\t\treturn jquery.is(this, expr, webDriver);\r\n\t}", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> containsAny(String field, String... values);", "public LanguageAssert hasTag(String tag) {\n\t\tassertThat(actual.getLanguageTag()).as(descriptionText() + \" tag\").isEqualTo(tag);\n\t\treturn this;\n\t}", "private boolean checkTag(String tag) {\n if (tag.length() < 1) {\n return false;\n }\n char c = tag.charAt(0);\n if (!(c >= 'a' && c <= 'z')) {\n return false;\n }\n for (int i = 1; i < tag.length(); ++i) {\n c = tag.charAt(i);\n if (!(c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '-')) {\n return false;\n }\n }\n return true;\n }", "public boolean contains(String tagName, PageContext pageContext) throws IOException\n {\n /*\n * TODO JSPs using a different encoding then the system default will break here if the values for the characters in the opening\n * or closing tags are different. Not sure how to grab the encoding from the JSP that created the current content automatically.\n * Maybe add a filter parameter to specify the encoding if it's different then default.\n */\n byte[] tagNameBytes = tagName.getBytes();\n byte[] openTagBytes = new byte[tagNameBytes.length + 2];\n openTagBytes[0] = LESS_THAN;\n for (int i = 0; i < tagNameBytes.length; i++)\n {\n openTagBytes[i + 1] = tagNameBytes[i];\n }\n openTagBytes[openTagBytes.length - 1] = GREATER_THAN;\n\n int openTagIndex = indexOf(content, openTagBytes);\n if (openTagIndex >= 0)\n {\n byte[] closedTagBytes = new byte[tagNameBytes.length + 3];\n closedTagBytes[0] = LESS_THAN;\n closedTagBytes[1] = SOLIDUS;\n for (int i = 0; i < tagNameBytes.length; i++)\n {\n closedTagBytes[i + 2] = tagNameBytes[i];\n }\n closedTagBytes[closedTagBytes.length - 1] = GREATER_THAN;\n\n int closeTagIndex = lastIndexOf(content, closedTagBytes);\n return (closeTagIndex > openTagIndex);\n }\n else\n {\n return false;\n }\n }", "public interface ISelector {\n\t\tboolean accept(int startOffset, int endOffset);\n\t}", "public static boolean matches(EndElement endElement, String tag) {\n String elementTag = getElementName(endElement);\n return tag.equals(elementTag);\n }", "public void verifySelectedPageScreenIsDisplayed(String tagName, String text) {\n\t\tWebElement pagetitle = findElement(By.xpath(\"//\" + tagName + \"[contains(text(),'\" + text + \"')]\"));\n moveToElement(pagetitle);\n Assert.assertTrue(isElementPresent(pagetitle));\n\t}", "public boolean isSelectorType() {\n return m_selectorType != NestingCustomBase.SELECTION_UNCHECKED;\n }", "private boolean isIgnoredByTag(AnnotatedElement element) {\n Tag[] annotations = element.getDeclaredAnnotationsByType(Tag.class);\n\n if (annotations.length == 0 || enabledTags.isEmpty()) {\n LOGGER.info(\"Test method {} is not ignored by tag\", ((Method) element).getName());\n return false;\n }\n\n for (Tag annotation : annotations) {\n if (enabledTags.contains(annotation.value())) {\n LOGGER.info(\"Test method {} is not ignored by tag: {}\", ((Method) element).getName(), annotation.value());\n return false;\n }\n }\n LOGGER.info(\"Test method {} is ignored by tag\", ((Method) element).getName());\n return true;\n }", "String getSelector();", "@Test\n public void withAttribute_Matching() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EQUALS, \"en-US\").size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \"content\").size());\n assertEquals(0, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EQUALS, \" content\").size());\n }", "public boolean containAttribute(String name);", "public static boolean matches(StartElement startElement, String tag) {\n String elementTag = StaxParserUtil.getElementName(startElement);\n return tag.equals(elementTag);\n }", "@Override\n public boolean isTagged() {\n for (List<String> t : tags.values()) {\n if(!t.isEmpty()) return true;\n }\n return false;\n }", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> doesNotContain(String field, String propertyValue);", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> equalsId(Long id);", "public boolean match(Event e);", "public boolean searchTag(String s){\n\t\tfor(String a : tags)\n\t\t\tif(a.equalsIgnoreCase(s))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "public void verifyUIElements(){\r\n\t\t\tisClickable(Txt_HomePage_Search);\r\n\t\t\tisClickable(Btn_HomePage_Search);\r\n\t\t}", "static boolean tagExists(CompoundTag tag, String key) {\n return tag.getValue().get(key) != null;\n }", "@Test\n public void testAccept() {\n Tag tag = new BaseTag(HtmlElement.DIV);\n TagVisitorMockup visitor = new TagVisitorMockup();\n tag.accept(visitor);\n assertEquals(\"Wrong CompositeTag\", tag, visitor.getBaseTag());\n }", "@Then(\"^assert that the text \\\"([^\\\"]*)\\\" element has \\\"([^\\\"]*)\\\"$\")\n\tpublic void assert_that_the_text_element_has(String arg1, String arg2) throws Throwable {\n\t\tString[] parts = arg1.split(\"=\");\n\t\tString selector=parts[1];\n\t\tString result = driver.findElement(By.cssSelector(selector)).getText();\n\t\tAssert.assertTrue(\"Text is not included\", result.contains(arg2));\n\t\tSystem.out.println(\"Assert \"+ result +\" contain the text : \"+arg2 );\n\t}", "public boolean\nmatches( SoElement element)\n{\n//#ifdef DEBUG\n SoDebugError.post(\"SoLazyElement.matches\", \n \"Should never be called\\n\");\n//#endif\n return true;\n}", "public boolean isSetTag() {\n return this.tag != null;\n }", "boolean hasSetAttribute();", "@Override\n public boolean hasTagProcessor(String uri, String localName) {\n return cdiManager.exists(Object.class, new TemplateProcessorLiteral(uri, localName));\n }", "public Selector getSelector();", "public Selector getSelector();", "public boolean match(String nodeName, int depth) {\n int elementIndex = depth - 1;\n checkElementIndex(elementIndex, elements.length);\n String e = elements[elementIndex];\n return STAR.equals(e) || nodeName.equals(e);\n }", "public static boolean isAdded() {\r\n\tSelect BagTypeDesc = new Select(Browser.instance.findElement(BagTypeDescriptionDropdown));\r\n\tBoolean found = false;\r\n\tList<WebElement> allOptions = BagTypeDesc.getOptions();\r\n\tloop:\r\n\tfor (WebElement we : allOptions) {\r\n \r\n if (we.getText().contains(RandomString)) {\r\n found = true;\r\n System.out.println(\"The \"+ RandomString +\" has been added to BagType description\");\r\n break loop;\r\n \r\n }\r\n\t}\r\n\treturn found;\r\n}", "@Test\n public void isSellableTest() {\n // TODO: test isSellable\n }", "boolean hasIsNodeOf();", "boolean matches(String medium, CSSCanvas canvas);", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER, AdsUtility.SELECTOR_FIELD})\n SelectorBuilderInterface<SelectorT> contains(EntityField field, String propertyValue);", "public boolean matches(ClassDoc cd) {\n\tif(pattern.matcher(cd.toString()).matches())\n\t return true;\n\t\n\t// recurse on supeclass, if available\n\tif(cd.superclass() != null)\n\t return matches(cd.superclass());\n\t\n\treturn false;\n }", "private static boolean isSuitableElement(Element element) {\n \n \t\tif (element instanceof ElementCSSInlineStyle\n \t\t\t\t&& isAttributeAvailable(element, STYLE_TAG_NAME)) {\n \t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}", "public boolean tagFound (String from) {\n boolean found = (from.length() == 0);\n int e = 0;\n int s = indexOfNextWordStart (tags, e, slashToSeparate);\n\n // Go through tags, looking for complete tags\n while (s < tags.length() && (! found)) {\n e = indexOfNextSeparator (tags, s, false, true, slashToSeparate);\n if (from.equalsIgnoreCase (tags.substring (s, e))) {\n found = true;\n } else {\n s = indexOfNextWordStart (tags, e, slashToSeparate);\n }\n }\n return found;\n }", "@Test\n public void withAttribute_Existing() {\n assertEquals(1, onPage.withAttribute(\"lang\", MatchType.EXISTING, null).size());\n assertEquals(3, onPage.get(\"div.article div\").withAttribute(\"class\", MatchType.EXISTING, null).size());\n }", "@Test\n public void keywordSelectTest() {\n\n onView(withId(R.id.fab)).perform(click());\n\n try{\n Thread.sleep(2000);\n } catch(Exception e) {\n\n }\n\n onView(withText(\"Cat\")).check(matches(isDisplayed()));\n onView(withText(\"Dog\")).check(matches(isDisplayed()));\n\n DataInteraction constraintLayout = onData(anything())\n .inAdapterView(allOf(withId(R.id.keyword_list_view),\n childAtPosition(\n withClassName(is(\"android.support.constraint.ConstraintLayout\")),\n 0)))\n .atPosition(1);\n\n constraintLayout.perform(click());\n\n try{\n Thread.sleep(2000);\n } catch(Exception e) {\n\n }\n\n onView(allOf(withText(\"Dog\"), withId(R.id.test_result_view))).check(matches(isDisplayed()));\n\n }", "private static boolean ElementTest_2_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"ElementTest_2_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = ElementNameOrWildcard(b, l + 1);\n r = r && ElementTest_2_0_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "boolean isNilTag();", "static ElementDoesNotExist doesNotContainElement(String cssSelector) {\n return new ElementDoesNotExist(cssSelector);\n }", "Selector getSelector();", "public boolean hasAttribute(final String elementLocator, final String attributeName, final String textPattern);", "private static boolean matches(XmlPullParser parser, String mcc, String mnc) {\n boolean mccMatches = false;\n boolean mncMatches = false;\n boolean isMMSType = false;\n for (int i = 0; i < parser.getAttributeCount(); i++) {\n String name = parser.getAttributeName(i);\n String value = parser.getAttributeValue(i);\n if (\"mcc\".equals(name) && mcc.equals(value)) {\n mccMatches = true;\n } else if (\"mnc\".equals(name) && mnc.equals(value)) {\n mncMatches = true;\n } else if (\"type\".equals(name) &&\n !TextUtils.isEmpty(value) && value.contains(\"mms\")) {\n isMMSType = true;\n }\n }\n return mccMatches && mncMatches && isMMSType;\n }", "public static boolean isClassicTag(String tag){\n\t\treturn clsBalises.contains(tag);\n\t}", "private final boolean isMatch(Element e, boolean isMatch) {\n\n\t\tCollection<Attribute> attributes = e.getAttributes().values(); //PERF\n\t\t//Attribute[] myAttributes = this.getAttributes();\n\n\t\tisMatch = ( e.getName() == null || e.getName().equals(\"*\") ) \n\t\t|| ( (e.isQbeEquality() && e.getName().equalsIgnoreCase(this.getName())) || (!e.isQbeEquality() && !e.getName().equalsIgnoreCase(this.getName())) ) ;\n\n\t\tisMatch = isMatch\n\t\t&& (e.getValue() == null || (this.getValue() != null && \n\t\t\t\t(e.isQbeEquality() && e.getValue().equalsIgnoreCase(this.getValue())) || (!e.isQbeEquality() && !e.getValue().equalsIgnoreCase(this.getValue())) ));\n\n\t\tString attName = null, value = null, myValue = null;\n\t\tAttribute myAtt = null;\n\t\tboolean attMustMatch;\n\n\t\tfor (Attribute att : attributes) {\n\t\t\t\n\t\t\tattName = att.getName();\n\t\t\tvalue = att.getValue();\n\t\t\tattMustMatch = att.isQbeMatch();\n\n\t\t\tmyAtt = this.getAttribute(attName);\n\n\t\t\tif (myAtt != null)\n\t\t\t\tmyValue = myAtt.getValue();\n\n\t\t\t// (value == null) 071207 \n\t\t\tisMatch = isMatch\n\t\t\t&& ( (value == null) || (myAtt != null\n\t\t\t\t\t&& value.equals(\"*\") ) \n\t\t\t\t\t|| (myValue != null && myValue\n\t\t\t\t\t\t\t.equalsIgnoreCase(\"*\")) || (myValue != null && \n\t\t\t\t\t\t\t\t\t( attMustMatch && myValue.equalsIgnoreCase(value) ) || ( !attMustMatch && !myValue.equalsIgnoreCase(value) ) ));\n\n\t\t\t\n\t\t\tif ( ! isMatch )\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor (Element child : e.getAllChildren()) {\n\n\t\t\tboolean match = false;\n\n\t\t\tfor (Element myChild : this.getAllChildren()) {\n\n\t\t\t\tmatch = match || myChild.isMatch(child, isMatch);\n\t\t\t\t\n\t\t\t\tif ( match )\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tisMatch = isMatch && match;\n\n\t\t\tif ( !isMatch )\n\t\t\t\tbreak;\n\n\t\t}\n\t\treturn isMatch;\n\n\t}", "private void checkSearchViewExists() {\n onView(withId(R.id.searchView)).check(matches(isDisplayed()));\n }", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "boolean hasContent();", "private boolean selectionFound(JTextPane pane) {\r\n\t\tfinal int selectionStart = pane.getSelectionStart();\r\n\t\tfinal int selectionEnd = pane.getSelectionEnd();\r\n\t\treturn selectionStart != selectionEnd;\r\n\t}", "public static boolean isHTMLMatched(String html) {\n Stack<String> buffer = new LinkedStack<>();\n int j = html.indexOf('<'); // find first ’<’ character (if any)\n while (j != -1) {\n int k = html.indexOf('>', j + 1); // find next ’>’ character\n if (k == -1)\n return false; // invalid tag\n String tag = html.substring(j + 1, k); // strip away < >\n if (!tag.startsWith(\"/\")) // this is an opening tag\n buffer.push(tag);\n else { // this is a closing tag\n if (buffer.isEmpty())\n return false; // no tag to match\n if (!tag.substring(1).equals(buffer.pop()))\n return false; // mismatched tag\n }\n j = html.indexOf('<', k + 1); // find next ’<’ character (if any)\n }\n return buffer.isEmpty(); // were all opening tags matched?\n }", "public boolean hasText(final String elementLocator, final String textPattern);", "public boolean isElementPresent(final String elementLocator);" ]
[ "0.6358083", "0.6083923", "0.594375", "0.58909774", "0.587158", "0.5639336", "0.5587393", "0.5569775", "0.55376637", "0.55283505", "0.55099183", "0.54367125", "0.5433736", "0.5423064", "0.53936243", "0.53935003", "0.5370345", "0.53667843", "0.5352708", "0.5339641", "0.5215382", "0.5212236", "0.5162738", "0.5162351", "0.5126011", "0.51154375", "0.51073974", "0.51044923", "0.50685704", "0.50403666", "0.50263745", "0.50164723", "0.5011075", "0.4988478", "0.49605173", "0.49602288", "0.49516103", "0.4945896", "0.49404445", "0.49327603", "0.49212533", "0.49160442", "0.4894696", "0.48853683", "0.4873359", "0.48660707", "0.48497963", "0.48327017", "0.48256415", "0.48163038", "0.4804186", "0.4802801", "0.47988978", "0.4798654", "0.4786622", "0.47865862", "0.4785095", "0.4775896", "0.4772995", "0.47601703", "0.4758843", "0.47345927", "0.47145978", "0.47107437", "0.47074148", "0.46784967", "0.46764714", "0.46694505", "0.46694505", "0.46653113", "0.46630192", "0.46590292", "0.46538267", "0.46527946", "0.4627518", "0.4624507", "0.4620655", "0.4617285", "0.46147782", "0.45910868", "0.45897236", "0.45806396", "0.45775452", "0.45705143", "0.45679358", "0.45676968", "0.45655596", "0.45588106", "0.45568508", "0.45476082", "0.45476082", "0.45476082", "0.45476082", "0.45476082", "0.45476082", "0.45476082", "0.45373255", "0.45230252", "0.45205587", "0.45196766" ]
0.7011873
0
Caches the company ag in the entity cache if it is enabled.
public void cacheResult(CompanyAg companyAg) { EntityCacheUtil.putResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED, CompanyAgImpl.class, companyAg.getPrimaryKey(), companyAg); companyAg.resetOriginalValues(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cacheResult(List<CompanyAg> companyAgs) {\n\t\tfor (CompanyAg companyAg : companyAgs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCompanyAgImpl.class, companyAg.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(companyAg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcompanyAg.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void cacheResult(ContactCompanyAg contactCompanyAg) {\n\t\tEntityCacheUtil.putResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tContactCompanyAgImpl.class, contactCompanyAg.getPrimaryKey(),\n\t\t\tcontactCompanyAg);\n\n\t\tcontactCompanyAg.resetOriginalValues();\n\t}", "public void cacheResult(List<ContactCompanyAg> contactCompanyAgs) {\n\t\tfor (ContactCompanyAg contactCompanyAg : contactCompanyAgs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAg.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontactCompanyAg.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void cacheResult(EntityDealer entityDealer) {\n EntityCacheUtil.putResult(EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey(), entityDealer);\n\n entityDealer.resetOriginalValues();\n }", "@Override\n\tpublic void cacheResult(EmployeeComplaint employeeComplaint) {\n\t\tEntityCacheUtil.putResult(EmployeeComplaintModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tEmployeeComplaintImpl.class, employeeComplaint.getPrimaryKey(),\n\t\t\temployeeComplaint);\n\n\t\temployeeComplaint.resetOriginalValues();\n\t}", "public void flushEntityCache() {\n super.flushEntityCache();\n }", "public ArrayList<Company> updateCacheList() {\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n\n try {\n Company.pinAll(\"companyList\", query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchant from Parse Database:\\n\" + e.getMessage());\n }\n\n return getCompaniesFromCache();\n }", "@Override\n\tpublic void cacheResult(CreditAppBankReference creditAppBankReference) {\n\t\tEntityCacheUtil.putResult(CreditAppBankReferenceModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tCreditAppBankReferenceImpl.class,\n\t\t\tcreditAppBankReference.getPrimaryKey(), creditAppBankReference);\n\n\t\tcreditAppBankReference.resetOriginalValues();\n\t}", "@Override\n\tpublic void cacheResult(AssetManageReqHandle assetManageReqHandle) {\n\t\tEntityCacheUtil.putResult(AssetManageReqHandleModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tAssetManageReqHandleImpl.class,\n\t\t\tassetManageReqHandle.getPrimaryKey(), assetManageReqHandle);\n\n\t\tassetManageReqHandle.resetOriginalValues();\n\t}", "@Override\n\tpublic void cacheResult(Approvatore approvatore) {\n\t\tentityCache.putResult(ApprovatoreModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tApprovatoreImpl.class, approvatore.getPrimaryKey(), approvatore);\n\n\t\tapprovatore.resetOriginalValues();\n\t}", "@Override\n public void add(IBasicEntity ent) throws CachingException {\n EntityCachingServiceLocator.getEntityCachingService().add(ent);\n }", "@Override\r\n\tpublic void cacheResult(Share share) {\r\n\t\tentityCache.putResult(ShareModelImpl.ENTITY_CACHE_ENABLED,\r\n\t\t\tShareImpl.class, share.getPrimaryKey(), share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,\r\n\t\t\tnew Object[] { share.getUuid(), share.getGroupId() }, share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_NAMEMARKETCOMPANYGROUP,\r\n\t\t\tnew Object[] {\r\n\t\t\t\tshare.getCompanyId(), share.getGroupId(), share.getName(),\r\n\t\t\t\tshare.getMarketId()\r\n\t\t\t}, share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_SYMBOLCOMPANYGROUP,\r\n\t\t\tnew Object[] {\r\n\t\t\t\tshare.getCompanyId(), share.getGroupId(), share.getSymbol()\r\n\t\t\t}, share);\r\n\r\n\t\tshare.resetOriginalValues();\r\n\t}", "public interface OrganizationService extends EntityService<Organization> {\n\n /**\n * 缓存\n *\n * @param id\n * @return\n * @throws Exception\n */\n public Organization queryCacheOrganizationById(long id) throws Exception;\n}", "@Override\n public void update(IBasicEntity ent) throws CachingException {\n EntityCachingServiceLocator.getEntityCachingService().update(ent);\n }", "@Override\r\n\tpublic Company updateCompany(Company company) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void cacheResult(PhatVay phatVay) {\n\t\tentityCache.putResult(\n\t\t\tPhatVayModelImpl.ENTITY_CACHE_ENABLED, PhatVayImpl.class,\n\t\t\tphatVay.getPrimaryKey(), phatVay);\n\n\t\tfinderCache.putResult(\n\t\t\t_finderPathFetchBySoKU, new Object[] {phatVay.getSoKU()}, phatVay);\n\n\t\tphatVay.resetOriginalValues();\n\t}", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "public ArrayList<Company> getCompaniesFromCache() {\n\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n query.fromLocalDatastore();\n\n try {\n return new ArrayList<>(query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchants from local data store:\\n\" + e.getMessage());\n }\n\n return new ArrayList<>();\n }", "public void setCompanyAgId(java.lang.String companyAgId) {\n\t\t_imageCompanyAg.setCompanyAgId(companyAgId);\n\t}", "@Override\n\tpublic void cacheResult(\n\t\tStepDefsCompositeStepDefDBE stepDefsCompositeStepDefDBE) {\n\t\tEntityCacheUtil.putResult(StepDefsCompositeStepDefDBEModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tStepDefsCompositeStepDefDBEImpl.class,\n\t\t\tstepDefsCompositeStepDefDBE.getPrimaryKey(),\n\t\t\tstepDefsCompositeStepDefDBE);\n\n\t\tstepDefsCompositeStepDefDBE.resetOriginalValues();\n\t}", "@Override\n public void cacheResult(List<EntityDealer> entityDealers) {\n for (EntityDealer entityDealer : entityDealers) {\n if (EntityCacheUtil.getResult(\n EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey()) == null) {\n cacheResult(entityDealer);\n } else {\n entityDealer.resetOriginalValues();\n }\n }\n }", "public void resetCache() {\n logger.info(\"resetCache(): refilling clinical attribute cache\");\n\n Date dateOfCurrentCacheRefresh = new Date();\n ArrayList<ClinicalAttributeMetadata> latestClinicalAttributeMetadata = null;\n // latestOverrides is a map of study-id to list of overridden ClinicalAttributeMetadata objects\n Map<String, ArrayList<ClinicalAttributeMetadata>> latestOverrides = null;\n\n // attempt to refresh ehcache stores seperately and store success status\n boolean failedClinicalAttributeMetadataCacheRefresh = false;\n boolean failedOverridesCacheRefresh = false;\n try {\n clinicalAttributeMetadataPersistentCache.updateClinicalAttributeMetadataInPersistentCache();\n } catch (RuntimeException e) {\n logger.error(\"resetCache(): failed to pull clinical attributes from repository. Error message returned: \" + e.getMessage());\n failedClinicalAttributeMetadataCacheRefresh = true;\n }\n\n try {\n clinicalAttributeMetadataPersistentCache.updateClinicalAttributeMetadataOverridesInPersistentCache();\n } catch (RuntimeException e) {\n logger.error(\"resetCache(): failed to pull overrides from repository. Error message returned: \" + e.getMessage());\n failedOverridesCacheRefresh = true;\n }\n\n // regardless of whether ehcache was updated with new data - use that data to populate modeled object caches\n // ensures app starts up (between tomcat restarts) if TopBraid is down\n logger.info(\"Loading modeled object cache from EHCache\");\n try {\n // this will throw an exception if we cannot connect to TopBraid AND cache is corrupt\n latestClinicalAttributeMetadata = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataFromPersistentCache();\n latestOverrides = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataOverridesFromPersistentCache();\n } catch (Exception e) {\n try {\n // this will throw an exception if backup is unavailable\n logger.error(\"Unable to load modeled object cache from default EHCache... attempting to read from backup\");\n latestClinicalAttributeMetadata = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataFromPersistentCacheBackup();\n latestOverrides = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataOverridesFromPersistentCacheBackup();\n if (latestClinicalAttributeMetadata == null || latestOverrides == null) {\n throw new FailedCacheRefreshException(\"No data found in specified backup cache location...\", new Exception());\n }\n } catch (Exception e2) {\n logger.error(\"Unable to load modeled object cache from backup EHCache...\");\n throw new FailedCacheRefreshException(\"Unable to load data from all backup caches...\", new Exception());\n }\n }\n\n // backup cache at this point (maybe backup after each successful update above?)\n if (!failedClinicalAttributeMetadataCacheRefresh && !failedOverridesCacheRefresh) {\n logger.info(\"resetCache(): cache update succeeded, backing up cache...\");\n try {\n clinicalAttributeMetadataPersistentCache.backupClinicalAttributeMetadataPersistentCache(latestClinicalAttributeMetadata);\n clinicalAttributeMetadataPersistentCache.backupClinicalAttributeMetadataOverridesPersistentCache(latestOverrides);\n logger.info(\"resetCache(): succesfully backed up cache\");\n } catch (Exception e) {\n logger.error(\"resetCache(): failed to backup cache: \" + e.getMessage());\n }\n }\n\n HashMap<String, ClinicalAttributeMetadata> latestClinicalAttributeMetadataCache = new HashMap<String, ClinicalAttributeMetadata>();\n for (ClinicalAttributeMetadata clinicalAttributeMetadata : latestClinicalAttributeMetadata) {\n latestClinicalAttributeMetadataCache.put(clinicalAttributeMetadata.getColumnHeader(), clinicalAttributeMetadata);\n }\n\n // latestOverridesCache is a map of study-id to map of clinical attribute name to overridden ClinicalAttributeMetadata object\n HashMap<String, Map<String,ClinicalAttributeMetadata>> latestOverridesCache = new HashMap<String, Map<String, ClinicalAttributeMetadata>>();\n for (Map.Entry<String, ArrayList<ClinicalAttributeMetadata>> entry : latestOverrides.entrySet()) {\n HashMap<String, ClinicalAttributeMetadata> clinicalAttributesMetadataMapping = new HashMap<String, ClinicalAttributeMetadata>();\n for (ClinicalAttributeMetadata clinicalAttributeMetadata : entry.getValue()) {\n fillOverrideAttributeWithDefaultValues(clinicalAttributeMetadata, latestClinicalAttributeMetadataCache.get(clinicalAttributeMetadata.getColumnHeader()));\n clinicalAttributesMetadataMapping.put(clinicalAttributeMetadata.getColumnHeader(), clinicalAttributeMetadata);\n }\n latestOverridesCache.put(entry.getKey(), clinicalAttributesMetadataMapping);\n }\n\n clinicalAttributeCache = latestClinicalAttributeMetadataCache;\n logger.info(\"resetCache(): refilled cache with \" + latestClinicalAttributeMetadata.size() + \" clinical attributes\");\n overridesCache = latestOverridesCache;\n logger.info(\"resetCache(): refilled overrides cache with \" + latestOverrides.size() + \" overrides\");\n\n if (failedClinicalAttributeMetadataCacheRefresh || failedOverridesCacheRefresh) {\n logger.info(\"Unable to update cache with latest data from TopBraid... falling back on EHCache store.\");\n throw new FailedCacheRefreshException(\"Failed to refresh cache\", new Exception());\n } else {\n dateOfLastCacheRefresh = dateOfCurrentCacheRefresh;\n logger.info(\"resetCache(): cache last refreshed on: \" + dateOfLastCacheRefresh.toString());\n }\n }", "public void cacheResult(com.Hotel.model.Hotel hotel);", "@Override\n\tpublic void cacheResult(ScienceAppExecute scienceAppExecute) {\n\t\tEntityCacheUtil.putResult(ScienceAppExecuteModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tScienceAppExecuteImpl.class, scienceAppExecute.getPrimaryKey(),\n\t\t\tscienceAppExecute);\n\n\t\tscienceAppExecute.resetOriginalValues();\n\t}", "@Override\n\tpublic void cacheResult(RigoDocumento rigoDocumento) {\n\t\tEntityCacheUtil.putResult(RigoDocumentoModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tRigoDocumentoImpl.class, rigoDocumento.getPrimaryKey(),\n\t\t\trigoDocumento);\n\n\t\trigoDocumento.resetOriginalValues();\n\t}", "public void setCompany(Company aCompany) {\n company = aCompany;\n }", "public void cacheResult(VCal vCal) {\n\t\tEntityCacheUtil.putResult(VCalModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tVCalImpl.class, vCal.getPrimaryKey(), vCal);\n\n\t\tvCal.resetOriginalValues();\n\t}", "@Override\n\tpublic void cacheResult(Legacydb legacydb) {\n\t\tEntityCacheUtil.putResult(LegacydbModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tLegacydbImpl.class, legacydb.getPrimaryKey(), legacydb);\n\n\t\tlegacydb.resetOriginalValues();\n\t}", "@Nonnull\n public List<CustomerCompany> getCustomerCompanyOrFetch()\n throws ODataException\n {\n if (toCustomerCompany == null) {\n toCustomerCompany = fetchCustomerCompany();\n }\n return toCustomerCompany;\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData getAuditingCompany();", "public EntityMetadata get(String appl, String entityName, boolean refreshCache) {\n if (!refreshCache) {\n EntityMetadata cached = cache.get(appl, entityName);\n if (cached != null) return cached;\n }\n\n List<KeyValuePair<String, String>> params = new ArrayList<>();\n params.add(new KeyValuePair<>(\"TV.APPLICATION\", appl));\n params.add(new KeyValuePair<>(\"TV.ENTITY.NAME\", entityName));\n\n Map<String, String> m = dmiCTXService.executeRaw(\"UT\", \"GET.ENTITY.METADATA\", params);\n\n if (m != null) {\n\n String[] names = split(m.get(\"TV.CDD.NAME\"), VM);\n String[] physNames = split(m.get(\"TV.PHYS.CDD.NAME\"), VM);\n String[] sources = split(m.get(\"TV.SOURCE\"), VM);\n String[] maxStorageSizes = split(m.get(\"TV.MAXIMUM.STORAGE.SIZE\"), VM);\n String[] fieldPlacements = split(m.get(\"TV.FIELD.PLACEMENT\"), VM);\n String[] usageTypes = split(m.get(\"TV.DATABASE.USAGE.TYPE\"), VM);\n String[] defaultDisplaySize = split(m.get(\"TV.DEFAULT.DISPLAY.SIZE\"), VM);\n String[] formatString = split(m.get(\"TV.INFORM.FORMAT.STRING\"), VM);\n String[] conversionString = split(m.get(\"TV.INFORM.CONVERSION.STRING\"), VM);\n String[] dataTypes = split(m.get(\"TV.DATA.TYPE\"), VM);\n String[] assocNames = split(m.get(\"TV.ELEMENT.ASSOC.NAME\"), VM);\n String[] assocTypes = split(m.get(\"TV.ELEMENT.ASSOC.TYPE\"), VM);\n String entityType = m.get(\"TV.ENTITY.TYPE\");\n String guidEnabled = m.get(\"TV.GUID.ENABLED\");\n\n int maxFieldPlacement = 0;\n if (fieldPlacements != null) {\n for (int y = 0; y < fieldPlacements.length; y++) {\n Integer p = getAtIntOrNull(fieldPlacements, y);\n if (p != null && p > maxFieldPlacement) maxFieldPlacement = p;\n }\n }\n\n Map<String, CddEntry> map = new HashMap<>();\n CddEntry[] ordered = new CddEntry[maxFieldPlacement];\n\n if (names != null) {\n for (int x = 0; x < names.length; x++) {\n if (EMPTY_STRING.equals(names[x])) continue;\n\n try {\n CddEntry.CddEntryBuilder b = CddEntry.builder();\n\n CddEntry e = b.name(getAt(names, x))\n .physName(getAt(physNames, x))\n .source(getAt(sources, x))\n .maximumStorageSize(getAtInt(maxStorageSizes, x))\n .fieldPlacement(getAtInt(fieldPlacements, x))\n .databaseUsageType(getAt(usageTypes, x))\n .defaultDisplaySize(getAt(defaultDisplaySize, x))\n .informFormatString(getAt(formatString, x))\n .informConversionString(getAt(conversionString, x))\n .dataType(getAt(dataTypes, x))\n .elementAssocName(getAt(assocNames, x))\n .elementAssocType(getAt(assocTypes, x))\n .build();\n\n map.put(names[x], e);\n\n Integer placement = getAtInt(fieldPlacements, x);\n if (placement != null && placement > 0) ordered[placement - 1] = e;\n } catch (NumberFormatException e) {\n throw new DmiMetadataException(\"Error reading metadata: \" + e.getClass().getName() + \": \" +\n e.getMessage(), e);\n }\n }\n }\n\n EntityMetadata entityMetadata = new EntityMetadata(entityType, guidEnabled, map, ordered);\n\n cache.put(appl, entityName, entityMetadata);\n return entityMetadata;\n\n }\n\n throw new DmiMetadataException(\"Error reading metadata - unexpected response from DMI\");\n }", "public void setCompany(String company) {\n this.company = company;\n }", "public void setCached() {\n }", "void setAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData auditingCompany);", "@Transactional\n public boolean isUsed(Long companyId) {\n return studentInfoRepository.isCompanyUsed(companyId);\n }", "@Override\n\tpublic void cacheResult(List<EmployeeComplaint> employeeComplaints) {\n\t\tfor (EmployeeComplaint employeeComplaint : employeeComplaints) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tEmployeeComplaintModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tEmployeeComplaintImpl.class,\n\t\t\t\t\t\temployeeComplaint.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(employeeComplaint);\n\t\t\t}\n\t\t\telse {\n\t\t\t\temployeeComplaint.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void loadCache() {\r\n\t\tint rango = getEmpleadoActual().getRango();\r\n\t\tArrayList<String> idsDptos = getEmpleadoActual().getDepartamentosId();\r\n\t\t\r\n\t\t// Para todos los departamentos a los que pertenezca el empleado\r\n\t\tfor (int nd=0; nd<idsDptos.size(); nd++){\r\n\t\t\tString dep = idsDptos.get(nd);\r\n\t\t\tint numvendedor = getEmpleadoActual().getEmplId();\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 50);\r\n\t\t\tcontratos = controlador.getListaContratosDpto(dep);\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 100);\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 25);\r\n\t\t\templeados = controlador.getEmpleadosDepartamento(getEmpleadoActual().getEmplId(),dep);\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 100);\r\n\t\t\t\r\n\t\t\t//Prueba ordenación empleados\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\tordenaEmpleados();\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\t//Fin PRueba\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (!alive) return;\r\n\t\t\tif (rango == 1) { // Si es un empleado, coger turnos de su departamento\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tturnos = controlador.getListaTurnosEmpleadosDpto(dep);\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t} else if (rango == 2) { // Si es un jefe, coger turnos de todos los departamentos\r\n\t\t\t\tArrayList<String> temp = new ArrayList<String>();\r\n\t\t\t\ttemp = controlador.getDepartamentosJefe(numvendedor);\r\n\t\t\t\tfor (int i=0; i<temp.size(); i++)\r\n\t\t\t\t\tdepartamentosJefe.add(controlador.getDepartamento(temp.get(i)));\r\n\t\t\t\t//TODO borrar si al final no se usa\r\n\t//\t\t\tsetProgreso(\"Cargando jefes de departamento\", 60);\r\n\t//\t\t\tnumeroJefesDepartamento = controlador.getNumVendedorTodosJefes();\r\n\t//\t\t\tnombreJefesDepartamento = controlador.getNombreTodosJefes();\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tArrayList<Turno> turnosDep = new ArrayList<Turno>();\r\n\t\t\t\tfor (int i=0; i<departamentosJefe.size(); i++) {\r\n\t\t\t\t\tturnosDep = controlador.getListaTurnosEmpleadosDpto(departamentosJefe.get(i).getNombreDepartamento());\r\n\t\t\t\t\tfor (int j=0; j<turnosDep.size(); j++) {\r\n\t\t\t\t\t\tturnos.add(turnosDep.get(j));\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tSystem.err.println(\"Vista\\t:: Tipo de empleado inválido para cargar la cache.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(rango==1){//si es un empleado guardamos las ventas que éste ha hecho en un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentas(this.getEmpleadoActual().getEmplId(),fecha.getYear()+1900);\r\n\t\t}else if(rango==2){//si es un jefe almacenamos la suma de las ventas de todos los empleados de este departamento durante un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentasJefe(this.empleados,fecha.getYear()+1900);\r\n\t\t}\r\n\t\tSystem.out.println(\"Cache cargada\");\r\n\t}", "@Override\n\tpublic void cacheResult(Facility_Host facility_Host) {\n\t\tEntityCacheUtil.putResult(Facility_HostModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tFacility_HostImpl.class, facility_Host.getPrimaryKey(),\n\t\t\tfacility_Host);\n\n\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_FACILITYID,\n\t\t\tnew Object[] { facility_Host.getFacilityId() }, facility_Host);\n\n\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_HOSTID,\n\t\t\tnew Object[] { facility_Host.getHostId() }, facility_Host);\n\n\t\tfacility_Host.resetOriginalValues();\n\t}", "@Activate\n\tprotected synchronized void activate(final ComponentContext componentContext) {\n\t\tLOGGER.info(\"Activating Caching Component...\");\n\n\t\tthis.m_cache = CacheBuilder.newBuilder().concurrencyLevel(5).weakValues().maximumSize(50000)\n\t\t\t\t.expireAfterWrite(3, TimeUnit.HOURS).removalListener(new RemoveRealtimeDataListener()).build();\n\n\t\tLOGGER.info(\"Activating Caching Component...Done\");\n\t}", "public CompanyAg fetchByPrimaryKey(String companyAgId)\n\t\tthrows SystemException {\n\t\tCompanyAg companyAg = (CompanyAg)EntityCacheUtil.getResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tCompanyAgImpl.class, companyAgId);\n\n\t\tif (companyAg == _nullCompanyAg) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (companyAg == null) {\n\t\t\tSession session = null;\n\n\t\t\tboolean hasException = false;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcompanyAg = (CompanyAg)session.get(CompanyAgImpl.class,\n\t\t\t\t\t\tcompanyAgId);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\thasException = true;\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (companyAg != null) {\n\t\t\t\t\tcacheResult(companyAg);\n\t\t\t\t}\n\t\t\t\telse if (!hasException) {\n\t\t\t\t\tEntityCacheUtil.putResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCompanyAgImpl.class, companyAgId, _nullCompanyAg);\n\t\t\t\t}\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn companyAg;\n\t}", "public void cacheResult(TrabajadorEmpresa trabajadorEmpresa) {\n\t\tEntityCacheUtil.putResult(TrabajadorEmpresaModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tTrabajadorEmpresaImpl.class, trabajadorEmpresa.getPrimaryKey(),\n\t\t\ttrabajadorEmpresa);\n\n\t\ttrabajadorEmpresa.resetOriginalValues();\n\t}", "public Company getCompany() {\n return company;\n }", "void xsetHasAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus hasAuditingCompany);", "protected Entity cacheLoadOrStore(Entity entity) {\n Entity cachedEntity = entityCache.findInCache(entity.getClass(), entity.getId());\n if (cachedEntity != null) {\n return cachedEntity;\n }\n entityCache.put(entity, true);\n return entity;\n }", "public void testMultiEMCachingTrue() {\n Map props = new HashMap(System.getProperties());\n props.put(\"openjpa.MetaDataFactory\", \"jpa(Types=\" + Person.class.getName() + \")\");\n props.put(\"openjpa.jdbc.QuerySQLCache\", \"true\");\n runMultiEMCaching(props);\n }", "@Override\r\n\tpublic void setCompanyData(RentCompanyData companyData) {\n\r\n\t}", "@Override\n\tpublic void cacheResult(AddressChangeReqDetails addressChangeReqDetails) {\n\t\tEntityCacheUtil.putResult(AddressChangeReqDetailsModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tAddressChangeReqDetailsImpl.class,\n\t\t\taddressChangeReqDetails.getPrimaryKey(), addressChangeReqDetails);\n\n\t\taddressChangeReqDetails.resetOriginalValues();\n\t}", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void cacheResult(SitbMoneyCollection sitbMoneyCollection);", "public List<CompanyAg> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public void setCompany(String company) {\r\n\t\tthis.company = company;\r\n\t}", "@Override\n\tpublic void cacheResult(LinkGroup linkGroup) {\n\t\tentityCache.putResult(LinkGroupModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tLinkGroupImpl.class, linkGroup.getPrimaryKey(), linkGroup);\n\n\t\tlinkGroup.resetOriginalValues();\n\t}", "public void assignCache(String databaseName, String collectionName, FeatureExtractionPipeline pipeline, boolean allowUpdates, boolean overwriteCollidingHashes){\n DB db = client.getDB(databaseName);\n DBCollection cache = db.collectionExists(collectionName)? db.getCollection(collectionName): setupCollection(db, collectionName);\n pipeline.setCache(cache, allowUpdates);\n addToHashingIndex(pipeline.getCacheConfiguration(), pipeline.getCacheConfigurationString(), overwriteCollidingHashes);\n }", "@Override\n public void appendCache(List<FavoriteEntity> ltEntity)\n {\n for (FavoriteEntity entity : ltEntity)\n {\n addWithCheckExistID(entity);\n }\n }", "public CustomerCompany addOrUpdateCustomerCompany(CustomerCompany company) \n\t{\n\t\tif (company.getId() == null) \n\t\t{\n\t\t\tthis.entityManager.persist(company);\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tcompany = this.entityManager.merge(company);\n\t\t}\n\t\treturn company;\n\t}", "@Override\n @SuppressWarnings(\"unchecked\")\n public <T> void putEntity(Key<T> key, T entity)\n {\n // Add to both caches\n session.getCache().put((Class<T>)key.getType(), entity, key.getId());\n queryCache.putEntity(key, entity);\n }", "@Override\n\tpublic void cacheResult(InterviewSchedule interviewSchedule) {\n\t\tEntityCacheUtil.putResult(InterviewScheduleModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tInterviewScheduleImpl.class, interviewSchedule.getPrimaryKey(),\n\t\t\tinterviewSchedule);\n\n\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VACANCYCANDIDATEANDINTERVIEW,\n\t\t\tnew Object[] {\n\t\t\t\tinterviewSchedule.getVacancyCandidateId(),\n\t\t\t\tinterviewSchedule.getInterviewId()\n\t\t\t}, interviewSchedule);\n\n\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VACANCYCANDIDATEANDSTATUS,\n\t\t\tnew Object[] {\n\t\t\t\tinterviewSchedule.getVacancyCandidateId(),\n\t\t\t\tinterviewSchedule.getStatus()\n\t\t\t}, interviewSchedule);\n\n\t\tinterviewSchedule.resetOriginalValues();\n\t}", "public DBMaker enableSoftCache() {\n cacheType = DBCacheRef.SOFT;\n return this;\n }", "public Company getChg() {return chgEntity;}", "public void setCompany(String company) {\n\t\tthis.company = company;\n\t}", "public Company getCompany() {\r\n return this.company;\r\n }", "@Override\n public boolean isCaching() {\n return false;\n }", "@Override\n\tpublic int alterCompany(Company company) {\n\t\treturn companyDao.alterCompany(company);\n\t}", "public java.util.Set<vn.com.phuclocbao.entity.CompanyEntity> getCompanies()\n {\n return companies;\n }", "public ContactCompanyAg fetchByPrimaryKey(String contactCompanyAgId)\n\t\tthrows SystemException {\n\t\tContactCompanyAg contactCompanyAg = (ContactCompanyAg)EntityCacheUtil.getResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId);\n\n\t\tif (contactCompanyAg == _nullContactCompanyAg) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (contactCompanyAg == null) {\n\t\t\tSession session = null;\n\n\t\t\tboolean hasException = false;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcontactCompanyAg = (ContactCompanyAg)session.get(ContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAgId);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\thasException = true;\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (contactCompanyAg != null) {\n\t\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t\t}\n\t\t\t\telse if (!hasException) {\n\t\t\t\t\tEntityCacheUtil.putResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId,\n\t\t\t\t\t\t_nullContactCompanyAg);\n\t\t\t\t}\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn contactCompanyAg;\n\t}", "public static void cacheResult(\n\t\tes.davinciti.liferay.model.SapEmployee sapEmployee) {\n\t\tgetPersistence().cacheResult(sapEmployee);\n\t}", "AgentPolicyBuilder setClearCache(boolean clearCache);", "public void cacheResult(\n de.i3mainz.flexgeo.portal.liferay.services.model.OGCServiceLayer ogcServiceLayer);", "public void cacheResult(CsclAppointeeMaster csclAppointeeMaster);", "@Override\n\tpublic void save(Company company) {\n\t\t\n\t}", "@Override\n\tpublic void cacheResult(List<Approvatore> approvatores) {\n\t\tfor (Approvatore approvatore : approvatores) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\t\tApprovatoreModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tApprovatoreImpl.class, approvatore.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(approvatore);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tapprovatore.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public static void setAgenciesInCache(Map<String,String> agencyMap){ \t\n\t\tlog.info(\"setAgenciesInCache : memcache key:\"+MEDIA_PLAN_AGENCIES_KEY);\t\t\t\n\t\tif(memcache !=null && memcache.contains(MEDIA_PLAN_AGENCIES_KEY)){\n \t\tmemcache.delete(MEDIA_PLAN_AGENCIES_KEY);\n \t}\n \tmemcache.put(MEDIA_PLAN_AGENCIES_KEY, agencyMap);\n\t}", "@Override\n\tpublic void cacheResult(\n\t\tESFInstructsShootingDirector esfInstructsShootingDirector) {\n\t\tEntityCacheUtil.putResult(ESFInstructsShootingDirectorModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tESFInstructsShootingDirectorImpl.class,\n\t\t\tesfInstructsShootingDirector.getPrimaryKey(),\n\t\t\tesfInstructsShootingDirector);\n\n\t\tesfInstructsShootingDirector.resetOriginalValues();\n\t}", "public long getCompanyId() {\n return companyId;\n }", "public void refreshCompanies() {\n\t\t \n\t\t mDbHelper.refreshTable(mDatabase, MySQLiteHelper.TABLE_COMPANIES);\n\t }", "boolean isCachingEnabled();", "@Override\r\n\tpublic List<Company> getAllCompanies() {\r\n\t\tString methodName = \"getAllCompanies()\";\r\n\t\tlog.info(className+\",\"+methodName);\r\n\t\treturn companyRepository.findAll();\r\n\t\t\r\n\t}", "boolean isSetHasAuditingCompany();", "@Override\n\tpublic void cacheResult(List<PhatVay> phatVaies) {\n\t\tfor (PhatVay phatVay : phatVaies) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\tPhatVayModelImpl.ENTITY_CACHE_ENABLED, PhatVayImpl.class,\n\t\t\t\t\tphatVay.getPrimaryKey()) == null) {\n\n\t\t\t\tcacheResult(phatVay);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tphatVay.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public boolean requiresViewEntityCacheInvalidation() {\n return !tableToViewDescMap.isEmpty();\n }", "@Override\n\tpublic void modifryCompany(BeanCompany Company) {\n\t\tSession session = HibernateUtil.getSessionFactory().getCurrentSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\ttry {\n\t\t\tsession.update(Company);\n\t\t\ttx.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}\n\t}", "boolean isSetAuditingCompany();", "boolean isSetCompanyBaseData();", "@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_expandoColumn.setCompanyId(companyId);\n\t}", "public Long getCompanyId() {\n return companyId;\n }", "public void storeInCache() {\r\n lockValueStored = IN_CACHE;\r\n }", "protected BaseTransferCache(UserVisit userVisit) {\n this.userVisit = userVisit;\n \n session = ThreadSession.currentSession();\n transferCache = new HashMap<>();\n \n var options = session.getOptions();\n if(options != null) {\n includeEntityAttributeGroups = options.contains(BaseOptions.BaseIncludeEntityAttributeGroups);\n includeTagScopes = options.contains(BaseOptions.BaseIncludeTagScopes);\n }\n }", "public void setCompany(String company)\r\n {\r\n m_company = company;\r\n }", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "public void cacheResult(AnnotationInfo annotationInfo) {\n\t\tEntityCacheUtil.putResult(AnnotationInfoModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tAnnotationInfoImpl.class, annotationInfo.getPrimaryKey(),\n\t\t\tannotationInfo);\n\n\t\tFinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_ANNOTATIONPROPERTIES,\n\t\t\tnew Object[] {\n\t\t\t\tLong.valueOf(annotationInfo.getDocumentRecordID()),\n\t\t\t\t\n\t\t\tannotationInfo.getName(),\n\t\t\t\t\n\t\t\tannotationInfo.getAnnotationType(),\n\t\t\t\t\n\t\t\tannotationInfo.getLead()\n\t\t\t}, annotationInfo);\n\n\t\tannotationInfo.resetOriginalValues();\n\t}", "public Company getCompany() {\n\t\treturn company;\n\t}", "@Override\n protected void forceRefresh() {\n if (getEntity() != null) {\n super.forceRefresh();\n }\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _dictData.getCompanyId();\n\t}" ]
[ "0.7049812", "0.690144", "0.6595939", "0.61298835", "0.60344595", "0.6022531", "0.57230026", "0.5521067", "0.5501943", "0.54959565", "0.5490726", "0.5469169", "0.5437048", "0.5416558", "0.5389508", "0.53508663", "0.5315826", "0.5312335", "0.52961653", "0.52936596", "0.5245286", "0.5234215", "0.5210832", "0.5207732", "0.5196924", "0.5164506", "0.5152531", "0.5128574", "0.50997937", "0.5098166", "0.5097677", "0.5091437", "0.5084888", "0.5082966", "0.507222", "0.50670475", "0.50579506", "0.50562966", "0.50537467", "0.5039033", "0.50217634", "0.50155264", "0.5014294", "0.49993524", "0.4998532", "0.49954545", "0.49889022", "0.4984307", "0.4984307", "0.4984307", "0.4984307", "0.4984307", "0.49806005", "0.49799043", "0.49729103", "0.49702346", "0.49583966", "0.49564707", "0.4953583", "0.49421418", "0.4941704", "0.49260312", "0.49189737", "0.49149415", "0.49148482", "0.4908378", "0.490644", "0.490113", "0.48988053", "0.48940217", "0.48782092", "0.48780593", "0.48762944", "0.48707864", "0.48675147", "0.4857303", "0.485675", "0.4851127", "0.48472703", "0.48472205", "0.48419392", "0.4841808", "0.48353037", "0.48344937", "0.48158303", "0.48120782", "0.48052305", "0.48006904", "0.47970563", "0.47969866", "0.47938272", "0.4793323", "0.47773442", "0.47773442", "0.47773442", "0.47773442", "0.4777263", "0.47741053", "0.47698998", "0.47697544" ]
0.7420789
0
Caches the company ags in the entity cache if it is enabled.
public void cacheResult(List<CompanyAg> companyAgs) { for (CompanyAg companyAg : companyAgs) { if (EntityCacheUtil.getResult( CompanyAgModelImpl.ENTITY_CACHE_ENABLED, CompanyAgImpl.class, companyAg.getPrimaryKey()) == null) { cacheResult(companyAg); } else { companyAg.resetOriginalValues(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cacheResult(List<ContactCompanyAg> contactCompanyAgs) {\n\t\tfor (ContactCompanyAg contactCompanyAg : contactCompanyAgs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAg.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontactCompanyAg.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public void cacheResult(CompanyAg companyAg) {\n\t\tEntityCacheUtil.putResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tCompanyAgImpl.class, companyAg.getPrimaryKey(), companyAg);\n\n\t\tcompanyAg.resetOriginalValues();\n\t}", "public void cacheResult(ContactCompanyAg contactCompanyAg) {\n\t\tEntityCacheUtil.putResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tContactCompanyAgImpl.class, contactCompanyAg.getPrimaryKey(),\n\t\t\tcontactCompanyAg);\n\n\t\tcontactCompanyAg.resetOriginalValues();\n\t}", "public ArrayList<Company> updateCacheList() {\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n\n try {\n Company.pinAll(\"companyList\", query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchant from Parse Database:\\n\" + e.getMessage());\n }\n\n return getCompaniesFromCache();\n }", "public void flushEntityCache() {\n super.flushEntityCache();\n }", "public ArrayList<Company> getCompaniesFromCache() {\n\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n query.fromLocalDatastore();\n\n try {\n return new ArrayList<>(query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchants from local data store:\\n\" + e.getMessage());\n }\n\n return new ArrayList<>();\n }", "@Override\n public void cacheResult(EntityDealer entityDealer) {\n EntityCacheUtil.putResult(EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey(), entityDealer);\n\n entityDealer.resetOriginalValues();\n }", "@Override\n\tpublic void cacheResult(EmployeeComplaint employeeComplaint) {\n\t\tEntityCacheUtil.putResult(EmployeeComplaintModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tEmployeeComplaintImpl.class, employeeComplaint.getPrimaryKey(),\n\t\t\temployeeComplaint);\n\n\t\temployeeComplaint.resetOriginalValues();\n\t}", "@Override\n public void appendCache(List<FavoriteEntity> ltEntity)\n {\n for (FavoriteEntity entity : ltEntity)\n {\n addWithCheckExistID(entity);\n }\n }", "@Override\n public void cacheResult(List<EntityDealer> entityDealers) {\n for (EntityDealer entityDealer : entityDealers) {\n if (EntityCacheUtil.getResult(\n EntityDealerModelImpl.ENTITY_CACHE_ENABLED,\n EntityDealerImpl.class, entityDealer.getPrimaryKey()) == null) {\n cacheResult(entityDealer);\n } else {\n entityDealer.resetOriginalValues();\n }\n }\n }", "@Override\n\tpublic void cacheResult(CreditAppBankReference creditAppBankReference) {\n\t\tEntityCacheUtil.putResult(CreditAppBankReferenceModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tCreditAppBankReferenceImpl.class,\n\t\t\tcreditAppBankReference.getPrimaryKey(), creditAppBankReference);\n\n\t\tcreditAppBankReference.resetOriginalValues();\n\t}", "@Override\n public void add(IBasicEntity ent) throws CachingException {\n EntityCachingServiceLocator.getEntityCachingService().add(ent);\n }", "@Override\r\n\tpublic void cacheResult(Share share) {\r\n\t\tentityCache.putResult(ShareModelImpl.ENTITY_CACHE_ENABLED,\r\n\t\t\tShareImpl.class, share.getPrimaryKey(), share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,\r\n\t\t\tnew Object[] { share.getUuid(), share.getGroupId() }, share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_NAMEMARKETCOMPANYGROUP,\r\n\t\t\tnew Object[] {\r\n\t\t\t\tshare.getCompanyId(), share.getGroupId(), share.getName(),\r\n\t\t\t\tshare.getMarketId()\r\n\t\t\t}, share);\r\n\r\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_SYMBOLCOMPANYGROUP,\r\n\t\t\tnew Object[] {\r\n\t\t\t\tshare.getCompanyId(), share.getGroupId(), share.getSymbol()\r\n\t\t\t}, share);\r\n\r\n\t\tshare.resetOriginalValues();\r\n\t}", "public interface OrganizationService extends EntityService<Organization> {\n\n /**\n * 缓存\n *\n * @param id\n * @return\n * @throws Exception\n */\n public Organization queryCacheOrganizationById(long id) throws Exception;\n}", "@Override\r\n\tpublic Company updateCompany(Company company) {\n\t\treturn null;\r\n\t}", "@Override\n public void update(IBasicEntity ent) throws CachingException {\n EntityCachingServiceLocator.getEntityCachingService().update(ent);\n }", "@Override\n\tpublic void cacheResult(\n\t\tStepDefsCompositeStepDefDBE stepDefsCompositeStepDefDBE) {\n\t\tEntityCacheUtil.putResult(StepDefsCompositeStepDefDBEModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tStepDefsCompositeStepDefDBEImpl.class,\n\t\t\tstepDefsCompositeStepDefDBE.getPrimaryKey(),\n\t\t\tstepDefsCompositeStepDefDBE);\n\n\t\tstepDefsCompositeStepDefDBE.resetOriginalValues();\n\t}", "public java.util.Set<vn.com.phuclocbao.entity.CompanyEntity> getCompanies()\n {\n return companies;\n }", "@Override\n\tpublic void cacheResult(AssetManageReqHandle assetManageReqHandle) {\n\t\tEntityCacheUtil.putResult(AssetManageReqHandleModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tAssetManageReqHandleImpl.class,\n\t\t\tassetManageReqHandle.getPrimaryKey(), assetManageReqHandle);\n\n\t\tassetManageReqHandle.resetOriginalValues();\n\t}", "public void assignCache(String databaseName, String collectionName, FeatureExtractionPipeline pipeline, boolean allowUpdates, boolean overwriteCollidingHashes){\n DB db = client.getDB(databaseName);\n DBCollection cache = db.collectionExists(collectionName)? db.getCollection(collectionName): setupCollection(db, collectionName);\n pipeline.setCache(cache, allowUpdates);\n addToHashingIndex(pipeline.getCacheConfiguration(), pipeline.getCacheConfigurationString(), overwriteCollidingHashes);\n }", "public void resetCache() {\n logger.info(\"resetCache(): refilling clinical attribute cache\");\n\n Date dateOfCurrentCacheRefresh = new Date();\n ArrayList<ClinicalAttributeMetadata> latestClinicalAttributeMetadata = null;\n // latestOverrides is a map of study-id to list of overridden ClinicalAttributeMetadata objects\n Map<String, ArrayList<ClinicalAttributeMetadata>> latestOverrides = null;\n\n // attempt to refresh ehcache stores seperately and store success status\n boolean failedClinicalAttributeMetadataCacheRefresh = false;\n boolean failedOverridesCacheRefresh = false;\n try {\n clinicalAttributeMetadataPersistentCache.updateClinicalAttributeMetadataInPersistentCache();\n } catch (RuntimeException e) {\n logger.error(\"resetCache(): failed to pull clinical attributes from repository. Error message returned: \" + e.getMessage());\n failedClinicalAttributeMetadataCacheRefresh = true;\n }\n\n try {\n clinicalAttributeMetadataPersistentCache.updateClinicalAttributeMetadataOverridesInPersistentCache();\n } catch (RuntimeException e) {\n logger.error(\"resetCache(): failed to pull overrides from repository. Error message returned: \" + e.getMessage());\n failedOverridesCacheRefresh = true;\n }\n\n // regardless of whether ehcache was updated with new data - use that data to populate modeled object caches\n // ensures app starts up (between tomcat restarts) if TopBraid is down\n logger.info(\"Loading modeled object cache from EHCache\");\n try {\n // this will throw an exception if we cannot connect to TopBraid AND cache is corrupt\n latestClinicalAttributeMetadata = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataFromPersistentCache();\n latestOverrides = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataOverridesFromPersistentCache();\n } catch (Exception e) {\n try {\n // this will throw an exception if backup is unavailable\n logger.error(\"Unable to load modeled object cache from default EHCache... attempting to read from backup\");\n latestClinicalAttributeMetadata = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataFromPersistentCacheBackup();\n latestOverrides = clinicalAttributeMetadataPersistentCache.getClinicalAttributeMetadataOverridesFromPersistentCacheBackup();\n if (latestClinicalAttributeMetadata == null || latestOverrides == null) {\n throw new FailedCacheRefreshException(\"No data found in specified backup cache location...\", new Exception());\n }\n } catch (Exception e2) {\n logger.error(\"Unable to load modeled object cache from backup EHCache...\");\n throw new FailedCacheRefreshException(\"Unable to load data from all backup caches...\", new Exception());\n }\n }\n\n // backup cache at this point (maybe backup after each successful update above?)\n if (!failedClinicalAttributeMetadataCacheRefresh && !failedOverridesCacheRefresh) {\n logger.info(\"resetCache(): cache update succeeded, backing up cache...\");\n try {\n clinicalAttributeMetadataPersistentCache.backupClinicalAttributeMetadataPersistentCache(latestClinicalAttributeMetadata);\n clinicalAttributeMetadataPersistentCache.backupClinicalAttributeMetadataOverridesPersistentCache(latestOverrides);\n logger.info(\"resetCache(): succesfully backed up cache\");\n } catch (Exception e) {\n logger.error(\"resetCache(): failed to backup cache: \" + e.getMessage());\n }\n }\n\n HashMap<String, ClinicalAttributeMetadata> latestClinicalAttributeMetadataCache = new HashMap<String, ClinicalAttributeMetadata>();\n for (ClinicalAttributeMetadata clinicalAttributeMetadata : latestClinicalAttributeMetadata) {\n latestClinicalAttributeMetadataCache.put(clinicalAttributeMetadata.getColumnHeader(), clinicalAttributeMetadata);\n }\n\n // latestOverridesCache is a map of study-id to map of clinical attribute name to overridden ClinicalAttributeMetadata object\n HashMap<String, Map<String,ClinicalAttributeMetadata>> latestOverridesCache = new HashMap<String, Map<String, ClinicalAttributeMetadata>>();\n for (Map.Entry<String, ArrayList<ClinicalAttributeMetadata>> entry : latestOverrides.entrySet()) {\n HashMap<String, ClinicalAttributeMetadata> clinicalAttributesMetadataMapping = new HashMap<String, ClinicalAttributeMetadata>();\n for (ClinicalAttributeMetadata clinicalAttributeMetadata : entry.getValue()) {\n fillOverrideAttributeWithDefaultValues(clinicalAttributeMetadata, latestClinicalAttributeMetadataCache.get(clinicalAttributeMetadata.getColumnHeader()));\n clinicalAttributesMetadataMapping.put(clinicalAttributeMetadata.getColumnHeader(), clinicalAttributeMetadata);\n }\n latestOverridesCache.put(entry.getKey(), clinicalAttributesMetadataMapping);\n }\n\n clinicalAttributeCache = latestClinicalAttributeMetadataCache;\n logger.info(\"resetCache(): refilled cache with \" + latestClinicalAttributeMetadata.size() + \" clinical attributes\");\n overridesCache = latestOverridesCache;\n logger.info(\"resetCache(): refilled overrides cache with \" + latestOverrides.size() + \" overrides\");\n\n if (failedClinicalAttributeMetadataCacheRefresh || failedOverridesCacheRefresh) {\n logger.info(\"Unable to update cache with latest data from TopBraid... falling back on EHCache store.\");\n throw new FailedCacheRefreshException(\"Failed to refresh cache\", new Exception());\n } else {\n dateOfLastCacheRefresh = dateOfCurrentCacheRefresh;\n logger.info(\"resetCache(): cache last refreshed on: \" + dateOfLastCacheRefresh.toString());\n }\n }", "@Override\r\n\tpublic List<Company> getAllCompanies() {\r\n\t\tString methodName = \"getAllCompanies()\";\r\n\t\tlog.info(className+\",\"+methodName);\r\n\t\treturn companyRepository.findAll();\r\n\t\t\r\n\t}", "public void setCompany(Company aCompany) {\n company = aCompany;\n }", "@Override\n\tpublic void cacheResult(PhatVay phatVay) {\n\t\tentityCache.putResult(\n\t\t\tPhatVayModelImpl.ENTITY_CACHE_ENABLED, PhatVayImpl.class,\n\t\t\tphatVay.getPrimaryKey(), phatVay);\n\n\t\tfinderCache.putResult(\n\t\t\t_finderPathFetchBySoKU, new Object[] {phatVay.getSoKU()}, phatVay);\n\n\t\tphatVay.resetOriginalValues();\n\t}", "public void setCompany(String company) {\n this.company = company;\n }", "@Override\n\tpublic void cacheResult(List<EmployeeComplaint> employeeComplaints) {\n\t\tfor (EmployeeComplaint employeeComplaint : employeeComplaints) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tEmployeeComplaintModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tEmployeeComplaintImpl.class,\n\t\t\t\t\t\temployeeComplaint.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(employeeComplaint);\n\t\t\t}\n\t\t\telse {\n\t\t\t\temployeeComplaint.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void updateCache(List<FavoriteEntity> ltEntity)\n {\n super.delAll();\n this.appendCache(ltEntity);\n }", "public void testMultiEMCachingTrue() {\n Map props = new HashMap(System.getProperties());\n props.put(\"openjpa.MetaDataFactory\", \"jpa(Types=\" + Person.class.getName() + \")\");\n props.put(\"openjpa.jdbc.QuerySQLCache\", \"true\");\n runMultiEMCaching(props);\n }", "public void loadCache() {\r\n\t\tint rango = getEmpleadoActual().getRango();\r\n\t\tArrayList<String> idsDptos = getEmpleadoActual().getDepartamentosId();\r\n\t\t\r\n\t\t// Para todos los departamentos a los que pertenezca el empleado\r\n\t\tfor (int nd=0; nd<idsDptos.size(); nd++){\r\n\t\t\tString dep = idsDptos.get(nd);\r\n\t\t\tint numvendedor = getEmpleadoActual().getEmplId();\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 50);\r\n\t\t\tcontratos = controlador.getListaContratosDpto(dep);\r\n\t\t\tsetProgreso(\"Cargando contratos dpto \"+dep, 100);\r\n\r\n\t\t\tif (!alive) return;\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 25);\r\n\t\t\templeados = controlador.getEmpleadosDepartamento(getEmpleadoActual().getEmplId(),dep);\r\n\t\t\tsetProgreso(\"Cargando empleados dpto \"+dep, 100);\r\n\t\t\t\r\n\t\t\t//Prueba ordenación empleados\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\tordenaEmpleados();\r\n//\t\t\tfor (int i = 0; i < empleados.size(); i++) {\r\n//\t\t\t\tSystem.out.println(empleados.get(i).getPosicion());\r\n//\t\t\t}\r\n\t\t\t//Fin PRueba\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (!alive) return;\r\n\t\t\tif (rango == 1) { // Si es un empleado, coger turnos de su departamento\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tturnos = controlador.getListaTurnosEmpleadosDpto(dep);\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t} else if (rango == 2) { // Si es un jefe, coger turnos de todos los departamentos\r\n\t\t\t\tArrayList<String> temp = new ArrayList<String>();\r\n\t\t\t\ttemp = controlador.getDepartamentosJefe(numvendedor);\r\n\t\t\t\tfor (int i=0; i<temp.size(); i++)\r\n\t\t\t\t\tdepartamentosJefe.add(controlador.getDepartamento(temp.get(i)));\r\n\t\t\t\t//TODO borrar si al final no se usa\r\n\t//\t\t\tsetProgreso(\"Cargando jefes de departamento\", 60);\r\n\t//\t\t\tnumeroJefesDepartamento = controlador.getNumVendedorTodosJefes();\r\n\t//\t\t\tnombreJefesDepartamento = controlador.getNombreTodosJefes();\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 70);\r\n\t\t\t\tArrayList<Turno> turnosDep = new ArrayList<Turno>();\r\n\t\t\t\tfor (int i=0; i<departamentosJefe.size(); i++) {\r\n\t\t\t\t\tturnosDep = controlador.getListaTurnosEmpleadosDpto(departamentosJefe.get(i).getNombreDepartamento());\r\n\t\t\t\t\tfor (int j=0; j<turnosDep.size(); j++) {\r\n\t\t\t\t\t\tturnos.add(turnosDep.get(j));\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsetProgreso(\"Cargando turnos dpto \"+dep, 100);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tSystem.err.println(\"Vista\\t:: Tipo de empleado inválido para cargar la cache.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(rango==1){//si es un empleado guardamos las ventas que éste ha hecho en un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentas(this.getEmpleadoActual().getEmplId(),fecha.getYear()+1900);\r\n\t\t}else if(rango==2){//si es un jefe almacenamos la suma de las ventas de todos los empleados de este departamento durante un año\r\n\t\t\tjava.util.Date fecha = new java.util.Date();//cogemos la fecha del sistema\r\n\t\t\tvector_ventas=controlador.getVentasJefe(this.empleados,fecha.getYear()+1900);\r\n\t\t}\r\n\t\tSystem.out.println(\"Cache cargada\");\r\n\t}", "@Override\n\tpublic List<Company> queryCompanyAll() {\n\t\treturn companyDao.queryCompanyAll();\n\t}", "public void refreshCompanies() {\n\t\t \n\t\t mDbHelper.refreshTable(mDatabase, MySQLiteHelper.TABLE_COMPANIES);\n\t }", "private Map<String, Object> addCaches(Map<String, Object> options, boolean includeShoppings, boolean includeBrands, boolean includeFinancialEntities) throws ASException {\n\n\t\tif( options == null ) options = new HashMap<String, Object>();\n//\t\tUser user = (User)options.get(CouponAdapter.OPTIONS_REQUESTER);\n//\n//\t\tif( includeShoppings ) {\n//\t\t\toptions.put(CouponAdapter.OPTIONS_SDAO, shoppingDao);\n//\t\t\tif( user != null ) {\n//\t\t\t\tUserEntityCache uecShopping = uecService.get(user, EntityKind.KIND_SHOPPING, UserEntityCache.TYPE_FAVORITES_ONLY);\n//\t\t\t\toptions.put(CouponAdapter.OPTIONS_UECS, uecShopping);\n//\t\t\t}\n//\t\t}\n//\n//\t\tif( includeBrands ) {\n//\t\t\toptions.put(CouponAdapter.OPTIONS_BDAO, brandDao);\n//\t\t\tif( user != null ) {\n//\t\t\t\tUserEntityCache uecBrand = uecService.get(user, EntityKind.KIND_BRAND, UserEntityCache.TYPE_FAVORITES_ONLY);\n//\t\t\t\toptions.put(CouponAdapter.OPTIONS_UECB, uecBrand);\n//\t\t\t}\n//\t\t}\n//\n//\t\tif( includeFinancialEntities ) {\n//\t\t\toptions.put(CouponAdapter.OPTIONS_FEDAO, financialEntityDao);\n//\t\t\tif( user != null ) {\n//\t\t\t\tUserEntityCache uecFinancialEntity = uecService.get(user, EntityKind.KIND_FINANCIAL_ENTITY, UserEntityCache.TYPE_FAVORITES_ONLY);\n//\t\t\t\toptions.put(CouponAdapter.OPTIONS_UECFE, uecFinancialEntity);\n//\t\t\t}\n//\t\t}\n\n\t\treturn options;\n\t}", "@Override\n\tpublic void cacheResult(List<PhatVay> phatVaies) {\n\t\tfor (PhatVay phatVay : phatVaies) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\tPhatVayModelImpl.ENTITY_CACHE_ENABLED, PhatVayImpl.class,\n\t\t\t\t\tphatVay.getPrimaryKey()) == null) {\n\n\t\t\t\tcacheResult(phatVay);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tphatVay.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "private void registerCaches(){\n // Initialize region arraylist\n prisoners = new HashMap<>();\n regions = QueryManager.getRegions();\n prisonBlocks = QueryManager.getPrisonBlocks();\n portals = QueryManager.getPortals();\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public <T> void putEntity(Key<T> key, T entity)\n {\n // Add to both caches\n session.getCache().put((Class<T>)key.getType(), entity, key.getId());\n queryCache.putEntity(key, entity);\n }", "public void setCompany(String company) {\r\n\t\tthis.company = company;\r\n\t}", "public List<Company> companies() {\n StandardServiceRegistry registry = new StandardServiceRegistryBuilder().configure().build();\n SessionFactory sessionFactory = null;\n try {\n\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n Session session = sessionFactory.getCurrentSession();\n session.beginTransaction();\n List<Company> listOfCompanies = session.createQuery(\"FROM Company\").getResultList();\n session.getTransaction().commit();\n return listOfCompanies;\n\n } finally {\n if (sessionFactory != null) {\n sessionFactory.close();\n }\n }\n }", "public void setCached() {\n }", "@Override\n\tpublic List<Company> getAll() {\n\t\treturn dao.getAll();\n\t}", "public void cacheResult(SitbMoneyCollection sitbMoneyCollection);", "@Override\n\tpublic void save(Company company) {\n\t\t\n\t}", "@Nonnull\n public List<CustomerCompany> getCustomerCompanyOrFetch()\n throws ODataException\n {\n if (toCustomerCompany == null) {\n toCustomerCompany = fetchCustomerCompany();\n }\n return toCustomerCompany;\n }", "@Override\n\tpublic void cacheResult(Approvatore approvatore) {\n\t\tentityCache.putResult(ApprovatoreModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tApprovatoreImpl.class, approvatore.getPrimaryKey(), approvatore);\n\n\t\tapprovatore.resetOriginalValues();\n\t}", "public void setCompany(String company) {\n\t\tthis.company = company;\n\t}", "public void cacheResult(com.Hotel.model.Hotel hotel);", "public void setCompanyAgId(java.lang.String companyAgId) {\n\t\t_imageCompanyAg.setCompanyAgId(companyAgId);\n\t}", "public List<CompanyAg> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public Company getCompany() {\n return company;\n }", "@Override\n public boolean isCaching() {\n return false;\n }", "public List<Company> getCompanys() {\n\t\treturn companyDao.findAll();\n//\t\treturn companies;\n\t}", "@Activate\n\tprotected synchronized void activate(final ComponentContext componentContext) {\n\t\tLOGGER.info(\"Activating Caching Component...\");\n\n\t\tthis.m_cache = CacheBuilder.newBuilder().concurrencyLevel(5).weakValues().maximumSize(50000)\n\t\t\t\t.expireAfterWrite(3, TimeUnit.HOURS).removalListener(new RemoveRealtimeDataListener()).build();\n\n\t\tLOGGER.info(\"Activating Caching Component...Done\");\n\t}", "@Override\r\n\tpublic void cacheResult(List<Share> shares) {\r\n\t\tfor (Share share : shares) {\r\n\t\t\tif (entityCache.getResult(ShareModelImpl.ENTITY_CACHE_ENABLED,\r\n\t\t\t\t\t\tShareImpl.class, share.getPrimaryKey()) == null) {\r\n\t\t\t\tcacheResult(share);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tshare.resetOriginalValues();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean isCachingEnabled();", "@Override\n\tpublic void cacheResult(List<LinkGroup> linkGroups) {\n\t\tfor (LinkGroup linkGroup : linkGroups) {\n\t\t\tif (entityCache.getResult(LinkGroupModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tLinkGroupImpl.class, linkGroup.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(linkGroup);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlinkGroup.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "@Transactional\n public boolean isUsed(Long companyId) {\n return studentInfoRepository.isCompanyUsed(companyId);\n }", "private void assertCache() throws Exception {\n\t\t// skip if already cached, otherwise create and fill\n\t\tif(validCache) return;\n\t\t\n\t\tLog.d(TAG, \"assertCache() is building in-memory cache\");\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tCursor c = db.query(TABLE_APP, new String[] { FIELD_APP_PACKAGE,\n\t\t\t\tFIELD_APP_CATEGORY }, null, null, null, null, null);\n\t\tif(c == null)\n\t\t\tthrow new Exception(\"Couldn't load application-to-category mapping database table\");\n\n\t\tint COL_PACKAGE = c.getColumnIndexOrThrow(FIELD_APP_PACKAGE),\n\t\t\tCOL_CATEGORY = c.getColumnIndexOrThrow(FIELD_APP_CATEGORY);\n\t\t\n\t\twhile(c.moveToNext()) {\n\t\t\tString packageName = c.getString(COL_PACKAGE),\n\t\t\t\tcategoryName = c.getString(COL_CATEGORY);\n\t\t\tpackageMapping.put(packageName, categoryName);\n\t\t}\n\t\t\n\t\tc.close();\n\t\tvalidCache = true;\n\t}", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "@Override\n\tpublic int alterCompany(Company company) {\n\t\treturn companyDao.alterCompany(company);\n\t}", "@Override\r\n\tpublic void setCompanyData(RentCompanyData companyData) {\n\r\n\t}", "public static void setBQAccountsInCache(Map<String,String> accountDFPMap, String key){ \n\t \tkey = ACCOUNTS_BQ_KEY+\"-\"+StringUtil.getHashedValue(key);\n\t\t\tlog.info(\"setBQAccountsInCache : memcache key:\"+key);\t\t\t\n\t\t\tif(memcache !=null && memcache.contains(key)){\n\t \t\tmemcache.delete(key);\n\t \t}\n\t \tmemcache.put(key, accountDFPMap, Expiration.byDeltaSeconds(expiredInTwoHours));\n\t\t}", "@Override\n\tpublic void cacheResult(\n\t\tESFInstructsShootingDirector esfInstructsShootingDirector) {\n\t\tEntityCacheUtil.putResult(ESFInstructsShootingDirectorModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tESFInstructsShootingDirectorImpl.class,\n\t\t\tesfInstructsShootingDirector.getPrimaryKey(),\n\t\t\tesfInstructsShootingDirector);\n\n\t\tesfInstructsShootingDirector.resetOriginalValues();\n\t}", "@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_expandoColumn.setCompanyId(companyId);\n\t}", "public void setCompanies(java.util.Set<vn.com.phuclocbao.entity.CompanyEntity> _companies)\n {\n companies = _companies;\n }", "@Transactional(readOnly = true)\n @PreAuthorize(\"hasRole('COMPANY_READER')\")\n public List<Company> getAll() {\n return companyRepository.findAll();\n }", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "@Override\n\tpublic void cacheResult(ScienceAppExecute scienceAppExecute) {\n\t\tEntityCacheUtil.putResult(ScienceAppExecuteModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tScienceAppExecuteImpl.class, scienceAppExecute.getPrimaryKey(),\n\t\t\tscienceAppExecute);\n\n\t\tscienceAppExecute.resetOriginalValues();\n\t}", "public void getAllCompanyInfo() throws FileNotFoundException, IOException\r\n {\r\n \r\n String tickerFileLoc = \"companylist.csv\";\r\n CSVReader nameReader = new CSVReader(new FileReader(tickerFileLoc));\r\n \r\n String[] nextLine;\r\n String tempFileLoc;\r\n int x = 0;\r\n \r\n while ((nextLine = nameReader.readNext()) != null)\r\n {\r\n HashMap<String, SingleDayQuote> oneDay = new HashMap<>();\r\n if (x == 0){x++;continue;} //skips CSV category header\r\n if (x > 6){break;} //temporary, to prevent downloading more than 6 companys info\r\n \r\n String tempTicker = nextLine[0];\r\n tempFileLoc = \"StockFiles\\\\\" + tempTicker + \".csv\";\r\n \r\n //downloadFile(tempTicker);\r\n \r\n Company tempCompany = new Company(tempTicker, pullInfo(tempFileLoc));\r\n allCompanys.put(tempTicker, tempCompany);\r\n \r\n \r\n x++;\r\n }\r\n \r\n }", "@Override\n\tpublic void cacheResult(Campus campus) {\n\t\tentityCache.putResult(CampusModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tCampusImpl.class, campus.getPrimaryKey(), campus);\n\n\t\tfinderCache.putResult(FINDER_PATH_FETCH_BY_NAME,\n\t\t\tnew Object[] { campus.getName() }, campus);\n\n\t\tcampus.resetOriginalValues();\n\t}", "void xsetHasAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.AuditingCompanyStatus hasAuditingCompany);", "public void setCompanyId(long companyId) {\n this.companyId = companyId;\n }", "public interface UserEntityCache {\n int getHitCount();\n int getMissCount();\n\n void put(long key, CacheElement<UserEntity> cacheElement);\n\n CacheElement<UserEntity> get(long key);\n}", "@Override\n\tpublic void cacheResult(List<AssetManageReqHandle> assetManageReqHandles) {\n\t\tfor (AssetManageReqHandle assetManageReqHandle : assetManageReqHandles) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tAssetManageReqHandleModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tAssetManageReqHandleImpl.class,\n\t\t\t\t\t\tassetManageReqHandle.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(assetManageReqHandle);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tassetManageReqHandle.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public static void setBQAgenciesInCache(Map<String,String> agencyDFPMap, String publisherIdsInBQ, String agencyId){\n \tString hashedKeyPart = StringUtil.getHashedValue(publisherIdsInBQ+\"_\"+agencyId);\n\t\tString key = AGENCIES_BQ_KEY+\"-\"+hashedKeyPart;\n\t\tlog.info(\"setBQAgenciesInCache : memcache key:\"+key);\t\t\t\n\t\tif(memcache !=null && memcache.contains(key)){\n \t\tmemcache.delete(key);\n \t}\n \tmemcache.put(key, agencyDFPMap, Expiration.byDeltaSeconds(expiredInTwoHours));\n\t}", "public abstract List<Company> getAll();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Company> loadAll() {\r\n\t\treturn sessionFactory.getCurrentSession().createQuery(\"from Company\").list();\r\n\t}", "public void cacheResult(VCal vCal) {\n\t\tEntityCacheUtil.putResult(VCalModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tVCalImpl.class, vCal.getPrimaryKey(), vCal);\n\n\t\tvCal.resetOriginalValues();\n\t}", "protected Entity cacheLoadOrStore(Entity entity) {\n Entity cachedEntity = entityCache.findInCache(entity.getClass(), entity.getId());\n if (cachedEntity != null) {\n return cachedEntity;\n }\n entityCache.put(entity, true);\n return entity;\n }", "@Override\n\tpublic void cacheResult(\n\t\tList<StepDefsCompositeStepDefDBE> stepDefsCompositeStepDefDBEs) {\n\t\tfor (StepDefsCompositeStepDefDBE stepDefsCompositeStepDefDBE : stepDefsCompositeStepDefDBEs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tStepDefsCompositeStepDefDBEModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tStepDefsCompositeStepDefDBEImpl.class,\n\t\t\t\t\t\tstepDefsCompositeStepDefDBE.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(stepDefsCompositeStepDefDBE);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstepDefsCompositeStepDefDBE.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData getAuditingCompany();", "@Override\n\tpublic void cacheResult(List<Approvatore> approvatores) {\n\t\tfor (Approvatore approvatore : approvatores) {\n\t\t\tif (entityCache.getResult(\n\t\t\t\t\t\tApprovatoreModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tApprovatoreImpl.class, approvatore.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(approvatore);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tapprovatore.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "private void expire(final boolean byType) {\n LOG.info(\"expiring cache...\");\n\n try {\n CacheManager cacheManager = _db.getCacheManager();\n if (byType) {\n Class[] typeArray = new Class[5];\n typeArray[0] = LazyContract.class;\n typeArray[1] = LazyContractCategory.class;\n typeArray[2] = LazyPayRoll.class;\n typeArray[3] = LazyAddress.class;\n typeArray[4] = LazyEmployee.class;\n cacheManager.expireCache(typeArray);\n } else {\n Object[] identityArray = new Object[1];\n identityArray[0] = new Identity(\"First\", \"Person\");\n cacheManager.expireCache(LazyEmployee.class, identityArray);\n }\n } catch (Exception e) {\n LOG.error(\"expireCache: exception encountered clearing cache\", e);\n }\n }", "public EntityMetadata get(String appl, String entityName, boolean refreshCache) {\n if (!refreshCache) {\n EntityMetadata cached = cache.get(appl, entityName);\n if (cached != null) return cached;\n }\n\n List<KeyValuePair<String, String>> params = new ArrayList<>();\n params.add(new KeyValuePair<>(\"TV.APPLICATION\", appl));\n params.add(new KeyValuePair<>(\"TV.ENTITY.NAME\", entityName));\n\n Map<String, String> m = dmiCTXService.executeRaw(\"UT\", \"GET.ENTITY.METADATA\", params);\n\n if (m != null) {\n\n String[] names = split(m.get(\"TV.CDD.NAME\"), VM);\n String[] physNames = split(m.get(\"TV.PHYS.CDD.NAME\"), VM);\n String[] sources = split(m.get(\"TV.SOURCE\"), VM);\n String[] maxStorageSizes = split(m.get(\"TV.MAXIMUM.STORAGE.SIZE\"), VM);\n String[] fieldPlacements = split(m.get(\"TV.FIELD.PLACEMENT\"), VM);\n String[] usageTypes = split(m.get(\"TV.DATABASE.USAGE.TYPE\"), VM);\n String[] defaultDisplaySize = split(m.get(\"TV.DEFAULT.DISPLAY.SIZE\"), VM);\n String[] formatString = split(m.get(\"TV.INFORM.FORMAT.STRING\"), VM);\n String[] conversionString = split(m.get(\"TV.INFORM.CONVERSION.STRING\"), VM);\n String[] dataTypes = split(m.get(\"TV.DATA.TYPE\"), VM);\n String[] assocNames = split(m.get(\"TV.ELEMENT.ASSOC.NAME\"), VM);\n String[] assocTypes = split(m.get(\"TV.ELEMENT.ASSOC.TYPE\"), VM);\n String entityType = m.get(\"TV.ENTITY.TYPE\");\n String guidEnabled = m.get(\"TV.GUID.ENABLED\");\n\n int maxFieldPlacement = 0;\n if (fieldPlacements != null) {\n for (int y = 0; y < fieldPlacements.length; y++) {\n Integer p = getAtIntOrNull(fieldPlacements, y);\n if (p != null && p > maxFieldPlacement) maxFieldPlacement = p;\n }\n }\n\n Map<String, CddEntry> map = new HashMap<>();\n CddEntry[] ordered = new CddEntry[maxFieldPlacement];\n\n if (names != null) {\n for (int x = 0; x < names.length; x++) {\n if (EMPTY_STRING.equals(names[x])) continue;\n\n try {\n CddEntry.CddEntryBuilder b = CddEntry.builder();\n\n CddEntry e = b.name(getAt(names, x))\n .physName(getAt(physNames, x))\n .source(getAt(sources, x))\n .maximumStorageSize(getAtInt(maxStorageSizes, x))\n .fieldPlacement(getAtInt(fieldPlacements, x))\n .databaseUsageType(getAt(usageTypes, x))\n .defaultDisplaySize(getAt(defaultDisplaySize, x))\n .informFormatString(getAt(formatString, x))\n .informConversionString(getAt(conversionString, x))\n .dataType(getAt(dataTypes, x))\n .elementAssocName(getAt(assocNames, x))\n .elementAssocType(getAt(assocTypes, x))\n .build();\n\n map.put(names[x], e);\n\n Integer placement = getAtInt(fieldPlacements, x);\n if (placement != null && placement > 0) ordered[placement - 1] = e;\n } catch (NumberFormatException e) {\n throw new DmiMetadataException(\"Error reading metadata: \" + e.getClass().getName() + \": \" +\n e.getMessage(), e);\n }\n }\n }\n\n EntityMetadata entityMetadata = new EntityMetadata(entityType, guidEnabled, map, ordered);\n\n cache.put(appl, entityName, entityMetadata);\n return entityMetadata;\n\n }\n\n throw new DmiMetadataException(\"Error reading metadata - unexpected response from DMI\");\n }", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "@Override\n\tpublic void setCompanyId(long companyId);", "@AllowFailure(message=\"OPENJPA-1179 2.0 doesn't allow 'all' as in previous releases\")\n public void testMultiEMCachingAll() {\n Map props = new HashMap(System.getProperties());\n props.put(\"openjpa.MetaDataFactory\", \"jpa(Types=\" + Person.class.getName() + \")\");\n props.put(\"openjpa.jdbc.QuerySQLCache\", \"all\");\n runMultiEMCaching(props);\n }", "public Company getCompany() {\r\n return this.company;\r\n }", "void setAuditingCompany(ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData auditingCompany);", "public void flushCaches() {\n LOCAL_SMALL_CACHE.clear();\n LOCAL_LARGE_CACHE.clear();\n }", "public void cacheResult(TrabajadorEmpresa trabajadorEmpresa) {\n\t\tEntityCacheUtil.putResult(TrabajadorEmpresaModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tTrabajadorEmpresaImpl.class, trabajadorEmpresa.getPrimaryKey(),\n\t\t\ttrabajadorEmpresa);\n\n\t\ttrabajadorEmpresa.resetOriginalValues();\n\t}", "@Override\n @CacheEvict(value=AccountingPeriod.CACHE_NAME,allEntries=true)\n public void clearCache() {\n }", "public CustomerCompany addOrUpdateCustomerCompany(CustomerCompany company) \n\t{\n\t\tif (company.getId() == null) \n\t\t{\n\t\t\tthis.entityManager.persist(company);\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tcompany = this.entityManager.merge(company);\n\t\t}\n\t\treturn company;\n\t}", "boolean hasCompany();", "public void cacheResult(CsclAppointeeMaster csclAppointeeMaster);", "@Override\n\tpublic void cacheResult(LinkGroup linkGroup) {\n\t\tentityCache.putResult(LinkGroupModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\tLinkGroupImpl.class, linkGroup.getPrimaryKey(), linkGroup);\n\n\t\tlinkGroup.resetOriginalValues();\n\t}" ]
[ "0.7179557", "0.66793936", "0.62835604", "0.5952633", "0.577712", "0.5577608", "0.55571336", "0.54694545", "0.53644353", "0.53390175", "0.52540815", "0.52524203", "0.5227153", "0.51968867", "0.51738983", "0.5147005", "0.51278", "0.5126286", "0.5116078", "0.5064819", "0.50632256", "0.50579536", "0.50467026", "0.5033967", "0.5032343", "0.5020235", "0.50179803", "0.50118643", "0.498925", "0.4925248", "0.49094617", "0.49075678", "0.4903457", "0.48936775", "0.48916212", "0.48845538", "0.488102", "0.48723572", "0.48723206", "0.4872263", "0.4857335", "0.4848456", "0.48379558", "0.48370695", "0.48347417", "0.48291796", "0.48287898", "0.48043784", "0.47962126", "0.47941914", "0.47887886", "0.47802013", "0.47791713", "0.47786152", "0.47687417", "0.47658354", "0.4758115", "0.4758115", "0.4758115", "0.4758115", "0.4758115", "0.47505638", "0.47474208", "0.4744235", "0.4738445", "0.4729736", "0.4720894", "0.47166148", "0.47164598", "0.47140294", "0.4712643", "0.47114372", "0.47097057", "0.47042844", "0.4701541", "0.469452", "0.46912754", "0.46909824", "0.4688169", "0.46863604", "0.46858093", "0.46842304", "0.46834555", "0.46817854", "0.46760842", "0.46742567", "0.46734723", "0.46734723", "0.46734723", "0.46734723", "0.46719408", "0.46711636", "0.466838", "0.46676567", "0.46669585", "0.4663918", "0.46594334", "0.4655723", "0.46553442", "0.46552646" ]
0.758236
0
Creates a new company ag with the primary key. Does not add the company ag to the database.
public CompanyAg create(String companyAgId) { CompanyAg companyAg = new CompanyAgImpl(); companyAg.setNew(true); companyAg.setPrimaryKey(companyAgId); return companyAg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ContactCompanyAg create(String contactCompanyAgId) {\n\t\tContactCompanyAg contactCompanyAg = new ContactCompanyAgImpl();\n\n\t\tcontactCompanyAg.setNew(true);\n\t\tcontactCompanyAg.setPrimaryKey(contactCompanyAgId);\n\n\t\treturn contactCompanyAg;\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData addNewAuditingCompany();", "RentalAgency createRentalAgency();", "static void addNewCompany(SQLiteDatabase db, Company company) {\n ContentValues values = new ContentValues();\n values.put(COMPANY_ID, company.companyId);\n values.put(COMPANY_NAME, company.name);\n values.put(COMPANY_LOGO, company.companyLogo);\n values.put(COMPANY_DESCRIPTION, company.companyDescription);\n values.put(COMPANY_LAST_UPDATED, company.lastUpdatedDate);\n if (company.wasDeleted)\n values.put(COMPANY_WAS_DELETED, 1);\n else\n values.put(COMPANY_WAS_DELETED, 0);\n\n db.insert(COMPANY_TABLE, COMPANY_ID, values);\n }", "int insert(CompanyExtend record);", "public com.alain.puntocoma.model.Catalogo create(long catalogoId);", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData addNewCompanyBaseData();", "public void createCompany(Company company) throws ApplicationException {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\n\t\ttry {\n\t\t\t// Establish a connection from the connection manager\n\t\t\tconnection = JdbcUtils.getConnection();\n\n\t\t\t// Creating the SQL query\n\t\t\t// CompanyID is defined as a primary key and auto incremented\n\t\t\tString sqlStatement = \"INSERT INTO companies (company_Name) VALUES (?)\";\n\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\n\n\t\t\t// Replacing the question marks in the statement above with the relevant data\n\t\t\tpreparedStatement.setString(1, company.getName());\n\n\t\t\t// Executing the update\n\t\t\tpreparedStatement.executeUpdate();\n\n\t\t} catch (SQLException e) {\n\t\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t\t// notifies a level above.\n\t\t\te.printStackTrace();\n\t\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to create a company\");\n\t\t} finally {\n\t\t\t// Closing the resources\n\t\t\tJdbcUtils.closeResources(connection, preparedStatement);\n\t\t}\n\t}", "int insert(CmGroupRelIndustry record);", "@Override\r\n\tpublic void insertCompany(Company company) throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\r\n\t\tString sql = \"insert into Company(ID, COMP_NAME, PASSWORD, EMAIL) values (?,?,?,?)\";\r\n\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {\r\n\r\n\t\t\tpreparedStatement.setLong(1, company.getCompanyId());\r\n\t\t\tpreparedStatement.setString(2, company.getCompanyName());\r\n\t\t\tpreparedStatement.setString(3, company.getCompanyPassword());\r\n\t\t\tpreparedStatement.setString(4, company.getCompanyEmail());\r\n\r\n\t\t\tpreparedStatement.executeUpdate();\r\n\r\n\t\t\tSystem.out.println(\"Company created: \" + company.toString());\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new Exception(\"DB error - Company creation failed. companyId: \"+ company.getCompanyId());\r\n\t\t}catch (Exception e) {\r\n\t\t\tthrow new Exception(\"Company creation failed. companyId: \"+ company.getCompanyId());\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic void add(cp_company cp) {\n\t\t\n\t}", "public AirlineCompany() {\n\t}", "@Override\r\n\tpublic Company insertCompany(Company company) throws SQLException {\n\t\treturn companyRepository.save(company);\r\n\t}", "@Override\r\n\tpublic void addCompany(Company company) throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tString sql = \"insert into companies values(0, ?, ?, ?)\";\r\n\t\t\tPreparedStatement pstmt = con.prepareStatement(sql);\r\n\t\t\tif (company != null) {\r\n\t\t\t\tpstmt.setString(1, company.getCompName());\r\n\t\t\t\tpstmt.setString(2, company.getCompEmail());\r\n\t\t\t\tpstmt.setString(3, company.getCompPass());\r\n\t\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t\t\tSystem.out.println(\"New company was added\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"addCompany Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "int insert(InspectionAgency record);", "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 }", "Company getOrCreateCompanyId(String companyID) throws Exception;", "public void newConcert(DatabaseHandler dbh) throws SQLException {\n\t\tString query = \"INSERT INTO concert VALUES \" +\n\t\t\t\t\"(DEFAULT, ?, 5, ?, 0, ?, ?, ?)\";\n\t\tPreparedStatement prepStatement = dbh.prepareQuery(query);\n\t\tprepStatement.setObject(1, this.startDate, Types.DATE);\n\t\tprepStatement.setInt(2, this.ticketPrice);\n\t\tprepStatement.setInt(3, this.artistID);\n\t\tprepStatement.setInt(4, this.offerID);\n\t\tprepStatement.setInt(5, this.stageID);\n\n\t\tprepStatement.executeUpdate();\n\t}", "public Company saveCompany(Company company);", "ch.crif_online.www.webservices.crifsoapservice.v1_00.BusinessIndustryLicense addNewBusinessIndustryLicenses();", "@Override\n\tpublic void addCompany(BeanCompany Company) {\n\t\tSession session = HibernateUtil.getSessionFactory().getCurrentSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\ttry {\n\t\t\tsession.save(Company);\n\t\t\ttx.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}\n\t}", "UserGroup createGroup(String companyId, String name);", "@Override\n\tpublic EmployeeComplaint create(long employeeComplaintId) {\n\t\tEmployeeComplaint employeeComplaint = new EmployeeComplaintImpl();\n\n\t\temployeeComplaint.setNew(true);\n\t\temployeeComplaint.setPrimaryKey(employeeComplaintId);\n\n\t\treturn employeeComplaint;\n\t}", "int insertSelective(CompanyExtend record);", "public void setCompanyAgId(java.lang.String companyAgId) {\n\t\t_imageCompanyAg.setCompanyAgId(companyAgId);\n\t}", "public void create(CostEngineering costEngineering) {\n cost_engineering_dao.create(costEngineering);\n }", "UserGroup createGroup(String companyId, String name, String groupLead);", "ch.crif_online.www.webservices.crifsoapservice.v1_00.BusinessIndustryLicense insertNewBusinessIndustryLicenses(int i);", "void create(Authority authority) throws ExTrackDAOException;", "public static Company createCompany() {\r\n\t\treturn createCompany(1, \"Pepcus\", \"Software\", \"PEP\", new Date(), \"Special\", \"This is search help\");\r\n\t}", "Airbnb addAirbnb(Airbnb airbnb);", "public void insert(ZyCorporation record) {\r\n getSqlMapClientTemplate().insert(\"zy_corporation.insertcorporation\", record);\r\n }", "@PostMapping(\"/estate-agencies\")\n @Timed\n public ResponseEntity<EstateAgencyDTO> createEstateAgency(@RequestBody EstateAgencyDTO estateAgencyDTO) throws URISyntaxException {\n log.debug(\"REST request to save EstateAgency : {}\", estateAgencyDTO);\n if (estateAgencyDTO.getId() != null) {\n throw new BadRequestAlertException(\"A new estateAgency cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n EstateAgencyDTO result = estateAgencyService.save(estateAgencyDTO);\n return ResponseEntity.created(new URI(\"/api/estate-agencies/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "@PostMapping(\"/addAgence\")\r\n public Agence createAgence(@Valid @RequestBody Agence agence) {\r\n return agenceRepository.save(agence);\r\n }", "public boolean addCompanyData (CompanyData companyData) //ADD\n\t{\n\t\tContentValues contentValues = new ContentValues();\n\t\tcontentValues.put(COLUMN_COMPANY_NAME, companyData.getCompanyName());\n\n\n\t\tlong result = db.insert(TABLE_COMPANY, null, contentValues);\n\t\tdb.close();\n\n\t\t//Notifying if transaction was successful \n\t\tif(result == -1)return false;\n\t\telse return true;\n\n\t}", "@Override\n\tpublic Approvatore create(long id_approvatore) {\n\t\tApprovatore approvatore = new ApprovatoreImpl();\n\n\t\tapprovatore.setNew(true);\n\t\tapprovatore.setPrimaryKey(id_approvatore);\n\n\t\treturn approvatore;\n\t}", "public Company addCompany(int companyId, String companyName, String companyPassword) {\n\t\t \n\t\t ContentValues values = new ContentValues();\n\t\t values.put(MySQLiteHelper.COLUMN_COMPANY_ID, companyId);\n\t\t values.put(MySQLiteHelper.COLUMN_COMPANY_NAME, companyName);\n\t\t values.put(MySQLiteHelper.COLUMN_COMPANY_PASSWORD, companyPassword);\n\n\t\t long insertId = mDatabase.insert(MySQLiteHelper.TABLE_COMPANIES, null, values);\n\t\t Cursor cursor = mDatabase.query(MySQLiteHelper.TABLE_COMPANIES,\n\t\t mAllColumns, null, null,\n\t\t null, null, null);\n\t\t cursor.moveToFirst();\n\t\t Company newCompany = cursorToCompany(cursor);\n\t\t cursor.close();\n\t\t return newCompany;\n\t\t }", "public void createOpportunity(String oppoSubject_, String oppoCloseDate_, String oppoAmount_\n , String oppoProbablity_, String oppoRelatedLead_, String oppoAssignedto_, String oppoID_, String oppoRelatedLeadID_, String oppoAssignedToID_) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n // make values to be inserted\n ContentValues values = new ContentValues();\n values.put(oppoSubject,oppoSubject_ );\n values.put( oppoCloseDate,oppoCloseDate_);\n values.put( oppoAmount, oppoAmount_);\n values.put(oppoProbablity , oppoProbablity_ );\n values.put(oppoRelatedLead , oppoRelatedLead_ );\n values.put(oppoAssignedto , oppoAssignedto_ );\n values.put(oppoID , oppoID_ );\n values.put(oppoRelatedLeadID, oppoRelatedLeadID_);\n values.put(oppoAssignedToID, oppoAssignedToID_);\n\n String xcf= oppoSubject_;\n // insert Event\n db.insert(table_Opportunity, null, values);\n\n // close database transaction\n\n }", "int insertSelective(CmGroupRelIndustry record);", "public long insertAgency(String agency_id, String agency_name, String agency_url, String agency_timezone, String agency_lang, String agency_phone) {\n\t\t\tContentValues initialValues = new ContentValues();\n\t\t\tinitialValues.put(KEY_AGENCYID, agency_id);\n\t\t\tinitialValues.put(KEY_AGENCYNAME, agency_name);\n\t\t\tinitialValues.put(KEY_AGENCYURL, agency_url);\n\t\t\tinitialValues.put(KEY_AGENCYTIMEZONE, agency_timezone);\n\t\t\tinitialValues.put(KEY_AGENCYLANG, agency_lang);\n\t\t\tinitialValues.put(KEY_AGENCYPHONE, agency_phone);\n\t\t\treturn db.insert(AGENCIES_TABLE, null, initialValues);\n\t\t}", "Purchase create(Purchase purchase) throws SQLException, DAOException;", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public void setCompanyId(long companyId);", "public long addCompany(CompanyEntity companyEntity) throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n //CompanyID is defined as a primary key and auto incremented\n String sqlStatement = \"INSERT INTO companies (company_name, company_email, company_phone, company_address) VALUES(?,?,?,?)\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement, Statement.RETURN_GENERATED_KEYS);\n\n //Replacing the question marks in the statement above with the relevant data\n preparedStatement.setString(1, companyEntity.getCompanyName());\n preparedStatement.setString(2, companyEntity.getCompanyEmail());\n preparedStatement.setString(3, companyEntity.getCompanyPhone());\n preparedStatement.setString(4, companyEntity.getCompanyAddress());\n\n //Executing the update\n preparedStatement.executeUpdate();\n\n ResultSet resultSet = preparedStatement.getGeneratedKeys();\n if (!resultSet.next()) {\n throw new ApplicationException(ErrorType.FAILED_CREATE_COMPANY, \"Invalid company key during creation\");\n }\n System.out.println(\"Company has been successfully added to DB\");\n return resultSet.getLong(1);\n\n } catch (Exception e) {\n //\t\t\te.printStackTrace();\n //If there was an exception in the \"try\" block above, it is caught here and notifies a level above.\n //\t\t\tthrow new ApplicationException(e, ErrorType.GENERAL_ERROR, DateUtils.getCurrentDateAndTime()\n //\t\t\t\t\t+\" Create company failed\");\n throw new Exception(\"Failed to create company \" + companyEntity.toString(), e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "public void create(Employee employee, Company company, IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "@Override\n\tpublic void createAgence(Agence a) {\n\t\t\n\t}", "public void createAgenda(Agenda agenda){\n Session session = HibernateUtil.getSessionFactory().openSession(); \n Transaction transaction = session.beginTransaction();\n session.save(agenda);\n transaction.commit();\n session.close();\n }", "int insertSelective(InspectionAgency record);", "@Override\n\tpublic void save(Company company) {\n\t\t\n\t}", "int insert(Organization record);", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Aa addNewAa();", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "public com.Hotel.model.Hotel create(long hotelId);", "int insert(TycCompanyExecutiveCrawler record);", "public CustomerCompany addOrUpdateCustomerCompany(CustomerCompany company) \n\t{\n\t\tif (company.getId() == null) \n\t\t{\n\t\t\tthis.entityManager.persist(company);\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tcompany = this.entityManager.merge(company);\n\t\t}\n\t\treturn company;\n\t}", "public void insert(TmCompany tmCompany) {\n\t\ttmCompanyDao.insert(tmCompany);\r\n\t}", "public ServiceGroup create(String shortName, String title, int cid) throws Exception;", "int insert(SysOrganization record);", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "int insert(TycCompanyCheckCrawler record);", "public void insert(EpAssets record) {\n getSqlMapClientTemplate().insert(\"EP_ASSETS.abatorgenerated_insert\", record);\n }", "public Company() {\r\n\t\tsuper();\r\n\t}", "@Override\n\tpublic PhatVay create(long phatVayId) {\n\t\tPhatVay phatVay = new PhatVayImpl();\n\n\t\tphatVay.setNew(true);\n\t\tphatVay.setPrimaryKey(phatVayId);\n\n\t\tphatVay.setCompanyId(companyProvider.getCompanyId());\n\n\t\treturn phatVay;\n\t}", "AdPartner insertAdPartner(AdPartner adPartner);", "public Company() {\n\t\tsuper();\n\t}", "public void agregar(Provincia provincia) throws BusinessErrorHelper;", "public int agregar(SegFacultadDto comp) throws Exception, BusinessException{\r\n\t\treturn segFacultadDao.insertar(comp);\r\n\t}", "public void create() {\n\t\t\tdb.execSQL(AGENCYDB_CREATE+\".separete,.import agency.txt agency\");\n\t\t\tdb.execSQL(STOPSDB_CREATE+\".separete,.import stop_times.txt stop_times\");\n\t\t\t\n\t\t\t// Add 2 agencies for testing\n\t\t\t\n\t\t\t\n\t\t\tdb.setVersion(DATABASE_VERSION);\n\t\t}", "public AirlineCompany(final String name) {\n\t\tthis.setName(name);\n\t}", "int insert(NeeqCompanyAccountingFirmOnline record);", "int insert(DepAcctDO record);", "int insert(ErpOaLicKey record);", "int insert(TdxCompanyTaxArrears record);", "int insert(CmIndustryConfig record);", "int insert(EcsAd record);", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "@Override\n\tpublic int saveNewAgency(AgencyMaster newAgency) {\n\t\tlogger.debug(\"=====START AdminDAOImpl saveNewAgency======\");\n\t\tSession session = null;\n\t\ttry {\n\t\tsession = sessionFactory.openSession();\t\n\t\t\tTransaction tx = session.beginTransaction();\n\t\t\tsession.save(newAgency);\n\t\t tx.commit();\n\t\t} catch (HibernateException he) {\n\t\t\tlogger.error(\"Exception occured while inserting agency:\"\n\t\t\t\t\t+ he.getMessage());\n\t\t\tthrow new ERPException(\n\t\t\t\t\t\"Exception occured while inserting agency:\"\n\t\t\t\t\t\t\t+ he.getMessage());\n\t\t} catch (ERPException erp) {\n\t\t\tlogger.error(\"Exception occured while inserting agency:\"\n\t\t\t\t\t+ erp.getMessage());\n\t\t\tthrow new ERPException(\"Error while inserting agency\");\n\t\t} catch (Exception e) {\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t\tlogger.debug(\"=====END AdminDAOImpl saveNewAgency======\");\n\t\t return 1;\n\t}", "public void newCrayon(Crayon cr) {\r\n\tem.getTransaction( ).begin( );\r\n em.persist(cr);\r\n em.getTransaction().commit();\r\n }", "public CsclAppointeeMaster create(long id_);", "public void insert(AlManageOnAir record) {\r\n getSqlMapClientTemplate().insert(\"AL_MANAGE_ON_AIR.ibatorgenerated_insert\", record);\r\n }", "int insert(CGcontractCredit record);", "public org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo create(long id);", "@Transactional\n public Agency addAgency(String name, Double rating) {\n return agencyRepository.saveAndFlush(new Agency(null, name, rating));\n }", "@Override\n\tpublic LinkGroup create(long linkgroupId) {\n\t\tLinkGroup linkGroup = new LinkGroupImpl();\n\n\t\tlinkGroup.setNew(true);\n\t\tlinkGroup.setPrimaryKey(linkgroupId);\n\n\t\tlinkGroup.setCompanyId(companyProvider.getCompanyId());\n\n\t\treturn linkGroup;\n\t}", "int insert(OauthApprovals record);", "@Override\r\n\tpublic int create(Estado_Civil civil) {\n\t\treturn jdbcTemplate.update(\"call PKG_ESTADO_CIVIL.PR_INS_ESTADO_CIVIL(?)\", civil.getNombre());\r\n\t}", "int insert(ActivityHongbaoPrize record);", "public static EnrollmentAgency createEntity(EntityManager em) {\n EnrollmentAgency enrollmentAgency = new EnrollmentAgency()\n .name(DEFAULT_NAME)\n .office(DEFAULT_OFFICE)\n .recordNumber(DEFAULT_RECORD_NUMBER)\n .phone(DEFAULT_PHONE);\n return enrollmentAgency;\n }", "int insertSelective(TycCompanyExecutiveCrawler record);", "public Hoppy insert(Hoppy hoppy, IdGenerateService<Long> idGenerateService) throws DataAccessException;", "void createACustomer() {\r\n\t\tSystem.out.println(\"\\nCreating a customer:\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tEntityTransaction tx = em.getTransaction();\r\n\t\tCustomer2 c1 = new Customer2(\"Ali\", \"Telli\");\r\n\t\ttx.begin();\r\n\t\tem.persist(c1);\r\n\t\ttx.commit();\r\n\t\tem.close();\r\n\t}", "@Override\n @Transactional\n public String create(Company company, BindingResult result) {\n\n\t// Security check.\n\tif (!this.authHelper.isSuperAdmin()) {\n\t this.messageHelper.unauthorizedID(Company.OBJECT_NAME, company.getId());\n\t return AlertBoxFactory.ERROR;\n\t}\n\n\t// Service layer form validation.\n\tthis.companyValidator.validate(company, result);\n\tif (result.hasErrors()) {\n\t return this.validationHelper.errorMessageHTML(result);\n\t}\n\n\tthis.companyDAO.create(company);\n\n\t// Log.\n\tthis.messageHelper.auditableID(AuditAction.ACTION_CREATE, Company.OBJECT_NAME, company.getId(),\n\t\tcompany.getName());\n\n\t// Do actual service and construct response.\n\treturn AlertBoxFactory.SUCCESS.generateCreate(Company.OBJECT_NAME, company.getName());\n }", "@Override\r\n\tpublic int createAdvertisement(AdvertisementDto dto) {\n\t\treturn session.insert(\"kdc.advertisement.createAdvertisement\", dto);\r\n\t}", "int insert(OcCustContract record);", "public void insert(ChargePolicy chargePolicy);", "public Complaint create(Complaint complaint) {\n\t\t//int employeeId,customerServiceId;\n\t\t//String employeeName=complaint.getEmployeeName();\n\t\t//String customerServiceName=complaint.getCustomerServiceName();\n\t\t//Employee employee=findByEmployeeName(employeeName);\n\t\t//Employee employee1=findByEmployeeName(customerServiceName);\n\t\t//employeeId=employee.getEmployeeId();\n\t\t//customerServiceId=employee1.getEmployeeId();\n\t\tSimpleDateFormat date=new SimpleDateFormat(\"dd/MM/yyyy\");\n \t\tDate dt=new Date();\n \t\t//complaint.setEmployeeId(complaint.getEmployeeId());\n \t\t//complaint.setCustomerServiceId(complaint.getCustomerServiceId());\n \t\tcomplaint.setCreatedDate(date.format(dt));\n \t\tcomplaint.setCreatedBy(complaint.getCustomerServiceId());\n \t\tcomplaint.setModifiedDate(date.format(dt));\n \t\tcomplaint.setModifiedBy(complaint.getCustomerServiceId());\n \t\tcomplaint.setDeletedFlag(\"Y\");\n\t\treturn complaintRepository.save(complaint);\n\t}" ]
[ "0.6803424", "0.6131078", "0.6082383", "0.6026884", "0.5890657", "0.57896996", "0.5754989", "0.57111067", "0.56904584", "0.566581", "0.5640555", "0.5635784", "0.56200784", "0.56070554", "0.55489033", "0.55227315", "0.5505002", "0.5497229", "0.54886997", "0.5488118", "0.5477282", "0.547457", "0.54532367", "0.5441662", "0.54388595", "0.5415476", "0.53849465", "0.53670985", "0.5360991", "0.5350209", "0.5349", "0.5316251", "0.5311375", "0.52910376", "0.5271394", "0.525363", "0.5242828", "0.522147", "0.52165484", "0.52127576", "0.52085286", "0.518663", "0.518663", "0.518663", "0.518663", "0.518663", "0.51838344", "0.5177532", "0.5177201", "0.5163096", "0.5151764", "0.51515853", "0.5148178", "0.51414543", "0.5135387", "0.5130117", "0.51223826", "0.51205385", "0.51124233", "0.5110997", "0.50986415", "0.5070293", "0.5053879", "0.5053832", "0.5044575", "0.5040205", "0.5033405", "0.5028768", "0.50198305", "0.50114995", "0.5008298", "0.5006377", "0.5003437", "0.5003004", "0.49999678", "0.4988775", "0.49745554", "0.4963903", "0.49534774", "0.49430755", "0.49288985", "0.4917506", "0.4917447", "0.49155715", "0.49099675", "0.49084684", "0.48945192", "0.4891651", "0.4885485", "0.48686963", "0.48542824", "0.4853201", "0.48493326", "0.48489773", "0.48322177", "0.48182446", "0.48141372", "0.4811191", "0.47973776", "0.4796703" ]
0.71497726
0
Removes the company ag with the primary key from the database. Also notifies the appropriate model listeners.
public CompanyAg remove(String companyAgId) throws NoSuchCompanyAgException, SystemException { return remove((Serializable)companyAgId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeByCompanyId(long companyId);", "@Override\n\tpublic CompanyAg remove(Serializable primaryKey)\n\t\tthrows NoSuchCompanyAgException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tCompanyAg companyAg = (CompanyAg)session.get(CompanyAgImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (companyAg == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchCompanyAgException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(companyAg);\n\t\t}\n\t\tcatch (NoSuchCompanyAgException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "@Override\n\tpublic ContactCompanyAg remove(Serializable primaryKey)\n\t\tthrows NoSuchContactCompanyAgException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tContactCompanyAg contactCompanyAg = (ContactCompanyAg)session.get(ContactCompanyAgImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (contactCompanyAg == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchContactCompanyAgException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(contactCompanyAg);\n\t\t}\n\t\tcatch (NoSuchContactCompanyAgException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "@Override\r\n\tpublic void removeCompany(Company company) throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\r\n\t\tString sql = \"delete from Company where ID = ?\";\r\n\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {\r\n\r\n\t\t\tconnection.setAutoCommit(false);\r\n\t\t\tpreparedStatement.setLong(1, company.getCompanyId());\r\n\t\t\tpreparedStatement.executeUpdate();\r\n\t\t\tconnection.commit();\r\n\t\t\tSystem.out.println(\"remove succeeded. Company removed id: \" + company.getCompanyId()); \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\r\n\t\t} catch (SQLException e) {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.rollback();\r\n\t\t\t} catch (SQLException e2) {\r\n\t\t\t\tthrow new Exception(\"DB error - failed to remove Company. companyId: \" + company.getCompanyId());\r\n\t\t\t}\r\n\t\t\tthrow new Exception(\"failed to remove Company. companyId: \" + company.getCompanyId());\r\n\t\t} finally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t} \r\n\r\n\t}", "@Override\r\n\tpublic void deleteCompany(int compId) throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tString sql = \"delete from companies where companyId=\" + compId;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"Company with ID: \" + compId + \" was deleted\");\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"deleteCompany Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void delete(Company company) {\r\n\t\tsessionFactory.getCurrentSession().delete(company);\r\n\t}", "public void removeCouponByCompany(Company company) throws DbException;", "@Override\n\tpublic void remove(cp_company cp) {\n\t\t\n\t}", "public void deleteCompany(Company obj);", "public void removeByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;", "public void removeCompany(int id, String name) {\n }", "public void removeCustomerCoupon(Company company) throws DbException;", "public void removeByc_g(long groupId, long companyId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "int deleteByPrimaryKey(String industryId);", "public ContactCompanyAg remove(String contactCompanyAgId)\n\t\tthrows NoSuchContactCompanyAgException, SystemException {\n\t\treturn remove((Serializable)contactCompanyAgId);\n\t}", "@Transactional\n public void deleteBy(final Long companyId) {\n final Company company = companyRepository.findOne(companyId);\n if (company != null) {\n companyRepository.delete(company);\n }\n }", "public void deleteCompany(Long companyId) throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"DELETE FROM companies WHERE company_id = ?\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Replacing the question marks in the statement above with the relevant data\n preparedStatement.setLong(1, companyId);\n\n //Executing the update\n int result = preparedStatement.executeUpdate();\n\n if (result == 0) {\n throw new ApplicationException(ErrorType.FAILED_DELETE_COMPANY, \"Failed to delete company\");\n }\n System.out.println(result + \" Company has been successfully deleted from DB\");\n\n } catch (Exception e) {\n throw new Exception(\"Failed to delete company \" + companyId, e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "void deleteComputerByCompany(Company company);", "public void removeByCompanyAgId(String companyAgId)\n\t\tthrows SystemException {\n\t\tfor (ContactCompanyAg contactCompanyAg : findByCompanyAgId(companyAgId)) {\n\t\t\tremove(contactCompanyAg);\n\t\t}\n\t}", "public void removeByUuid_C(String uuid, long companyId);", "public void removeByUuid_C(String uuid, long companyId);", "public void removeByUuid_C(String uuid, long companyId);", "@Override\r\n\tpublic ResponseEntity<String> deleteCompany(int companyCode) {\n\t\tcompanyRepository.deleteById(companyCode);\r\n\t\treturn new ResponseEntity<>(\"Company has been Deleted\", HttpStatus.OK);\r\n\t}", "void unsetAuditingCompany();", "public void removeByC_S(long companyId, int status);", "void unsetCompanyBaseData();", "public void removeCarritoDeCompras (Long compradorId) {\r\n\r\n CompradorEntity compradorEntity = compradorPersistence.find(compradorId); \r\n CarritoDeComprasEntity carroEntity = carroPersistence.find(compradorEntity.getCarritoDeCompras().getId());\r\n carroPersistence.delete(compradorEntity.getListaDeDeseos().getId());\r\n compradorEntity.setListaDeDeseos(null);\r\n carroEntity.setComprador(null);\r\n \r\n}", "public int DelCompany(Long cid, String compname, Long shareamt, Long getnoShare) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from company where comp_id=\"+cid+\"\");\r\n\treturn i;\r\n}", "@Override\n\tpublic void delete(Long primaryKey) {\n\t\t\n\t}", "public void removeByUuid_C(java.lang.String uuid, long companyId);", "@Override\n public void deleteById(Long idCompte) {\n Session session = entityManager.unwrap(Session.class);\n Compte compte = session.get(Compte.class, idCompte);\n session.remove(compte);\n }", "@Override\n\t/**\n\t * Removes all Coupons from the Coupon table in the database related to\n\t * Company ID received\n\t */\n\tpublic void deleteCouponsByCompanyID(int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\n\t\ttry {\n\t\t\t// Defining SQL string to remove Coupons related to specified\n\t\t\t// Company ID from the Coupon table via prepared statement\n\t\t\tString deleteCouponsByCompanyIDSQL = \"delete from coupon where id in (select couponid from compcoupon where companyid = ?)\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(deleteCouponsByCompanyIDSQL);\n\t\t\t// Set Company ID from variable that method received\n\t\t\tpstmt.setInt(1, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute check\n\t\t\tint resRemByComp3 = pstmt.executeUpdate();\n\t\t\tif (resRemByComp3 != 0) {\n\t\t\t\t// If result row count is not equal to zero - execution has been\n\t\t\t\t// successful\n\t\t\t\tSystem.out.println(\"Coupons of specified Company have been deleted from Coupon table successfully\");\n\t\t\t} else {\n\t\t\t\t// Otherwise execution failed due to Coupons related to\n\t\t\t\t// specified Company not found in the database\n\t\t\t\tSystem.out.println(\"Coupons removal has been failed - subject entries not found in the database\");\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon removal from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupons removal has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\t}", "@Override\n\t@Transactional(rollbackFor=RuntimeException.class)\n\tpublic void deleteOne(Long id){\n\t\tnew ComputerDao().deleteByCompany(id);\n\t\tdao.delete(id);\n\t}", "int deleteByPrimaryKey(String depCode);", "public void unlinkAllCompanyCoupon(long companyId) throws SQLException;", "public void deleteCompanyById(long companyId) throws Exception {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\n\t\ttry {\n\t\t\tconnection = JdbcUtils.getConnection();\n\t\t\t\n\t\t\t// Creating the SQL query\n\t\t\tString sqlStatement = \"DELETE FROM `javaproject`.`companies` WHERE `Company_ID` = ?;\";\n\t\t\t\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\n\t\t\t\n\t\t\t// Replacing the question marks in the statement above with the relevant data\n\t\t\tpreparedStatement.setLong(1, companyId);\n\t\t\t\n\t\t\t// Executing the update\n\t\t\tpreparedStatement.executeUpdate();\n\t\t\n\t} catch (SQLException e) {\n\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t// notifies a level above.\n\t\te.printStackTrace();\n\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to Delete a company\");\n\n\t\t// Closing the resources\n\t\t} finally {\n\t\t\tJdbcUtils.closeResources(connection, preparedStatement);\n\t\t}\n\t}", "@Override\n\tpublic void deleteByOid(int oaId) {\n\t\tdesignMapper.deleteByOid(oaId);\n\t}", "void unsetHasAuditingCompany();", "public void removeCustomerCompany(Long id) \n\t{\n\t\tQuery queryUsers = this.entityManager.createNamedQuery(\"CompanyUser.removeByCompanyId\");\n\t\tqueryUsers.setParameter(\"prCompanyId\", id);\n\t\tqueryUsers.executeUpdate();\n\t\tQuery queryCompany = this.entityManager.createNamedQuery(\"CustomerCompany.removeById\");\n\t\tqueryCompany.setParameter(\"prId\", id);\n\t\tqueryCompany.executeUpdate();\n\t}", "public int deleteCompGroup(CompGroupVO objCompGroupVO) throws EMDException,\n\tException;", "public void removeCompanyCoupon(Coupon coupon) throws DbException;", "void eliminar(PK id);", "@Override\n public void removeFromDb() {\n }", "public void delete() \n\t\t\t\tthrows model.ConsistencyException, PersistenceException{\n //TODO Check delegation to abstract class and overwrite if necessary!\n this.getMyCONCMModelItem().delete();\n }", "void deleteByOrgId(String csaOrgId);", "public int deleteByPrimaryKey(Integer rowid) {\r\n ZyCorporation key = new ZyCorporation();\r\n key.setRowid(rowid);\r\n int rows = getSqlMapClientTemplate().delete(\"zy_corporation.deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "public Builder clearCompany() {\n \n company_ = getDefaultInstance().getCompany();\n onChanged();\n return this;\n }", "public String delete() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result = model.delete(vendorMaster);\r\n\t\tif (result) {\r\n\t\t\taddActionMessage(\"Record Deleted Successfully.\");\r\n\t\t\treset();\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\taddActionMessage(\"This record is referenced in other resources.So can't delete.\");\r\n\t\t\treset();\r\n\t\t}// end of else\r\n\t\tmodel.Data(vendorMaster, request);\r\n\t\tmodel.terminate();\r\n\t\tgetNavigationPanel(1); \r\n\t\treturn \"success\";\r\n\t}", "@Test\n\tpublic void testDeleteCompanyApi() {\n\t\tCompany company = new Company(\"DataSolutionsPvtLtd\",\n\t\t\t\t\"Marthahalli road\", \"Bangalore\", \"India\", \"9880440671\");\n\t\tcompanyRepository.save(company);\n\n\t\tInteger companyId = company.getCompanyId();\n\n\t\t// Now Invoke the API to delete the Company\n\t\trestTemplate.delete(\"http://localhost:8888/companies/delete/\"\n\t\t\t\t+ companyId);\n\n\t\t// Try to fetch from the DB directly\n\t\tCompany companyFromDb = companyRepository.findOne(companyId);\n\t\t// and assert that there is no data found\n\t\tassertNull(companyFromDb);\n\t}", "public Boolean deleteManagedCompany(int id) {\n \n Boolean result = false;\n \n try { \n Connection conn = this.databaseUtils.getConnection();\n dao.setConnection(conn);\n result = dao.delete(id);\n } catch (SQLException e) {\n Logger.getLogger(AppService.class.getName()).log(Level.SEVERE, null, e);\n }\n \n return result;\n }", "@Override\n\tpublic int deleteByPrimaryKey(String modelid) {\n\t\treturn equipmentSetvalMapper.deleteByPrimaryKey(modelid);\n\t}", "public String deleteAccount(int companyId) {\n\t\tfactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);\n\t\tEntityManager em = factory.createEntityManager();\t\n\t\t\n\t\t//select business account matching the company id submitted in the argument\n\t\t\tem.getTransaction().begin();\n\t\t\tQuery myQuery = em.createQuery(\"SELECT b FROM BusinessAccount b WHERE b.id=:id\");\n\t\t\tmyQuery.setParameter(\"id\", companyId);\n\t\t\tList<BusinessAccount> accountList=myQuery.getResultList();\n\t\t\t\n\t\t\tem.remove(accountList.get(0));\t//remove this account using JPA\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\n\t\t\t\n\t\t\treturn \"delete\";\n\t\t}", "@Override\n\tpublic void deleteById(Integer id) throws Exception {\n\t\tcomproRepository.deleteById(id);\n\t}", "public void deletar() {\n\t\tClienteDAO Clientedao = new ClienteDAO();\t\r\n\t\tClientedao.delete(this);\r\n\t\t\r\n\t\tnovoRegistro();\r\n\t\tnotifyObservers();\r\n\t}", "@Override\n\tpublic EmployeeComplaint remove(Serializable primaryKey)\n\t\tthrows NoSuchEmployeeComplaintException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tEmployeeComplaint employeeComplaint = (EmployeeComplaint)session.get(EmployeeComplaintImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (employeeComplaint == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchEmployeeComplaintException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(employeeComplaint);\n\t\t}\n\t\tcatch (NoSuchEmployeeComplaintException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "public void delete() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.delete(this);\r\n\t}", "public void removeAll() throws SystemException {\n\t\tfor (CompanyAg companyAg : findAll()) {\n\t\t\tremove(companyAg);\n\t\t}\n\t}", "@Override\n\tpublic int deleteByPrimaryKey(String id) {\n\t\treturn siteReservoirInfoMapper.deleteByPrimaryKey(id);\n\t}", "public static void removeByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException {\n getPersistence().removeByc(companyId);\n }", "@Override\n\tpublic PhatVay remove(Serializable primaryKey)\n\t\tthrows NoSuchPhatVayException {\n\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tPhatVay phatVay = (PhatVay)session.get(\n\t\t\t\tPhatVayImpl.class, primaryKey);\n\n\t\t\tif (phatVay == null) {\n\t\t\t\tif (_log.isDebugEnabled()) {\n\t\t\t\t\t_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchPhatVayException(\n\t\t\t\t\t_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t}\n\n\t\t\treturn remove(phatVay);\n\t\t}\n\t\tcatch (NoSuchPhatVayException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "@Override\r\n\tpublic Company updateCompany(Company company) {\n\t\treturn null;\r\n\t}", "int deleteByPrimaryKey(String EQP_MODEL_ID);", "@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}", "public void delete(Long compradorId) {\r\n CompradorEntity compradorEntity = em.find(CompradorEntity.class, compradorId);\r\n em.remove(compradorEntity);\r\n }", "@Override\n public void delete() {\n this.parent.handleRemoveSignal(this.deadline.getCourseName(),\n this.deadline.getName(),\n this.deadline.getYear(),\n this.deadline.getMonth(),\n this.deadline.getDay());\n }", "int deleteByPrimaryKey(String vendorid);", "public void eliminar(Provincia provincia) throws BusinessErrorHelper;", "@Override\n\tpublic int deleteFromLicenseBusinessLicenseByPrimaryKey(Integer id) {\n\t\treturn licenseBusinessLicenseMapper.deleteByPrimaryKey(id);\n\t}", "public void removeAll() throws SystemException {\n\t\tfor (ContactCompanyAg contactCompanyAg : findAll()) {\n\t\t\tremove(contactCompanyAg);\n\t\t}\n\t}", "@Override\n\tpublic void remove(Savable savable) {\n\t\tif (savable instanceof Contact) {\n\t\t\tContact contact = (Contact)savable;\n\t\t\tthis.contacts.remove(contact.getId());\n\t\t}\n\t}", "int deleteByPrimaryKey(Integer actPrizeId);", "int deleteByPrimaryKey(Long navigationId);", "public void purgeYearByChart(String chartOfAccountsCode, int year) {\n LOG.debug(\"purgeYearByChart() started\");\n\n Criteria criteria = new Criteria();\n criteria.addEqualTo(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);\n criteria.addLessThan(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, new Integer(year));\n\n getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(SufficientFundBalances.class, criteria));\n\n // This is required because if any deleted account balances are in the cache, deleteByQuery doesn't\n // remove them from the cache so a future select will retrieve these deleted account balances from\n // the cache and return them. Clearing the cache forces OJB to go to the database again.\n getPersistenceBrokerTemplate().clearCache();\n }", "public void elimina(Long id) {\n\n final EntityManager em = getEntityManager();\n\n try {\n\n final EntityTransaction tx = em.getTransaction();\n\n tx.begin();\n\n // Busca un conocido usando su llave primaria.\n\n final Conocido modelo = em.find(Conocido.class, id);\n\n if (modelo != null) {\n\n /* Si la referencia no es nula, significa que el modelo se encontró la\n\n * referencia no es nula y se elimina. */\n\n em.remove(modelo);\n\n }\n\n tx.commit();\n\n } finally {\n\n em.close();\n\n }\n\n }", "int deleteByPrimaryKey(Integer deliverid);", "private final void m118787c(bkcr bkcr) {\n if (getAdapter() instanceof bkcq) {\n ((bkcq) getAdapter()).remove(bkcr);\n }\n }", "public void removeBycompanyIdAndGroupId(long companyId, long groupId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "void remove(PK id);", "int deleteByPrimaryKey(String idTipoComprobante) throws SQLException;", "@Override\n\tpublic void deleteAgence(Agence a) {\n\t\t\n\t}", "@Transactional\n\t\tpublic void delete(ComplaintVO complaintVO) \n\t\t{\n\t\t\tcomplaintDAO.delete(complaintVO);\n\t\t}", "int deleteByPrimaryKey(Long catalogId);", "public void clearLineaGastos(long pk)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Override\n\tpublic CreditAppBankReference remove(Serializable primaryKey)\n\t\tthrows NoSuchCreditAppBankReferenceException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tCreditAppBankReference creditAppBankReference = (CreditAppBankReference)session.get(CreditAppBankReferenceImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (creditAppBankReference == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchCreditAppBankReferenceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(creditAppBankReference);\n\t\t}\n\t\tcatch (NoSuchCreditAppBankReferenceException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "int deleteByPrimaryKey(Integer cId);", "int deleteByPrimaryKey(Integer cId);", "@Override\n\tpublic ResultMessage delOrganization(OrganizationVO vo) throws RemoteException {\n\t\treturn ResultMessage.success;\n\t}", "public void deleteEducation() {\n workerPropertiesController.deleteEducation(myEducationCollection.getRowData()); \n // usuniecie z bazy\n getUser().getEducationCollection().remove(myEducationCollection.getRowData()); \n // usuniecie z obiektu usera ktory mamy zapamietany w sesji\n }", "@Override\r\n\tpublic void eliminar() {\n\t\ttab_cuenta.eliminar();\r\n\t}", "@Override\n\tpublic void delete(String cid) {\n\t\tCommodity commodity=this.getHibernateTemplate().get(Commodity.class, cid);\n\t\t System.out.println(\"查询完毕\");\n\t\t System.out.println(commodity.getCname());\n\t this.getHibernateTemplate().delete(commodity);\n\t}", "public int delComp(Long cid, String compname, String address, String city,\r\n\t\tString state, Long offno, Long faxno, String website, String eMail,\r\n\t\tLong shareamt, Long getnoShare)throws SQLException {\n\tLong id=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select login_id from company where comp_id=\"+cid+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tid=rs.getLong(1);\r\n\t}\r\n\tint i=DbConnect.getStatement().executeUpdate(\"Delete from login where login_id=\"+id+\"\");\r\n\treturn i;\r\n}", "public void eliminar(Long id) throws AppException;", "public void onRemoveAgendaItem() {\n AgendaItem agendaItem = outputAgendaItemsPreparation.getSelectionModel().getSelectedItem();\n\n if (agendaItem == null) {\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_NULL, null);\n return;\n }\n\n if (controller.removeAgendaItem(agendaItem)) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_REMOVE, null);\n }", "int deleteByPrimaryKey(String taxregcode);", "@Override\n public int deleteByPrimaryKey(BorrowDO record){\n return borrowExtMapper.deleteByPrimaryKey(record);\n }", "int deleteByPrimaryKey(String contractNo);", "private void deleteEmployeeBooking() {\n BookingModel bookingModel1 = new BookingModel();\n try {\n bookingModel1.deleteBooking(employeeID);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\tpublic void removeByCreditAppId(long creditAppId) throws SystemException {\n\t\tfor (CreditAppBankReference creditAppBankReference : findByCreditAppId(\n\t\t\t\tcreditAppId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n\t\t\tremove(creditAppBankReference);\n\t\t}\n\t}", "int deleteByPrimaryKey(String goodsId);" ]
[ "0.71257937", "0.6967333", "0.68627024", "0.6722307", "0.65238726", "0.63413197", "0.63282514", "0.6281373", "0.62603897", "0.62549484", "0.61633205", "0.6155056", "0.61257344", "0.6008604", "0.6000891", "0.59696597", "0.59596306", "0.5926152", "0.5909855", "0.58997285", "0.58997285", "0.58997285", "0.5893985", "0.588912", "0.5849744", "0.58150274", "0.580935", "0.5795159", "0.57821625", "0.5772237", "0.5764925", "0.5759824", "0.5730408", "0.56779766", "0.56127954", "0.559535", "0.5594508", "0.55864406", "0.55849373", "0.55815965", "0.557101", "0.5569085", "0.55657053", "0.5564575", "0.55552965", "0.5537993", "0.5536486", "0.5532873", "0.55182105", "0.549793", "0.5482761", "0.547382", "0.54546237", "0.54353034", "0.54342014", "0.5433531", "0.54330397", "0.5429927", "0.54290307", "0.5427258", "0.54267794", "0.54219025", "0.54102606", "0.5401072", "0.5399762", "0.5390133", "0.53633356", "0.5355808", "0.53539723", "0.53476167", "0.53430223", "0.53375465", "0.53287077", "0.5325116", "0.53248674", "0.53170794", "0.53088117", "0.5305019", "0.53042084", "0.5297497", "0.5295702", "0.52943915", "0.5290797", "0.52859366", "0.52803123", "0.5278381", "0.5278381", "0.52780944", "0.5275231", "0.5268871", "0.5266776", "0.5266371", "0.5266028", "0.5259262", "0.52591646", "0.5257859", "0.5257802", "0.524497", "0.5242718", "0.52412987" ]
0.6295484
7
Removes the company ag with the primary key from the database. Also notifies the appropriate model listeners.
@Override public CompanyAg remove(Serializable primaryKey) throws NoSuchCompanyAgException, SystemException { Session session = null; try { session = openSession(); CompanyAg companyAg = (CompanyAg)session.get(CompanyAgImpl.class, primaryKey); if (companyAg == null) { if (_log.isWarnEnabled()) { _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchCompanyAgException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return remove(companyAg); } catch (NoSuchCompanyAgException nsee) { throw nsee; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeByCompanyId(long companyId);", "@Override\n\tpublic ContactCompanyAg remove(Serializable primaryKey)\n\t\tthrows NoSuchContactCompanyAgException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tContactCompanyAg contactCompanyAg = (ContactCompanyAg)session.get(ContactCompanyAgImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (contactCompanyAg == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchContactCompanyAgException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(contactCompanyAg);\n\t\t}\n\t\tcatch (NoSuchContactCompanyAgException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "@Override\r\n\tpublic void removeCompany(Company company) throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\r\n\t\tString sql = \"delete from Company where ID = ?\";\r\n\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {\r\n\r\n\t\t\tconnection.setAutoCommit(false);\r\n\t\t\tpreparedStatement.setLong(1, company.getCompanyId());\r\n\t\t\tpreparedStatement.executeUpdate();\r\n\t\t\tconnection.commit();\r\n\t\t\tSystem.out.println(\"remove succeeded. Company removed id: \" + company.getCompanyId()); \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\r\n\t\t} catch (SQLException e) {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.rollback();\r\n\t\t\t} catch (SQLException e2) {\r\n\t\t\t\tthrow new Exception(\"DB error - failed to remove Company. companyId: \" + company.getCompanyId());\r\n\t\t\t}\r\n\t\t\tthrow new Exception(\"failed to remove Company. companyId: \" + company.getCompanyId());\r\n\t\t} finally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t} \r\n\r\n\t}", "@Override\r\n\tpublic void deleteCompany(int compId) throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tString sql = \"delete from companies where companyId=\" + compId;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"Company with ID: \" + compId + \" was deleted\");\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"deleteCompany Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void delete(Company company) {\r\n\t\tsessionFactory.getCurrentSession().delete(company);\r\n\t}", "public void removeCouponByCompany(Company company) throws DbException;", "public CompanyAg remove(String companyAgId)\n\t\tthrows NoSuchCompanyAgException, SystemException {\n\t\treturn remove((Serializable)companyAgId);\n\t}", "@Override\n\tpublic void remove(cp_company cp) {\n\t\t\n\t}", "public void deleteCompany(Company obj);", "public void removeByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;", "public void removeCompany(int id, String name) {\n }", "public void removeCustomerCoupon(Company company) throws DbException;", "public void removeByc_g(long groupId, long companyId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "int deleteByPrimaryKey(String industryId);", "public ContactCompanyAg remove(String contactCompanyAgId)\n\t\tthrows NoSuchContactCompanyAgException, SystemException {\n\t\treturn remove((Serializable)contactCompanyAgId);\n\t}", "@Transactional\n public void deleteBy(final Long companyId) {\n final Company company = companyRepository.findOne(companyId);\n if (company != null) {\n companyRepository.delete(company);\n }\n }", "public void deleteCompany(Long companyId) throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"DELETE FROM companies WHERE company_id = ?\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Replacing the question marks in the statement above with the relevant data\n preparedStatement.setLong(1, companyId);\n\n //Executing the update\n int result = preparedStatement.executeUpdate();\n\n if (result == 0) {\n throw new ApplicationException(ErrorType.FAILED_DELETE_COMPANY, \"Failed to delete company\");\n }\n System.out.println(result + \" Company has been successfully deleted from DB\");\n\n } catch (Exception e) {\n throw new Exception(\"Failed to delete company \" + companyId, e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "void deleteComputerByCompany(Company company);", "public void removeByCompanyAgId(String companyAgId)\n\t\tthrows SystemException {\n\t\tfor (ContactCompanyAg contactCompanyAg : findByCompanyAgId(companyAgId)) {\n\t\t\tremove(contactCompanyAg);\n\t\t}\n\t}", "public void removeByUuid_C(String uuid, long companyId);", "public void removeByUuid_C(String uuid, long companyId);", "public void removeByUuid_C(String uuid, long companyId);", "@Override\r\n\tpublic ResponseEntity<String> deleteCompany(int companyCode) {\n\t\tcompanyRepository.deleteById(companyCode);\r\n\t\treturn new ResponseEntity<>(\"Company has been Deleted\", HttpStatus.OK);\r\n\t}", "void unsetAuditingCompany();", "public void removeByC_S(long companyId, int status);", "void unsetCompanyBaseData();", "public void removeCarritoDeCompras (Long compradorId) {\r\n\r\n CompradorEntity compradorEntity = compradorPersistence.find(compradorId); \r\n CarritoDeComprasEntity carroEntity = carroPersistence.find(compradorEntity.getCarritoDeCompras().getId());\r\n carroPersistence.delete(compradorEntity.getListaDeDeseos().getId());\r\n compradorEntity.setListaDeDeseos(null);\r\n carroEntity.setComprador(null);\r\n \r\n}", "public int DelCompany(Long cid, String compname, Long shareamt, Long getnoShare) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from company where comp_id=\"+cid+\"\");\r\n\treturn i;\r\n}", "@Override\n\tpublic void delete(Long primaryKey) {\n\t\t\n\t}", "public void removeByUuid_C(java.lang.String uuid, long companyId);", "@Override\n public void deleteById(Long idCompte) {\n Session session = entityManager.unwrap(Session.class);\n Compte compte = session.get(Compte.class, idCompte);\n session.remove(compte);\n }", "@Override\n\t/**\n\t * Removes all Coupons from the Coupon table in the database related to\n\t * Company ID received\n\t */\n\tpublic void deleteCouponsByCompanyID(int compID) throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\n\t\ttry {\n\t\t\t// Defining SQL string to remove Coupons related to specified\n\t\t\t// Company ID from the Coupon table via prepared statement\n\t\t\tString deleteCouponsByCompanyIDSQL = \"delete from coupon where id in (select couponid from compcoupon where companyid = ?)\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(deleteCouponsByCompanyIDSQL);\n\t\t\t// Set Company ID from variable that method received\n\t\t\tpstmt.setInt(1, compID);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute check\n\t\t\tint resRemByComp3 = pstmt.executeUpdate();\n\t\t\tif (resRemByComp3 != 0) {\n\t\t\t\t// If result row count is not equal to zero - execution has been\n\t\t\t\t// successful\n\t\t\t\tSystem.out.println(\"Coupons of specified Company have been deleted from Coupon table successfully\");\n\t\t\t} else {\n\t\t\t\t// Otherwise execution failed due to Coupons related to\n\t\t\t\t// specified Company not found in the database\n\t\t\t\tSystem.out.println(\"Coupons removal has been failed - subject entries not found in the database\");\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon removal from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupons removal has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\t}", "@Override\n\t@Transactional(rollbackFor=RuntimeException.class)\n\tpublic void deleteOne(Long id){\n\t\tnew ComputerDao().deleteByCompany(id);\n\t\tdao.delete(id);\n\t}", "int deleteByPrimaryKey(String depCode);", "public void unlinkAllCompanyCoupon(long companyId) throws SQLException;", "public void deleteCompanyById(long companyId) throws Exception {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\n\t\ttry {\n\t\t\tconnection = JdbcUtils.getConnection();\n\t\t\t\n\t\t\t// Creating the SQL query\n\t\t\tString sqlStatement = \"DELETE FROM `javaproject`.`companies` WHERE `Company_ID` = ?;\";\n\t\t\t\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\n\t\t\t\n\t\t\t// Replacing the question marks in the statement above with the relevant data\n\t\t\tpreparedStatement.setLong(1, companyId);\n\t\t\t\n\t\t\t// Executing the update\n\t\t\tpreparedStatement.executeUpdate();\n\t\t\n\t} catch (SQLException e) {\n\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t// notifies a level above.\n\t\te.printStackTrace();\n\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to Delete a company\");\n\n\t\t// Closing the resources\n\t\t} finally {\n\t\t\tJdbcUtils.closeResources(connection, preparedStatement);\n\t\t}\n\t}", "@Override\n\tpublic void deleteByOid(int oaId) {\n\t\tdesignMapper.deleteByOid(oaId);\n\t}", "void unsetHasAuditingCompany();", "public void removeCustomerCompany(Long id) \n\t{\n\t\tQuery queryUsers = this.entityManager.createNamedQuery(\"CompanyUser.removeByCompanyId\");\n\t\tqueryUsers.setParameter(\"prCompanyId\", id);\n\t\tqueryUsers.executeUpdate();\n\t\tQuery queryCompany = this.entityManager.createNamedQuery(\"CustomerCompany.removeById\");\n\t\tqueryCompany.setParameter(\"prId\", id);\n\t\tqueryCompany.executeUpdate();\n\t}", "public int deleteCompGroup(CompGroupVO objCompGroupVO) throws EMDException,\n\tException;", "public void removeCompanyCoupon(Coupon coupon) throws DbException;", "void eliminar(PK id);", "public void delete() \n\t\t\t\tthrows model.ConsistencyException, PersistenceException{\n //TODO Check delegation to abstract class and overwrite if necessary!\n this.getMyCONCMModelItem().delete();\n }", "@Override\n public void removeFromDb() {\n }", "void deleteByOrgId(String csaOrgId);", "public Builder clearCompany() {\n \n company_ = getDefaultInstance().getCompany();\n onChanged();\n return this;\n }", "public int deleteByPrimaryKey(Integer rowid) {\r\n ZyCorporation key = new ZyCorporation();\r\n key.setRowid(rowid);\r\n int rows = getSqlMapClientTemplate().delete(\"zy_corporation.deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "public String delete() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result = model.delete(vendorMaster);\r\n\t\tif (result) {\r\n\t\t\taddActionMessage(\"Record Deleted Successfully.\");\r\n\t\t\treset();\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\taddActionMessage(\"This record is referenced in other resources.So can't delete.\");\r\n\t\t\treset();\r\n\t\t}// end of else\r\n\t\tmodel.Data(vendorMaster, request);\r\n\t\tmodel.terminate();\r\n\t\tgetNavigationPanel(1); \r\n\t\treturn \"success\";\r\n\t}", "@Test\n\tpublic void testDeleteCompanyApi() {\n\t\tCompany company = new Company(\"DataSolutionsPvtLtd\",\n\t\t\t\t\"Marthahalli road\", \"Bangalore\", \"India\", \"9880440671\");\n\t\tcompanyRepository.save(company);\n\n\t\tInteger companyId = company.getCompanyId();\n\n\t\t// Now Invoke the API to delete the Company\n\t\trestTemplate.delete(\"http://localhost:8888/companies/delete/\"\n\t\t\t\t+ companyId);\n\n\t\t// Try to fetch from the DB directly\n\t\tCompany companyFromDb = companyRepository.findOne(companyId);\n\t\t// and assert that there is no data found\n\t\tassertNull(companyFromDb);\n\t}", "public Boolean deleteManagedCompany(int id) {\n \n Boolean result = false;\n \n try { \n Connection conn = this.databaseUtils.getConnection();\n dao.setConnection(conn);\n result = dao.delete(id);\n } catch (SQLException e) {\n Logger.getLogger(AppService.class.getName()).log(Level.SEVERE, null, e);\n }\n \n return result;\n }", "@Override\n\tpublic int deleteByPrimaryKey(String modelid) {\n\t\treturn equipmentSetvalMapper.deleteByPrimaryKey(modelid);\n\t}", "public String deleteAccount(int companyId) {\n\t\tfactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);\n\t\tEntityManager em = factory.createEntityManager();\t\n\t\t\n\t\t//select business account matching the company id submitted in the argument\n\t\t\tem.getTransaction().begin();\n\t\t\tQuery myQuery = em.createQuery(\"SELECT b FROM BusinessAccount b WHERE b.id=:id\");\n\t\t\tmyQuery.setParameter(\"id\", companyId);\n\t\t\tList<BusinessAccount> accountList=myQuery.getResultList();\n\t\t\t\n\t\t\tem.remove(accountList.get(0));\t//remove this account using JPA\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\n\t\t\t\n\t\t\treturn \"delete\";\n\t\t}", "@Override\n\tpublic void deleteById(Integer id) throws Exception {\n\t\tcomproRepository.deleteById(id);\n\t}", "public void deletar() {\n\t\tClienteDAO Clientedao = new ClienteDAO();\t\r\n\t\tClientedao.delete(this);\r\n\t\t\r\n\t\tnovoRegistro();\r\n\t\tnotifyObservers();\r\n\t}", "public void delete() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.delete(this);\r\n\t}", "@Override\n\tpublic EmployeeComplaint remove(Serializable primaryKey)\n\t\tthrows NoSuchEmployeeComplaintException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tEmployeeComplaint employeeComplaint = (EmployeeComplaint)session.get(EmployeeComplaintImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (employeeComplaint == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchEmployeeComplaintException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(employeeComplaint);\n\t\t}\n\t\tcatch (NoSuchEmployeeComplaintException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "public void removeAll() throws SystemException {\n\t\tfor (CompanyAg companyAg : findAll()) {\n\t\t\tremove(companyAg);\n\t\t}\n\t}", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "@Override\n\tpublic int deleteByPrimaryKey(String id) {\n\t\treturn siteReservoirInfoMapper.deleteByPrimaryKey(id);\n\t}", "public static void removeByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException {\n getPersistence().removeByc(companyId);\n }", "@Override\r\n\tpublic Company updateCompany(Company company) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic PhatVay remove(Serializable primaryKey)\n\t\tthrows NoSuchPhatVayException {\n\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tPhatVay phatVay = (PhatVay)session.get(\n\t\t\t\tPhatVayImpl.class, primaryKey);\n\n\t\t\tif (phatVay == null) {\n\t\t\t\tif (_log.isDebugEnabled()) {\n\t\t\t\t\t_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchPhatVayException(\n\t\t\t\t\t_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t}\n\n\t\t\treturn remove(phatVay);\n\t\t}\n\t\tcatch (NoSuchPhatVayException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "int deleteByPrimaryKey(String EQP_MODEL_ID);", "public void delete(Long compradorId) {\r\n CompradorEntity compradorEntity = em.find(CompradorEntity.class, compradorId);\r\n em.remove(compradorEntity);\r\n }", "@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}", "@Override\n public void delete() {\n this.parent.handleRemoveSignal(this.deadline.getCourseName(),\n this.deadline.getName(),\n this.deadline.getYear(),\n this.deadline.getMonth(),\n this.deadline.getDay());\n }", "int deleteByPrimaryKey(String vendorid);", "@Override\n\tpublic int deleteFromLicenseBusinessLicenseByPrimaryKey(Integer id) {\n\t\treturn licenseBusinessLicenseMapper.deleteByPrimaryKey(id);\n\t}", "public void eliminar(Provincia provincia) throws BusinessErrorHelper;", "public void removeAll() throws SystemException {\n\t\tfor (ContactCompanyAg contactCompanyAg : findAll()) {\n\t\t\tremove(contactCompanyAg);\n\t\t}\n\t}", "@Override\n\tpublic void remove(Savable savable) {\n\t\tif (savable instanceof Contact) {\n\t\t\tContact contact = (Contact)savable;\n\t\t\tthis.contacts.remove(contact.getId());\n\t\t}\n\t}", "int deleteByPrimaryKey(Integer actPrizeId);", "int deleteByPrimaryKey(Long navigationId);", "public void purgeYearByChart(String chartOfAccountsCode, int year) {\n LOG.debug(\"purgeYearByChart() started\");\n\n Criteria criteria = new Criteria();\n criteria.addEqualTo(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);\n criteria.addLessThan(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, new Integer(year));\n\n getPersistenceBrokerTemplate().deleteByQuery(new QueryByCriteria(SufficientFundBalances.class, criteria));\n\n // This is required because if any deleted account balances are in the cache, deleteByQuery doesn't\n // remove them from the cache so a future select will retrieve these deleted account balances from\n // the cache and return them. Clearing the cache forces OJB to go to the database again.\n getPersistenceBrokerTemplate().clearCache();\n }", "public void elimina(Long id) {\n\n final EntityManager em = getEntityManager();\n\n try {\n\n final EntityTransaction tx = em.getTransaction();\n\n tx.begin();\n\n // Busca un conocido usando su llave primaria.\n\n final Conocido modelo = em.find(Conocido.class, id);\n\n if (modelo != null) {\n\n /* Si la referencia no es nula, significa que el modelo se encontró la\n\n * referencia no es nula y se elimina. */\n\n em.remove(modelo);\n\n }\n\n tx.commit();\n\n } finally {\n\n em.close();\n\n }\n\n }", "int deleteByPrimaryKey(Integer deliverid);", "private final void m118787c(bkcr bkcr) {\n if (getAdapter() instanceof bkcq) {\n ((bkcq) getAdapter()).remove(bkcr);\n }\n }", "public void removeBycompanyIdAndGroupId(long companyId, long groupId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "void remove(PK id);", "@Override\n\tpublic void deleteAgence(Agence a) {\n\t\t\n\t}", "int deleteByPrimaryKey(String idTipoComprobante) throws SQLException;", "@Transactional\n\t\tpublic void delete(ComplaintVO complaintVO) \n\t\t{\n\t\t\tcomplaintDAO.delete(complaintVO);\n\t\t}", "int deleteByPrimaryKey(Long catalogId);", "public void clearLineaGastos(long pk)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Override\n\tpublic CreditAppBankReference remove(Serializable primaryKey)\n\t\tthrows NoSuchCreditAppBankReferenceException, SystemException {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = openSession();\n\n\t\t\tCreditAppBankReference creditAppBankReference = (CreditAppBankReference)session.get(CreditAppBankReferenceImpl.class,\n\t\t\t\t\tprimaryKey);\n\n\t\t\tif (creditAppBankReference == null) {\n\t\t\t\tif (_log.isWarnEnabled()) {\n\t\t\t\t\t_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);\n\t\t\t\t}\n\n\t\t\t\tthrow new NoSuchCreditAppBankReferenceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +\n\t\t\t\t\tprimaryKey);\n\t\t\t}\n\n\t\t\treturn remove(creditAppBankReference);\n\t\t}\n\t\tcatch (NoSuchCreditAppBankReferenceException nsee) {\n\t\t\tthrow nsee;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow processException(e);\n\t\t}\n\t\tfinally {\n\t\t\tcloseSession(session);\n\t\t}\n\t}", "@Override\n\tpublic ResultMessage delOrganization(OrganizationVO vo) throws RemoteException {\n\t\treturn ResultMessage.success;\n\t}", "int deleteByPrimaryKey(Integer cId);", "int deleteByPrimaryKey(Integer cId);", "public void deleteEducation() {\n workerPropertiesController.deleteEducation(myEducationCollection.getRowData()); \n // usuniecie z bazy\n getUser().getEducationCollection().remove(myEducationCollection.getRowData()); \n // usuniecie z obiektu usera ktory mamy zapamietany w sesji\n }", "@Override\r\n\tpublic void eliminar() {\n\t\ttab_cuenta.eliminar();\r\n\t}", "@Override\n\tpublic void delete(String cid) {\n\t\tCommodity commodity=this.getHibernateTemplate().get(Commodity.class, cid);\n\t\t System.out.println(\"查询完毕\");\n\t\t System.out.println(commodity.getCname());\n\t this.getHibernateTemplate().delete(commodity);\n\t}", "public int delComp(Long cid, String compname, String address, String city,\r\n\t\tString state, Long offno, Long faxno, String website, String eMail,\r\n\t\tLong shareamt, Long getnoShare)throws SQLException {\n\tLong id=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select login_id from company where comp_id=\"+cid+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tid=rs.getLong(1);\r\n\t}\r\n\tint i=DbConnect.getStatement().executeUpdate(\"Delete from login where login_id=\"+id+\"\");\r\n\treturn i;\r\n}", "public void eliminar(Long id) throws AppException;", "public void onRemoveAgendaItem() {\n AgendaItem agendaItem = outputAgendaItemsPreparation.getSelectionModel().getSelectedItem();\n\n if (agendaItem == null) {\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_NULL, null);\n return;\n }\n\n if (controller.removeAgendaItem(agendaItem)) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_REMOVE, null);\n }", "@Override\n public int deleteByPrimaryKey(BorrowDO record){\n return borrowExtMapper.deleteByPrimaryKey(record);\n }", "int deleteByPrimaryKey(String taxregcode);", "int deleteByPrimaryKey(String contractNo);", "private void deleteEmployeeBooking() {\n BookingModel bookingModel1 = new BookingModel();\n try {\n bookingModel1.deleteBooking(employeeID);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\tpublic void removeByCreditAppId(long creditAppId) throws SystemException {\n\t\tfor (CreditAppBankReference creditAppBankReference : findByCreditAppId(\n\t\t\t\tcreditAppId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {\n\t\t\tremove(creditAppBankReference);\n\t\t}\n\t}", "int deleteByPrimaryKey(String goodsId);" ]
[ "0.71218354", "0.6860835", "0.67205065", "0.6523585", "0.63403577", "0.63256544", "0.6293396", "0.6279604", "0.6259504", "0.62524235", "0.61614", "0.61527526", "0.61223334", "0.6005876", "0.59986883", "0.5968873", "0.59582436", "0.5924643", "0.59078014", "0.5895024", "0.5895024", "0.5895024", "0.5892975", "0.588918", "0.5846139", "0.581502", "0.58050144", "0.57936597", "0.57791185", "0.5767474", "0.5762178", "0.57581973", "0.5730147", "0.5675058", "0.5611829", "0.5594054", "0.5593403", "0.55858374", "0.5583387", "0.5579865", "0.55674833", "0.5564807", "0.55637896", "0.5561644", "0.5552025", "0.5537578", "0.5535164", "0.5531297", "0.55178154", "0.5496989", "0.54811525", "0.54722613", "0.5452343", "0.5433821", "0.54320997", "0.5430865", "0.543007", "0.5430002", "0.5427439", "0.5425186", "0.54250026", "0.54228", "0.5406889", "0.5396347", "0.539609", "0.5390315", "0.5360143", "0.5352318", "0.53509146", "0.53474516", "0.5340362", "0.5333822", "0.53248864", "0.5324084", "0.53206366", "0.53145146", "0.53072774", "0.53010803", "0.5299435", "0.52946126", "0.52934974", "0.52933115", "0.5287287", "0.5284973", "0.5276783", "0.5275845", "0.5274818", "0.5274818", "0.527344", "0.52656406", "0.52655935", "0.52645797", "0.5260786", "0.5257263", "0.5254571", "0.52544576", "0.52543193", "0.5244108", "0.52391785", "0.523731" ]
0.6965276
1
Returns the company ag with the primary key or returns null if it could not be found.
@Override public CompanyAg fetchByPrimaryKey(Serializable primaryKey) throws SystemException { return fetchByPrimaryKey((String)primaryKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic ContactCompanyAg fetchByPrimaryKey(Serializable primaryKey)\n\t\tthrows SystemException {\n\t\treturn fetchByPrimaryKey((String)primaryKey);\n\t}", "public CompanyAg fetchByPrimaryKey(String companyAgId)\n\t\tthrows SystemException {\n\t\tCompanyAg companyAg = (CompanyAg)EntityCacheUtil.getResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tCompanyAgImpl.class, companyAgId);\n\n\t\tif (companyAg == _nullCompanyAg) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (companyAg == null) {\n\t\t\tSession session = null;\n\n\t\t\tboolean hasException = false;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcompanyAg = (CompanyAg)session.get(CompanyAgImpl.class,\n\t\t\t\t\t\tcompanyAgId);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\thasException = true;\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (companyAg != null) {\n\t\t\t\t\tcacheResult(companyAg);\n\t\t\t\t}\n\t\t\t\telse if (!hasException) {\n\t\t\t\t\tEntityCacheUtil.putResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCompanyAgImpl.class, companyAgId, _nullCompanyAg);\n\t\t\t\t}\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn companyAg;\n\t}", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "Optional<Company> getCompany(long id);", "Company getCompany(int id);", "public com.hps.july.persistence.Company getCompany() throws Exception {\n\tif (getDivision() == null) {\n\t\tCompanyAccessBean bean = constructCompanies();\n\t\tif (bean != null)\n\t\t return (Company)bean.getEJBRef();\n\t\telse\n\t\t return null;\n\t}\n\telse\n\t\treturn null;\n\t\t\n}", "public ContactCompanyAg fetchByPrimaryKey(String contactCompanyAgId)\n\t\tthrows SystemException {\n\t\tContactCompanyAg contactCompanyAg = (ContactCompanyAg)EntityCacheUtil.getResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId);\n\n\t\tif (contactCompanyAg == _nullContactCompanyAg) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (contactCompanyAg == null) {\n\t\t\tSession session = null;\n\n\t\t\tboolean hasException = false;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcontactCompanyAg = (ContactCompanyAg)session.get(ContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAgId);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\thasException = true;\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (contactCompanyAg != null) {\n\t\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t\t}\n\t\t\t\telse if (!hasException) {\n\t\t\t\t\tEntityCacheUtil.putResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId,\n\t\t\t\t\t\t_nullContactCompanyAg);\n\t\t\t\t}\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn contactCompanyAg;\n\t}", "public Company findCompany(long id);", "Optional<Company> findById(long company_id);", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public String getCompany() {\n return (String) get(\"company\");\n }", "public EmsCompany getCompany(String uid)\n\t{\n\t\tEmsCompany company = new EmsCompany().findFirst(\"select * from ems_company where UID = '\"+uid+\"'\");\n\t\tif (company != null)\n\t\t{\n\t\t\treturn company;\n\t\t}\n\t\treturn null;\n\t}", "Optional<Company> findOneById(String id);", "CompanyExtend selectByPrimaryKey(Long id);", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _dictData.getCompanyId();\n\t}", "public CompanyTO getCompany() {\n\t\t\r\n\t\treturn CompanyService.getInstance().getCompany();\r\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "public Long getCompanyId() {\n return companyId;\n }", "public Integer getCompanyId() {\n return companyId;\n }", "public Integer getCompanyId() {\n return companyId;\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _paper.getCompanyId();\n\t}", "public Company getCompany() {\n\t\treturn company;\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _changesetEntry.getCompanyId();\n\t}", "public Integer getCompanyId() {\n return this.companyId;\n }", "public Company getCompany(String companyShortName);", "public long getCompanyId() {\n return companyId;\n }", "public String getCompanyId() {\n return companyId;\n }", "public String getCompanyId() {\r\n return companyId;\r\n }", "public String getCompanyId() {\r\n return companyId;\r\n }", "static Company getCompany(SQLiteDatabase db, String companyId) {\n Cursor cursor = db.query(COMPANY_TABLE, null, COMPANY_ID + \" = ?\", new String[] { companyId }, null, null, null);\n List<Company> list = new LinkedList<Company>();\n if (cursor.moveToFirst()) {\n int idIndex = cursor.getColumnIndex(COMPANY_ID);\n int nameIndex = cursor.getColumnIndex(COMPANY_NAME);\n int logoIndex = cursor.getColumnIndex(COMPANY_LOGO);\n int descriptionIndex = cursor.getColumnIndex(COMPANY_DESCRIPTION);\n int lastUpdatedIndex = cursor.getColumnIndex(COMPANY_LAST_UPDATED);\n int wasDeletedIndex = cursor.getColumnIndex(COMPANY_WAS_DELETED);\n\n do {\n if(cursor.getString(idIndex).equals(companyId)) {\n Company company = new Company();\n company.companyId = cursor.getString(idIndex);\n company.name = cursor.getString(nameIndex);\n company.companyLogo = cursor.getString(logoIndex);\n company.companyDescription = cursor.getString(descriptionIndex);\n company.lastUpdatedDate = cursor.getDouble(lastUpdatedIndex);\n company.wasDeleted = (cursor.getInt(wasDeletedIndex) == 1);\n company.models = CarSQL.getCompanyCars(db,company.companyId);\n return company;\n }\n else\n Log.d(\"TAG\",\"can not give correct company companyID \" + companyId + \" from sql\");\n } while (cursor.moveToNext());\n }\n return null;\n }", "public int getCompanyId() {\n return companyId;\n }", "public String getCompanyId()\n {\n return companyId;\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _expandoColumn.getCompanyId();\n\t}", "public abstract Company get(int id);", "public Company getCompany(String companyId) throws ParseException {\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n query.fromLocalDatastore();\n return query.get(companyId);\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _employee.getCompanyId();\n\t}", "public ContactCompanyAg fetchByCompanyAgId_First(String companyAgId,\n\t\tOrderByComparator orderByComparator) throws SystemException {\n\t\tList<ContactCompanyAg> list = findByCompanyAgId(companyAgId, 0, 1,\n\t\t\t\torderByComparator);\n\n\t\tif (!list.isEmpty()) {\n\t\t\treturn list.get(0);\n\t\t}\n\n\t\treturn null;\n\t}", "public ManagedCompany getManagedCompany(int id) {\n \n ManagedCompany result = null;\n \n try {\n Connection conn = this.databaseUtils.getConnection();\n dao.setConnection(conn);\n result = dao.getItemById(id);\n } catch (SQLException e) {\n Logger.getLogger(AppService.class.getName()).log(Level.SEVERE, null, e);\n }\n \n return result;\n }", "public java.lang.Integer getCompany() {\n\treturn company;\n}", "@Override\n\tpublic Company getOne(Long id) {\n\t\treturn dao.getById(id);\n\t}", "@Override\n public long getCompanyId() {\n return _partido.getCompanyId();\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _scienceApp.getCompanyId();\n\t}", "public Company getCompany() {\r\n return this.company;\r\n }", "public String getCompany()\n\t{\n\t\treturn getCompany( getSession().getSessionContext() );\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _second.getCompanyId();\n\t}", "public Long getCompanyId() {\r\n\t\treturn companyId;\r\n\t}", "public String getCompany() {\n return company;\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData getAuditingCompany();", "public String getCompany() {\r\n\t\treturn company;\r\n\t}", "public String getCompanyId() {\r\n\t\treturn companyId;\r\n\t}", "@Override\r\n\tpublic Company getOneCompanyById(int compId) throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tString sql = \"select * from companies where companyId=\" + compId;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(sql);\r\n\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tCompany comp = new Company();\r\n\t\t\t\tcomp.setCompId(compId);\r\n\t\t\t\tcomp.setCompName(rs.getString(\"companyName\"));\r\n\t\t\t\tcomp.setCompEmail(rs.getString(\"companyEmail\"));\r\n\t\t\t\tcomp.setCompPass(rs.getString(\"companyPass\"));\r\n\r\n\t\t\t\treturn comp;\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Couldn't find any company by this ID: \" + compId);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"getOneCompanyById Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompany()\r\n {\r\n return (m_company);\r\n }", "public Company getCompany() {\n return company;\n }", "String getCompany();", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _esfTournament.getCompanyId();\n\t}", "public static final String getCompany() { return company; }", "public Cursor getAgency(long rowId) throws SQLException {\n\t\t\tCursor mCursor = \n\t\t\t\tdb.query(true, AGENCIES_TABLE, new String[] {\n\t\t\t\t\tKEY_ROWID,\n\t\t\t\t\tKEY_AGENCYID,\n\t\t\t\t\tKEY_AGENCYNAME,\n\t\t\t\t\tKEY_AGENCYURL,\n\t\t\t\t\tKEY_AGENCYTIMEZONE,\n\t\t\t\t\tKEY_AGENCYLANG,\n\t\t\t\t\tKEY_AGENCYPHONE}, \n\t\t\t\t\tKEY_ROWID + \"=\" + rowId,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull);\n\t\t\tif (mCursor != null) {\n\t\t\t\tmCursor.moveToFirst();\n\t\t\t}\n\t\t\treturn mCursor;\n\t\t}", "public String getPrimaryCompanyName() {\r\n return primaryCompanyName;\r\n }", "public Company findCompany(IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "public String getCompany()\n {\n return (String) getProperty(PropertyIDMap.PID_COMPANY);\n }", "@Override\r\n\tpublic Company getCompany(long companyId) throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\t\tCompany company = new Company();\r\n\t\tString sql = \"SELECT * FROM Company WHERE ID=\" + companyId;\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {\r\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\r\n\t\t\tresultSet.next();\r\n\t\t\tcompany.setCompanyId(resultSet.getLong(1));\r\n\t\t\tcompany.setCompanyName(resultSet.getString(2));\r\n\t\t\tcompany.setCompanyPassword(resultSet.getString(3));\r\n\t\t\tcompany.setCompanyEmail(resultSet.getString(4));\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new Exception(\"DB error - unable to get Company data. companyId: \" + companyId);\r\n\t\t}catch (Exception e) {\r\n\t\t\tthrow new Exception(\"unable to get Company data. companyId: \" + companyId);\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t}\r\n\t\treturn company;\r\n\t}", "public Company getCompanyById(long companyId) throws Exception {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tconnection = JdbcUtils.getConnection();\n\n\t\t\t// Creating the SQL query\n\t\t\tString sqlStatement = \"SELECT * FROM companies WHERE COMPANY_ID = ?\";\n\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\n\n\t\t\t// Replacing the question marks in the statement above with the relevant data\n\t\t\tpreparedStatement.setLong(1, companyId);\n\n\t\t\t// Executing the query\n\t\t\tresultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\tif (resultSet.next()) {\n\t\t\t\tString name = resultSet.getString(\"Company_NAME\");\n\t\t\t\treturn new Company(companyId,name);\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t\t\t\n\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t\t\t// notifies a level above.\n\t\t\t\te.printStackTrace();\n\t\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to return a company\");\n\n\t\t\t// Closing the resources\n\t\t} finally {\n\t\t\tJdbcUtils.closeResources(connection, preparedStatement,resultSet);\n\t\t}\n\t}", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "Optional<Company> findByName(String name);", "protected Company getCompany(HttpServletRequest req) {\n\t\t\n\t\tEmployee user = getUser(req);\n\n return (user == null?null:user.getContact().getCompany());\n\t}", "@Nonnull\n public List<CustomerCompany> getCustomerCompanyOrFetch()\n throws ODataException\n {\n if (toCustomerCompany == null) {\n toCustomerCompany = fetchCustomerCompany();\n }\n return toCustomerCompany;\n }", "public String getCompanyCode() {\n return companyCode;\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "public String getCompany(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, COMPANY);\n\t}", "public CompanyEntity getCompany(long companyId) throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"SELECT * FROM companies WHERE id = ?\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Replacing the question marks in the statement above with the relevant data\n preparedStatement.setLong(1, companyId);\n\n //Executing the update\n ResultSet resultSet = preparedStatement.executeQuery();\n\n if (!resultSet.next()) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"Cannot retrieve information\");\n }\n// creating an array of companies\n CompanyEntity companyEntity = new CompanyEntity();\n companyEntity.setCompanyId(resultSet.getLong(\"id\"));\n companyEntity.setCompanyName(resultSet.getString(\"company_name\"));\n companyEntity.setCompanyEmail(resultSet.getString(\"company_email\"));\n companyEntity.setCompanyPhone(resultSet.getString(\"company_phone\"));\n companyEntity.setCompanyAddress(resultSet.getString(\"company_address\"));\n\n return companyEntity;\n\n } catch (Exception e) {\n //\t\t\te.printStackTrace();\n throw new Exception(\"Failed to retrieve data\", e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "SysOrganization selectByPrimaryKey(Long id);", "public java.lang.String getPrimaryKey() {\n\t\treturn _imageCompanyAg.getPrimaryKey();\n\t}", "Company getOrCreateCompanyId(String companyID) throws Exception;", "@Transactional(readOnly = true)\n public Company findOne(final Long companyId) {\n return companyRepository.findOne(companyId);\n }", "@Override\r\n\tpublic Company getDetailByCompanyName(String companyName) {\n\t\treturn companyRepository.findByCompanyName(companyName);\r\n\t}", "public void getFindByIdCompany() {\n log.info(\"CompaniesContactsBean => method : getFindByIdCompany()\");\n\n log.info(\"ID company\" + companiesBean.getCompaniesEntity().getId());\n this.companiesContactsEntityList = findByIdCompany(companiesBean.getCompaniesEntity());\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _userTracker.getCompanyId();\n\t}", "public java.lang.Integer getCompanycode() {\n\treturn companycode;\n}", "Organization selectByPrimaryKey(Integer id);", "OrganizationMaster getOrganization(Long uniqueId);", "@Override\n Optional<Complaint> findById(Integer id);", "@Override\n\tpublic List<CompanyVO> getCompanyInfo(String c_name) {\n\t\treturn null;\n\t}", "public Company getCompanyAt(int index) {\r\n\t\treturn companyDirectory.get(index); \r\n\t\t\t\r\n\t}", "public ZyCorporation selectByPrimaryKey(Integer rowid) {\r\n ZyCorporation key = new ZyCorporation();\r\n key.setRowid(rowid);\r\n ZyCorporation record = (ZyCorporation) getSqlMapClientTemplate().queryForObject(\"zy_corporation.selectByPrimaryKey\", key);\r\n return record;\r\n }" ]
[ "0.7159468", "0.68146056", "0.6788337", "0.67805046", "0.6750502", "0.6660049", "0.66214687", "0.6526173", "0.6448355", "0.63811195", "0.63811195", "0.63811195", "0.63811195", "0.63642704", "0.63642704", "0.63642704", "0.63642704", "0.63642704", "0.6324554", "0.628092", "0.62641776", "0.622714", "0.6195465", "0.61907196", "0.6186135", "0.6186135", "0.6186135", "0.6182396", "0.61798596", "0.61798596", "0.6151084", "0.61499476", "0.6125386", "0.61252666", "0.61222523", "0.6119505", "0.611466", "0.6111955", "0.6111955", "0.6098525", "0.6091574", "0.6085301", "0.6084423", "0.60775805", "0.6076879", "0.60726494", "0.60551393", "0.60521334", "0.6047191", "0.6044436", "0.6042556", "0.60387844", "0.6013346", "0.6013019", "0.6009954", "0.59842926", "0.59724855", "0.5956467", "0.5941962", "0.5931651", "0.59291923", "0.59043396", "0.59043396", "0.5897502", "0.5897502", "0.5888106", "0.5879693", "0.5877535", "0.5860262", "0.5841638", "0.58089817", "0.57976645", "0.576968", "0.57691413", "0.5765687", "0.57542074", "0.5747076", "0.5747076", "0.5735673", "0.5723288", "0.57060844", "0.5705554", "0.5686858", "0.5686858", "0.56846136", "0.5680478", "0.5653082", "0.56401026", "0.56347656", "0.5626905", "0.5612137", "0.5586839", "0.55758554", "0.5551883", "0.55501294", "0.554266", "0.55418557", "0.55322427", "0.55266213", "0.5508388" ]
0.6994966
1
Returns the company ag with the primary key or returns null if it could not be found.
public CompanyAg fetchByPrimaryKey(String companyAgId) throws SystemException { CompanyAg companyAg = (CompanyAg)EntityCacheUtil.getResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED, CompanyAgImpl.class, companyAgId); if (companyAg == _nullCompanyAg) { return null; } if (companyAg == null) { Session session = null; boolean hasException = false; try { session = openSession(); companyAg = (CompanyAg)session.get(CompanyAgImpl.class, companyAgId); } catch (Exception e) { hasException = true; throw processException(e); } finally { if (companyAg != null) { cacheResult(companyAg); } else if (!hasException) { EntityCacheUtil.putResult(CompanyAgModelImpl.ENTITY_CACHE_ENABLED, CompanyAgImpl.class, companyAgId, _nullCompanyAg); } closeSession(session); } } return companyAg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic ContactCompanyAg fetchByPrimaryKey(Serializable primaryKey)\n\t\tthrows SystemException {\n\t\treturn fetchByPrimaryKey((String)primaryKey);\n\t}", "@Override\n\tpublic CompanyAg fetchByPrimaryKey(Serializable primaryKey)\n\t\tthrows SystemException {\n\t\treturn fetchByPrimaryKey((String)primaryKey);\n\t}", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "Optional<Company> getCompany(long id);", "Company getCompany(int id);", "public com.hps.july.persistence.Company getCompany() throws Exception {\n\tif (getDivision() == null) {\n\t\tCompanyAccessBean bean = constructCompanies();\n\t\tif (bean != null)\n\t\t return (Company)bean.getEJBRef();\n\t\telse\n\t\t return null;\n\t}\n\telse\n\t\treturn null;\n\t\t\n}", "public ContactCompanyAg fetchByPrimaryKey(String contactCompanyAgId)\n\t\tthrows SystemException {\n\t\tContactCompanyAg contactCompanyAg = (ContactCompanyAg)EntityCacheUtil.getResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId);\n\n\t\tif (contactCompanyAg == _nullContactCompanyAg) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (contactCompanyAg == null) {\n\t\t\tSession session = null;\n\n\t\t\tboolean hasException = false;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcontactCompanyAg = (ContactCompanyAg)session.get(ContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAgId);\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\thasException = true;\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (contactCompanyAg != null) {\n\t\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t\t}\n\t\t\t\telse if (!hasException) {\n\t\t\t\t\tEntityCacheUtil.putResult(ContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class, contactCompanyAgId,\n\t\t\t\t\t\t_nullContactCompanyAg);\n\t\t\t\t}\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn contactCompanyAg;\n\t}", "public Company findCompany(long id);", "Optional<Company> findById(long company_id);", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "@Override\n\tpublic long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public long getCompanyId();", "public String getCompany() {\n return (String) get(\"company\");\n }", "public EmsCompany getCompany(String uid)\n\t{\n\t\tEmsCompany company = new EmsCompany().findFirst(\"select * from ems_company where UID = '\"+uid+\"'\");\n\t\tif (company != null)\n\t\t{\n\t\t\treturn company;\n\t\t}\n\t\treturn null;\n\t}", "Optional<Company> findOneById(String id);", "CompanyExtend selectByPrimaryKey(Long id);", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _dictData.getCompanyId();\n\t}", "public CompanyTO getCompany() {\n\t\t\r\n\t\treturn CompanyService.getInstance().getCompany();\r\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn model.getCompanyId();\n\t}", "public Long getCompanyId() {\n return companyId;\n }", "public Integer getCompanyId() {\n return companyId;\n }", "public Integer getCompanyId() {\n return companyId;\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _paper.getCompanyId();\n\t}", "public Company getCompany() {\n\t\treturn company;\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _changesetEntry.getCompanyId();\n\t}", "public Integer getCompanyId() {\n return this.companyId;\n }", "public Company getCompany(String companyShortName);", "public long getCompanyId() {\n return companyId;\n }", "public String getCompanyId() {\n return companyId;\n }", "public String getCompanyId() {\r\n return companyId;\r\n }", "public String getCompanyId() {\r\n return companyId;\r\n }", "static Company getCompany(SQLiteDatabase db, String companyId) {\n Cursor cursor = db.query(COMPANY_TABLE, null, COMPANY_ID + \" = ?\", new String[] { companyId }, null, null, null);\n List<Company> list = new LinkedList<Company>();\n if (cursor.moveToFirst()) {\n int idIndex = cursor.getColumnIndex(COMPANY_ID);\n int nameIndex = cursor.getColumnIndex(COMPANY_NAME);\n int logoIndex = cursor.getColumnIndex(COMPANY_LOGO);\n int descriptionIndex = cursor.getColumnIndex(COMPANY_DESCRIPTION);\n int lastUpdatedIndex = cursor.getColumnIndex(COMPANY_LAST_UPDATED);\n int wasDeletedIndex = cursor.getColumnIndex(COMPANY_WAS_DELETED);\n\n do {\n if(cursor.getString(idIndex).equals(companyId)) {\n Company company = new Company();\n company.companyId = cursor.getString(idIndex);\n company.name = cursor.getString(nameIndex);\n company.companyLogo = cursor.getString(logoIndex);\n company.companyDescription = cursor.getString(descriptionIndex);\n company.lastUpdatedDate = cursor.getDouble(lastUpdatedIndex);\n company.wasDeleted = (cursor.getInt(wasDeletedIndex) == 1);\n company.models = CarSQL.getCompanyCars(db,company.companyId);\n return company;\n }\n else\n Log.d(\"TAG\",\"can not give correct company companyID \" + companyId + \" from sql\");\n } while (cursor.moveToNext());\n }\n return null;\n }", "public int getCompanyId() {\n return companyId;\n }", "public String getCompanyId()\n {\n return companyId;\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _expandoColumn.getCompanyId();\n\t}", "public abstract Company get(int id);", "public Company getCompany(String companyId) throws ParseException {\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n query.fromLocalDatastore();\n return query.get(companyId);\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _employee.getCompanyId();\n\t}", "public ContactCompanyAg fetchByCompanyAgId_First(String companyAgId,\n\t\tOrderByComparator orderByComparator) throws SystemException {\n\t\tList<ContactCompanyAg> list = findByCompanyAgId(companyAgId, 0, 1,\n\t\t\t\torderByComparator);\n\n\t\tif (!list.isEmpty()) {\n\t\t\treturn list.get(0);\n\t\t}\n\n\t\treturn null;\n\t}", "public ManagedCompany getManagedCompany(int id) {\n \n ManagedCompany result = null;\n \n try {\n Connection conn = this.databaseUtils.getConnection();\n dao.setConnection(conn);\n result = dao.getItemById(id);\n } catch (SQLException e) {\n Logger.getLogger(AppService.class.getName()).log(Level.SEVERE, null, e);\n }\n \n return result;\n }", "public java.lang.Integer getCompany() {\n\treturn company;\n}", "@Override\n\tpublic Company getOne(Long id) {\n\t\treturn dao.getById(id);\n\t}", "@Override\n public long getCompanyId() {\n return _partido.getCompanyId();\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _scienceApp.getCompanyId();\n\t}", "public Company getCompany() {\r\n return this.company;\r\n }", "public String getCompany()\n\t{\n\t\treturn getCompany( getSession().getSessionContext() );\n\t}", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _second.getCompanyId();\n\t}", "public Long getCompanyId() {\r\n\t\treturn companyId;\r\n\t}", "public String getCompany() {\n return company;\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyBaseData getAuditingCompany();", "public String getCompany() {\r\n\t\treturn company;\r\n\t}", "public String getCompanyId() {\r\n\t\treturn companyId;\r\n\t}", "@Override\r\n\tpublic Company getOneCompanyById(int compId) throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tString sql = \"select * from companies where companyId=\" + compId;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(sql);\r\n\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tCompany comp = new Company();\r\n\t\t\t\tcomp.setCompId(compId);\r\n\t\t\t\tcomp.setCompName(rs.getString(\"companyName\"));\r\n\t\t\t\tcomp.setCompEmail(rs.getString(\"companyEmail\"));\r\n\t\t\t\tcomp.setCompPass(rs.getString(\"companyPass\"));\r\n\r\n\t\t\t\treturn comp;\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Couldn't find any company by this ID: \" + compId);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"getOneCompanyById Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n return company;\n }", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompany() {\n\t\treturn company;\n\t}", "public String getCompany()\r\n {\r\n return (m_company);\r\n }", "public Company getCompany() {\n return company;\n }", "String getCompany();", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _esfTournament.getCompanyId();\n\t}", "public static final String getCompany() { return company; }", "public Cursor getAgency(long rowId) throws SQLException {\n\t\t\tCursor mCursor = \n\t\t\t\tdb.query(true, AGENCIES_TABLE, new String[] {\n\t\t\t\t\tKEY_ROWID,\n\t\t\t\t\tKEY_AGENCYID,\n\t\t\t\t\tKEY_AGENCYNAME,\n\t\t\t\t\tKEY_AGENCYURL,\n\t\t\t\t\tKEY_AGENCYTIMEZONE,\n\t\t\t\t\tKEY_AGENCYLANG,\n\t\t\t\t\tKEY_AGENCYPHONE}, \n\t\t\t\t\tKEY_ROWID + \"=\" + rowId,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull);\n\t\t\tif (mCursor != null) {\n\t\t\t\tmCursor.moveToFirst();\n\t\t\t}\n\t\t\treturn mCursor;\n\t\t}", "public String getPrimaryCompanyName() {\r\n return primaryCompanyName;\r\n }", "public Company findCompany(IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "public String getCompany()\n {\n return (String) getProperty(PropertyIDMap.PID_COMPANY);\n }", "@Override\r\n\tpublic Company getCompany(long companyId) throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\t\tCompany company = new Company();\r\n\t\tString sql = \"SELECT * FROM Company WHERE ID=\" + companyId;\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {\r\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\r\n\t\t\tresultSet.next();\r\n\t\t\tcompany.setCompanyId(resultSet.getLong(1));\r\n\t\t\tcompany.setCompanyName(resultSet.getString(2));\r\n\t\t\tcompany.setCompanyPassword(resultSet.getString(3));\r\n\t\t\tcompany.setCompanyEmail(resultSet.getString(4));\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new Exception(\"DB error - unable to get Company data. companyId: \" + companyId);\r\n\t\t}catch (Exception e) {\r\n\t\t\tthrow new Exception(\"unable to get Company data. companyId: \" + companyId);\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t}\r\n\t\treturn company;\r\n\t}", "public Company getCompanyById(long companyId) throws Exception {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tconnection = JdbcUtils.getConnection();\n\n\t\t\t// Creating the SQL query\n\t\t\tString sqlStatement = \"SELECT * FROM companies WHERE COMPANY_ID = ?\";\n\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\n\n\t\t\t// Replacing the question marks in the statement above with the relevant data\n\t\t\tpreparedStatement.setLong(1, companyId);\n\n\t\t\t// Executing the query\n\t\t\tresultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\tif (resultSet.next()) {\n\t\t\t\tString name = resultSet.getString(\"Company_NAME\");\n\t\t\t\treturn new Company(companyId,name);\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t\t\t\n\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t\t\t// notifies a level above.\n\t\t\t\te.printStackTrace();\n\t\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to return a company\");\n\n\t\t\t// Closing the resources\n\t\t} finally {\n\t\t\tJdbcUtils.closeResources(connection, preparedStatement,resultSet);\n\t\t}\n\t}", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "public String getCompanyCd() {\r\n return companyCd;\r\n }", "Optional<Company> findByName(String name);", "protected Company getCompany(HttpServletRequest req) {\n\t\t\n\t\tEmployee user = getUser(req);\n\n return (user == null?null:user.getContact().getCompany());\n\t}", "@Nonnull\n public List<CustomerCompany> getCustomerCompanyOrFetch()\n throws ODataException\n {\n if (toCustomerCompany == null) {\n toCustomerCompany = fetchCustomerCompany();\n }\n return toCustomerCompany;\n }", "public String getCompanyCode() {\n return companyCode;\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "public String getCompanyCode() {\r\n return companyCode;\r\n }", "public String getCompany(final SessionContext ctx)\n\t{\n\t\treturn (String)getProperty( ctx, COMPANY);\n\t}", "public CompanyEntity getCompany(long companyId) throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"SELECT * FROM companies WHERE id = ?\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Replacing the question marks in the statement above with the relevant data\n preparedStatement.setLong(1, companyId);\n\n //Executing the update\n ResultSet resultSet = preparedStatement.executeQuery();\n\n if (!resultSet.next()) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"Cannot retrieve information\");\n }\n// creating an array of companies\n CompanyEntity companyEntity = new CompanyEntity();\n companyEntity.setCompanyId(resultSet.getLong(\"id\"));\n companyEntity.setCompanyName(resultSet.getString(\"company_name\"));\n companyEntity.setCompanyEmail(resultSet.getString(\"company_email\"));\n companyEntity.setCompanyPhone(resultSet.getString(\"company_phone\"));\n companyEntity.setCompanyAddress(resultSet.getString(\"company_address\"));\n\n return companyEntity;\n\n } catch (Exception e) {\n //\t\t\te.printStackTrace();\n throw new Exception(\"Failed to retrieve data\", e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "SysOrganization selectByPrimaryKey(Long id);", "public java.lang.String getPrimaryKey() {\n\t\treturn _imageCompanyAg.getPrimaryKey();\n\t}", "Company getOrCreateCompanyId(String companyID) throws Exception;", "@Transactional(readOnly = true)\n public Company findOne(final Long companyId) {\n return companyRepository.findOne(companyId);\n }", "@Override\r\n\tpublic Company getDetailByCompanyName(String companyName) {\n\t\treturn companyRepository.findByCompanyName(companyName);\r\n\t}", "public void getFindByIdCompany() {\n log.info(\"CompaniesContactsBean => method : getFindByIdCompany()\");\n\n log.info(\"ID company\" + companiesBean.getCompaniesEntity().getId());\n this.companiesContactsEntityList = findByIdCompany(companiesBean.getCompaniesEntity());\n }", "@Override\n\tpublic long getCompanyId() {\n\t\treturn _userTracker.getCompanyId();\n\t}", "public java.lang.Integer getCompanycode() {\n\treturn companycode;\n}", "Organization selectByPrimaryKey(Integer id);", "OrganizationMaster getOrganization(Long uniqueId);", "@Override\n Optional<Complaint> findById(Integer id);", "@Override\n\tpublic List<CompanyVO> getCompanyInfo(String c_name) {\n\t\treturn null;\n\t}", "public Company getCompanyAt(int index) {\r\n\t\treturn companyDirectory.get(index); \r\n\t\t\t\r\n\t}", "public ZyCorporation selectByPrimaryKey(Integer rowid) {\r\n ZyCorporation key = new ZyCorporation();\r\n key.setRowid(rowid);\r\n ZyCorporation record = (ZyCorporation) getSqlMapClientTemplate().queryForObject(\"zy_corporation.selectByPrimaryKey\", key);\r\n return record;\r\n }" ]
[ "0.7159468", "0.6994966", "0.6788337", "0.67805046", "0.6750502", "0.6660049", "0.66214687", "0.6526173", "0.6448355", "0.63811195", "0.63811195", "0.63811195", "0.63811195", "0.63642704", "0.63642704", "0.63642704", "0.63642704", "0.63642704", "0.6324554", "0.628092", "0.62641776", "0.622714", "0.6195465", "0.61907196", "0.6186135", "0.6186135", "0.6186135", "0.6182396", "0.61798596", "0.61798596", "0.6151084", "0.61499476", "0.6125386", "0.61252666", "0.61222523", "0.6119505", "0.611466", "0.6111955", "0.6111955", "0.6098525", "0.6091574", "0.6085301", "0.6084423", "0.60775805", "0.6076879", "0.60726494", "0.60551393", "0.60521334", "0.6047191", "0.6044436", "0.6042556", "0.60387844", "0.6013346", "0.6013019", "0.6009954", "0.59842926", "0.59724855", "0.5956467", "0.5941962", "0.5931651", "0.59291923", "0.59043396", "0.59043396", "0.5897502", "0.5897502", "0.5888106", "0.5879693", "0.5877535", "0.5860262", "0.5841638", "0.58089817", "0.57976645", "0.576968", "0.57691413", "0.5765687", "0.57542074", "0.5747076", "0.5747076", "0.5735673", "0.5723288", "0.57060844", "0.5705554", "0.5686858", "0.5686858", "0.56846136", "0.5680478", "0.5653082", "0.56401026", "0.56347656", "0.5626905", "0.5612137", "0.5586839", "0.55758554", "0.5551883", "0.55501294", "0.554266", "0.55418557", "0.55322427", "0.55266213", "0.5508388" ]
0.68146056
2
Returns all the company ags.
public List<CompanyAg> findAll() throws SystemException { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic List<Company> getAll() {\n\t\treturn dao.getAll();\n\t}", "@Override\r\n\tpublic List<Company> getAllCompanies() {\r\n\t\tString methodName = \"getAllCompanies()\";\r\n\t\tlog.info(className+\",\"+methodName);\r\n\t\treturn companyRepository.findAll();\r\n\t\t\r\n\t}", "public List<Company> getCompanys() {\n\t\treturn companyDao.findAll();\n//\t\treturn companies;\n\t}", "@Override\n\tpublic List<Company> queryCompanyAll() {\n\t\treturn companyDao.queryCompanyAll();\n\t}", "public List<Company> getAllCompanies() {\n\t\t \n\t List<Company> listOfCompanies = new ArrayList<Company>();\n\n\t Cursor cursor = mDatabase.query(MySQLiteHelper.TABLE_COMPANIES,\n\t mAllColumns, null, null, null, null, null);\n\n\t cursor.moveToFirst();\n\t while (!cursor.isAfterLast()) {\n\t Company hunt = cursorToCompany(cursor);\n\t listOfCompanies.add(hunt);\n\t cursor.moveToNext();\n\t }\n\t \n\t cursor.close();\n\t return listOfCompanies;\n\t }", "public abstract List<Company> getAll();", "public List<Company> companies() {\n StandardServiceRegistry registry = new StandardServiceRegistryBuilder().configure().build();\n SessionFactory sessionFactory = null;\n try {\n\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n Session session = sessionFactory.getCurrentSession();\n session.beginTransaction();\n List<Company> listOfCompanies = session.createQuery(\"FROM Company\").getResultList();\n session.getTransaction().commit();\n return listOfCompanies;\n\n } finally {\n if (sessionFactory != null) {\n sessionFactory.close();\n }\n }\n }", "public List<Company> getAllCompanies() {\n\t\treturn Validations.VerifyNotEmpty(companyRepository.findAll());\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Company> loadAll() {\r\n\t\treturn sessionFactory.getCurrentSession().createQuery(\"from Company\").list();\r\n\t}", "public List<ContactCompanyAg> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public java.util.List<contactsapi.company.CompanyResponse> getCompaniesList() {\n return companies_;\n }", "public ArrayList<Company> getCompaniesFromCache() {\n\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n query.fromLocalDatastore();\n\n try {\n return new ArrayList<>(query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchants from local data store:\\n\" + e.getMessage());\n }\n\n return new ArrayList<>();\n }", "public static void showCompanies(){\n\t\tCompanyDao.getAllCompanies();\n\t}", "List<Acquest> getAllAcquests();", "@Override\r\n\tpublic ArrayList<Company> getAllCompanies() throws CouponSystemException {\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = ConnectionPool.getInstance().getConnection();\r\n\t\t\tArrayList<Company> allCompanies = new ArrayList<>();\r\n\t\t\tString sql = \"select * from companies\";\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(sql);\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tCompany comp = new Company(rs.getInt(\"companyId\"), rs.getString(\"companyName\"),\r\n\t\t\t\t\t\trs.getString(\"companyEmail\"), rs.getString(\"companyPass\"));\r\n\t\t\t\tallCompanies.add(comp);\r\n\t\t\t}\r\n\t\t\treturn allCompanies;\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new CouponSystemException(\"getAllCompanies Failed\", e);\r\n\t\t} finally {\r\n\t\t\tif (con != null) {\r\n\t\t\t\tConnectionPool.getInstance().restoreConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public java.util.Set<vn.com.phuclocbao.entity.CompanyEntity> getCompanies()\n {\n return companies;\n }", "@Override\n\t@Transactional\n\tpublic List<MAgama> getAgamas() {\n\t\treturn agamaDAO.getAgamas();\n\t}", "@RequestMapping(value = \"/accompagnants/getAll\", method = RequestMethod.GET, headers = \"Accept=application/json\")\r\n\tpublic List<Accompagnant> getAllAccompagnants() {\r\n\t\tList<Accompagnant> listeAccompagnants = accompagnantService.getAllAccompagnant();\r\n\t\treturn listeAccompagnants;\r\n\t}", "public ArrayList<Company> getAllCompanies() throws Exception {\n\t\tConnection connection = null;\n\t\tPreparedStatement preparedStatement = null;\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tconnection = JdbcUtils.getConnection();\n\n\t\t\t// Creating the SQL query\n\t\t\tString sqlStatement = \"SELECT * FROM companies\";\n\n\t\t\t// Combining between the syntax and our connection\n\t\t\tpreparedStatement = connection.prepareStatement(sqlStatement);\t\t\t\n\n\t\t\t// Executing the query\n\t\t\tresultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\tArrayList<Company> allCompanies = new ArrayList<Company>(); \n\t\t\t\n\t\t\twhile (resultSet.next()) {\n\t\t\t\t\n\t\t\t\tLong id = resultSet.getLong(\"Company_Id\");\n\t\t\t\tString name = resultSet.getString(\"Company_NAME\");\n\t\t\t\tallCompanies.add(new Company(id, name));\n\t\t\t}\n\t\t\treturn allCompanies;\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// **If there was an exception in the \"try\" block above, it is caught here and\n\t\t\t// notifies a level above.\n\t\t\te.printStackTrace();\n\t\t\tthrow new ApplicationException(e,ErrorType.GENERAL_ERROR,\n\t\t\t\t\tDateUtils.getCurrentDateAndTime() + \"FAILED to return all companies\");\n\n\t\t\t// Closing the resources\n\t\t\t} finally {\n\t\t\t\tJdbcUtils.closeResources(connection, preparedStatement,resultSet);\n\t\t\t}\t\n\t\t}", "@Override\n\tpublic Collection<String> getCompanyList() {\n\t\treturn getHibernateTemplate().execute(new HibernateCallback<String, Collection<String>>(\"getCompanyList\") {\n\t\t\t@Override\n\t\t\tpublic Collection<String> doInHibernate(final Session session) {\n\t\t\t\tfinal Criteria criteria = session.createCriteria(getEntityClass());\n\t\t\t\tcriteria.setProjection(Projections.property(\"name\"));\n\t\t\t\tcriteria.addOrder(Order.asc(\"name\"));\n\t\t\t\treturn criteria.list();\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public CompanyEntity[] getAllCompanies() throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"SELECT * FROM companies\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Executing the update\n ResultSet resultSet = preparedStatement.executeQuery();\n\n if (!resultSet.next()) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"Cannot retrieve information\");\n }\n// getting the number of rows returned to create an array of companies\n int numberOfRows = MyUtils.getRowCount(resultSet);\n if (numberOfRows == 0) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"0 companies in the table\");\n }\n// creating an array of companies\n CompanyEntity[] companies = new CompanyEntity[numberOfRows];\n int i = 0;\n while (resultSet.next()) {\n companies[i].setCompanyId(resultSet.getLong(\"id\"));\n companies[i].setCompanyName(resultSet.getString(\"company_name\"));\n companies[i].setCompanyEmail(resultSet.getString(\"company_email\"));\n companies[i].setCompanyPhone(resultSet.getString(\"company_phone\"));\n companies[i].setCompanyAddress(resultSet.getString(\"company_address\"));\n i++;\n }\n\n return companies;\n\n } catch (Exception e) {\n //\t\t\te.printStackTrace();\n throw new Exception(\"Failed to retrieve data\", e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "@Override\n\tpublic List<Company> getAll(Page<Company,Long> page) {\n\t\t\treturn dao.getAll(companyPageMapper.pageToDaoRequestParameter(page));\n\t}", "public List<TmCompany> findAll() {\n\t\treturn tmCompanyDao.findAll();\r\n\t}", "public List<ManagedCompany> getManagedCompanies() {\n \n List<ManagedCompany> results = new ArrayList<>();\n \n try {\n Connection conn = this.databaseUtils.getConnection();\n dao.setConnection(conn);\n results = dao.getItems();\n } catch (SQLException e) {\n Logger.getLogger(AppService.class.getName()).log(Level.SEVERE, null, e);\n }\n \n return results;\n }", "public List<CustomerCompany> getAllCustomerCompanies() \n\t{\n\t\treturn this.entityManager.createNamedQuery(\"CustomerCompany.listAll\", CustomerCompany.class).getResultList();\n\t}", "public List<Organization> getAll() throws SQLException {\n\t\tlogger.info(\"[Organization] get\");\n\t\treturn organizationDao.queryForAll();\n\t}", "public List<Achievement> getAllAchievements() {\n return achievementList;\n }", "public Cursor getAllAgencies() {\n\t\t\treturn db.query(AGENCIES_TABLE, new String[] {\n\t\t\t\t\t// importing only needed columns instead of all\n\t\t\t\t\tKEY_ROWID,\n\t\t\t\t\tKEY_AGENCYNAME},\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull,\n\t\t\t\t\tnull);\t\t\t\t\n\t\t}", "public static Vector<Company> getAllPrices(){\n\t\treturn all_prices;\n\t}", "@Override\r\n\tpublic synchronized List<Company> getAllCompanies() throws Exception {\r\n\r\n\t\tconnectionPool = ConnectionPool.getInstance();\r\n\t\tConnection connection = connectionPool.getConnection();\r\n\t\tList<Company> list = new ArrayList<>();\r\n\t\tString sql = \"select * from Company\";\r\n\t\ttry (PreparedStatement preparedStatement = connection.prepareStatement(sql); ResultSet resultSet = preparedStatement.executeQuery()) {\r\n\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tlong companyId = resultSet.getLong(1);\r\n\t\t\t\tString companyName = resultSet.getString(2);\r\n\t\t\t\tString companyPassword = resultSet.getString(3);\r\n\t\t\t\tString companyEmail = resultSet.getString(4);\r\n\r\n\t\t\t\tlist.add(new Company(companyId, companyName, companyPassword, companyEmail));\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new Exception(\"DB error - unable to get Company data\");\r\n\t\t}catch (Exception e) {\r\n\t\t\tthrow new Exception(\"unable to get Company data\");\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tconnection.close();\r\n\t\t\tconnectionPool.returnConnection(connection);\r\n\t\t}\r\n\t\treturn list;\r\n\r\n\t}", "public List<Company> getCompanies() throws BusinessException {\n\t\tList<Company> lstCompanies = new ArrayList<Company>();\n\n\t\ttry {\n\n\t\t\tList<Object> list = UtilSession.getObjectsByNamedQuery(this.em, Company.FIND_COMPANIES, null);\n\n\t\t\tfor (Object object : list) {\n\t\t\t\tCompany vnt = (Company) object;\n\t\t\t\tlstCompanies.add(vnt);\n\t\t\t}\n\n\t\t} catch (Exception ex) {\n\t\t\tString s = \"Error al consultar las compa�ias\";\n\t\t\t_logger.error(s, ex);\n\t\t\tthrow new BusinessException(s, ex);\n\t\t}\n\n\t\t\n\n\t\treturn lstCompanies;\n\n\t}", "public List<Accomodation> getAll() {\n\t\tList<Accomodation> result = new LinkedList<>();\n\n\t\ttry (Connection conn = newConnection(\"postgresql\", \"localhost\", \"5432\", \"Booking\", \"postgres\", \"portocaliu\");\n\t\t\t\tStatement stm = conn.createStatement();\n\t\t\t\tResultSet rs = stm.executeQuery(\"select id, type, bed_type, max_guests, description from accomodation\");\n\n\t\t) {\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tAccomodation ac = new Accomodation();\n\n\t\t\t\tac.setId(rs.getInt(\"id\"));\n\t\t\t\tac.setType(rs.getString(\"type\"));\n\t\t\t\tac.setBedType(rs.getString(\"bed_type\"));\n\t\t\t\tac.setMaxGuests(rs.getInt(\"max_guests\"));\n\t\t\t\tac.setDescription(rs.getString(\"description\"));\n\n\t\t\t\tresult.add(ac);\n\t\t\t}\n\t\t} catch (SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\n\t\treturn result;\n\t}", "List<Company> getCompanyList() throws DAOException ;", "public java.util.List<contactsapi.company.CompanyResponse.Builder> \n getCompaniesBuilderList() {\n return getCompaniesFieldBuilder().getBuilderList();\n }", "public static List<Company> createCompanies() {\r\n\t\tList<Company> companies = new ArrayList<Company>();\r\n\t\tcompanies.add(createCompany(1, \"Pepcus\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help1\"));\r\n\t\tcompanies.add(createCompany(2, \"Google\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help2\"));\r\n\t\tcompanies.add(createCompany(3, \"Facebook\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help3\"));\r\n\t\tcompanies.add(createCompany(4, \"Suzuki\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help4\"));\r\n\t\tcompanies.add(createCompany(5, \"General Motors\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help5\"));\r\n\t\tcompanies.add(createCompany(6, \"L & T\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help6\"));\r\n\t\tcompanies.add(createCompany(7, \"General Electric\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help7\"));\r\n\t\tcompanies.add(createCompany(8, \"Oracle\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help8\"));\r\n\t\tcompanies.add(createCompany(9, \"Microsoft\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help9\"));\r\n\t\tcompanies.add(createCompany(10, \"Thinkhr\", \"IT\", \"PEP\", new Date(), \"IT comp at Indore\", \"This is search help10\"));\r\n\t\treturn companies;\r\n\r\n\t}", "public void cacheResult(List<CompanyAg> companyAgs) {\n\t\tfor (CompanyAg companyAg : companyAgs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCompanyAgImpl.class, companyAg.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(companyAg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcompanyAg.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public String[] getCompanyNames() {\n return companyNames;\n }", "public ArrayList<Athlete> getAllAthletes() {\n populateData();\n return athletes;\n }", "public List<Organization> getAllOrganizations() {\n // service endpoint url\n String url = targetUrl + \"/organizationManagement?filter={filter}\";\n\n // generate filter to only return organizations of type dto/tco,\n // unknown, and criminal\n String filter = \"{\\\"where\\\": {\\\"or\\\": [{\\\"type\\\":\\\"DTO/TCO\\\"},\" +\n \"{\\\"type\\\":\\\"Unknown\\\"},{\\\"type\\\":\\\"Criminal\\\"}]}}\";\n return getOrgs(url, filter);\n }", "private List<Organization> getOrgs(String url, String filter) {\n // create response object\n NodeServiceListResponse<Organization> response = \n new NodeServiceListResponse<Organization>(Organization.class);\n List<Organization> orgList;\n\n try {\n // create http entity class with common headers\n HttpEntity entity = new HttpEntity(headers);\n\n // retrieve the response from the node service call\n response = NodeServicesUtil.getNodeListResponse(url, entity, \n HttpMethod.GET, response, filter);\n \n // retrieve data from the response object\n orgList = response.getConvertedData();\n\n // catch and log all errors from the service\n } catch (Exception e) {\n // error getting data\n orgList = new ArrayList<Organization>();\n LOG.error(\"There was an error getting organizations \" + e);\n }\n\n return orgList;\n }", "List<ApplicantDetailsResponse> getAllApplicants() throws ServiceException;", "@Override\r\n\tpublic List<Grade> getAllGrades(Long companyId) {\r\n\t\treturn gradeRepository.findAllGrades(companyId);\r\n\r\n\t}", "@Override\r\n\tpublic List<Company> getCompanyList() throws SQLException {\n\r\n\t\tList<Company> companies = new ArrayList<>();\r\n\t\tcompanyRepository.findAll().forEach(companies::add);\r\n\r\n\t\treturn companies;\r\n\t}", "public ReactorResult<Contact> getAllLicensee_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), LICENSEE, Contact.class);\r\n\t}", "public java.util.List<? extends contactsapi.company.CompanyResponseOrBuilder> \n getCompaniesOrBuilderList() {\n return companies_;\n }", "@Override\n\t\tpublic List<Carrera> getAll() {\n\t\t\t\treturn null;\n\t\t}", "@Transactional(readOnly = true)\n @PreAuthorize(\"hasRole('COMPANY_READER')\")\n public List<Company> getAll() {\n return companyRepository.findAll();\n }", "static List<Company> getAllCompanies(SQLiteDatabase db) {\n Cursor cursor = db.query(COMPANY_TABLE, null, COMPANY_WAS_DELETED + \" = ?\", new String[] {\"0\"}, null, null, null);\n List<Company> list = new LinkedList<Company>();\n if (cursor.moveToFirst()) {\n int idIndex = cursor.getColumnIndex(COMPANY_ID);\n int nameIndex = cursor.getColumnIndex(COMPANY_NAME);\n int logoIndex = cursor.getColumnIndex(COMPANY_LOGO);\n int descriptionIndex = cursor.getColumnIndex(COMPANY_DESCRIPTION);\n int lastUpdatedIndex = cursor.getColumnIndex(COMPANY_LAST_UPDATED);\n\n do {\n Company company = new Company();\n company.companyId = cursor.getString(idIndex);\n company.name = cursor.getString(nameIndex);\n company.companyLogo = cursor.getString(logoIndex);\n company.companyDescription = cursor.getString(descriptionIndex);\n company.lastUpdatedDate = cursor.getDouble(lastUpdatedIndex);\n if(company.wasDeleted == false) {\n company.models = CarSQL.getCompanyCars(db, company.companyId);\n list.add(company);\n }\n } while (cursor.moveToNext());\n }\n return list;\n }", "public ArrayList<CompanyAUI> getCompanyAUI() {\n\t\treturn companyAUI;\n\t}", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "public List<BusinessAccount> searchAllContractors() {\n\t\tfactory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);\n\t\tEntityManager em = factory.createEntityManager();\t\n\t\n\t\t\tem.getTransaction().begin();\n\t\t\tQuery myQuery = em.createQuery(\"SELECT b FROM BusinessAccount b\");\n\t\t\tcontractorList=myQuery.getResultList();\n\t\t em.getTransaction().commit();\n\t\t em.close();\n\t\t\t\n\t\t\treturn contractorList;\n\t\t}", "public java.util.List<contactsapi.company.CompanyResponse> getCompaniesList() {\n if (companiesBuilder_ == null) {\n return java.util.Collections.unmodifiableList(companies_);\n } else {\n return companiesBuilder_.getMessageList();\n }\n }", "@Override\n\tpublic List<Advertising> selectAll() {\n\t\treturn advertisingDao.selectAll();\n\t}", "@Override\n public List<Appeal> getAllAppeals(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,3);\n List<Appeal> appeals = new ArrayList<>();\n try {\n //List<Map<String,Object>> data = get(\"SELECT * FROM TblAppeals\");\n List<Map<String,Object>> data = get(\"SELECT TblAppeals.*, TblDefendants.*, TblOfficerReport.* \" +\n \"FROM TblDefendants INNER JOIN (TblAppeals INNER JOIN TblOfficerReport ON TblAppeals.serialNum = TblOfficerReport.appeal) ON TblDefendants.ID = TblOfficerReport.defendant\");\n for(Map<String,Object> map: data) {\n Appeal appeal = new Appeal(map);\n Defendant defendant = new Defendant(map);\n Report report = new Report(map);\n\n appeal.setReport(report);\n appeal.setDefendant(defendant);\n\n appeals.add(appeal);\n }\n return appeals;\n } catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "@GetMapping(\"/company-types\")\n @Timed\n public List<CompanyType> getAllCompanyTypes() {\n log.debug(\"REST request to get all CompanyTypes\");\n List<CompanyType> companyTypes = companyTypeRepository.findAll();\n return companyTypes;\n }", "@Override\n\tpublic List<BikeAdvert> getBikeAdverts() {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t//create the query\n\t\tQuery<BikeAdvert> theQuery= \n\t\t\t\tcurrentSession.createQuery(\"from BikeAdvert order by companyName\",BikeAdvert.class);\n\t\t//execute query and get result list\n\t\tList<BikeAdvert> bikeAdverts= theQuery.getResultList();\n\t\t// and return the results \n\t\treturn bikeAdverts;\n\t}", "public List<Companhia> getCompanhiasDoJogador() {\r\n return companhiasDoJogador;\r\n }", "public List<Contract> allContracts() {\r\n\r\n\t\tQuery query = this.em.createQuery(\"SELECT c FROM Contract c order by c.contractId desc\");\r\n\t\tList<Contract> contractList = null;\r\n\t\tif (query != null) {\r\n\t\t\tcontractList = query.getResultList();\r\n\t\t\tSystem.out.println(\"List:\"+contractList);\r\n\t\t}\r\n\t\treturn contractList;\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<MAgama> getAgamas(int page, int limit) {\n\t\treturn agamaDAO.getAgamas(page, limit);\n\t}", "public Collection<CompaniaDTO> findObtenerListaCompanias() throws ERPException{\r\n\t\treturn this.companiaGestor.obtenerListaCompanias();\r\n\t}", "@Override\n\tpublic List<Empresa> getAll() {\n\t\treturn empresaJpaRepository.findAll();\n\t}", "public List<Almacen> getStoresByIdCompany(long idCompany);", "public List<Gasto> findAll(){\n\t\treturn (List<Gasto>) gastoModel.findAll();\n\t}", "@Override\n\tpublic List<Client> getAll() {\n\t\treturn dao.getAll(Client.class);\n\t}", "@GetMapping(\"getAll\")\n\tpublic ServiceResponse<ContactAllResponse> getAll() {\n\t\treturn contactService.getAll();\n\t}", "public ReactorResult<Contact> getAllConductor_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), CONDUCTOR, Contact.class);\r\n\t}", "public static String[] getCompanyNames() throws EnvoyServletException\n {\n try\n {\n Collection cns = ServerProxy.getVendorManagement()\n .getCompanyNames();\n String[] cnArray = new String[cns.size()];\n cnArray = (String[]) cns.toArray(cnArray);\n return cnArray;\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Aois> getAoisList() {\n return aois_;\n }", "public void cacheResult(List<ContactCompanyAg> contactCompanyAgs) {\n\t\tfor (ContactCompanyAg contactCompanyAg : contactCompanyAgs) {\n\t\t\tif (EntityCacheUtil.getResult(\n\t\t\t\t\t\tContactCompanyAgModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tContactCompanyAgImpl.class,\n\t\t\t\t\t\tcontactCompanyAg.getPrimaryKey()) == null) {\n\t\t\t\tcacheResult(contactCompanyAg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontactCompanyAg.resetOriginalValues();\n\t\t\t}\n\t\t}\n\t}", "public List<Client> getAllClient() {\n \tTypedQuery<Client> query = em.createQuery(\n \"SELECT g FROM Client g ORDER BY g.id\", Client.class);\n \treturn query.getResultList();\n }", "public List<Organization> getAllOrganizations() throws Exception{\n\t\tList<Organization> organizationResult=null;\n\t\tPreparedStatement preparedSELECTstatement;\n\t\tResultSet resultSet = null;\n\t\t\n\t\t// look up the user by name which should be unique\n\t\t//\n\t\t\n\t\t// get the connection\n\t\tConnection conn = openConnection();\n\t\t\n\t\t// \n\t\t// process the request\n\t\t\n\t\t// create the statement\n\t\tpreparedSELECTstatement = conn\n .prepareStatement(\"SELECT * \"\n \t\t\t\t+ \"FROM organization \");\n\n\t\t// execute the statement \n resultSet = preparedSELECTstatement.executeQuery();\n \n //\n // process the result\n organizationResult = extractOrganizationsFromResult(resultSet);\n\n\t\t// release the connection\n\t\tcloseConnection(conn);\n\t\t\t\t\n\t\t// return the result\n\t\treturn organizationResult;\n\t}", "public contactsapi.company.CompanyResponse getCompanies(int index) {\n return companies_.get(index);\n }", "@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();", "@GetMapping(\"/contacts\")\r\n\tCollectionModel<EntityModel<Contact>> all() {\r\n\t\t//Use map to call toModel on each Contact resource\r\n\t List<EntityModel<Contact>> contacts = repo.findAll().stream()\r\n\t .map(assembler::toModel)\r\n\t .collect(Collectors.toList());\r\n\t return CollectionModel.of(contacts, linkTo(methodOn(ContactController.class).all()).withSelfRel());\r\n\t}", "@Transactional(readOnly = true)\n\t@Override\n\tpublic List<Object[]> getApplicants() {\n\t\treturn dao.getApplicants();\n\t}", "List<CompositionSpaceToDraftAssociation> getAll() throws OXException;", "public List<Automotor> getAll()\n {\n\n CriteriaQuery<Automotor> criteria = this.entityManager.getCriteriaBuilder().createQuery(Automotor.class);\n return this.entityManager.createQuery(criteria.select(criteria.from(Automotor.class))).getResultList();\n }", "public Map<String, String> getActiveAccountsForDropDown(String companyId, boolean getAdvertiser, boolean getAgencies) throws Exception;", "public List<String> getAllCAs(){\n return myDatabase.getAllCAs();\n }", "public List<Achievement> getAchievements()\n\t{\n\t\treturn achievements;\n\t}", "List<Company> getCompaniesByEmailDomain(String domain);", "public List<contact> contact_get_all() {\n \treturn contact_get(null, KEY_CONTACT_LASTACT + \" DESC\");\n }", "public java.util.List<com.example.grpc.SimpleServiceOuterClass.Aois.Builder> \n getAoisBuilderList() {\n return getAoisFieldBuilder().getBuilderList();\n }", "public int getCompaniesCount() {\n return companies_.size();\n }", "@Override\r\n\tpublic List<CurrencyAccountCorporate> findAll() {\n\t\treturn em.createQuery(\"from CurrencyAccountCorporate\",\r\n\t\t\t\tCurrencyAccountCorporate.class).getResultList();\r\n\t}", "@GetMapping(\"/anexlaborals\")\n @Timed\n public List<Anexlaboral> getAllAnexlaborals() {\n log.debug(\"REST request to get all Anexlaborals\");\n return anexlaboralRepository.findAll();\n }", "public contactsapi.company.CompanyResponse.Builder addCompaniesBuilder() {\n return getCompaniesFieldBuilder().addBuilder(\n contactsapi.company.CompanyResponse.getDefaultInstance());\n }", "public Company getCompany() {\n return company;\n }", "Collection<Account> getAll();", "@Transactional\n\t@Override\n\tpublic List<ApplicantModel> viewAllApplicants() {\n\t\treturn applicantRepo.findAll().stream().map(course -> parser.parse(course))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public List<Contact> getAllContacts();", "public nl.webservices.www.soap.GCRAssets getAssets() {\n return assets;\n }", "@RequestMapping(path = \"/listCompanies\", method = RequestMethod.GET)\n\tpublic ResponseEntity<RestResponse<ListCompaniesResponse>> listCompanies() {\n\n\t\tList<CompanyDTO> companies = companyService.listAll();\n\t\t\n\t\tListCompaniesResponse result = new ListCompaniesResponse(companies);\n\t\t\n\t\tRestResponse<ListCompaniesResponse> restResponse = \n\t\t\t\tnew RestResponse<ListCompaniesResponse>(RestResponseCodes.OK.getCode(), RestResponseCodes.OK.getDescription(), result);\n\t\t\n\t\treturn new ResponseEntity<RestResponse<ListCompaniesResponse>>(restResponse, HttpStatus.OK);\n\t\t\n\t}", "public ArrayList<Company> updateCacheList() {\n ParseQuery<Company> query = ParseQuery.getQuery(PARSE_NAME);\n\n try {\n Company.pinAll(\"companyList\", query.find());\n } catch (ParseException e) {\n Log.e(PARSE_NAME, \"Unable to find any merchant from Parse Database:\\n\" + e.getMessage());\n }\n\n return getCompaniesFromCache();\n }", "@Override\n\tpublic List<CompanyVO> getCompanyInfo(String c_name) {\n\t\treturn null;\n\t}", "public Iterable<StudentQualificationOrgDetail> getOrganizationData(){\n\t\t\n\t\treturn sqcOrgRepository.findAll();\n\t}", "public Company getCompany() {\r\n return this.company;\r\n }", "@RequestMapping(path = \"/v1/get-all-asset-group-apis\", method = RequestMethod.GET)\n \n public ResponseEntity<List<Map<String, Object>>> getAllAssetGroupApis() {\n try {\n List<Map<String, Object>> assetGroupDetails = assetGroupService\n .getAllAssetGroupApis();\n return new ResponseEntity<>(\n assetGroupDetails, HttpStatus.OK);\n } catch (Exception exception) {\n LOGGER.error(\"Exception in sendTextMail:\", exception);\n return new ResponseEntity<>(HttpStatus.FORBIDDEN);\n }\n }", "public List<Agente> getAllAgentes(){\r\n\t\treturn resAgenteDAO.getAllAgentes();\r\n\t}", "public ReactorResult<Contact> getAllOntologies20070510nid3Publisher_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), ONTOLOGIES20070510NID3PUBLISHER, Contact.class);\r\n\t}" ]
[ "0.67498213", "0.6646008", "0.6572776", "0.65419644", "0.6516782", "0.64715075", "0.63135284", "0.6260299", "0.61483794", "0.6073905", "0.6001728", "0.59997386", "0.5999727", "0.59606194", "0.5945223", "0.5942583", "0.5935351", "0.5917489", "0.5907408", "0.59023196", "0.5852152", "0.58168215", "0.5809767", "0.58052033", "0.58017987", "0.57873785", "0.5768493", "0.57546693", "0.5753963", "0.575177", "0.5740756", "0.57286906", "0.5664179", "0.56475085", "0.56397563", "0.55935645", "0.5587546", "0.5578551", "0.55717003", "0.55709106", "0.5569171", "0.5540586", "0.55140644", "0.5510474", "0.54906565", "0.54810494", "0.54675835", "0.5452112", "0.54155564", "0.54066586", "0.5396869", "0.53960437", "0.538272", "0.53788537", "0.5360251", "0.5355734", "0.53333443", "0.5326797", "0.5317205", "0.5305498", "0.5298621", "0.5292045", "0.5291778", "0.52863586", "0.5274802", "0.52739704", "0.527249", "0.52448624", "0.524169", "0.5238445", "0.5236949", "0.5227593", "0.5226147", "0.5221989", "0.52183646", "0.5211955", "0.52020574", "0.5195367", "0.51874214", "0.5184504", "0.5176059", "0.5175922", "0.5168753", "0.5158482", "0.5156046", "0.5150131", "0.5144721", "0.51428974", "0.51427996", "0.5139085", "0.5135748", "0.51356757", "0.51327956", "0.5126571", "0.5125361", "0.5121592", "0.51067007", "0.51063764", "0.510627", "0.5105367" ]
0.65344226
4
Removes all the company ags from the database.
public void removeAll() throws SystemException { for (CompanyAg companyAg : findAll()) { remove(companyAg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeAll() throws SystemException {\n\t\tfor (ContactCompanyAg contactCompanyAg : findAll()) {\n\t\t\tremove(contactCompanyAg);\n\t\t}\n\t}", "public void deleteAllFromDB() {\r\n for (int i = 0; i < uploads.size(); i++) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n }\r\n super.getBasebo().remove(uploads);\r\n }", "public void clearDatabase() {\n\n\t\tObjectSet<Article> articles = db.query(Article.class);\n\t\tarticles.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<CreditCard> creditCards = db.query(CreditCard.class);\n\t\tcreditCards.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Customer> customers = db.query(Customer.class);\n\t\tcustomers.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<Order> orders = db.query(Order.class);\n\t\torders.stream()\n\t\t\t.forEach(db::delete);\n\n\t\tObjectSet<OrderDetail> orderDetails = db.query(OrderDetail.class);\n\t\torderDetails.stream()\n\t\t\t.forEach(db::delete);\n\t\t\n\t\tSystem.out.println(\"\\nBase de dades esborrada per complet\");\n\t}", "public void unlinkAllCompanyCoupon(long companyId) throws SQLException;", "@Override\n\tpublic void deleteAll() throws Exception {\n\t\tcomproRepository.deleteAll();\n\t}", "public void removeAll()\r\n {\n db = this.getWritableDatabase(); // helper is object extends SQLiteOpenHelper\r\n db.execSQL(\"drop table \"+\"campaing\");\r\n db.execSQL(\"drop table \"+\"cafe\");\r\n db.execSQL(\"drop table \"+\"points\");\r\n\r\n db.close ();\r\n }", "public void deleteAll() {\n\t\t mongoTemplate.remove(new Query(), COLLECTION);\n\t}", "void unsetCompanyBaseData();", "public void clearAll() {\n\n realm.beginTransaction();\n realm.clear(PhotoGalleryModel.class);\n realm.commitTransaction();\n }", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (CreditAppBankReference creditAppBankReference : findAll()) {\n\t\t\tremove(creditAppBankReference);\n\t\t}\n\t}", "public void refreshCompanies() {\n\t\t \n\t\t mDbHelper.refreshTable(mDatabase, MySQLiteHelper.TABLE_COMPANIES);\n\t }", "@Override\n\tpublic void deleteAll() {\n\t\tdao.deleteAll();\n\n\t}", "public void deleteAll()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbookdao.openCurrentSessionwithTransation();\r\n\t\t\tbookdao.deleteAll();\r\n\t\t\tbookdao.closeSessionwithTransaction();\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\r\n public void removeAll() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n em.getTransaction().begin();\r\n Query query = em.createQuery(\"DELETE FROM Assunto \");\r\n query.executeUpdate();\r\n em.getTransaction().commit();\r\n }", "@Override\r\n\tpublic void deleteAllAccounts() {\n\t\t\r\n\t}", "@Transactional\r\n\tpublic void deleteAllBlogs() {\n\t\tsessionFactory.getCurrentSession().delete(getClass());\r\n\t}", "public void clearDatabase(){\n\t\tem.createNativeQuery(\"DELETE FROM CAMINHO\").executeUpdate();\r\n\t\tem.createNativeQuery(\"DELETE FROM MAPA\").executeUpdate();\r\n\t\t\r\n\t\tlog.info(\"Limpou a base de dados\");\r\n\t\r\n\t}", "@Override\n\tpublic void removeAll() {\n\t\tfor (Approvatore approvatore : findAll()) {\n\t\t\tremove(approvatore);\n\t\t}\n\t}", "public void deleteAll() {\n\t\ttry{\t\n\t\t\tbanco.delete(meuBancoHelper.TABELA_MTAG,null,null);\n\t\t\t}\n\t\t\tcatch(NullPointerException e)\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t}", "@Modifying\n @Transactional\n @Query(\"DELETE FROM \" + dbName)\n void deleteAllFromTable();", "@AfterEach\n\tvoid clearDatabase() {\n\t\t//Clear the table\n\t\taccountRepository.deleteAll();\n\t}", "@Override\n\tpublic void removeAll() {\n\t\tfor (PhatVay phatVay : findAll()) {\n\t\t\tremove(phatVay);\n\t\t}\n\t}", "public static void deleteAll() throws RocksDBException {\n RocksIterator iter = db.newIterator();\n\n for (iter.seekToFirst(); iter.isValid(); iter.next()) {\n db.delete(iter.key());\n }\n\n iter.close();\n }", "public void deleteAll() {\n Session session = getSessionFactory().openSession();\n\n try {\n session.beginTransaction();\n Query query = session.createQuery(\"DELETE FROM Person \");\n query.executeUpdate();\n session.getTransaction().commit();\n LOGGER.log(Level.INFO,\"Successfully deleted all persons.\");\n }\n catch (Exception e){\n session.getTransaction().rollback();\n LOGGER.log(Level.INFO,\"Deletion of all persons failed\");\n }\n finally {\n session.close();\n }\n }", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void deleteAll() {\n\t\t\r\n\t}", "public void DeleteAllRecordsInTable() {\n\n final List<Address> gndPlan = GetAllRecordsFromTable();\n for (int i = 0; i < gndPlan.size(); i++) {\n\n gndPlan.get(i).delete();\n //delete all item in table House\n }\n\n }", "@Override\n\tpublic void removeAll() {\n\t\tfor (Campus campus : findAll()) {\n\t\t\tremove(campus);\n\t\t}\n\t}", "public void removeCouponByCompany(Company company) throws DbException;", "void clearAssociations();", "public void deleteAll();", "public void deleteAll();", "public void deleteAll();", "public void clearDatabase() {\n new ExecutionEngine(this.database).execute(\"MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r, n\");\n }", "@Override\n public void deleteAllAccounts() {\n synchronized (accounts) {\n accounts.clear();\n }\n }", "public void deleteAll() {\n repository.deleteAll();\n }", "public void deleteAll() {\n try (Connection connection = dataSource.getConnection();\n Statement statement = connection.createStatement()) {\n statement.execute(INIT.DELETE_ALL.toString());\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "private void deleteAllPets() {\n// int rowsDeleted = getContentResolver().delete(ArtistsContracts.GenderEntry.CONTENT_URI, null, null);\n// Log.v(\"CatalogActivity\", rowsDeleted + \" rows deleted from pet database\");\n }", "public void clearDatabase();", "void unsetAuditingCompany();", "public void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\tmDB.execSQL(\"DROP TABLE EVENT\");\n\t}", "@After\n public void cleanDatabase() {\n\n databaseInstance.setTaxpayersArrayList(new ArrayList<Taxpayer>());\n }", "public void removeAll(){\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_GAS_SENSOR, null, null);\n // db.delete(DatabaseHelper.TAB_USERS_GROUP, null, null);\n }", "@Override\n\tpublic int deleteAll() {\n\t\treturn SApplicationcategorydao.executeHql(\"delete from \"+tablename);\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "@Override\n\tpublic void deleteAll() {\n\n\t}", "public void removeByCompanyId(long companyId);", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (EmployeeComplaint employeeComplaint : findAll()) {\n\t\t\tremove(employeeComplaint);\n\t\t}\n\t}", "public void deleteAll() {\n\n\t}", "private void clearAllDatabases()\n\t{\n\t\tdb.clear();\n\t\tstudent_db.clear();\n\t}", "@Override\r\n\tpublic void clearDatabase() {\n\t\t\r\n\t}", "protected void deleteAllTag() {\n\t\tReaderDataBase.deleteAll(this);\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "@Override\n\tpublic void deleteAll() {\n\t\t\n\t}", "public void dropAll () {\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tif (dbCol.getIndexInfo().size()>0)\n\t\t\tdbCol.dropIndexes();\n\t\tdbCol.drop();\n\t\t\t \n\t\t\n\t}", "@Override\n public void deleteAll(final Connection _con) throws SQLException {\n\n final Statement stmtSel = _con.createStatement();\n final Statement stmtExec = _con.createStatement();\n\n try {\n // remove all foreign keys\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Foreign Keys\");\n }\n ResultSet rs = stmtSel.executeQuery(SELECT_ALL_KEYS);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n final String constrName = rs.getString(2);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"' Constraint '\" + constrName + \"'\");\n }\n stmtExec.execute(\"alter table \" + tableName + \" drop constraint \" + constrName);\n }\n rs.close();\n\n // remove all views\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Views\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_VIEWS);\n while (rs.next()) {\n final String viewName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - View '\" + viewName + \"'\");\n }\n stmtExec.execute(\"drop view \" + viewName);\n }\n rs.close();\n\n // remove all tables\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Remove all Tables\");\n }\n rs = stmtSel.executeQuery(SELECT_ALL_TABLES);\n while (rs.next()) {\n final String tableName = rs.getString(1);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\" - Table '\" + tableName + \"'\");\n }\n stmtExec.execute(\"drop table \" + tableName);\n }\n rs.close();\n } finally {\n stmtSel.close();\n stmtExec.close();\n }\n }", "public void removeAll() {\n db.delete(TABLE_NAME, null, null);\n Log.d(\"deleteHistoryCS\", \"Remove All HistoryCS\");\n }", "@Override\r\n\tpublic void deleteAll() {\n\r\n\t}", "@Override\n\tpublic void removeAll() {\n\t\tfor (LinkGroup linkGroup : findAll()) {\n\t\t\tremove(linkGroup);\n\t\t}\n\t}", "public void deleteAll()\n\t{\n\t}", "public void deleteAll()\n\t{\n\t}", "void deleteAll();", "void deleteAll();", "void deleteAll();", "@Transactional\n\t@Override\n\tpublic void deleteAll() {\n\t\tanchorKeywordsDAO.deleteAll();\n\t}", "@Override\n\t@Transactional\n\tpublic void deleteAll() throws Exception {\n\t\tdetalleCarritoRepository.deleteAll();\n\t}", "void deleteAll(Collection<?> entities);", "@Override\n\t/** Removes all expired Coupons from the Coupon table in the database */\n\tpublic void deleteExpiredCoupons() throws CouponSystemException {\n\t\tConnection con = null;\n\t\t// Getting a connection from the Connection Pool\n\t\tcon = ConnectionPool.getInstance().getConnection();\n\n\t\ttry {\n\t\t\t// Defining SQL string to remove expired Coupons from the Coupon\n\t\t\t// table via prepared statement\n\t\t\tString deleteExpiredCouponsFinalSQL = \"delete from coupon where expired = 'expired'\";\n\t\t\t// Creating prepared statement with predefined SQL string\n\t\t\tPreparedStatement pstmt = con.prepareStatement(deleteExpiredCouponsFinalSQL);\n\t\t\t// Executing prepared statement and using its result for\n\t\t\t// post-execute check\n\t\t\tint resExpired = pstmt.executeUpdate();\n\t\t\tif (resExpired != 0) {\n\t\t\t\t// If result row count is not equal to zero - execution has been\n\t\t\t\t// successful\n\t\t\t\tSystem.out.println(\"Expired coupons have been deleted from Coupon table successfully\");\n\t\t\t} else {\n\t\t\t\t// Otherwise execution failed due to expired Coupons not found\n\t\t\t\t// in the database\n\t\t\t\tSystem.out.println(\"Coupons removal has been failed - subject entries not found in the database\");\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// Handling SQL exception during Coupon removal from the database\n\t\t\tthrow new CouponSystemException(\"SQL error - Coupons removal has been failed\", e);\n\t\t} finally {\n\t\t\t// In any case we return connection to the Connection Pool (at least\n\t\t\t// we try to)\n\t\t\tConnectionPool.getInstance().returnConnection(con);\n\t\t}\n\t}", "public void clearDatabase() {\n\t\tstudentRepository.deleteAll();\n\t}", "public void deleteAll();", "public void clearProteges(){\n ActiveAndroid.execSQL(\"delete from proteges\");\n }", "@Override\n\tpublic void deleteAll() throws Exception {\n\t\topcionRepository.deleteAll();\n\t}", "public void delete(Company company) {\r\n\t\tsessionFactory.getCurrentSession().delete(company);\r\n\t}", "private static void clearDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n clearTable(\"myRooms\");\n clearTable(\"myReservations\");\n }", "public void removeCustomerCoupon(Company company) throws DbException;", "private void clearAll(){\r\n List<FantasyMatch> allMatches = fmatchBean.findAll();\r\n for(FantasyMatch fm : allMatches){\r\n fmatchBean.remove(fm);\r\n }\r\n \r\n List<RosterPlayer> allRps= rpBean.findAll();\r\n for(RosterPlayer rp : allRps){\r\n rpBean.remove(rp);\r\n }\r\n \r\n List<FantasyTeam> allTeams = ftBean.findAll();\r\n for(FantasyTeam ft : allTeams){\r\n ftBean.remove(ft);\r\n }\r\n \r\n List<FantasyLeague> allLeagues = flBean.findAll();\r\n for(FantasyLeague fl : allLeagues){\r\n flBean.remove(fl);\r\n }\r\n \r\n List<FantasyUser> allUsers = fUserBean.findAll();\r\n for(FantasyUser fu : allUsers){\r\n fUserBean.remove(fu);\r\n }\r\n }", "public void deleteUpsos() {\n SQLiteDatabase db = this.getWritableDatabase();\n // Delete All Rows\n db.delete(TABLE_UPSO, null, null);\n db.close();\n\n Log.d(TAG, \"Deleted all upso info from sqlite\");\n }", "private void DropEverything() throws isisicatclient.IcatException_Exception {\n List<Object> allGroupsResults = port.search(sessionId, \"Grouping\");\r\n List tempGroups = allGroupsResults;\r\n List<EntityBaseBean> allGroups = (List<EntityBaseBean>) tempGroups;\r\n port.deleteMany(sessionId, allGroups);\r\n\r\n //Drop all rules\r\n List<Object> allRulesResults = port.search(sessionId, \"Rule\");\r\n List tempRules = allRulesResults;\r\n List<EntityBaseBean> allRules = (List<EntityBaseBean>) tempRules;\r\n port.deleteMany(sessionId, allRules);\r\n\r\n //Drop all public steps\r\n List<Object> allPublicStepResults = port.search(sessionId, \"PublicStep\");\r\n List tempPublicSteps = allPublicStepResults;\r\n List<EntityBaseBean> allPublicSteps = (List<EntityBaseBean>) tempPublicSteps;\r\n port.deleteMany(sessionId, allPublicSteps);\r\n }", "public void clear()\n\t{\n\t\tmerchants.clear();\n dao.deleteRows(null);\n }", "public boolean deleteAllAgencies() {\n\t\t\tint agency = db.delete(AGENCIES_TABLE, KEY_ROWID, null);\n\t\t\tint stops = db.delete(STOPS_TABLE, KEY_STOPID, null);\n\t\t\treturn (agency + stops > 0);\n\t\t}", "@BeforeEach\n @AfterEach\n public void clearDatabase() {\n \taddressRepository.deleteAll();\n \tcartRepository.deleteAll();\n \tuserRepository.deleteAll();\n }", "void unsetHasAuditingCompany();", "@Override\n\tpublic void delete(Oglas oglas) {\n\t\trepository.delete(oglas);\n\t}", "public void delete() {\r\n\t\tfor (int i = 0; i <= DatabaseUniverse.getDatabaseNumber(); i++) {\r\n\t\t\tif (this.equals(DatabaseUniverse.getDatabases(i))) {\r\n\t\t\t\tDatabaseUniverse.getAllDatabases().set(i, null);\r\n\t\t\t\tDatabaseUniverse.getAllDatabases().remove(i);\r\n\t\t\t\tDatabaseUniverse.setDatabaseNumber(-1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void deleteAll() {\n new Thread(new DeleteAllRunnable(dao)).start();\n }", "public void clearAll() {\n if (orderId != null) {\n BouquetOrder order = orderDAO.get(orderId);\n order.getBouquets().clear();\n orderDAO.update(order);\n sendMessage(orderId);\n }\n }", "public void deleteAllRequests() {\n try {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, null, null);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_NAME);\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public static void eliminarTodasLasBasesDeCalculoCptos() {\n\t\tnew Delete().from(BaseCalculoConcepto.class).execute();\n\t}", "public void clearAggroList()\n\t{\n\t\tgetAggroList().clear();\n\t}", "public void deleteAll(){\n SQLiteDatabase db = this.getWritableDatabase();\n db.execSQL(\"delete from \" + TABLE_NAME);\n }" ]
[ "0.6713644", "0.65321314", "0.6186571", "0.61785007", "0.60985965", "0.6017859", "0.598704", "0.5981224", "0.5960998", "0.5920135", "0.5905444", "0.587489", "0.584951", "0.5829308", "0.5810083", "0.58081526", "0.5805905", "0.5803876", "0.5793794", "0.57819724", "0.57749325", "0.5748553", "0.5744778", "0.5714829", "0.5710365", "0.5710365", "0.5710365", "0.5710365", "0.5708135", "0.57005847", "0.56965595", "0.5694802", "0.5683195", "0.5683195", "0.5683195", "0.567365", "0.5658268", "0.5654795", "0.56322265", "0.5630088", "0.5629332", "0.56186825", "0.56082654", "0.5607951", "0.56063724", "0.56058013", "0.5593468", "0.55934334", "0.55934334", "0.55934334", "0.55932796", "0.55918944", "0.5585872", "0.5582496", "0.5579899", "0.5572354", "0.5569463", "0.5569463", "0.5569463", "0.5569463", "0.5569463", "0.5569463", "0.5569463", "0.5569463", "0.555605", "0.55457795", "0.5535132", "0.5534734", "0.5533174", "0.5530138", "0.5530138", "0.5516045", "0.5516045", "0.5516045", "0.5511988", "0.5511863", "0.5507523", "0.5493709", "0.548224", "0.5481372", "0.54658276", "0.5462917", "0.5461105", "0.5459369", "0.5459024", "0.5452284", "0.5445203", "0.54352534", "0.543421", "0.54296416", "0.5405067", "0.54024243", "0.5389922", "0.53869295", "0.53849494", "0.5384424", "0.5372163", "0.53707016", "0.5364858", "0.5364053" ]
0.68133265
0
Returns the number of company ags.
public int countAll() throws SystemException { Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, this); if (count == null) { Session session = null; try { session = openSession(); Query q = session.createQuery(_SQL_COUNT_COMPANYAG); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, count); closeSession(session); } } return count.intValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int totalCompanies(){\n\treturn companyEmpWageArray.size();\n }", "public int getCompaniesCount() {\n return companies_.size();\n }", "@Override\n\tpublic int countCompany() {\n\t\treturn comShortMapper.selectCountShort()+elegantMapper.selectCountEle()+honorMapper.selectCountHonor();\n\t}", "public int getCompaniesCount() {\n if (companiesBuilder_ == null) {\n return companies_.size();\n } else {\n return companiesBuilder_.getCount();\n }\n }", "int getAoisCount();", "private String companies() {\r\n\t\tint num=tile.getCompaniesNum();\r\n\t\tString out=\"Total Companies: \"+num;\r\n\t\treturn out;\r\n\t}", "public long employeesCount(String companyShortName);", "int getEducationsCount();", "public int countByc_g(long groupId, long companyId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "int countByCompanyId(int companyId);", "int getContactCount();", "public int countByCompanyId(long companyId);", "public int countByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;", "public int getAoisCount() {\n if (aoisBuilder_ == null) {\n return aois_.size();\n } else {\n return aoisBuilder_.getCount();\n }\n }", "int getContactAddressCount();", "public String getCount() {\r\n \t\r\n \tBoolean anyAges = Boolean.FALSE;\r\n \tBoolean anyAssayTypes = Boolean.FALSE;\r\n \tint count = 0;\r\n \t\r\n \tfor (String age: ages) {\r\n \t\tif (age.endsWith(\"ANY\")) {\r\n \t\t\tanyAges = Boolean.TRUE;\r\n \t\t}\r\n \t}\r\n \t\r\n \tfor (String type: assayTypes) {\r\n \t\tif (type.equals(\"ANY\")) {\r\n \t\t\tanyAssayTypes = Boolean.TRUE;\r\n \t\t}\r\n \t}\r\n \t\r\n \t// No Restrictions on Ages or AssayTypes, count everything\r\n \tif (anyAssayTypes && anyAges) {\r\n \tcount = record.getPairs().size(); \t\t\r\n \t}\r\n \t\r\n \t// There are restrictions on ages only, iterate and count appropriately.\r\n \t\r\n \telse if (anyAssayTypes) {\r\n \t\tfor (GxdLitAssayTypeAgePair pair: record.getPairs()) {\r\n \t\t\tfor (String age: ages) {\r\n \t\t\t\tif (pair.getAge().equals(age)) {\r\n \t\t\t\t\tcount ++;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \t// There are restrictions on assayTypes only, iterate and count appropriately.\r\n \t\r\n \telse if (anyAges) {\r\n \t\tfor (GxdLitAssayTypeAgePair pair: record.getPairs()) {\r\n \t\t\tfor (String type: assayTypes) {\r\n \t\t\t\tif (pair.getAssayType().equals(type)) {\r\n \t\t\t\t\tcount ++;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \telse {\r\n \t\tfor (GxdLitAssayTypeAgePair pair: record.getPairs()) {\r\n \t\t\tfor (String type: assayTypes) {\r\n \t\t\t\tfor (String age: ages) {\r\n \t\t\t\t\tif (pair.getAssayType().equals(type) && pair.getAge().equals(age)) {\r\n \t\t\t\t\t\tcount ++;\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}\r\n\r\n \treturn \"\" + count;\r\n \t\r\n }", "int getCazuriCount();", "public int countAll() throws SystemException {\n\t\tLong count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,\n\t\t\t\tFINDER_ARGS_EMPTY, this);\n\n\t\tif (count == null) {\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(_SQL_COUNT_CONTACTCOMPANYAG);\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (count == null) {\n\t\t\t\t\tcount = Long.valueOf(0);\n\t\t\t\t}\n\n\t\t\t\tFinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,\n\t\t\t\t\tFINDER_ARGS_EMPTY, count);\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}", "public int getNumGruppoPacchetti();", "@Override\n\tpublic Integer getAllComBorrowingsCount() {\n\t\treturn comBorrowingsMapper.countByExample(new ComBorrowingsExample());\n\t}", "int getAcksCount();", "int getAcksCount();", "public int countEmployees(String g) {\n\t}", "public int getCazuriCount() {\n if (cazuriBuilder_ == null) {\n return cazuri_.size();\n } else {\n return cazuriBuilder_.getCount();\n }\n }", "int getCountForConditionCompany(Long companyId);", "public int getAoisCount() {\n return aois_.size();\n }", "int getUserQuestJobsCount();", "public int getCount() {\n\t\t\tcantidadGrupos = extras.getInt(\"cantidadGrupos\");\n\t\t\treturn cantidadGrupos;\n\t\t}", "public abstract int getNumberOfCages();", "public static int getNoOfHospitals(){\n return noOfHospitals;\n }", "int getPersonInfoCount();", "public int getContactCount() {\n if (contactBuilder_ == null) {\n return contact_.size();\n } else {\n return contactBuilder_.getCount();\n }\n }", "int getNumberOfCavalry();", "public Long getAssociatedPricingPlanCount() {\n return this.associatedPricingPlanCount;\n }", "int getAchieveInfoCount();", "public int countByCompanyAgId(String companyAgId) throws SystemException {\n\t\tObject[] finderArgs = new Object[] { companyAgId };\n\n\t\tLong count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYAGID,\n\t\t\t\tfinderArgs, this);\n\n\t\tif (count == null) {\n\t\t\tStringBundler query = new StringBundler(2);\n\n\t\t\tquery.append(_SQL_COUNT_CONTACTCOMPANYAG_WHERE);\n\n\t\t\tif (companyAgId == null) {\n\t\t\t\tquery.append(_FINDER_COLUMN_COMPANYAGID_COMPANYAGID_1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (companyAgId.equals(StringPool.BLANK)) {\n\t\t\t\t\tquery.append(_FINDER_COLUMN_COMPANYAGID_COMPANYAGID_3);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tquery.append(_FINDER_COLUMN_COMPANYAGID_COMPANYAGID_2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString sql = query.toString();\n\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tQuery q = session.createQuery(sql);\n\n\t\t\t\tQueryPos qPos = QueryPos.getInstance(q);\n\n\t\t\t\tif (companyAgId != null) {\n\t\t\t\t\tqPos.add(companyAgId);\n\t\t\t\t}\n\n\t\t\t\tcount = (Long)q.uniqueResult();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (count == null) {\n\t\t\t\t\tcount = Long.valueOf(0);\n\t\t\t\t}\n\n\t\t\t\tFinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYAGID,\n\t\t\t\t\tfinderArgs, count);\n\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn count.intValue();\n\t}", "int getDeliveriesCount();", "public int getTotalContacts() {\n\t\treturn DataAccessUtils.intResult(hibernateTemplate\n\t\t\t\t.find(\"SELECT COUNT(*) FROM L7ServiceConfig\"));\n\t}", "public int getContactCount() {\n return contact_.size();\n }", "public Integer getNumOfCarbons() {\n return numOfCarbons;\n }", "private int numeroCuentas() {\r\n\t\tint cuentasCreadas = 0;\r\n\t\tfor (Cuenta cuenta : this.cuentas) {\r\n\t\t\tif (cuenta != null) {\r\n\t\t\t\tcuentasCreadas++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cuentasCreadas;\r\n\t}", "int getServiceAccountsCount();", "int getServicesCount();", "int getServicesCount();", "public int getCazuriCount() {\n return cazuri_.size();\n }", "int getJobsCount();", "int getJobsCount();", "int getJobsCount();", "int getContactListCount();", "int getContactListCount();", "int getContactListCount();", "int getContactListCount();", "int numberOfContracts() {\n return policy.numberOfContracts();\n }", "public int NumOfGames()\n\t{\n\t\treturn gametype.length;\n\t}", "int getPhoneCount();", "int getPhoneCount();", "int getPriceCount();", "int getGroupCount();", "int getExperiencesCount();", "@Override\r\n\tpublic int carpoollistCount(Criteria cri) throws Exception {\n\t\treturn adminDAO.carpoollistCount(cri);\r\n\t}", "public int getBadgeCount()\n\t{\n\t\tint result = 0;\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tif(m_badges[i] == 1)\n\t\t\t\tresult++;\n\t\treturn result;\n\t}", "private int getNumberOfAccounts()\n {\n ProtocolProviderFactory factory =\n DictAccRegWizzActivator.getDictProtocolProviderFactory();\n\n return factory.getRegisteredAccounts().size();\n }", "int getNumOfBuyOrders();", "public java.lang.Integer getCompany() {\n\treturn company;\n}", "public static int getNumberOfGuppiesBorn() {\n return numberOfGuppiesBorn;\n }", "public int obtenerNumeroFacturas(){\n return historialFacturas.size();\n }", "public int getContactAddressCount() {\n if (contactAddressBuilder_ == null) {\n return contactAddress_.size();\n } else {\n return contactAddressBuilder_.getCount();\n }\n }", "public int get_count();", "public int countByUuid_C(String uuid, long companyId);", "public int countByUuid_C(String uuid, long companyId);", "public int countByUuid_C(String uuid, long companyId);", "@Override\n public int getBanking_organizationsCount() throws SystemException {\n return banking_organizationPersistence.countAll();\n }", "int getAchievementsCount();", "int getCustomersCount();", "int getApplicationsCount();", "public int getContactAddressCount() {\n return contactAddress_.size();\n }", "public int cantidadGastos() {\n\t\treturn this.devolverTodosGastos().size();\n\t}", "int sizeOfBusinessIndustryLicensesArray();", "public java.lang.String getCompanyAgId() {\n\t\treturn _imageCompanyAg.getCompanyAgId();\n\t}", "int countByExample(CGcontractCreditExample example);", "public int getGears();", "public int getGoalsCount() {\n if (goalsBuilder_ == null) {\n return goals_.size();\n } else {\n return goalsBuilder_.getCount();\n }\n }", "public int getAgentsCount() {\n if (agentsBuilder_ == null) {\n return agents_.size();\n } else {\n return agentsBuilder_.getCount();\n }\n }", "public int numberOfOpenSites() {\n return count;\n }", "public int getAvailNumComps(){\n return this.mFarm.getAvailNumComps();\n }", "public int numContacts();", "public String getBulletinCount(String companyId) {\n\t\tlong count = 0;\n\t\tSession session = getSession();\n\t\tString hql = \"select count(id) from AuctionBulletin a \" +\n\t\t\t\"where a.deleteFlag=0 and a.companyId=:companyId \";\n\t\tcount = Long.parseLong(session.createQuery(hql).setString(\"companyId\", companyId)\n\t\t\t\t.uniqueResult().toString());\n\t\tsession.close();\n\t\treturn \"\" + count;\n\t}", "public int getTotalbuildings() {\n\t\treturn totalbuildings;\n\t}", "public int getNumCars() {\r\n\t\treturn (numCars + numSmallCars);\r\n\t}", "public int contactAmount()\n\t{\n\t\treturn contacts.size();\n\t}", "int getNumberOfArtillery();", "int getHotelImageURLsCount();", "public int getNumComps(){\n return this.mFarm.getNumComps();\n }", "public int countByUuid_C(java.lang.String uuid, long companyId);", "int getFundsCount();", "int getFundsCount();", "public int numberOfOpenSites() {\n \treturn num;\r\n }", "public int getPriceCount() {\n if (priceBuilder_ == null) {\n return price_.size();\n } else {\n return priceBuilder_.getCount();\n }\n }", "private int getGoodsCount(GoodsType type) {\n return colony.getGoodsCount(type);\n }", "public int getNumberofAns()\n\t{\n\t\treturn numAns;\t\n\t}" ]
[ "0.70838404", "0.6844639", "0.6781592", "0.6727177", "0.65181464", "0.63261366", "0.6298601", "0.62255096", "0.6216474", "0.61900204", "0.6168079", "0.61649686", "0.612751", "0.6080621", "0.60523283", "0.6045281", "0.60341066", "0.6032531", "0.5996286", "0.5980171", "0.5936619", "0.5936619", "0.5930449", "0.592121", "0.58959806", "0.58577937", "0.58458555", "0.584155", "0.5833402", "0.5815669", "0.5804684", "0.58028084", "0.57990456", "0.5774656", "0.5759391", "0.5748498", "0.5733476", "0.5722668", "0.5719894", "0.57131135", "0.57110524", "0.56998336", "0.5693087", "0.5693087", "0.56809515", "0.5670726", "0.5670726", "0.5670726", "0.56639105", "0.56639105", "0.56639105", "0.56639105", "0.56637645", "0.5662583", "0.5639616", "0.5639616", "0.5636214", "0.5632435", "0.5625418", "0.5624422", "0.56200993", "0.561071", "0.5587571", "0.5583755", "0.5583619", "0.55817646", "0.55773073", "0.5576603", "0.55763084", "0.55763084", "0.55763084", "0.5575758", "0.557365", "0.55677915", "0.5565188", "0.55626315", "0.5560237", "0.5554028", "0.5549611", "0.55486584", "0.5543447", "0.55375016", "0.55339813", "0.553048", "0.55268955", "0.552382", "0.55131066", "0.55112576", "0.5510062", "0.5503496", "0.54835755", "0.54735774", "0.54608434", "0.545584", "0.54551005", "0.54551005", "0.54514694", "0.54428613", "0.54427946", "0.54359305" ]
0.5999108
18
Initializes the company ag persistence.
public void afterPropertiesSet() { String[] listenerClassNames = StringUtil.split(GetterUtil.getString( com.liferay.util.service.ServiceProps.get( "value.object.listener.com.agbar.intranet.quienesquien.model.CompanyAg"))); if (listenerClassNames.length > 0) { try { List<ModelListener<CompanyAg>> listenersList = new ArrayList<ModelListener<CompanyAg>>(); for (String listenerClassName : listenerClassNames) { listenersList.add((ModelListener<CompanyAg>)InstanceFactory.newInstance( listenerClassName)); } listeners = listenersList.toArray(new ModelListener[listenersList.size()]); } catch (Exception e) { _log.error(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected CompanyJPA() {\n\t}", "public void initDatabase() {\n Datastore mongoDataStore = DatabaseHandler.getInstance().getMongoDataStore();\n initUsers();\n initAccounts();\n mongoDataStore.save(users);\n }", "public void initPersistence (){\n\t\tif (!this._onAppInit){\n\t\t\t/*\n\t\t\t * Evita stackoverflow\n\t\t\t */\n\t\t\tcloseActiveStoreData ();\n\t\t}\n\t\tsetDatastoreProperties ();\n\t\tfinal Properties properties = this._dataStoreEnvironment.getDataStoreProperties ();\n\t\tfinal PersistenceManagerFactory pmf =\n\t\t\t\t\t JDOHelper.getPersistenceManagerFactory(properties);\n\t\t\n//\t\tSystem.out.println (\"Setting persistent manager from \"+properties);\n\t\t\n\t\tthis.pm = pmf.getPersistenceManager();\n\t\t\n\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\tthis.pm.currentTransaction().commit();\n\t\t}\n\t\tthis.pm.currentTransaction().setOptimistic (false);\n//\t\tthis.pm.currentTransaction().begin();\n\t}", "private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}", "public void init() {\n\t\tM_log.info(\"initialization...\");\n\t\t\n\t\t// register as an entity producer\n\t\tm_entityManager.registerEntityProducer(this, SakaiGCalendarServiceStaticVariables.REFERENCE_ROOT);\n\t\t\n\t\t// register functions\n\t\tfunctionManager.registerFunction(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW);\n\t\tfunctionManager.registerFunction(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_VIEW_ALL);\n\t\tfunctionManager.registerFunction(SakaiGCalendarServiceStaticVariables.SECURE_GCAL_EDIT);\n\t\t\n \t\t//Setup cache. This will create a cache using the default configuration used in the memory service.\n \t\tcache = memoryService.newCache(CACHE_NAME);\n\t}", "@Override\n protected void doInit() {\n getLogger().finer(\"Initialization of CompanyListServerResource.\");\n\n // Initialize the persistence layer.\n companyPersistence = PersistenceService.getCompanyPersistence();\n\n getLogger().finer(\"Initialization of CompanyListServerResource ended.\");\n }", "abstract void initPersistance();", "private static void init() {\n\t\tif (factory == null) {\n\t\t\tfactory = Persistence.createEntityManagerFactory(\"hibernatePersistenceUnit\");\n\t\t}\n\t\tif (em == null) {\n\t\t\tem = factory.createEntityManager();\n\t\t}\n\t}", "@Before\n\tpublic void init()\n\t{\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"persistenceUnit\");\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\tcacheManager = new CacheManagerDefaultImpl();\n\t\t((CacheManagerDefaultImpl) cacheManager).setEntityManager(entityManager);\n\t}", "@PostConstruct\r\n public void init() {\n File database = new File(applicationProps.getGeodb());\r\n try {\r\n reader = new DatabaseReader.Builder(database).withCache(new CHMCache()).build();\r\n } catch (IOException e) {\r\n log.error(\"Error reading maxmind DB, \", e);\r\n }\r\n }", "public CompanyData() {\r\n }", "public void initializeOnCreation() \n\t\t\t\tthrows PersistenceException{\n\n\t}", "private CompanyManager() {}", "private static void init(){\n entityManager = HibernateUtil.getEntityManager();\n transaction = entityManager.getTransaction();\n }", "EMInitializer() {\r\n try {\r\n emf = Persistence.createEntityManagerFactory(\"pl.polsl_MatchStatist\"\r\n + \"icsWeb_war_4.0-SNAPSHOTPU\");\r\n em = emf.createEntityManager();\r\n } catch (Exception e) {\r\n em = null;\r\n emf = null;\r\n }\r\n\r\n }", "public static void initialize() {\r\n\t\tif (!connectionByProjectIdMap.isEmpty()) {\r\n\t\t\tcloseAllMsiDb();\r\n\t\t\tconnectionByProjectIdMap.clear();\r\n\t\t}\r\n\t\tif (udsDbConnection != null) {\r\n\t\t\tinitializeUdsDb();\r\n\t\t}\r\n\t}", "private void initDB() {\n dataBaseHelper = new DataBaseHelper(this);\n }", "protected void entityInit() {}", "public void initializeOnInstantiation() \n\t\t\t\tthrows PersistenceException{\n\n\t}", "public AddressDaoImpl()\n {\n \t//Initialise the related Object stores\n \n }", "public AirlineCompany() {\n\t}", "@PostConstruct\n\tpublic void init() {\n\t\tvisitaSelecionada = new AgendamentoVisitas();\n\n\t}", "private void initData() {\n Author steinbeck = new Author(\"John\", \"Steinbeck\");\n Publisher p1 = new Publisher(\"Covici Friede\", \"111 Main Street\", \"Santa Cruz\", \"CA\", \"95034\");\n Book omam = new Book(\"Of Mice And Men\", \"11234\", p1);\n \n publisherRepository.save(p1);\n\n steinbeck.getBooks().add(omam);\n omam.getAuthors().add(steinbeck);\n authorRepository.save(steinbeck);\n bookRepository.save(omam);\n\n // Create Crime & Punishment\n Author a2 = new Author(\"Fyodor\", \"Dostoevsky\");\n Publisher p2 = new Publisher( \"The Russian Messenger\", \"303 Stazysky Rao\", \"Rustovia\", \"OAL\", \"00933434-3943\");\n Book b2 = new Book(\"Crime and Punishment\", \"22334\", p2);\n a2.getBooks().add(b2);\n b2.getAuthors().add(a2);\n\n publisherRepository.save(p2);\n authorRepository.save(a2);\n bookRepository.save(b2);\n }", "public void initiate() {\n\t\tallDepartments.put(HRDepartment.class.getSimpleName(), HRDepartment.getInstance());\n\t\tallDepartments.put(ProductionDepartment.class.getSimpleName(), ProductionDepartment.getInstance());\n\t\tallDepartments.put(WarehousingDepartment.class.getSimpleName(), WarehousingDepartment.getInstance());\n\t\tallDepartments.put(FinanceDepartment.class.getSimpleName(), FinanceDepartment.getInstance());\n\t\tallDepartments.put(MarketingDepartment.class.getSimpleName(), MarketingDepartment.getInstance());\n\t\tallDepartments.put(LogisticsDepartment.class.getSimpleName(), LogisticsDepartment.getInstance());\n\t\tallDepartments.put(ProcurementDepartment.class.getSimpleName(), ProcurementDepartment.getInstance());\n\t\tallDepartments.put(ResearchAndDevelopmentDepartment.class.getSimpleName(), ResearchAndDevelopmentDepartment.getInstance());\n\t\tallDepartments.put(SalesDepartment.class.getSimpleName(), SalesDepartment.getInstance());\n\n\t\tcustomerSatisfaction = CustomerSatisfaction.getInstance();\n\t\tcustomerDemand = CustomerDemand.getInstance();\n\t\texternalEvents = ExternalEvents.getInstance();\n\t\tcompanyEcoIndex = CompanyEcoIndex.getInstance();\n\t\tinternalFleet = InternalFleet.getInstance();\n\t\tbankingSystem = BankingSystem.getInstance();\n\t\tproductSupport = ProductSupport.getInstance();\n\t\temployeeGenerator = EmployeeGenerator.getInstance();\n\t\temployeeGenerator.setDepartment((HRDepartment) allDepartments.get(HRDepartment.class.getSimpleName()));\n\t}", "private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}", "@Before\n\tpublic void initialize() {\n\t\tCategory category= new Category();// = SAMPLE_CATEGORY1;\n\t\tcategory.setCategoryName(SAMPLE_CATEGORY1.getCategoryName());\n\t\tcategory.setCompanyReferenceNumber(SAMPLE_COMPANY.getCompanyReferenceNumber());\n\t\tcomServ.saveOrUpdate(SAMPLE_COMPANY);\n\t\tcatServ.saveOrUpdate(category);\n\t\tappServ.saveOrUpdate(SAMPLE_APPLICATION1);\n\t\t\n\t}", "public Persistence() {\n\t\tconn = dbConnection();\n\t}", "@PostConstruct\r\n\tpublic void init(){\r\n\t\tcom = new Comentarios();\r\n\t\tlistComentarios = comDao.getComentarios();\r\n\t}", "private void init(){\n if(solicitudEnviadaDAO == null){\n solicitudEnviadaDAO = new SolicitudEnviadaDAO(getApplicationContext());\n }\n if(solicitudRecibidaDAO == null){\n solicitudRecibidaDAO = new SolicitudRecibidaDAO(getApplicationContext());\n }\n if(solicitudContestadaDAO == null){\n solicitudContestadaDAO = new SolicitudContestadaDAO(getApplicationContext());\n }\n if(preguntaEnviadaDAO == null){\n preguntaEnviadaDAO = new PreguntaEnviadaDAO(getApplicationContext());\n }\n if(preguntaRecibidaDAO == null){\n preguntaRecibidaDAO = new PreguntaRecibidaDAO(getApplicationContext());\n }\n if(preguntaContestadaDAO == null){\n preguntaContestadaDAO = new PreguntaContestadaDAO(getApplicationContext());\n }\n if(puntuacionRecibidaDAO == null){\n puntuacionRecibidaDAO = new PuntuacionRecibidaDAO(getApplicationContext());\n }\n }", "public void init() {\n\t\tTypedQuery<Personne> query = em.createQuery(\"SELECT p FROM Personne p\", Personne.class);\n\t\tList<Personne> clients = query.getResultList();\n\t\tif (clients.size()==0) {\n\t\t\tSqlUtils.executeFile(\"exemple.sql\", em);\n\t\t}\n\t}", "public static void init(){\n\t\t\n\t\tif(!daoRol.existeRol(cliente.getNombre()))daoRol.save(cliente);\n\t\t\n\t\tif(!daoRol.existeRol(analista.getNombre()))daoRol.save(analista);\n\t\t\n\t\tif(!daoUsuario.existeUsuario(admin.getEmail(), admin.getMd5()))daoUsuario.save(admin);\n\t\t\n\t\t\n\t\tfor(TipoAccionPublicitaria t : TipoAccionPublicitaria.values()){\n\t\t\t\n\t\t\tif(daoPrecio.getCurrentPriceOf(t) == null){\n\t\t\t\tPrecioAccionPublicitaria p = new PrecioAccionPublicitaria();\n\t\t\t\tp.setCurrent(true);\n\t\t\t\tp.setFechaCreacion(DateTime.now());\n\t\t\t\tp.setMonto(\"0\");\n\t\t\t\tp.setObjetoValuable(t);\n\t\t\t\t\n\t\t\t\tdaoPrecio.save(p);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void initDatabase(){\n CovidOpener cpHelper = new CovidOpener(this);\n cdb = cpHelper.getWritableDatabase();\n }", "private static void initializeDatabase() {\n\t\tArrayList<String> data = DatabaseHandler.readDatabase(DATABASE_NAME);\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\trecords = serializer.deserialize(data);\n\t}", "public ApplicationUserBoImpl()\n {\n \t//Initialise the related Object stores\n \n }", "public Company() {\r\n\t\tsuper();\r\n\t}", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n entitymanager = DBConnection.getEntityManger();\n this.loadCombos();\n this.loadTime();\n this.setLocations();\n }", "public BeansCompany() {\n\t\tsuper();\n\t}", "@PostConstruct\r\n public void init() {\r\n all.addAll(allFromDB());\r\n Collections.sort(all);\r\n }", "private synchronized void initAtomStore() {\n if (atomStore != null) {\n return;\n }\n\n atomStore = new PersistedAtomStore(this);\n }", "public Company() {\n\t\tsuper();\n\t}", "public OWLAnonymousIndividualHGDB()\r\n\t{\r\n\r\n\t}", "public AccommodationPledgeServiceImpl()\n {\n \t//Initialise the related Object stores\n \n }", "public void bootstrap() {\n EntityManager em = CONNECTION_FACTORY.getConnection();\n List<CaixaItemTipo> cits = new ArrayList<>();\n cits.add(CaixaItemTipo.LANCAMENTO_MANUAL);\n cits.add(CaixaItemTipo.DOCUMENTO);\n cits.add(CaixaItemTipo.ESTORNO);\n cits.add(CaixaItemTipo.TROCO);\n \n cits.add(CaixaItemTipo.SUPRIMENTO);\n cits.add(CaixaItemTipo.SANGRIA);\n \n cits.add(CaixaItemTipo.CONTA_PROGRAMADA);\n //cits.add(CaixaItemTipo.PAGAMENTO_DOCUMENTO); 2019-06-10 generalizado com tipo 2\n cits.add(CaixaItemTipo.TRANSFERENCIA);\n \n cits.add(CaixaItemTipo.FUNCIONARIO);\n \n \n em.getTransaction().begin();\n for(CaixaItemTipo cit : cits){\n if(findById(cit.getId()) == null){\n em.persist(cit);\n } else {\n em.merge(cit);\n }\n }\n em.getTransaction().commit();\n\n em.close();\n }", "public static void SetupORM(Connection con) {\n // Add all ORM models here\n User.Initialize(con);\n Milestone.Initialize(con);\n Planner.Initialize(con);\n }", "@BeforeEach\n void init() {\n\n EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"pu\");\n employeeDao = new EmployeeDao(entityManagerFactory);\n\n\n }", "public BOEmpresa() {\r\n\t\tdaoEmpresa = new DAOEmpresaJPA();\r\n\t}", "public PostalCodeDataBase()\n {\n codeToCityMap = new HashMap<String, Set<String>>();\n // additional instance variable(s) to be initialized in part (b)\n }", "public CompanyDirectory() {\r\n\t\tcompanyDirectory = new LinkedListRecursive<Company>();\r\n\t}", "private void init() {\r\n final List<VCSystem> vcs = datastore.createQuery(VCSystem.class)\r\n .field(\"url\").equal(Parameter.getInstance().getUrl())\r\n .asList();\r\n if (vcs.size() != 1) {\r\n logger.error(\"Found: \" + vcs.size() + \" instances of VCSystem. Expected 1 instance.\");\r\n System.exit(-1);\r\n }\r\n vcSystem = vcs.get(0);\r\n\r\n project = datastore.getByKey(Project.class, new Key<Project>(Project.class, \"project\", vcSystem.getProjectId()));\r\n\r\n }", "@PostConstruct\n protected void init() {\n // Look up the associated batch data\n job = batchService.findByInstanceId(jobContext.getInstanceId());\n }", "public EpAssetsDAOImpl() {\n super();\n }", "public void initializeGraphDB(AuditLog auditLog) throws OpenLineageException {\n this.auditLog = auditLog;\n try {\n graphFactory = new GraphFactory();\n graphFactory.openGraph(connectionProperties.getConnectorType().getConnectorProviderClassName(),\n connectionProperties.getConfigurationProperties(), auditLog);\n this.helper = new LineageGraphConnectorHelper(graphFactory, graphFactory.isSupportingTransactions());\n\n } catch (JanusConnectorException error) {\n log.error(THE_LINEAGE_GRAPH_COULD_NOT_BE_INITIALIZED_DUE_TO_AN_ERROR, error);\n throw new OpenLineageException(500, error.getReportingClassName(), error.getReportingActionDescription(),\n error.getReportedErrorMessage(), error.getReportedSystemAction(), error.getReportedUserAction());\n }\n }", "protected void init()\n {\n Timestamp now = new Timestamp(System.currentTimeMillis());\n timestampCreated = now;\n timestampModified = now;\n createdByAgent = AppContextMgr.getInstance() == null? null : (AppContextMgr.getInstance().hasContext() ? Agent.getUserAgent() : null);\n modifiedByAgent = null;\n }", "@PostConstruct\r\n\tpublic void init(){\r\n\t\tconta = new Conta();\r\n\t\tservice = new ContaService();\r\n\t\tconta.setDataAbertura(Calendar.getInstance());\r\n\t}", "public Session(){\n\t\tdb = ALiteOrmBuilder.getInstance().openWritableDatabase();\n\t\texternalsCallbacks = new ArrayList<EntityListener>();\n\t}", "public void beginInitialization() {\n SQLiteDatabase db = this.helper.getWritableDatabase();\n db.beginTransaction();\n populateMeasurementVersionsCache(db);\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 MongoManager()\n\t{\n\t\ttry\n\t\t{\n\t\t/*\tmorphia = new Morphia();\n\t\t\tclient = new MongoClient();\n\t\t\tmorphia.mapPackage(\"com.glenwood.kernai.data.entity\");\n\t\t\tdatastore = morphia.createDatastore(client, \"Kernai\");\n\t\t\tdatastore.ensureIndexes();\n\t\t*/\t\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\tthrow ex;\n\t\t}\n\t\n\t}", "@Before\n public void initTest() {\n AccountCapsule ownerAccountFirstCapsule =\n new AccountCapsule(\n ByteString.copyFromUtf8(ACCOUNT_NAME_FIRST),\n ByteString.copyFrom(ByteArray.fromHexString(OWNER_ADDRESS_FIRST)),\n AccountType.Normal,\n 10000_000_000L);\n AccountCapsule ownerAccountSecondCapsule =\n new AccountCapsule(\n ByteString.copyFromUtf8(ACCOUNT_NAME_SECOND),\n ByteString.copyFrom(ByteArray.fromHexString(OWNER_ADDRESS_SECOND)),\n AccountType.Normal,\n 20000_000_000L);\n\n dbManager.getAccountStore()\n .put(ownerAccountFirstCapsule.getAddress().toByteArray(), ownerAccountFirstCapsule);\n dbManager.getAccountStore()\n .put(ownerAccountSecondCapsule.getAddress().toByteArray(), ownerAccountSecondCapsule);\n\n dbManager.getDynamicPropertiesStore().saveLatestBlockHeaderTimestamp(1000000);\n dbManager.getDynamicPropertiesStore().saveLatestBlockHeaderNumber(10);\n dbManager.getDynamicPropertiesStore().saveNextMaintenanceTime(2000000);\n }", "public LocalResidenciaColaborador() {\n //ORM\n }", "@Override\n\tpublic void contextInitialized(ServletContextEvent arg0) {\n\t\temf = Persistence.createEntityManagerFactory(\"CACIC2018\");\n\t}", "@Before\n\tpublic void init() {\n\t\tthis.acccountMock = new AccountDTO();\n\t\tthis.acccountMock.setId(ACCOUNT_ID);\n\t\tthis.acccountMock.setActive(true);\n\t\tthis.acccountMock.setBankingTransactions(new ArrayList<>());\n\n\t}", "@Override\n public void initialize()\n {\n super.initialize();\n log.info(\"Initialize \" + name);\n Map<String, Collection<?>> beans;\n generator = service.getRandomSeedRepo().\n getRandomSeed(\"EvSocialClass-\" + name, 1, \"initialize\");\n\n Config.recycle();\n config = Config.getInstance();\n config.configure(service.getServerConfiguration());\n\n beans = config.getBeans();\n unpackBeans(beans);\n\n // Create and set up the customer instances\n evCustomers = new ArrayList<EvCustomer>();\n if (null == customerAttributeList) {\n // boot session - dynamic configuration\n configureForBoot(beans);\n }\n else {\n // sim session - restore from boot record\n configureForSim(beans);\n }\n }", "public ManagementCompany() {\r\n\t\tthis.name = \"\";\r\n\t\tthis.taxID = \"\";\r\n\t\tthis.mgmFeePer = 0;\r\n\t\tthis.plot.setX(0);\r\n\t\tthis.plot = new Plot();\r\n\t\tproperties = new Property[MAX_PROPERTY];\r\n\t}", "@PostConstruct\n public void init() {\n entradas = entradaFacadeLocal.findAll();\n salidas = salidaFacadeLocal.findAll();\n inventarios = inventarioFacadeLocal.leerTodos();\n }", "private void initDB() {\n dataBaseHelper = new DataBaseHelper(getActivity());\n }", "public void initAfterUnpersistence() {\n //From a legacy bundle\n if (sources == null) {\n sources = Misc.newList(getName());\n }\n super.initAfterUnpersistence();\n openData();\n }", "public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }", "public static void init(File envHome) throws DatabaseException {\n try {\n //noinspection ResultOfMethodCallIgnored\n envHome.mkdirs();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n /* Open a transactional Berkeley DB engine environment. */\n EnvironmentConfig envConfig = new EnvironmentConfig();\n envConfig.setAllowCreate(true);\n// envConfig.setTransactional(true);\n env = new Environment(envHome, envConfig);\n\n /* Open a transactional entity store. */\n StoreConfig storeConfig = new StoreConfig();\n storeConfig.setAllowCreate(true);\n// storeConfig.setTransactional(true);\n store = new EntityStore(env, \"CrawlerStore\", storeConfig);\n\n /* Initialize the data access object. */\n userAccessor = new UserAccessor(store);\n documentAccessor = new DocumentAccessor(store);\n }", "public void initialize()\r\n\t{\r\n\t\tdatabaseHandler = DatabaseHandler.getInstance();\r\n\t\tfillPatientsTable();\r\n\t}", "public CineplexManager() {\n\t\tif (records == null)\n\t\t\tinitializeDatabase();\n\t}", "private void initialize()\n {\n if (null!=cc)\n {\n throw new RuntimeException(\"CorpusServiceI has been initialized already\");\n }\n dataDir = mAdapter.getCommunicator().getProperties().getProperty(\"CVAC.DataDir\");\n logger.log(Level.FINE, \"CorpusService found CVAC.DataDir={0}\", dataDir);\n logger.setLevel(Level.FINEST);\n CorpusI.rootDataDir = dataDir;\n cc = new CorpusConfig();\n corpToImp = new HashMap<String, CorpusI>();\n logger.log(Level.INFO, \"CorpusService initialized\" );\n }", "@Before\n public void initDb() {\n mDatabase = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getContext(),\n ToDoDatabase.class).build();\n }", "@PostConstruct\r\n public void init() {\n this.logs = this.logDAO.findAllExamCaseLog();\r\n }", "private void hibernateInitialize(Solicitud solicitud) {\n// Hibernate.initialize(solicitud);\n// Hibernate.initialize(solicitud.getEstudiante());\n// Hibernate.initialize(solicitud.getEstudiante().getPersona());\n// Hibernate.initialize(solicitud.getEstudiante().getPersona().getTipoDocumento());\n// Hibernate.initialize(solicitud.getEstudiante().getHorario_disponible());\n// Hibernate.initialize(solicitud.getEstudiante().getHorario_disponible().getDias_disponibles());\n// Hibernate.initialize(solicitud.getEstudiante().getEstudiante().getInformacion_Academica());\n// Hibernate.initialize(solicitud.getEstudiante().getEstudiante().getPrograma().getNombre());\n// Hibernate.initialize(solicitud.getMonitoria_solicitada());\n// Hibernate.initialize(solicitud.getMonitoria_solicitada().getCurso());\n// Collection<MonitoriaAceptada> monitorias = solicitud.getMonitorias();\n// for (Iterator<MonitoriaAceptada> it = monitorias.iterator(); it.hasNext();) {\n// MonitoriaAceptada monitoria = it.next();\n// Hibernate.initialize(monitoria);\n// Hibernate.initialize(monitoria.getSeccion());\n// }\n// Collection<MonitoriaRealizada> monitoriasRealizadas = solicitud.getEstudiante().getMonitoriasRealizadas();\n// Hibernate.initialize(monitoriasRealizadas);\n// for (MonitoriaRealizada monitoriaRealizada : monitoriasRealizadas) {\n// Hibernate.initialize(monitoriaRealizada);\n// }\n// Hibernate.initialize(solicitud.getResponsablePreseleccion());\n\n }", "@PostConstruct\r\n\tpublic void init() {\n\t\tstockService.create(new Stock(\"PROD 1\", BigDecimal.ONE));\r\n\t\tstockService.create(new Stock(\"PROD 2\", BigDecimal.TEN));\r\n\t\tstockService.create(new Stock(\"PROD 3\", new BigDecimal(12.123)));\r\n\t}", "public void initialize() {\n this.loadBidDetails();\n }", "private void initialize() throws InstantiationException, IllegalAccessException, ClassNotFoundException {\n\t\tuserCatalog = CatalogoUsuarios.getInstance();\n\t\tcontactDAO = AdaptadorContacto.getInstance();\n\t\tmessageDAO = AdaptadorMensajes.getInstance();\n\t}", "public SPManager() {\n \tmyCon = new DBManager();\n }", "@PostConstruct\r\n\tpublic void initDb() {\n\r\n\t\tSystem.out.println(\"End init\");\r\n\t}", "public AlManageOnAirDAOImpl() {\r\n super();\r\n }", "@Before\n\tpublic void init() {\n\t\tprofesseurServiceEmp = new ProfesseurServiceEmp();\n\t}", "private void initialisation()\n\t{\n\t\tdaoFactory = new DaoFactory();\n\n\t\ttry\n\t\t{\n\t\t\tequationStandardSessions = EquationCommonContext.getContext().getGlobalProcessingEquationStandardSessions(\n\t\t\t\t\t\t\tsession.getSessionIdentifier());\n\t\t}\n\t\tcatch (Exception eQException)\n\t\t{\n\t\t\tif (LOG.isErrorEnabled())\n\t\t\t{\n\t\t\t\tStringBuilder message = new StringBuilder(\"There is a problem creating Global processing the sessions\");\n\t\t\t\tLOG.error(message.toString(), eQException);\n\t\t\t}\n\t\t}\n\t}", "@PostConstruct\n public void initPool() {\n SpringHelper.setApplicationContext(applicationContext);\n if (!initialized) {\n try {\n final File configDirectory = ConfigDirectory.setupTestEnvironement(\"OGCRestTest\");\n final File dataDirectory2 = new File(configDirectory, \"dataCsw2\");\n dataDirectory2.mkdir();\n\n try {\n serviceBusiness.delete(\"csw\", \"default\");\n serviceBusiness.delete(\"csw\", \"intern\");\n } catch (ConfigurationException ex) {}\n\n final Automatic config2 = new Automatic(\"filesystem\", dataDirectory2.getPath());\n config2.putParameter(\"shiroAccessible\", \"false\");\n serviceBusiness.create(\"csw\", \"default\", config2, null);\n\n writeProvider(\"meta1.xml\", \"42292_5p_19900609195600\");\n\n Automatic configuration = new Automatic(\"internal\", (String)null);\n configuration.putParameter(\"shiroAccessible\", \"false\");\n serviceBusiness.create(\"csw\", \"intern\", configuration, null);\n\n initServer(null, null, \"api\");\n pool = GenericDatabaseMarshallerPool.getInstance();\n initialized = true;\n } catch (Exception ex) {\n Logger.getLogger(OGCRestTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "protected void commonInit() {\r\n dataBinder = new DBTreeDataBinder(this);\r\n }", "@PostConstruct\n\tprivate void init() {\n\t\tEntrada entr = new Entrada(\n\t\t\t\tnew Persona(\"Manuel\",\"Jimenex\",\"52422\",\"100000\",\"Cra 340\"),\n\t\t\t\t(new PreFactura(1l,new Date())), itemsService.lista());\n\t\t\n\t\tlistaEntrada.add(entr);\n\t}", "static void init() {\n\t\tuserDatabase = new HashMap<String, User>();\n\t}", "public void init() {\r\n\t\tdbVersion = new DBVersion( getDefaultDatabase(), progress, upgradeFile.versionTableName, upgradeFile.logTableName );\r\n\t}", "@SuppressWarnings(\"LawOfDemeter\")\n public AccessoryBO() throws PersistenceException {\n this.dao = DAOFactory.getDAOFactory().getAccessoryDAO();\n }", "@PostConstruct\n public void init() {\n ColorDao colorDao = new ColorDao();\n colores = colorDao.consultarColores();\n }", "private void initObjects() {\n inputValidation = new InputValidation(activity);\n databaseHelper = new DatabaseHelper(activity);\n user = new User();\n }", "public static void initRepository() {\n deserialize();\n if (flightRepository == null) {\n flightRepository = new FlightRepository();\n }\n }", "protected void initializationAfterValidation() {\n ordersEntity = null;\n priceOrder = 0;\n }", "public ZyCorporationDAOImpl() {\r\n super();\r\n }", "private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }", "@Override\n\t@Transactional\n\n\tpublic void initCinemas() {\n\t\tvilleRepository.findAll().forEach(v->{\n\t\t\tStream.of(\"Megarama\",\"Pathé\",\"UGC\",\"MK2\").forEach(c->{\n\t\t\t\tCinema cinema=new Cinema();\n\t\t\t\tcinema.setName(c);\n\t\t\t\tcinema.setNombreSalles(3+(int) (Math.random()*7));\n\t\t\t\tcinema.setVille(v);\n\t\t\t\t\n\t\t\t cinemaRepository.save(cinema);\t\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t});\n\t}", "private void initialize()\n {\n aggregatedFields = new Fields(fieldToAggregator.keySet());\n }", "public Database() {\n if (init) {\n\n //creating Transaction data\n Transaction transactionOne\n = new Transaction(1, \"Debit\", \"Spar Grocery\", 54.68,1);\n\n transactionDB.add(transactionOne);\n\n // Creating an Account data\n Account accountOne = new Account(1, 445, 111111111, \"Savings\",\n 1250.24, transactionDB);\n\n accountDB.add(accountOne);\n\n //creating withdrawal data\n Withdrawal withdrawalOne = new Withdrawal(1, 64422545, 600.89);\n withdrawalDB.add(withdrawalOne);\n\n //creating transfer data\n Transfer transferOne = new Transfer(1, 25252525, 521.23);\n transferDB.add(transferOne);\n\n //creating lodgement data\n Lodgement lodgementOne = new Lodgement(1, 67766666, 521.23);\n lodgementDB.add(lodgementOne);\n\n //add Customer data \n Customer customerOne\n = new Customer(1, \"Darth Vader\", \"[email protected]\",\n \"Level 5, Suit Dark\", \"darkSideIsGoodStuff\",\n accountDB, withdrawalDB, transferDB, lodgementDB);\n\n customerDB.add(customerOne);\n\n init = false;\n }\n }", "public ArAgingDetailReportDAO () {}", "protected void initializeInstances() {\n if (mUser == null) {\n mUser = new User(getApplicationContext());\n }\n if (mUserCache == null) {\n mUserCache = new UserCache();\n }\n if(mGlobalGroupContainer == null) {\n mGlobalGroupContainer = new GroupContainer(getApplicationContext());\n }\n if(mGlobalHistoryContainer == null) {\n mGlobalHistoryContainer = new HistoryContainer(getApplicationContext());\n }\n\n if(mGlobalContactContainer == null) {\n mGlobalContactContainer = new ContactContainer(getApplicationContext());\n mGlobalContactContainer.setContactSortKey(Contact.UserSortKey.USER_FIRST_NAME);\n }\n }", "private void initialData() {\n\n// if (MorphiaObject.datastore.createQuery(SecurityRole.class).countAll() == 0) {\n// for (final String roleName : Arrays\n// .asList(controllers.Application.USER_ROLE)) {\n// final SecurityRole role = new SecurityRole();\n// role.roleName = roleName;\n// MorphiaObject.datastore.save(role);\n// }\n// }\n }" ]
[ "0.64312047", "0.6290116", "0.6268548", "0.6232273", "0.6196737", "0.6188251", "0.617316", "0.6144306", "0.6124721", "0.6035713", "0.6025726", "0.6016273", "0.60160875", "0.5984907", "0.5966531", "0.5949992", "0.59432393", "0.5931909", "0.592774", "0.5872215", "0.58436877", "0.58310616", "0.58306307", "0.58206517", "0.58099216", "0.580917", "0.5801631", "0.57974696", "0.5785913", "0.57755345", "0.575953", "0.5758244", "0.57385117", "0.57222474", "0.5715873", "0.5708784", "0.5694607", "0.5687101", "0.56769097", "0.5673177", "0.56704843", "0.5660514", "0.5658652", "0.56443584", "0.56300503", "0.5620049", "0.56184596", "0.5600951", "0.56004375", "0.55915093", "0.55642027", "0.5557536", "0.5553982", "0.5553546", "0.5551581", "0.55502355", "0.5534674", "0.55292416", "0.5528642", "0.5527642", "0.5517242", "0.5515842", "0.5512978", "0.5511493", "0.5484535", "0.5478253", "0.54778844", "0.54759616", "0.5474623", "0.5471516", "0.5469412", "0.5464634", "0.5464606", "0.54641193", "0.5463698", "0.5452731", "0.5452212", "0.5448254", "0.5437178", "0.5408694", "0.5404564", "0.54026043", "0.5401264", "0.5398587", "0.5388252", "0.53864706", "0.5381657", "0.5381206", "0.53720987", "0.5370331", "0.5369385", "0.5366695", "0.5364641", "0.536373", "0.5350083", "0.53444064", "0.53442144", "0.53437066", "0.5343223", "0.5339588", "0.5336952" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner scan = new Scanner(System.in); int people = scan.nextInt(); long[] memo = new long[people+1]; long ret = Handshake_memo(people, memo); System.out.println("Handshake_memo " + ret + " cnt " + cnt); cnt = 0; HashMap<Integer, Long> mem = new HashMap<Integer, Long>(); long result = Handshake(people, mem); System.out.println("Handshake_hashmap " + result + " cnt " + cnt); cnt = 0; /* before = System.currentTimeMillis(); long result = Handshake(people, mem); after = System.currentTimeMillis(); System.out.println(result + " time " + (after-before) + " cnt " + cnt); cnt = 0; System.out.println("_____________________________"); before = System.currentTimeMillis(); long result1 = Handshaking(people); after = System.currentTimeMillis(); System.out.println(result1 + " time " + (after-before) + " cnt " + cnt);*/ long result1 = Handshaking(people); System.out.println("Handshake normal "+ result1 + " cnt " + cnt); cnt = 0; long result2 = handShaking_DP(people); System.out.println("DP "+ result2 + " cnt " + cnt); scan.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Gets LineReference by Id
public LineReference convert(String element){ Long oid = Long.parseLong( element ); //Long oid = Long.parseLong( (String) element ); LineReference linereference = servicelinereference.findByOid(oid); return linereference; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BossBarLine getLine(UUID id) {\n\t\tfor (BossBarLine line : getLines().values()) {\n\t\t\tif (line.getUuid() == id) return line;\n\t\t}\n\t\treturn null;\n\t}", "LineItem getLineItemById(Integer lineItemId);", "LineReferenceType getLineReference();", "public String getLineId() {\n return lineId;\n }", "public CartLine get(int id);", "@Override\n public LineEntity findOne(Long id) throws IllegalArgumentException {\n return null;\n }", "public void setLineId(String line_id)\r\n {\r\n this.line_id = line_id;\r\n }", "public Number getLineId() {\n return (Number) getAttributeInternal(LINEID);\n }", "@Override\r\n\tpublic Newstrategypojo getline(int id) {\n\t\treturn dao.getline(id);\r\n\t}", "public static Line CreateLine(String id) { return new MyLine(id); }", "public Number getLineId() {\n return (Number)getAttributeInternal(LINEID);\n }", "public Number getLineId() {\n return (Number)getAttributeInternal(LINEID);\n }", "public SupplierSettlementLine getLine(long objectId, long lineId) throws CoreException {\n try (Response response = clientApi.get(SUPPLIER_SETTLEMENTS + objectId + LINES + lineId, null)) {\n return (SupplierSettlementLine) readResponse(response, SupplierSettlementLine.class);\n }\n }", "private LineJPA findStopEntryById(Long id) {\n LineJPA lineResult = lineRepository.findOne(id);\n return lineResult;\n }", "ReferenceData findById(ReferenceDataId id) throws DataException;", "@Override\n\tpublic FDCartLineI getOrderLineById(int parseInt) {\n\t\treturn null;\n\t}", "public String getReferenceId();", "public Line getLine(String targetLine);", "public int getLineID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LINEID$2, 0);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "@GetMapping(\"/invoice-lines/{id}\")\n public ResponseEntity<InvoiceLinesDTO> getInvoiceLines(@PathVariable Long id) {\n log.debug(\"REST request to get InvoiceLines : {}\", id);\n Optional<InvoiceLinesDTO> invoiceLinesDTO = invoiceLinesService.findOne(id);\n return ResponseUtil.wrapOrNotFound(invoiceLinesDTO);\n }", "@Override\n public LineEntity find(Long id) throws ObjectNotFoundUserException {\n return null;\n }", "public void setLineId(String lineId) {\n this.lineId = lineId == null ? null : lineId.trim();\n }", "public abstract ArrayList<T> findFromReference(int id);", "public org.apache.xmlbeans.XmlInt xgetLineID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(LINEID$2, 0);\n return target;\n }\n }", "public AssetRef retrieveRef(Long id) throws IOException, SQLException {\n String select = \"select definition_id, name, ref from ASSET_REF where definition_id = ?\";\n try (Connection conn = getDbConnection();\n PreparedStatement stmt = conn.prepareStatement(select)) {\n stmt.setLong(1, id);\n try (ResultSet rs = stmt.executeQuery()) {\n if (rs.next()) {\n return new AssetRef(rs.getString(\"name\"), id, rs.getString(\"ref\"));\n }\n }\n }\n return null;\n }", "@Override\n\tpublic CentreVisite getId(Long id) {\n\t\treturn CR.getOne(id);\n\t}", "public java.util.List<ReferenceLine> getReferenceLines() {\n return referenceLines;\n }", "public int getC_OrderLine_ID();", "public void xsetLineID(org.apache.xmlbeans.XmlInt lineID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(LINEID$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(LINEID$2);\n }\n target.set(lineID);\n }\n }", "public Line getLine ()\r\n {\r\n if (line == null) {\r\n computeLine();\r\n }\r\n\r\n return line;\r\n }", "@Override\n public PurchaseOrderLine getOrderLine(int index) {\n return orderLines.get(index);\n }", "public String getReferenceId() {\n return refid;\n }", "public void setLineId(Number value) {\n setAttributeInternal(LINEID, value);\n }", "public void setLineId(Number value) {\n setAttributeInternal(LINEID, value);\n }", "public void setLineId(Number value) {\n setAttributeInternal(LINEID, value);\n }", "@Nullable\n public Diff.Line getLineInHunk(int hunkIdx, int lineOfHunk) {\n AtomicLong out = new AtomicLong();\n int e = jniGetLineInHunk(out, getRawPointer(), hunkIdx, lineOfHunk);\n if (ENOTFOUND.getCode() == e) {\n return null;\n }\n Error.throwIfNeeded(e);\n return new Diff.Line(out.get());\n }", "public Line getLine()\n {\n return line;\n }", "List<LineItem> listLineItemByOrderId(Integer orderId);", "public String getTaskLineId() {\n return taskLineId;\n }", "public List<PurchaseOrderLine> findByOrderId(String orderId);", "public int lineNum() {\n return myId.lineNum();\n }", "@JsonIgnore\r\n public String getReferenceId() {\r\n return OptionalNullable.getFrom(referenceId);\r\n }", "public int getLBR_DocLine_Details_ID();", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Line)) {\n return false;\n }\n Line other = (Line) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public Plot getPlotRef(final String id) {\n return Identifiable.getIdentifiable(id, getPlotList());\n }", "public SupplierSettlementLineList queryLines(long objectId, RequestParams params) throws CoreException {\n try (Response response = clientApi.get(\"supplier-settlement/\" + objectId + \"/lines\", params)) {\n return (SupplierSettlementLineList) readResponse(response, SupplierSettlementLineList.class);\n }\n }", "public static MInOutLine[] getOfOrderLine (Ctx ctx, \n\t\tint C_OrderLine_ID, String where, Trx trx)\n\t{\n\t\tArrayList<MInOutLine> list = new ArrayList<MInOutLine>();\n\t\tString sql = \"SELECT * FROM M_InOutLine WHERE C_OrderLine_ID=?\";\n\t\tif (where != null && where.length() > 0)\n\t\t\tsql += \" AND \" + where;\n\t\tPreparedStatement pstmt = null;\n\t\ttry\n\t\t{\n\t\t\tpstmt = DB.prepareStatement (sql, trx);\n\t\t\tpstmt.setInt (1, C_OrderLine_ID);\n\t\t\tResultSet rs = pstmt.executeQuery ();\n\t\t\twhile (rs.next ())\n\t\t\t\tlist.add(new MInOutLine(ctx, rs, trx));\n\t\t\trs.close ();\n\t\t\tpstmt.close ();\n\t\t\tpstmt = null;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\ts_log.log(Level.SEVERE, sql, e);\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif (pstmt != null)\n\t\t\t\tpstmt.close ();\n\t\t\tpstmt = null;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tpstmt = null;\n\t\t}\n\t\tMInOutLine[] retValue = new MInOutLine[list.size ()];\n\t\tlist.toArray (retValue);\n\t\treturn retValue;\n\t}", "RelationshipRecord relLoadLight( long id );", "public java.util.List<java.lang.Integer> getDependLineIDList()\n {\n final class DependLineIDList extends java.util.AbstractList<java.lang.Integer>\n {\n public java.lang.Integer get(int i)\n { return OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i); }\n \n public java.lang.Integer set(int i, java.lang.Integer o)\n {\n java.lang.Integer old = OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.setDependLineIDArray(i, o);\n return old;\n }\n \n public void add(int i, java.lang.Integer o)\n { OOSOrderLineItemTypeImpl.this.insertDependLineID(i, o); }\n \n public java.lang.Integer remove(int i)\n {\n java.lang.Integer old = OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.removeDependLineID(i);\n return old;\n }\n \n public int size()\n { return OOSOrderLineItemTypeImpl.this.sizeOfDependLineIDArray(); }\n \n }\n \n synchronized (monitor())\n {\n check_orphaned();\n return new DependLineIDList();\n }\n }", "public void createLine(long id, SupplierSettlementLine line) throws CoreException {\n try (Response response = clientApi.post(SUPPLIER_SETTLEMENTS + id + \"/lines\", line)) {\n readResponse(response, String.class);\n // extract id from return location\n String locationUri = response.getHeaderString(\"Location\");\n Long lineId = Long.parseLong(locationUri.substring(locationUri.lastIndexOf(\"/\") + 1));\n line.setId(lineId);\n }\n }", "SmsCleanBagLine selectByPrimaryKey(String id);", "public E getReferenceId() {\n return referenceId;\n }", "public static TimeLine getById(String schema, Long timeline_id) {\r\n\r\n\t\tMultiSchemaHibernateUtil.beginTransaction(schema);\r\n\t\tTimeLine act = (TimeLine) MultiSchemaHibernateUtil.getSession(schema)\r\n\t\t\t\t.get(TimeLine.class, timeline_id);\r\n\r\n\t\tMultiSchemaHibernateUtil.commitAndCloseTransaction(schema);\r\n\r\n\t\treturn act;\r\n\r\n\t}", "public String getCustomLineItemId() {\n return this.customLineItemId;\n }", "int getLineID(Vector<Integer> lineIDs,Vector<Integer> lineDepIDs, Vector<String> lineCodes, String cellValue, int depID);", "public int getLBR_DocLine_ICMS_ID();", "PathHistory findOne(Long id);", "public String getIdString(CharSequence line) {\n\t\tList<String> values = parseCsvLine(line);\n\t\treturn values.get(id);\n\t}", "public LinkedList<Line> getTrack();", "public HitVertex getVertex(String id) {\n\t\treturn hitVertices.get(id);\n\t}", "public Readln(String id)\n {\n this.id = id;\n }", "public String getInternalLinkGotToReference(String id)\n {\n IDNode node = (IDNode)idReferences.get(id);\n return node.getInternalLinkGoToReference();\n }", "org.datacontract.schemas._2004._07.cdiscount_service_marketplace_api_external_contract_data_order.ExternalOrderLine getExternalOrderLineArray(int i);", "@Override\n public Line getLine() {\n return line;\n }", "@Override\n\tpublic FileModel getId(Long id) {\n\t\treturn fm.getOne(id);\n\t}", "@Override\r\n\tpublic MemberRefGd getMemberRef(String id) {\r\n\t\t//\r\n\r\n\t\treturn this.memberRefDgMap.getValue(id);\r\n\r\n\t}", "E getEdge(int id);", "public String getLine(int lineNumber) {\n if (list.size()>lineNumber)\n return list.get(lineNumber);\n else\n return null; // Requested line number outside range\n }", "@Override\n\tpublic ServiceFee getById(long id) {\n\t\treturn servicefeerepo.getOne(id);\n\t}", "@Override\n\tpublic ElementHistory getById(Long id) {\n\t\treturn elementHistoryRepository.findOne(id);\n\t}", "public MInOutLine getLine()\n\t{\n\t\tif (m_line == null)\n\t\t\tm_line = new MInOutLine (getCtx(), getM_InOutLine_ID(), get_TrxName());\n\t\treturn m_line;\n\t}", "@RequestMapping(value = \"/line/{lineId}/delete\", method = RequestMethod.GET)\n public void deleteLine(@PathVariable String lineId) {\n this.datasetService.deleteLine(lineId);\n }", "public String getSourceLine (int line);", "@Import(\"note\")\n\tint getLinkedNoteId();", "Object getRefid();", "public int getC_OrderLine_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_OrderLine_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public void setLineID(int lineID)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LINEID$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(LINEID$2);\n }\n target.setIntValue(lineID);\n }\n }", "public Client getClient(int Id) {\r\n\t\tfor (int i = 0; i < clients.length; i++) {\r\n\t\t\tClient currClient = clients[i];\r\n\t\t\tif (currClient != null && currClient.getId() == Id) {\r\n\t\t\t\treturn currClient;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static MInOutLine[] get (Ctx ctx, int C_OrderLine_ID, Trx trx)\n\t{\n\t\tArrayList<MInOutLine> list = new ArrayList<MInOutLine>();\n\t\tString sql = \"SELECT * FROM M_InOutLine WHERE C_OrderLine_ID=?\";\n\t\tPreparedStatement pstmt = null;\n\t\ttry\n\t\t{\n\t\t\tpstmt = DB.prepareStatement (sql, trx);\n\t\t\tpstmt.setInt (1, C_OrderLine_ID);\n\t\t\tResultSet rs = pstmt.executeQuery ();\n\t\t\twhile (rs.next ())\n\t\t\t\tlist.add(new MInOutLine(ctx, rs, trx));\n\t\t\trs.close ();\n\t\t\tpstmt.close ();\n\t\t\tpstmt = null;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\ts_log.log(Level.SEVERE, sql, e);\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif (pstmt != null)\n\t\t\t\tpstmt.close ();\n\t\t\tpstmt = null;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tpstmt = null;\n\t\t}\n\t\tMInOutLine[] retValue = new MInOutLine[list.size ()];\n\t\tlist.toArray (retValue);\n\t\treturn retValue;\n\t}", "public LineItem getLineItem(int index) {\n LineItem aLineItem = lineItems.get(index);\n return aLineItem;\n }", "public List<PurchaseOrderLine> findByLineTaxesId(String lineTaxesId);", "public OpenERPRecord get(int id) {\r\n\t\tIterator<OpenERPRecord> i = records.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tOpenERPRecord n = i.next();\r\n\t\t\tInteger rID = (Integer) n.get(\"id\"); // no class cast exception\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// expected here...\r\n\t\t\tif (rID == id)\r\n\t\t\t\treturn n;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n public List<LineEntity> findAll(Iterable<Long> ids) {\n return null;\n }", "public TarefaEntity GetTarefa(Integer idTarefa){\n \n\t\treturn this.entityManager.find(TarefaEntity.class, idTarefa);\n\t}", "@ApiModelProperty(value = \"Identifier for the product that is related to the referenced one\")\n public String getId() {\n return id;\n }", "public org.apache.xmlbeans.XmlInt addNewDependLineID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(DEPENDLINEID$26);\n return target;\n }\n }", "@Override\n\t@Transactional\n\tpublic Route getRoute(int theId) {\n\t\treturn routeDAO.getRoute(theId);\n\t}", "public void getBonuri(int id) {\n\t\tList<BonFiscal> bonuriClient = bonFiscalOperations.getAllBonuriFromClient(id);\n\t\tbonFiscalOperations.printListOfBonuri(bonuriClient);\n\t}", "private static File getLocalReference(MD5Key id) {\n \n \t\tFile lnkFile = getAssetLinkFile(id);\n \t\tif (!lnkFile.exists()) {\n \t\t\treturn null;\n \t\t}\n \t\ttry {\n \t\t\tList<String> refList = FileUtil.getLines(lnkFile);\n \n \t\t\tfor (String ref : refList) {\n \t\t\t\tFile refFile = new File(ref);\n \t\t\t\tif (refFile.exists()) {\n \t\t\t\t\treturn refFile;\n \t\t\t\t}\n \t\t\t}\n \n \t\t} catch (IOException ioe) {\n \t\t\t// Just so we know, but fall through to return null\n \t\t\tioe.printStackTrace();\n \t\t}\n \n \t\t// Guess we don't have one\n \t\treturn null;\n \t}", "public int getDependLineIDArray(int i)\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(DEPENDLINEID$26, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return target.getIntValue();\n }\n }", "public int getDecoratedLine (Node node);", "public org.apache.xmlbeans.XmlInt xgetDependLineIDArray(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlInt target = null;\n target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(DEPENDLINEID$26, i);\n if (target == null)\n {\n throw new IndexOutOfBoundsException();\n }\n return (org.apache.xmlbeans.XmlInt)target;\n }\n }", "List<Notification> getNotifications(String lineID);", "public static LogEntry getById ( final Long id ) {\n try {\n return getWhere( createCriterionAsList( ID, id ) ).get( 0 );\n }\n catch ( final Exception e ) {\n return null;\n }\n\n }", "public Integer getRefId() {\n return refId;\n }", "public Edge returnEdgeById(Id id){\n\t\tif(id.indice >= listOfEdges.size()) return null;\n\t\tEdge e = listOfEdges.elementAt(id.indice);\n\t\tif(e == null) return null;\n\t\tId eid = e.getId();\n\t\tif(eid.indice != id.indice || eid.unique != id.unique) return null; \n\t\treturn e;\n\t}", "public String getObjectByTimecuveIdAndDate(Long timecurveId, LocalDate refDate) {\n ObjectTimecurveRelation relation = relationRepository\n .findByTimecurveIdAndRefDate(timecurveId, refDate)\n .orElseThrow(() -> objectTimecurveRelationNotFound(null, timecurveId, refDate));\n return relation.getObjectId();\n }", "public OrderDetail getOrderDetail(final String id);", "public PDFGoTo getPDFGoTo(String id)\n {\n IDNode node=(IDNode)idReferences.get(id); \n return node.getInternalLinkGoTo();\n }", "public Timecurve getById(Long id) {\n return timecurveRepository.findById(id)\n .orElseThrow(() -> timecurveNotFound(id.toString()));\n\n }" ]
[ "0.6982023", "0.69027257", "0.68668664", "0.66537476", "0.64576966", "0.62632877", "0.62444484", "0.61898375", "0.61862874", "0.6142856", "0.6124804", "0.6124804", "0.60943156", "0.60672337", "0.6015586", "0.59654665", "0.5934109", "0.5866052", "0.5820093", "0.57472163", "0.56964517", "0.56377083", "0.56367713", "0.55643255", "0.55642945", "0.5533456", "0.5529693", "0.54845136", "0.54576", "0.540144", "0.5364117", "0.53591853", "0.5329947", "0.5329947", "0.5329947", "0.5326785", "0.53089756", "0.52662086", "0.5251553", "0.5235572", "0.51900625", "0.51603353", "0.51436967", "0.51377296", "0.51329005", "0.5131434", "0.51192725", "0.51162004", "0.51007116", "0.50928473", "0.5091266", "0.5080143", "0.5076633", "0.5072086", "0.5070683", "0.50705314", "0.50638396", "0.50558686", "0.50383806", "0.5036933", "0.5032337", "0.5030751", "0.5024044", "0.50171053", "0.500803", "0.4998783", "0.4990695", "0.49842522", "0.49588692", "0.49534005", "0.49515122", "0.4949826", "0.493329", "0.49216563", "0.4912944", "0.49118245", "0.48980182", "0.48979086", "0.48901775", "0.48893765", "0.48866847", "0.48753363", "0.4874791", "0.48736036", "0.48583204", "0.48548877", "0.48487112", "0.48481587", "0.48353705", "0.4835302", "0.48320276", "0.48319522", "0.48302743", "0.48288152", "0.48192418", "0.4819125", "0.48187506", "0.4814945", "0.4812489", "0.4808625" ]
0.61247736
12
Obtener todas las mascotas por especie
public LinkedList<PetReportBySpecieVO> getAllPetsBySpecie() { xcon = MySQLConnection.getInstance(); LinkedList<PetReportBySpecieVO> petList = new LinkedList<>(); try { PreparedStatement ps = xcon.getConnection().prepareCall("{call sp_getAllPetsBySpecie_Report}"); ResultSet rs = ps.executeQuery(); while(rs.next()) { PetReportBySpecieVO report = new PetReportBySpecieVO(); report.setCount(rs.getInt("amount")); report.setSpecie(rs.getString("PetSpecie")); petList.add(report); } } catch (SQLException e) { JOptionPane.showMessageDialog(null, "Query error" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } finally { xcon.close_connection(); } return petList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 Mascota[] getMascota(){\n return this.mascota;\n }", "public ArrayList<Mascota> getMascotas() {\n return mascotas;\n }", "public void Millas_M(){\r\n System.out.println(\"Cálcular Metros o Kilometros de Millas Marinas\");\r\n System.out.println(\"Ingrese un valor en Millas Marinas\");\r\n cadena =numero.next(); \r\n valor = metodo.Doble(cadena);\r\n valor = metodo.NegativoD(valor);\r\n totalM = valor * 1852 ;\r\n Millas_KM(totalM);\r\n }", "private void generarMarca() {\r\n\t\tthis.marca = MARCAS[(int) (Math.random() * MARCAS.length)];\r\n\t}", "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}", "public List<Double> getmasseslist(){return masses;}", "@GET\r\n public List<MarcaDetailDTO> getMarcas() {\r\n List<MarcaDetailDTO> listaMarcaes = listEntity2DetailDTO(marcaLogic.getMarcas());\r\n return listaMarcaes;\r\n }", "public void tipoDatos() {\n\t\tint num = 10;\n\t\t// Texto STring\n\t\tString cadena = \"cadena\";\n\n\t\t// Decimale O flotante\n\t\tdouble decimal = 12.16;\n\t\tfloat fl = new Float(10);\n\t\t// Bolean\n\t\tboolean bl = true;\n\n\t\t// ARREGLOS\n\t\t// string\n\t\tString[] veString = new String[5];\n\t\tveString[0] = \"hola mundo\";\n\t\tveString[1] = \"hola mundo\";\n\t\tveString[2] = \"hola mundo\";\n\t\tveString[3] = \"hola mundo\";\n\t\tveString[4] = \"hola mundo\";\n\n\t\tint[] varNum = new int[] { 0, 1, 2, 3, 4, 5 };\n\n\t}", "public void teclas() {\r\n\t\tif (app.key == '1') {\r\n\t\t\ttipoCom = 1;\r\n\t\t\tcaso1.clear();\r\n\t\t\tcaso2.clear();\r\n\t\t\tcaso3.clear();\r\n\t\t\tcaso4.clear();\r\n\t\t\tcaso1.addAll(persona);\r\n\t\t}\r\n\t\tif (app.key == '2') {\r\n\t\t\ttipoCom = 2;\r\n\t\t\tcaso1.clear();\r\n\t\t\tcaso2.clear();\r\n\t\t\tcaso3.clear();\r\n\t\t\tcaso4.clear();\r\n\t\t\tcaso2.addAll(persona);\r\n\t\t}\r\n\t\tif (app.key == '3') {\r\n\t\t\ttipoCom = 3;\r\n\t\t\tcaso1.clear();\r\n\t\t\tcaso2.clear();\r\n\t\t\tcaso3.clear();\r\n\t\t\tcaso4.clear();\r\n\t\t\tcaso3.addAll(persona);\r\n\t\t}\r\n\t\tif (app.key == '4') {\r\n\t\t\ttipoCom = 4;\r\n\t\t\tcaso1.clear();\r\n\t\t\tcaso2.clear();\r\n\t\t\tcaso3.clear();\r\n\t\t\tcaso4.clear();\r\n\t\t\tcaso4.addAll(persona);\r\n\t\t}\r\n\t}", "List<Pacote> buscarPorQtdDiasMaiorEPrecoMenor(int qtd, float preco);", "public static void main(String[] args) {\n\n\t\tMulta_Trafico mt1 = new Multa_Trafico(20, \"B\");\n\t\tmt1.setResponsable(\"Paco\");\n\t\tmt1.setDescripcion(\"Exceso de velocidad\");\n\t\tmt1.setMatricula(\"MK\");\n\t\tmt1.setFecha(\"Viernes\");\n\t\tmt1.verdatos();\n\n\t\tMulta_Covid mc2 = new Multa_Covid(10, \"C\");\n\t\tmc2.setResponsable(\"Pepa\");\n\t\tmc2.setDescripcion(\"No llevaba mascarilla\");\n\t\tmc2.setMascarilla(false);\n\t\tmc2.setFecha(\"Jueves\");\n\t\tmc2.verdatos();\n\n\t\t// Para saber de qué tipo es una clase, objeto, etc... con instanceof\n\t\t// Método saberTipo\n\n\t\tExpediente expe1 = new Expediente(10, \"A\");\n\t\tSystem.out.println(saberTipo(expe1));\n\t\tSystem.out.println(saberTipo(mt1));\n\t\tSystem.out.println(saberTipo(mc2));\n\n\t\tMulta m3 = new Multa(10, \"A\"); // variables del metodo ImporteMayor\n\t\tMulta m4 = new Multa(10, \"B\");\n\t\tm3.setDescripcion(\"Multa\");\n\t\tm3.setResponsable(\"Alberto\");\n\t\tm3.setImporte(200);\n\t\tm4.setImporte(2000);\n\n\t\tSystem.out.println(ImporteMayor(m3, m4));\n\t\tSystem.out.println(conocerTipo(m3));\n\t\tSystem.out.println(m3);\n\n\t\t// array de 50 posiciones para el método MultaMayor\n\n\t\tMulta multas[] = new Multa[50];\n\n\t\tfor (int i = 0; i < multas.length; i++) { // Relleno con descripción e importe\n\t\t\tmultas[i] = new Multa(i, \"A\");\n\t\t\tmultas[i].setDescripcion(\"Descripción\" + i);\n\t\t\tmultas[i].setImporte(Math.random() * 1000 + 25);\n\t\t}\n\t\tSystem.out.println(CalcularMayor(multas));\n\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 }", "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 }", "@Override\n\tpublic int manufacturando(int unidades) {\n\t\treturn unidades*this.getTiempoEstimadoParaProducirse();\n\t}", "public Marca[] getMarca(){\n return this.marca;\n }", "List<Matricula> listarMatriculas();", "public String Dime_datos_generales() {\n\t\t\n\t\treturn \"la plataforma del veiculo tiene \"+ rueda+\" ruedas\"+\n\t\t\"\\nmide \"+ largo/1000+\" metros con un ancho de \"+ancho+\n\t\t\"cm\"+\"\\nun peso de platafrorma de \"+peso;\n\t}", "public Mazzo(int numcarte) {\n this.numcarte = numcarte;\n\n //creo e dimensiono l'array \"mazzo\" dichiarato in precedenza\n mazzo = new Carta[numcarte];\n\n //qui dovrò creare tot carte ed inserirle nel mazzo\n String semicarta[] = {\"\", \"Picche\", \"Fiori\", \"Quadri\", \"Cuori\"};\n int valore = 1;\n int seme = 1;\n\n for (int i = 1; i <= numcarte; i++) {\n\n String nomicarta = valore + \" di \" + semicarta[seme];\n Carta carta = new Carta(valore, seme, nomicarta);\n mazzo[i - 1] = carta;\n valore++;\n\n //valore e semi correnti\n //se l'elemento corrente (i) è sulla decina (10, 20, 30, etc) resetto i valori e cambio il seme\n //ad esempio quando sono a 10 rimetto il valore ad 1 ed aumento di 1 il seme\n if (i % (numcarte / 4) == 0) {\n seme++;\n valore = 1;\n }\n\n }\n }", "public String[] ListarDPIMedicos(){\r\n int cantidad=0;\r\n Guardia s;\r\n for (int i = 0; i < medicosenfermeras.size(); i++) {\r\n s= medicosenfermeras.get(i);\r\n if (s instanceof Medico) {\r\n cantidad++;\r\n }\r\n }\r\n \r\n String[] DPIMedicos= new String[cantidad];\r\n Guardia t;\r\n int m=0;\r\n for (int i = 0; i < medicosenfermeras.size(); i++) {\r\n t=medicosenfermeras.get(i);\r\n if (t instanceof Medico) {\r\n DPIMedicos[m]=t.getNit();\r\n m++;\r\n }\r\n }\r\n \r\n return DPIMedicos;\r\n }", "public List<TonKho> findTonkhoByDmThuocMaso(Integer dmtMaso) {\n List<TonKho> result = null;\n try {\n Query q = getEm().createQuery(\"Select Distinct tk from TonKho tk Where tk.dmthuocMaso.dmthuocMaso = :dmthuocMaso \");\n q.setParameter(\"dmthuocMaso\", dmtMaso);\n result = q.getResultList();\n } catch (Exception ex) {\n System.out.println(\"Error: \" + ex.toString());\n }\n //System.out.println(\"End findTonkhoByDmThuocMaso(String dmtMa method\");\n return result;\n }", "protected void exibirMedicos(){\n System.out.println(\"--- MEDICOS CADASTRADOS ----\");\r\n String comando = \"select * from medico order by id\";\r\n ResultSet rs = cb.buscaDados(comando);\r\n try{\r\n while(rs.next()){\r\n int id = rs.getInt(\"id\");\r\n String nome = rs.getString(\"nome\");\r\n System.out.println(\"[\"+id+\"] \"+nome);\r\n }\r\n }\r\n catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "@WebMethod\n @WebResult(name = \"ResultadoObtenerMarcas\")\n public List<Marca> consultaObtenerMarcas() {\n logger.debug(\"consultaObtenerMarcas-Inicia\");\n\n List<Marca> marcas = new ArrayList<Marca>();\n try {\n marcas = administracionParametrosService.obtenerMarcas();\n } catch (Exception e1) {\n logger.error(\"obtenerFormula-Fin Error Exception:\" + e1.getMessage(), e1);\n \n }\n return marcas;\n }", "public void CambiarCartasCastillo() {\r\n\r\n\t\tint aux;\r\n\t\t// Asignamos el escudo del rey;\r\n\t\taux = (int) (Math.random() * 12) + 1;\r\n\t\tescudoRey = new Escudo(aux, Escudo.GrupoEscudo.rey);\r\n\t\t// Asignamos el escudo de la nobleza\r\n\t\taux = (int) (Math.random() * 12) + 1;\r\n\t\tescudoNobleza = new Escudo(aux, Escudo.GrupoEscudo.nobleza);\r\n\t\t// Asignamos el escudo del pueblo\r\n\t\taux = (int) (Math.random() * 6) + 1;\r\n\t\tescudoPueblo = new Escudo(aux, Escudo.GrupoEscudo.pueblo);\r\n\r\n\t}", "public List<VentaDet> generar(Periodo mes){\n\t\tString sql=ReplicationUtils.resolveSQL(mes,\"ALMACE\",\"ALMFECHA\")+\" AND ALMTIPO=\\'FAC\\' ORDER BY ALMSUCUR,ALMNUMER,ALMSERIE\";\r\n\t\tVentasDetMapper mapper=new VentasDetMapper();\r\n\t\tmapper.setBeanClass(getBeanClass());\r\n\t\tmapper.setOrigen(\"ALMACE\");\r\n\t\tmapper.setPropertyColumnMap(getPropertyColumnMap());\r\n\t\tList<VentaDet> rows=getFactory().getJdbcTemplate(mes).query(sql,mapper);\r\n\t\tlogger.info(\"VentaDet obtenidas : \"+rows.size());\r\n\t\treturn rows;\r\n\t}", "private void cargarRegistroMedicamentos() {\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/registro_medicamentos.zul\", \"REGISTRO DE MEDICAMENTOS\",\r\n\t\t\t\tparametros);\r\n\t}", "public String darPista() {\r\n\t\tString msj = \"\";\r\n\t\tboolean fin = false;\r\n\t\tfor (int i = 0; i < casillas.length && !fin; i++) {\r\n\t\t\tfor (int j = 0; j < casillas[0].length && !fin; j++) {\t\t\r\n\t\t\t\tif(casillas[i][j].esMina() == false && casillas[i][j].darValor() > 0) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tmsj += i+\",\"+j;\r\n\t\t\t\t\tfin = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn msj;\r\n\t}", "private static void printMas(int[] mas){\n for(int i = 0; i < mas.length; i++){\n System.out.println(\"mas[\"+i+\"] yra >>\" + mas[i]);\n }\n\n }", "public static void establecerMano(Monton todas,Mano[] jugadores){\n int pos;\n Pieza pieza;\n for (int i = 0; i < jugadores.length; i++) {\n for (int j = 0; j < Ajustes.PIEZAS_MANO; j++) {\n if(todas.getNPiezasMonton()>0){\n pos=(int) (Math.random()*todas.getNPiezasMonton());\n pieza=todas.getUnaPieza(pos);\n jugadores[i].setUnaPieza(pieza);\n todas.eliminarPiezaMonton(pieza); \n }\n \n }\n }\n System.out.println(\"\\nCada jugador tiene \"+jugadores[0].getNPiezas()+\" piezas.\");\n if(todas.getNPiezasMonton()!=0)\n System.out.println(\"Y en el monton quedan \"+todas.getNPiezasMonton());\n else\n System.out.println(\"No quedan piezas en el monton\");\n }", "public void mostrarEstadisticas(String promedio, int rechazados, String caracteristicas){\n System.out.println(\"El tiempo promedio es de: \" + promedio);\n System.out.println(\"La cantidad de carros rechazados es de: \" + rechazados);\n System.out.println(\"El modelo mas usado en parqueos es: \" + caracteristicas);\n }", "public void mixMazzo() {\n for (int i = 0; i < 2000; i++) {\n\n \n //pesco due numeri a caso da 0 a 39 e \n //scambio le due carte corrispondenti\n\n //scambio carte a caso\n //int caso1 = 22;\n //int caso2 = 34;\n int caso1 = (int) Math.floor(Math.random() * numcarte);\n int caso2 = (int) Math.floor(Math.random() * numcarte);\n\n //la 22 con la 34\n //prendo la 22 in mano e sposto la 34 al posto della 22\n //prendo la carta 22\n Carta cartainmano = mazzo[caso1];\n\n //metto la carta 34 al posto della 22\n mazzo[caso1] = mazzo[caso2];\n\n //metto la carta che ho in mano (22) al posto della 34\n mazzo[caso2] = cartainmano;\n\n //fine spostamento\n }\n\n}", "public void mostraDados() {\n System.out.println(\"O canal atual é: \" + tv.getCanal());\n System.out.println(\"O volume atual é: \" + tv.getVolume());\n System.out.println(\"--------------------------------------\");\n }", "public void enemigosCatacumba(){\n esq81 = new Esqueleto(1, 8, 400, 160, 30);\n esq82 = new Esqueleto(2, 8, 400, 160, 30);\n esq111 = new Esqueleto(1, 11, 800, 255, 50);\n esq112 = new Esqueleto(2, 11, 800, 255, 50);\n esq141 = new Esqueleto(1, 14, 1000, 265, 60);\n esq142 = new Esqueleto(2, 14, 1000, 265, 60);\n //\n zom81 = new Zombie(1, 8, 1000, 170, 40);\n zom82 = new Zombie(2, 8, 1000, 170, 40);\n zom111 = new Zombie(1, 11, 1300, 250, 50);\n zom112 = new Zombie(2, 11, 1300, 250, 50);\n zom141 = new Zombie(1, 14, 1700, 260, 60);\n zom142 = new Zombie(2, 14, 1700, 260, 60);\n //\n fana81 = new Fanatico(1, 8, 400, 190, 40);\n fana82 = new Fanatico(2, 8, 400, 190, 40);\n fana111 = new Fanatico(1, 11, 700, 250, 50);\n fana112 = new Fanatico(2, 11, 700, 250, 50);\n fana141 = new Fanatico(1, 14, 900, 260, 60);\n fana142 = new Fanatico(2, 14, 900, 260, 60);\n //\n mi81 = new Mimico(1, 8, 3, 1, 3000);\n mi111 = new Mimico(1, 11, 4, 1, 3000);\n mi141 = new Mimico(1, 14, 5, 1, 3200);\n }", "public Mazo()\n {\n cartasBaraja = new ArrayList<>();\n for(Palo paloActual: Palo.values()){ \n String palo = paloActual.toString().toLowerCase();\n for(int i = 1; i < 13; i ++){\n\n if(i > 7 && i < 10){\n i = 10;\n }\n Carta carta = new Carta(i, paloActual);\n cartasBaraja.add(carta);\n }\n }\n }", "public void Caracteristicas(){\n System.out.println(\"La resbaladilla tiene las siguientes caracteristicas: \");\r\n if (escaleras==true) {\r\n System.out.println(\"Tiene escaleras\");\r\n }else System.out.println(\"No tiene escaleras\");\r\n System.out.println(\"Esta hecho de \"+material);\r\n System.out.println(\"Tiene una altura de \"+altura);\r\n }", "private void cargarPreescripcionMedica() {\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(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(\"ocultaValor\", \"\");\r\n\t\tparametros.put(\"admision\", admision_seleccionada);\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false, \"/pages/receta_rips.zul\",\r\n\t\t\t\t\"PRESCRIPCION MEDICA\", parametros);\r\n\t}", "private void cargarNotasAclaratorias() {\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(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(\"tipo\", INotas.NOTAS_ACLARATORIAS);\r\n\t\ttabboxContendor\r\n\t\t\t\t.abrirPaginaTabDemanda(false, \"/pages/nota_aclaratoria.zul\",\r\n\t\t\t\t\t\t\"NOTAS ACLARATORIAS\", parametros);\r\n\t}", "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 MostrarDatos(){\n // En este caso, estamos mostrando la informacion necesaria del objeto\n // podemos acceder a la informacion de la persona y de su arreglo de Carros por medio de un recorrido\n System.out.println(\"Hola, me llamo \" + nombre);\n System.out.println(\"Tengo \" + contador + \" carros.\");\n for (int i = 0; i < contador; i++) {\n System.out.println(\"Tengo un carro marca: \" + carros[i].getMarca());\n System.out.println(\"El numero de placa es: \" + carros[i].getPlaca()); \n System.out.println(\"----------------------------------------------\");\n }\n }", "public String getMarca() {\n return Marca;\n }", "void datos(ConversionesCapsula c) {\n String v;\n\n\n v = d.readString(\"Selecciona opcion de conversion\"\n + \"\\n1 ingles a metrico\"\n + \"\\n2 metrico a ingles\"\n + \"\\n3 metrico a metrico\"\n + \"\\n4 ingles a ingles\");\n c.setopc((Integer.parseInt(v)));\n int opc = (int) conversion.getopc();\n switch (opc) {\n case 1:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Pies a metros\"\n + \"\\n2 Pies a centimetros\"\n + \"\\n3 Pies a Metros y Centimetros\"\n + \"\\n4 Pulgadas a metros\"\n + \"\\n5 Pulgadas a centimetros\"\n + \"\\n6 Pulgadas a Metros y Centimetros\"\n + \"\\n7 Pies y Pulgadas a metros\"\n + \"\\n8 Pies y Pulgadas a centimetros\"\n + \"\\n9 Pies y Pulgadas a Metros y Centimetros\");\n c.setopc1((Integer.parseInt(v)));\n\n\n break;\n case 2:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Metros a Pies\"\n + \"\\n2 Metros a Pulgadas\"\n + \"\\n3 Metros a Pies y Pulgadas\"\n + \"\\n4 Centimetros a Pies\"\n + \"\\n5 Centimetros a Pulgadas\"\n + \"\\n6 Centimetros a Pies y Pulgadas\"\n + \"\\n7 Metros y Centimetros a Pies\"\n + \"\\n8 Metros y Centimetros a Pulgadas\"\n + \"\\n9 Metros y Centimetros a Pies y Pulgadas\");\n c.setopc1((Integer.parseInt(v)));\n break;\n case 3:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Metros a Centimetros\"\n + \"\\n2 Metros a Metros y Centimetros\"\n + \"\\n3 Centimetros a Metros\"\n + \"\\n4 Centimetros a Metros y Centimetros\"\n + \"\\n5 Metros y Centimetros a Centimetros\"\n + \"\\n9 Metros y Centimetros a Metros\");\n c.setopc1((Integer.parseInt(v)));\n break;\n case 4:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Pies a Pulgadas\"\n + \"\\n2 Pies a Pies y Pulgadas\"\n + \"\\n3 Pulgadas a Pies\"\n + \"\\n4 Pulgadas a Pies y Pulgadas\"\n + \"\\n5 Pies y Pulgadas a Pies\"\n + \"\\n9 Pies y Pulgadas a Pulgadas\");\n c.setopc1((Integer.parseInt(v)));\n break;\n }\n\n do v = d.readString(\"\\n Ingrese el valor: \\n\");\n while (!isNum(v));\n c.setvalor((Double.parseDouble(v)));\n }", "private void getLactanciasMaternas() {\n mLactanciasMaternas = estudioAdapter.getListaLactanciaMaternasSinEnviar();\n //ca.close();\n }", "private static void calcularTotal(String[] campos) {\n\t\tif (campos.length == 1)\n\t\t\tSystem.out.println(\"TOTAL de lugares atribuidos: \" + gestor.totalAtribuidos());\n\t\telse {\n\t\t\tint escalao = Integer.valueOf(campos[1]);\n\t\t\tSystem.out.println(\"TOTAL de lugares atribuidos no escalao \" + escalao + \" : \" + gestor.atribuidosNoEscalao(escalao));\n\t\t}\n\t}", "private void calcularValorMano(Carta carta, int i) {\n\t\tSystem.out.println(\"El índice \"+i+\" tiene As?: \"+tieneAs[i]);\n\t\t// TODO Auto-generated method stub\n\t\tif (carta.getValor().equals(\"As\")) {\n\t\t\ttieneAs[i]++;\n\t\t\tSystem.out.println(\"Cambio el As de \"+i+\" a \"+tieneAs[i]);\n\t\t\tvalorManos[i]+=11;\n\t\t} else {\n\t\t\tif (carta.getValor().equals(\"J\") || carta.getValor().equals(\"Q\") || carta.getValor().equals(\"K\")) {\n\t\t\t\tvalorManos[i] += 10;\n\t\t\t} else {\n\t\t\t\tvalorManos[i] += Integer.parseInt(carta.getValor());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tint Ases = tieneAs[i];\n\t\tfor(int j=0;j<Ases;j++) {\n\t\t\tif(valorManos[i]>21) {\n\t\t\t\ttieneAs[i]--;\n\t\t\t\tSystem.out.println(\"Cambio el As de \"+i+\" a \"+tieneAs[i]);\n\t\t\t\tvalorManos[i]-=10;\n\t\t\t}\n\t\t}\n\t}", "public ResultSet MuestraMedicos() throws SQLException {\n\t\t\n\t\tString sql = \" SELECT * FROM medico \"; // sentencia busqueda cliente\n\t\ttry {\n\t\t\tconn = conexion.getConexion(); // nueva conexion a la bbdd CREARLO EN TODOS LOS METODOS\n\t\t\tst=(Statement) conn.createStatement();\n\t\t\tresultado = st.executeQuery(sql);\n\t\t\t/*\t\n\t\t\tst.close();\n\t\t\t\tconn.close();\n\t\t\t\t*/\n\t\t}\n\t\tcatch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn resultado;\n\t}", "public final void setMascota(Mascota[] m){\n this.mascota=m;\n }", "private void gerarLaudoPermanenciaMaior(MpmPrescricaoMedica prescricao,\r\n\t\t\tList<MpmLaudo> laudoList, FatConvenioSaudePlano convenioSaudePlano,\r\n\t\t\tAghParametros seqLaudoMaiorPermanencia) {\r\n\t\tMpmTipoLaudoConvenio tipoLaudoConvenio = this\r\n\t\t\t\t.getMpmTipoLaudoConvenioDAO()\r\n\t\t\t\t.obterTempoValidadeTipoLaudoPermanenciaMaior(\r\n\t\t\t\t\t\tseqLaudoMaiorPermanencia.getVlrNumerico().shortValue(),\r\n\t\t\t\t\t\tconvenioSaudePlano);\r\n\r\n\t\tif (tipoLaudoConvenio != null) {\r\n\r\n\t\t\tShort quantidadeDiasFaturamento = 0;\r\n\t\t\tShort diasPermanenciaMaior = 0;\r\n\r\n\t\t\tMpmTipoLaudo tipoLaudoMaiorPermanencia = this.getMpmTipoLaudoDAO()\r\n\t\t\t\t\t.obterPorChavePrimaria(\r\n\t\t\t\t\t\t\tseqLaudoMaiorPermanencia.getVlrNumerico()\r\n\t\t\t\t\t\t\t\t\t.shortValue());\r\n\r\n\t\t\tif (prescricao.getAtendimento().getInternacao() != null) {\r\n\t\t\t\tif (prescricao.getAtendimento()\r\n\t\t\t\t\t\t.getInternacao().getItemProcedimentoHospitalar() != null){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (prescricao.getAtendimento()\r\n\t\t\t\t\t.getInternacao().getItemProcedimentoHospitalar()\r\n\t\t\t\t\t.getQuantDiasFaturamento() != null){\r\n\t\t\t\t\t\tquantidadeDiasFaturamento = prescricao.getAtendimento()\r\n\t\t\t\t\t\t.getInternacao().getItemProcedimentoHospitalar()\r\n\t\t\t\t\t\t.getQuantDiasFaturamento();\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdiasPermanenciaMaior = prescricao.getAtendimento()\r\n\t\t\t\t\t.getInternacao().getItemProcedimentoHospitalar()\r\n\t\t\t\t\t.getDiasPermanenciaMaior();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (diasPermanenciaMaior == null || diasPermanenciaMaior > 0){\r\n\t\t\t\t\r\n\t\t\t\tInteger adicionalDias = 0;\r\n\t\t\t\tif (quantidadeDiasFaturamento != null) {\r\n\t\t\t\t\tadicionalDias = (quantidadeDiasFaturamento * 2) + 1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (DateUtil.validaDataTruncadaMaiorIgual(new Date(), DateUtil\r\n\t\t\t\t\t\t.adicionaDias(prescricao.getAtendimento().getInternacao()\r\n\t\t\t\t\t\t\t\t.getDthrInternacao(), adicionalDias))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (this.getMpmLaudoDAO()\r\n\t\t\t\t\t\t\t.obterCountLaudosPorTipoEAtendimento(\r\n\t\t\t\t\t\t\t\t\tprescricao.getAtendimento(),\r\n\t\t\t\t\t\t\t\t\ttipoLaudoMaiorPermanencia) <= 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tMpmLaudo laudo = new MpmLaudo();\r\n\t\t\t\t\t\tlaudo.setDthrInicioValidade(prescricao.getAtendimento()\r\n\t\t\t\t\t\t\t\t.getInternacao().getDthrInternacao());\r\n\t\t\t\t\t\tlaudo.setContaDesdobrada(false);\r\n\t\t\t\t\t\tlaudo.setImpresso(false);\r\n\t\t\t\t\t\tlaudo.setLaudoManual(false);\r\n\t\t\t\t\t\tlaudo.setAtendimento(prescricao.getAtendimento());\r\n\t\t\t\t\t\tlaudo.setTipoLaudo(tipoLaudoMaiorPermanencia);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlaudoList.add(laudo);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static Teclado[] cargaTeclados() {\n\t\tTeclado[] teclados = new Teclado[3];\n\t\tTeclado teclado1 = new Teclado(\"USB 2.0\", \"Genius\");\n\t\tTeclado teclado2 = new Teclado(\"USB 3.0\", \"Logitech\");\n\t\tTeclado teclado3 = new Teclado(\"Bluetooth\", \"Gamer\");\n\t\tteclados[0] = teclado1;\n\t\tteclados[1] = teclado2;\n\t\tteclados[2] = teclado3;\n\t\treturn teclados;\n\t}", "public ArrayList<String> cartasQueTieneEnLaMano()\n {\n {\n ArrayList<String> coleccionString = new ArrayList<String>();\n for (Carta objetoCarta : cartasDeJugador) {\n coleccionString.add(objetoCarta.getNombre());\n }\n return coleccionString;\n }\n }", "public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\n }", "List<TotalCarritoDTO> getTotalCarritoCompras(String userName,TipoMoneda tipoMoneda);", "public String getMascara()\r\n/* 287: */ {\r\n/* 288:355 */ if (this.dimensionContable.getMascara() != null) {\r\n/* 289:356 */ if (this.dimensionContable.getDimensionPadre() != null) {\r\n/* 290:358 */ this.mascara = (this.dimensionContable.getDimensionPadre().getCodigo() + this.dimensionContable.getMascara().substring(this.dimensionContable.getDimensionPadre().getCodigo().length()));\r\n/* 291: */ } else {\r\n/* 292:360 */ this.mascara = this.dimensionContable.getMascara();\r\n/* 293: */ }\r\n/* 294: */ }\r\n/* 295:363 */ return this.mascara;\r\n/* 296: */ }", "private static void estadisticaClase() {\n int numeroAlumnos;\n int aprobados = 0, suspensos = 0; // definición e instanciación de varias a la vez\n int suficentes = 0, bienes = 0, notables = 0, sobresalientes = 0;\n float totalNotas = 0;\n float media;\n Scanner in = new Scanner(System.in);\n\n // Salismos del bucle sólo si nos introduce un número positivo\n do {\n System.out.println(\"Introduzca el número de alumnos/as: \");\n numeroAlumnos = in.nextInt();\n } while (numeroAlumnos <= 0);\n\n // Como sabemos el número de alumnos es un bucle definido\n for (int i = 1; i <= numeroAlumnos; i++) {\n float nota = 0;\n\n // nota solo existe dentro de este for, por eso la definimos aquí.\n do {\n System.out.println(\"Nota del alumno \" + i + \" [0-10]: \");\n nota = in.nextFloat();\n } while (nota < 0 || nota > 10);\n\n // Sumamos el total de notas\n totalNotas += nota;\n\n if (nota < 5) {\n suspensos++;\n } else if (nota >= 5 && nota < 6) {\n aprobados++;\n suficentes++;\n } else if (nota >= 6 && nota < 7) {\n aprobados++;\n bienes++;\n } else if (nota >= 7 && nota < 9) {\n aprobados++;\n notables++;\n } else if (nota >= 9) {\n aprobados++;\n sobresalientes++;\n }\n }\n // De esta manera redondeo a dos decimales. Tengo que hacer un casting porque de Double quiero float\n // Si no debería trabajar con double siempre.\n media = (float) (Math.round((totalNotas / numeroAlumnos) * 100.0) / 100.0);\n\n // Sacamos las estadísticas\n System.out.println(\"Número de alumnos/as: \" + numeroAlumnos);\n System.out.println(\"Número de aprobados/as: \" + aprobados);\n System.out.println(\"Número de suspensos: \" + suspensos);\n System.out.println(\"Nota media: \" + media);\n System.out.println(\"Nº Suficientes: \" + suficentes);\n System.out.println(\"Nº Bienes: \" + bienes);\n System.out.println(\"Nº Notables: \" + notables);\n System.out.println(\"Nº Sobresalientes: \" + sobresalientes);\n\n\n }", "public static void visualizarTodasLasPiezas(Monton todas){\n \n System.out.println(\"\\nVisualizando todas las piezas: \");\n System.out.println(todas.toString());\n }", "private void setupEscenario3( )\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,3,7,9\";\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 = \"2,4,6,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 = \"5\";\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 }", "private void adicionaMusicasVaziasCD () {\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tfaixasCD.add(i, \"\");\n\t\t}\n\t}", "public static Object[] getArrayDeObjectosMon(int codigo,String nombre,String fabricante,float precio, String stock, int tam, String resolucion){\r\n Object[] v = new Object[7];\r\n \r\n v[0] = codigo;\r\n v[1] = nombre;\r\n v[2] = fabricante;\r\n v[3] = precio;\r\n v[4] = stock;\r\n v[5] = tam;\r\n v[6] = resolucion;\r\n\r\n return v;\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 String converterMassa(Medidas medidaUm, Medidas medidaDois) {\n String medidaUmUnidade = medidaUm.getUnidadeDeMassa();\n String medidaDoisUnidade = medidaDois.getUnidadeDeMassa();\n boolean unidadesIguais = medidaUmUnidade.equals(medidaDoisUnidade) ? true : false;\n String errorMessage = \"Não é possível realizar a conversão, pois as duas medidas já estão na mesma unidade.\";\n\n if (unidadesIguais)\n return errorMessage;\n else {\n double medidaUmMassaNova = (medidaUmUnidade == \"lb\") ? (medidaUm.getMassa() / 2.2046)\n : (medidaUm.getMassa() * 2.2046);\n medidaUm.setMassa(medidaUmMassaNova);\n String medidaUmUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaUm.setUnidadeDeMassa(medidaUmUnidadeDeMassaNova);\n\n double medidaDoisMassaNova = (medidaDoisUnidade == \"lb\") ? (medidaDois.getMassa() / 2.2046)\n : (medidaDois.getMassa() * 2.2046);\n medidaDois.setMassa(medidaDoisMassaNova);\n String medidaDoisUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaDois.setUnidadeDeMassa(medidaDoisUnidadeDeMassaNova);\n }\n\n String medidaUmConvertida = medidaUm.getMassa() + \" \" + medidaUm.getUnidadeDeMassa();\n String medidaDoisConvertida = medidaDois.getMassa() + \" \" + medidaDois.getUnidadeDeMassa();\n\n return (\"Massa 01: \" + medidaUmConvertida + \" | \" + \"Massa 02: \" + medidaDoisConvertida);\n }", "@Test\n void mostraTutti() {\n EAMese[] matrice = EAMese.values();\n assertNotNull(matrice);\n assertEquals(12, matrice.length);\n\n System.out.println();\n String sep = \" - \";\n int k=0;\n for (EAMese mese : matrice) {\n System.out.println(++k+sep+mese.getLungo() + sep + mese.getBreve() + sep + mese.getGiorni());\n }// end of for cycle\n\n }", "public void llenarOpciones(ArrayList<String> mezcales,ArrayList<String> porcentajes,ArrayList<String> tipos){\n for (String p : porcentajes) {\n alcohol.addItem(p + \"%\");\n }\n for (String t : tipos) {\n tipo.addItem(t);\n }\n String nombreMezcales[] = new String[mezcales.size()];\n for (int i = 0; i < mezcales.size(); i++) {\n nombreMezcales[i] = mezcales.get(i);\n }\n eleccion.setTextos(nombreMezcales);\n revalidate();\n }", "private void mostradados() {\r\n\t\tint in = 0;\r\n\r\n\t\tfor (Estado e : Estado.values()) {\r\n\t\t\tif (in == 0) {\r\n\t\t\t\tcmbx_estado.addItem(\"\");\r\n\t\t\t\tin = 1;\r\n\t\t\t}\r\n\t\t\tcmbx_estado.addItem(e.getNome());\r\n\t\t}\r\n\r\n\t\tfor (int x = 0; x < listacliente.size(); x++) {\r\n\t\t\tin = 0;\r\n\t\t\tif (x == 0) {\r\n\t\t\t\tcmbx_cidade.addItem(\"\");\r\n\t\t\t}\r\n\r\n\t\t\tfor (int y = 0; y < cmbx_cidade.getItemCount(); y++) {\r\n\t\t\t\tif (listacliente.get(x).getCidade().equals(cmbx_cidade.getItemAt(y).toString()))\r\n\t\t\t\t\tin++;\r\n\t\t\t\tif (in > 1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (in < 1)\r\n\t\t\t\tcmbx_cidade.addItem(listacliente.get(x).getCidade());\r\n\t\t}\r\n\t}", "public String getMarca(){\n return marca;\n }", "public void generTirarDados() {\n\r\n\t}", "public Mazo()\n {\n // initialise instance variables\n mazo = new ArrayList<Carta>(40);\n \n int contadorDePalo = 0;\n while (contadorDePalo <= 3) {\n int contadorDeValor = 1;\n while (contadorDeValor <= 12) {\n if (contadorDeValor <= 7 || contadorDeValor >= 10) {\n mazo.add(new Carta(contadorDeValor,contadorDePalo));\n }\n contadorDeValor++;\n }\n contadorDePalo++;\n }\n }", "public void setMarca(Marca[] marca){\n this.marca = marca;\n }", "public Memoria(Espacio[] espacios) {\r\n\t\tthis.numEspacios = espacios.length;\r\n\t\tthis.espacios = espacios;\r\n\t\ttamaņo = 0;\r\n\t\tfor (int i = 0; i < numEspacios; i++) {\r\n\t\t\ttamaņo += espacios[i].getTamaņo();\r\n\t\t}\r\n\t}", "private void asignarCapacidades ()\n\t{\n\t\tif(tipoVehiculo.equalsIgnoreCase(TIPO_VEHICULO_ECONOMICO))\n\t\t{\n\t\t\tcapacidadKilometrosPorGalon = CAPACIDAD_60;\n\t\t}\n\t\t\n\t\telse if(tipoVehiculo.equalsIgnoreCase(TIPO_VEHICULO_MEDIO))\n\t\t{\n\t\t\tcapacidadKilometrosPorGalon = CAPACIDAD_45;\n\t\t}\n\t\t\n\t\telse capacidadKilometrosPorGalon = CAPACIDAD_30;\n\t}", "public int getPrecios()\r\n {\r\n for(int i = 0; i < motos.size(); i++)\r\n {\r\n precio_motos += motos.get(i).getCoste();\r\n }\r\n \r\n return precio_motos;\r\n }", "public List<MascotaEntity> darMascotasPorEstado (String estado) throws Exception{\n if(!estado.equals(MascotaEntity.Estados_mascota.ADOPTADO.name()) \n && !estado.equals(MascotaEntity.Estados_mascota.EXTRAVIADO.name())\n && !estado.equals(MascotaEntity.Estados_mascota.ENCONTRADO.name()) \n && !estado.equals(MascotaEntity.Estados_mascota.EN_ADOPCION.name()))\n {\n throw new BusinessLogicException(\"El estado de la mascota no es correcto\");\n }\n \n List<MascotaEntity> mascotas = mascotaPersistence.findAll();\n List<MascotaEntity> mascotasFiltrados = new LinkedList<>();\n \n for(MascotaEntity m : mascotas){\n if(m.getEstado().name().equals(estado)){\n mascotasFiltrados.add(m);\n }\n }\n return mascotasFiltrados;\n }", "public static void main(String[] args) {\n\r\n\t\tCustomer customer0 = new Customer(2007, \"35621485268\", \"José Felipe Martins\", true, 590.9);\r\n\t\tCustomer customer1 = new Customer(1950, \"47821485297\", \"Maria Alice Barros\", true, 700);\r\n\t\tCustomer customer2 = new Customer(850, \"25521485858\", \"Carlos Eduardo\", true, 750);\r\n\t\tCustomer customer3 = new Customer(2150, \"32412587548\", \"Gev Alisson\", true, 400);\r\n\t\t\r\n\t\t//2 ­ Criar um programa que percorra uma lista de objetos do tipo \r\n\t\t//criado acima e calcule a média do campo ​vl_total​ apenas para os \r\n\t\t//itens que este valor seja maior que 560 e o capo id_customer​ \r\n\t\t//esteja entre 1500 e 2700.\r\n\t\t\r\n\t\tList<Customer> lista = new ArrayList<Customer>();\r\n\t\tlista.add(customer0);\r\n\t\tlista.add(customer1);\r\n\t\tlista.add(customer2);\r\n\t\tlista.add(customer3);\r\n\t\t\r\n\t\tCustomerControl control = new CustomerControl();\r\n\t\tdouble media = control.CalcMedia(lista);\r\n\r\n\t\t//3 ­ Exibir a média final.\r\n\t\tSystem.out.println(\"a media é: \"+ media);\r\n\t\t\r\n\t\t//4 ­ Imprima cada um dos obejtos selecionados para o cálculo da média. \r\n\t\tSystem.out.println(\"objetos selecionados para media\\n\");\r\n\t\tfor(Customer c : control.selecionarParaMedia(lista)){\r\n\t\t\tSystem.out.println(c.toString());\r\n\t\t}\r\n\t\t//5 - 5 ­ Ordene pelo campo vlTotal os objetos selecionados para o cálculo da média. \r\n\t\tList<Customer> listaOrdenada = control.Ordenar(control.selecionarParaMedia(lista));\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\n resultado da lista ordenada\");\r\n\t\tfor(Customer c : listaOrdenada){\r\n\t\t\tSystem.out.println(c.toString());\r\n\t\t}\r\n\r\n\t}", "public List<Matricula> getMatriculaAlumno() throws MatriculaException{\n\t\tList<Matricula> matalum = new ArrayList<Matricula>();\n\t\t\n for (Expediente ex : infosesion.getAlumno().getExpedientes()) {\n\t\t\tfor (Matricula matricula : matricula.buscarMatriculas(ex)) {\n\t\t\t\tmatalum.add(matricula);\n\t\t\t}\n\t\t}\n return matalum;\n\t}", "public void obterDados() {\r\n\r\n\t\tidade = Integer.parseInt(JOptionPane.showInputDialog(\"Informe a idade\"));\r\n\t\taltura = Double.parseDouble(JOptionPane.showInputDialog(\"Informe a altura\"));\r\n\t\tpeso = Double.parseDouble(JOptionPane.showInputDialog(\"Informe o peso\"));\r\n\t\t\r\n\t\tjogCadastrados ++;\r\n totalaltura += altura;\r\n\r\n\t}", "public String getMarca()\n {\n return marca;\n }", "public static List<Punto> getPuntos(){\n\t\t\n\t\tList<Punto> puntos = new ArrayList<Punto>();\n\t\ttry{\n\n\t\t\t//-12.045916, -75.195270\n\t\t\t\n\t\t\tPunto p1 = new Punto(1,-12.037512,-75.183327,0.0);\n\t\t\tp1.setDatos(getDatos(\"16/06/2017 09:00:00\", 2 , 1));\n\t\t\t\n\t\t\tPunto p2 = new Punto(2,-12.041961,-75.184786,0.0);\n\t\t\tp2.setDatos(getDatos(\"16/06/2017 09:00:00\",1 , 2));\n\t\t\t\n\t\t\tPunto p3 = new Punto(3,-12.0381,-75.1841,0.0);\n\t\t\tp3.setDatos(getDatos(\"16/06/2017 09:00:00\",2 , 2));\n\t\t\t\n\t\t\tPunto p4 = new Punto(4,-12.041542,-75.185816,0.0);\n\t\t\tp4.setDatos(getDatos(\"16/06/2017 11:00:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p5 = new Punto(5,-12.037764,-75.181096,0.0);\n\t\t\tp5.setDatos(getDatos(\"16/06/2017 11:15:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p6 = new Punto(6,-12.042801,-75.190108,0.0);\n\t\t\tp6.setDatos(getDatos(\"16/06/2017 11:00:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p7 = new Punto(7,-12.04364,-75.184014,0.0);\n\t\t\tp7.setDatos(getDatos(\"16/06/2017 11:00:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p8 = new Punto(8,-12.045739,-75.185387,0.0);\n\t\t\tp8.setDatos(getDatos(\"16/06/2017 11:30:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p9 = new Punto(9,-12.04683,-75.187361,0.0);\n\t\t\tp9.setDatos(getDatos(\"16/06/2017 11:50:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p10 = new Punto(10,-12.050775,-75.187962,0.0);\n\t\t\tp10.setDatos(getDatos(\"16/06/2017 12:30:00\",0 , 0));\n\t\t\t\n\t\t\tPunto p11 = new Punto(11,-12.053797,-75.184271,0.0);\n\t\t\tp11.setDatos(getDatos(\"16/06/2017 13:00:00\",0 , 0));\n\t\t\t\n\t\t\tpuntos.add(p8);\n\t\t\tpuntos.add(p9);\n\t\t\tpuntos.add(p3);\n\t\t\tpuntos.add(p4);\n\t\t\tpuntos.add(p5);\n\t\t\tpuntos.add(p6);\n\t\t\tpuntos.add(p7);\n\t\t\tpuntos.add(p10);\n\t\t\tpuntos.add(p1);\n\t\t\tpuntos.add(p2);\n\t\t\tpuntos.add(p11);\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e ){\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn puntos;\n\t\n\t}", "public void barajarCartas()\n {\n for (int posicionActual = 0; posicionActual < mazo.size(); posicionActual++) {\n Carta carta1 = mazo.get(0);\n Random aleatorio = new Random();\n int posicionAleatoria = aleatorio.nextInt(mazo.size());\n mazo.set(posicionActual, mazo.get(posicionAleatoria));\n mazo.set(posicionAleatoria, carta1);\n }\n }", "private void comerFantasma(Fantasma fantasma) {\n // TODO implement here\n }", "public List<Matricula> getMatriculas(){\n\t\t\n\t\ttry {\n\t\t\treturn matricula.leerMatriculasSecretaria();\n\t\t} catch (MatriculaException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public List<Mobibus> darMobibus();", "public ArrayList<String> obtenerNombresMedicos() {\n ArrayList<String> nombres = new ArrayList<String>();\n for (int i = 0; i < medicos.length; i++) {\n if (medicos[i] != null) {\n nombres.add(medicos[i].getNombre());\n }\n }\n return nombres;\n }", "public static void main(String[] args) {\n System.out.println(\"Escribe los tres números:\");\n Scanner sc = new Scanner(System.in);\n Numero numeros = new Numero(sc.nextFloat(),sc.nextFloat(),sc.nextFloat());\n numeros.calcularMaior();\n }", "private static List<PotionInfo> getPotionsManual()\n\t{\n\t\tArrayList<PotionInfo> potionsManual = new ArrayList<>();\n\n\t\tpotionsManual.add(PotionInfo.PYGMY_OIL());\n\t\tpotionsManual.add(PotionInfo.FLASK_OF_PURE_MOJO());\n\t\tpotionsManual.add(PotionInfo.LEZNUPARS_DRAUGHT());\n\t\tpotionsManual.add(PotionInfo.GURUS_ELIXIR());\n\n\t\treturn potionsManual;\n\t}", "public Materia getMateriaPractico()throws ParseException{\n Element tabla3=doc.getElementsByClass(\"display\").get(2);\n Elements elementostPractico=tabla3.select(\"td:nth-of-type(2)\");\n \n Profesor profesorPractico=new Profesor(elementostPractico.get(0).text());\n int paraleloPractico=Integer.parseInt(elementostPractico.get(1).text());\n String capacidadMaxima=elementostPractico.get(2).text();\n Materia materiaPractico=new Materia\n (nombreMateria,paraleloPractico,profesorPractico);//materia\n \n \n //Selecciona a la 4ta tabla con la informacion de las clases\n //del paralelo practico, se crea y se llena un arreglo con las clases\n Element tabla4=doc.getElementsByClass(\"display\").get(3);\n Elements clasesPractico=tabla4.select(\"tr\");\n ArrayList<Clase> clasePractico=new ArrayList<>();//arreglo de clases\n for(Element e:clasesPractico.subList(1, clasesPractico.size())){\n //System.out.println(e);\n Elements campos=e.select(\"td\");\n Dias dia=Dias.valueOf(campos.get(0).text().toUpperCase());\n Date horai=dateFormatClases.parse(campos.get(1).text());\n Date horaf=dateFormatClases.parse(campos.get(2).text());\n String aula=campos.get(3).text();\n String aulaDetalle=campos.get(4).text();\n Clase clase=new Clase(dia, horai, horaf,aula,aulaDetalle);\n //System.out.println(clase);\n clasePractico.add(clase);\n }\n \n //seteo el arreglo de clases del practico en la materiaPractico\n materiaPractico.setClases(clasePractico);\n return materiaPractico;\n }", "public void cargaDeDatos(List<List<Object>> Musuarios,List<List<Object>> Mtareas, List<List<Object>> Mrequisitos) {\r\n\tfor (List<Object> l: Musuarios) {\r\n\t\tam.addMiembro(new MiembroDeEquipo((int)l.get(0),(String)l.get(1)));\r\n\t}\r\n\t/**\r\n\t * Cargamos a la lista de administrador de tareas todas las tareas que se encuentran en la base de datos, \r\n\t * si no tiene miembro se le pone a null sino se le añade un miembro.\r\n\t */\r\n\tfor (List<Object> l: Mtareas) {\r\n\t\tat.addTarea(new Tarea((String)l.get(0),(int)l.get(1),(int)l.get(2),(int)l.get(3),(int)l.get(6)));\r\n\t\t//Si tiene un miembro asignado (cualquier id mayor que cero) le añade el miembro de equipo, sino null\r\n\t\tif(0 < (int)l.get(5)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setAsignadoA(am.BuscarMiembro((int) l.get(5)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setAsignadoA(null);\r\n\t\t}\r\n\t\t//Si tiene un requisito (cualquier id maor que cero) le añade el requisito, sino null\r\n\t\tif(0 < (int)l.get(4)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(ar.BuscarRequisito((int) l.get(4)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(null);\r\n\t\t}\r\n\t\tat.BuscarTarea((int)l.get(1)).setDescripcion((String)l.get(7));\r\n\t}\r\n\t/**\r\n\t * Cargamos la lista del administrador de requisitos con todos los requisitos que tenemos,\r\n\t * si el requisito tiene 5 atributos, será un defecto, sino será una historia de usuario\r\n\t */\r\n\tfor (List<Object> l: Mrequisitos) {\r\n\t\tHashSet<Tarea> lista = new HashSet<Tarea>();\r\n\t\t//Buscamos todas las tareas que tengan este requisito, para tener una lista de las tareas que este tiene\r\n\t\tfor(List<Object> t: Mtareas) {\r\n\t\t\t\r\n\t\t\tif((int)l.get(2)==(int)t.get(4)) {\r\n\t\t\t\tlista.add(at.BuscarTarea((int)t.get(1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Creamos defecto o historiaDeUsuario, según sea el caso y lo añadimos a la lista generica de Requisitos.\r\n\t\tif(l.size()==5) {\r\n\t\t\tDefecto req = new Defecto((String)l.get(4),(String) l.get(0), (String)l.get(1),(int)l.get(2),lista);\r\n\t\t\tif((int)l.get(3)==1) {\r\n\t\t\treq.finalizar();\r\n\t\t\t}\r\n\t\t\tar.addRequisito(req);\r\n\t\t}else {\r\n\t\t\tRequisito req = new HistoriaDeUsuario((String) l.get(0), (String)l.get(1),(int)l.get(2));\r\n\t\t\tif(!lista.isEmpty()) {\r\n\t\t\t\treq.setRequisitos(lista);\r\n\t\t\t}\r\n\t\t\tif((int)l.get(3)==1) {\r\n\t\t\treq.finalizar();\r\n\t\t\t}\r\n\t\t\tar.addRequisito(req);\t\t\r\n\t\t}\r\n\t}\r\n\tfor (List<Object> l: Mtareas) {\r\n\t\t//Si tiene un requisito (cualquier id maor que cero) le añade el requisito, sino null\r\n\t\tif(0 < (int)l.get(4)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(ar.BuscarRequisito((int) l.get(4)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(null);\r\n\t\t}\r\n\t}\r\n}", "public static void main(String[] args) {\n Alumno aaDatos []; // El identificador es nulo\n \n aaDatos = new Alumno[tam];//Creamos un arreglo de 10 \n //alumnos - AQUI HABRA PREGUNTA\n for (int i = 0; i < aaDatos.length; i++) {\n aaDatos[i]= new Alumno(\"Dany\",\"16550518\", 0);//Para cada lugar de arreglo se crea un objeto de la clase alumno\n \n }\n for (Alumno aaDatos1: aaDatos) {\n System.out.println(\"Nombre: \"+ aaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaDatos1.getiCar());\n \n }\n \n \n //CREAMOS UNA COPIA DEL ARREGLO\n Alumno aaCopiaDatos [];\n aaCopiaDatos = new Alumno [tam];\n \n for (int i = 0; i < aaCopiaDatos.length; i++) {\n aaCopiaDatos[i]= new Alumno(aaDatos[i].getsNom(), // <<<Se llenan todos los datos que pide el constructor por argumentos\n aaDatos[i].getsMatri(), \n aaDatos[i].getiCar());\n \n }\n for (Alumno aaCopiaDatos1 : aaCopiaDatos) {\n System.out.println(\"Nombre: \"+ aaCopiaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaCopiaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaCopiaDatos1.getiCar());\n }\n System.out.println(aaDatos);\n System.out.println(aaCopiaDatos);\n }", "public static Monitor[] cargaMonitores() {\n\t\t\n\t\tMonitor[] monitores = new Monitor[3];\n\t\t\n\t\tMonitor monitor1 = new Monitor(\"HP\", 33);\n\t\tMonitor monitor2 = new Monitor(\"RCA\", 19);\n\t\tMonitor monitor3 = new Monitor(\"Sony\", 27);\n\t\t\n\t\tmonitores[0] = monitor1;\n\t\tmonitores[1] = monitor2;\n\t\tmonitores[2] = monitor3;\n\t\t\n\t\treturn monitores;\n\t}", "private void carregaAvisosGerais() {\r\n\t\tif (codWcagEmag == WCAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"12.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"9.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.7\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\t// comentado por n�o ter achado equi\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t} else if (codWcagEmag == EMAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.21\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.24\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.17\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.6\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.14\", AVISO, codWcagEmag, \"\"));\r\n\t\t}\r\n\r\n\t}", "public HashSet<Integer> mesesComprou(){\n HashSet<Integer> hs = new HashSet<>();\n produtosComprados.keySet().stream().forEach(x->hs.add(x.getMes()));\n return hs;\n }", "private Map<String,Double> getPromedioHabilidades(Cuadrilla cuadrilla){\n\t\tSystem.out.println(\"#### getPromedioHabilidades ######\");\n\t\tdouble proprod= 0, protrae= 0, prodorm = 0, prodcaa = 0;\n\t\tint cantper = 0;\n\t\tfor (CuadrillasDetalle cd : cuadrilla.getCuadrillasDetalles()) {\n\t\t\t\n\t\t\tList<TecnicoCompetenciaDetalle> tcds = \tcd.getTecnico().getTecnicoCompetenciaDetalles();\n\t\t\tfor (TecnicoCompetenciaDetalle tcd : tcds) {\n\t\t\t\tInteger codigoComp = tcd.getCompetencia().getCodigoCompetencia();\n\t\t\t\tswitch(codigoComp){\n\t\t\t\t\tcase COMPETENCIA_PRODUCTIVIDAD:\n\t\t\t\t\t\tproprod = proprod+ tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_TRABAJO_EQUIPO:\n\t\t\t\t\t\tprotrae = protrae + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_ORIENTACION_METAS:\n\t\t\t\t\t\tprodorm = prodorm + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_CALIDAD_ATENCION:\n\t\t\t\t\t\tprodcaa = prodcaa +tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcantper++;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t// promedio de las competencias de los tenicos de cada cuadrilla\n\t\tproprod = proprod/cantper; \n\t\tprotrae = protrae/cantper;\n\t\tprodorm = prodorm/cantper;\n\t\tprodcaa = prodcaa/cantper;\n\n\t\tMap<String, Double> mpproms = new LinkedHashMap<String,Double>();\n\t\tmpproms.put(\"proprod\", proprod);\n\t\tmpproms.put(\"protrae\", protrae);\n\t\tmpproms.put(\"prodorm\", prodorm);\n\t\tmpproms.put(\"prodcaa\", prodcaa);\n\t\n\t\treturn mpproms;\n\t\t\n\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 ArrayList<String> Mass(String from, float amount, String[] units) {\n\t\tfrom = findFrom(from);\n\t\tif (from.equals(\"gram\")) {\n\t\t\tArrayList<String> kaduvil = new ArrayList<String>();\n\t\t\tkaduvil.add(\"\" + amount + \" \" + units[0] );\n\t\t\tkaduvil.add(\"\" + amount / 1000 + \" \" + units[1] );\n\t\t\tkaduvil.add(\"\" + amount / 453.59237f + \" \" + units[2] );\n\t\t\treturn kaduvil;\n\t\t} else {\n\t\t\tif (from.equals(\"pounds\")) {\n\t\t\t\treturn Mass(\"gram\", amount * 453.59237f, units);\n\t\t\t} else {\n\t\t\t\treturn Mass(\"gram\", amount * 1000, units);\n\t\t\t}\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}", "@GET\n\t@Path(\"/marcas\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic ArrayList<MarcaAutoDTO> listarMarcas(){\n\t\tSystem.out.println(\"ini: listarMarcas()\");\n\t\t\n\t\tMarcaAutoService marcaService = new MarcaAutoService();\n\t\tArrayList<MarcaAutoDTO> lista = marcaService.ListadoMarcaAuto();\n\t\t\n\t\tif (lista == null) {\n\t\t\tSystem.out.println(\"Listado Vacío\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Consulta Exitosa\");\n\t\t}\n\n\t\tSystem.out.println(\"fin: listarMarcas()\");\n\t\t\n\t\treturn lista;\n\t}", "public ArrayList<String> Info_Disc_Mus_Compras(String genero) {\r\n ArrayList<String> Lista_nombre = Info_Disco_Mus_Rep1(genero);\r\n ArrayList<String> Lista_datos_compras = new ArrayList();\r\n String line;\r\n try (BufferedReader br = new BufferedReader(new FileReader(\"src/Archivos/Compra_Musica.txt\"))) {\r\n while ((line = br.readLine()) != null) {\r\n String[] info_disco_compra = line.split(\";\");\r\n for (int s = 0; s < Lista_nombre.size(); s++) {\r\n if (Lista_nombre.get(s).equals(info_disco_compra[3])) {\r\n Lista_datos_compras.add(info_disco_compra[3]);\r\n Lista_datos_compras.add(info_disco_compra[5]);\r\n }\r\n }\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(ex);\r\n }\r\n return Lista_datos_compras;\r\n }", "public void buscarMarcacion(){\n\t\t\n \tif(!FuncionesFechas.validaFecha(fCargaI, fCargaF))\n \t{\t\n \t\tlistaMarcacion=null;\n \t\tlistaMarcacionPDF=null;\n \t\treturn ;}\n \tMarcacionDespatch marcacionDespatch=new MarcacionDespatch();\n\t\ttry {\n\t\t\t//listaMarcacion=marcacionDespatch.getMarcacionesPorCodigo(PGP_Usuario.getV_codpersonal());\n\t\t\t/*for(int i=0;i<listaMarcacion.size();i++)\n\t\t\t{\n\t\t\t\tif(listaMarcacion.get(i).getdFecha().after(fCargaI) && listaMarcacion.get(i).getdFecha().before(fCargaF)){\n\t\t\t\t\tSystem.out.println(\"Entroo\\nLista [\"+(i+1)+\"]:\"+listaMarcacion.get(i).getdFecha());\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t\n\t\t\tlistaMarcacion=marcacionDespatch.getMarcacionesPorCodigoFecha(PGP_Usuario.getV_codpersonal(),fCargaI,fCargaF);//\"44436285\"\n\t\t\tMap parametros = new HashMap();\t\t\t\n\t\t\tparametros.put(\"PARAM_NRODOC\", PGP_Usuario.getV_codpersonal());\n\t\t\tparametros.put(\"PARAM_STR_FI\", FuncionesFechas.getFormatDateDDMMYYYY(fCargaI));\n\t\t\tparametros.put(\"PARAM_STR_FF\", FuncionesFechas.getFormatDateDDMMYYYY(fCargaF));\n\t\t\tlistaMarcacionPDF=marcacionDespatch.reporteMisMarcaciones(parametros);\n\t\t} catch (Exception e) {\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n }", "public static void getMejorbeneficios(ArrayList<BeneficiosCovid19> lista1, ArrayList<BeneficiosCovid19> lista2){\n\n // obetjo de la clase BeneficiosCovid19 para almacenar los datos mayores\n BeneficiosCovid19 beneficiosMayores = new BeneficiosCovid19();\n\n //Variable para implementar el Wrapper del objeto tipo Float\n float valor = 0;\n\n //Almacenamos valor = 0\n beneficiosMayores.setValorSubsidio(valor);\n\n // Ciclo para obtener el subsidio mayor\n for (int i = 0;i< lista1.size();i++) {\n BeneficiosCovid19 auxiliarCovid = lista1.get(i);\n\n if (auxiliarCovid.getValorSubsidio() > beneficiosMayores.getValorSubsidio()){\n beneficiosMayores = auxiliarCovid;\n }\n }\n\n // Ciclo para obtener el ID mayor\n for (int i = 0;i< lista2.size();i++) {\n BeneficiosCovid19 auxiliarCovid2 = lista2.get(i);\n if (auxiliarCovid2.getValorSubsidio() > beneficiosMayores.getValorSubsidio()){\n beneficiosMayores = auxiliarCovid2;\n }\n }\n\n // Mostra resultado de las busquedas\n System.out.println(\"El id del subsidio mayor es: \" + beneficiosMayores.getId());\n System.out.println(\"El nombre subsidio mayor es: \" + beneficiosMayores.getNombre());\n System.out.println(\"El valor subsidio mayor es: \" + beneficiosMayores.getValorSubsidio());\n\n }", "public void buscarTemas() {\n ProfesorApiService.obtenerTemasAsignatura(callback.asignaturaSeleccionada).subscribe(temas -> {\n Utils.setTemasInVBox(temas, vbox_temas, callback, getClass());\n });\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString [] paises = new String [8];\r\n\t\t\r\n\t\t/*paises[0]=\"España\";\r\n\t\tpaises[1]=\"Mexico\";\r\n\t\tpaises[2]=\"Colombia\";\r\n\t\tpaises[3]=\"Peru\";\r\n\t\tpaises[4]=\"Chile\";\r\n\t\tpaises[5]=\"Argentina\";\r\n\t\tpaises[6]=\"Ecuador\";\r\n\t\tpaises[7]=\"Venezuela\";*/\r\n\t\t\r\n\t\t//String [] paises = {\"España\", \"México\", \"Colombia\", \"Peru\", \"Chile\", \"Argentina\", \"Ecuador\", \"Venezuela\"};\r\n\t\t\r\n\t\t/*for (int i = 0; i<paises.length; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Pais \"+ (i+1) + \" \" + paises[i]);\r\n\t\t}*/\r\n\t\t\r\n\t\t//Recorremos con foreach\r\n\t\t\r\n\t\t/*for(String elemento:paises) {\r\n\t\t\t\r\n\t\t\telemento = JOptionPane.showInputDialog(\"Introduce un pais\");\t\t\t\t//Mostrara todos los valores almacenados en la matriz \r\n\t\t}*/\r\n\t\t\r\n\t\tfor (int i=0; i<paises.length;i++) {\r\n\t\t\t\r\n\t\t\tpaises[i] = JOptionPane.showInputDialog(\"Introduce el pais \" + (i+1));\r\n\t\t}\r\n\t\t\r\n\t\tfor (String elemento:paises) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(elemento);\r\n\t\t}\r\n\t\t\r\n\t\t//rellenamos matriz d numeros aleatorios\r\n\t\t\r\n\t\tint [] matriz_aleatorios = new int [150];\r\n\t\t\r\n\t\tfor (int i=0; i<matriz_aleatorios.length;i++) {\r\n\t\t\t\r\n\t\t\t/*Como Math.random es un doble transformamos a int, redondeamos y numero aleatorio*/\r\n\t\t\tmatriz_aleatorios[i] = (int) Math.round(Math.random()*100);\t\t\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tfor (int numeros: matriz_aleatorios) {\t\t\t//antes usabamos string pq recorriamos palabras, ahora usamos int\r\n\t\t\t\r\n\t\t\tSystem.out.print(numeros + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public List<MovimentoPorCanalDeVendaVO> validaSelecionaEmissaoPorCanal(String movimento) {\n\n\t\tList<MovimentoPorCanalDeVendaVO> list = new ArrayList<MovimentoPorCanalDeVendaVO>(listaEmissaoPorCanal);\n\n\t\tList<MovimentoPorCanalDeVendaVO> listTotal = new ArrayList<MovimentoPorCanalDeVendaVO>();\n\n\t\tString[] mesesTotaisValor = { \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\", \"0.0\",\n\t\t\t\t\"0.0\" };\n\n\t\tString[] mesesTotaisQuantidade = { \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\" };\n\n\t\tString anoTotal = null;\n\t\tString produtoTotal = null;\n\n\t\tint qtdQuantidade = 0;\n\t\tint qtdValor = 0;\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tif (!(list.get(i).getMovimento().trim().equalsIgnoreCase(movimento.trim()))) {\n\t\t\t\tlist.remove(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tfor (MovimentoPorCanalDeVendaVO objLista : list) {\n\t\t\tif (objLista.getTipo().equalsIgnoreCase(\"Valor\")) {\n\t\t\t\tqtdValor++;\n\t\t\t} else if (objLista.getTipo().equalsIgnoreCase(\"Quantidade\")) {\n\t\t\t\tqtdQuantidade++;\n\t\t\t}\n\t\t}\n\t\tint indiceElementoNaoEncontrado = 0;\n\t\tif (qtdValor != qtdQuantidade) {\n\n\t\t\tif (qtdValor > qtdQuantidade) {// Valor eh maior\n\t\t\t\touter: for (int i = 0; i < list.size(); i++) {\n\t\t\t\t\tif (list.get(i).getTipo().equalsIgnoreCase(\"Valor\")) {\n\n\t\t\t\t\t\t// System.out.println();\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// System.out.print(\" 1 | \"\n\t\t\t\t\t\t// + list.get(i).getCanalDeVenda());\n\t\t\t\t\t\t// System.out.println();\n\n\t\t\t\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\t\t\t\tint achou = -1;\n\t\t\t\t\t\t\tif (list.get(j).getTipo().equalsIgnoreCase(\"Quantidade\")) {\n\n\t\t\t\t\t\t\t\t// System.out.print(\" 2 | \"\n\t\t\t\t\t\t\t\t// + list.get(j).getCanalDeVenda());\n\t\t\t\t\t\t\t\t// System.out.println();\n\n\t\t\t\t\t\t\t\tif (list.get(i).getCanalDeVenda().equals(list.get(j).getCanalDeVenda())) {\n\t\t\t\t\t\t\t\t\tachou = j;\n\t\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (j == list.size() - 1 && achou == -1) {\n\t\t\t\t\t\t\t\t\tindiceElementoNaoEncontrado = i;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tString[] meses = { \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\" };\n\n\t\t\t\tMovimentoPorCanalDeVendaVO canalVendaVazio = new MovimentoPorCanalDeVendaVO();\n\t\t\t\tcanalVendaVazio.setCanalDeVenda(list.get(indiceElementoNaoEncontrado).getCanalDeVenda());\n\t\t\t\tcanalVendaVazio.setProduto(list.get(indiceElementoNaoEncontrado).getProduto());\n\t\t\t\tcanalVendaVazio.setTipo(\"Quantidade\");\n\t\t\t\tcanalVendaVazio.setMeses(meses);\n\n\t\t\t\tlist.add(((list.size() + 1) / 2 + indiceElementoNaoEncontrado), canalVendaVazio);// aqui\n\t\t\t\t/* estou ordenando tudo que é tipo 'Valor' antes de 'Quantidade' */\n\t\t\t} else {// Qtd eh maior\n\t\t\t\touter: for (int i = 0; i < list.size(); i++) {\n\t\t\t\t\tif (list.get(i).getTipo().equalsIgnoreCase(\"Quantidade\")) {\n\n\t\t\t\t\t\t// System.out.println();\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// System.out.print(\" 1 | \"\n\t\t\t\t\t\t// + list.get(i).getCanalDeVenda());\n\t\t\t\t\t\t// System.out.println();\n\n\t\t\t\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\t\t\t\tint achou = -1;\n\t\t\t\t\t\t\tif (list.get(j).getTipo().equalsIgnoreCase(\"Valor\")) {\n\n\t\t\t\t\t\t\t\t// System.out.print(\" 2 | \"+\n\t\t\t\t\t\t\t\t// list.get(j).getCanalDeVenda());\n\t\t\t\t\t\t\t\t// System.out.println();\n\n\t\t\t\t\t\t\t\tif (list.get(i).getCanalDeVenda().equals(list.get(j).getCanalDeVenda())) {\n\t\t\t\t\t\t\t\t\tachou = j;\n\t\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (j == list.size() - 1 && achou == -1) {\n\t\t\t\t\t\t\t\t\tindiceElementoNaoEncontrado = i;\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\n\t\t\t\tString[] meses = { \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\" };\n\n\t\t\t\tMovimentoPorCanalDeVendaVO canalVendaVazio = new MovimentoPorCanalDeVendaVO();\n\t\t\t\tcanalVendaVazio.setCanalDeVenda(list.get(indiceElementoNaoEncontrado).getCanalDeVenda());\n\t\t\t\tcanalVendaVazio.setProduto(list.get(indiceElementoNaoEncontrado).getProduto());\n\t\t\t\tcanalVendaVazio.setTipo(\"Valor\");\n\t\t\t\tcanalVendaVazio.setMeses(meses);\n\n\t\t\t\tlist.add(((list.size() + 1) / 2 + indiceElementoNaoEncontrado), canalVendaVazio);// aqui\n\t\t\t\t/* estou ordenando tudo que é tipo 'Valor' antes de 'Quantidade' */\n\n\t\t\t}\n\n\t\t}\n\n\t\t/*\n\t\t * ===Primeiro crio os objetos com os totais=========\n\t\t */\n\t\tfor (MovimentoPorCanalDeVendaVO emi : list) {\n\n\t\t\tif (emi.getTipo().equals(\"Valor\")) {\n\n\t\t\t\tfor (int i = 0; i < emi.getMeses().length; i++) {\n\t\t\t\t\tmesesTotaisValor[i] = new BigDecimal(mesesTotaisValor[i]).add(new BigDecimal(emi.getMeses()[i]))\n\t\t\t\t\t\t\t.toString();\n\t\t\t\t}\n\n\t\t\t} else if (emi.getTipo().equals(\"Quantidade\")) {\n\n\t\t\t\tfor (int i = 0; i < emi.getMeses().length; i++) {\n\t\t\t\t\tmesesTotaisQuantidade[i] = Integer.toString(\n\t\t\t\t\t\t\t(Integer.parseInt(mesesTotaisQuantidade[i]) + Integer.parseInt(emi.getMeses()[i])));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tanoTotal = emi.getAno();\n\t\t\tprodutoTotal = emi.getProduto();\n\n\t\t}\n\n\t\tMovimentoPorCanalDeVendaVO totalValor = new MovimentoPorCanalDeVendaVO();\n\t\tMovimentoPorCanalDeVendaVO totalQuantidade = new MovimentoPorCanalDeVendaVO();\n\n\t\ttotalValor.setCanalDeVenda(\"Total\");\n\t\ttotalValor.setProduto(produtoTotal);\n\t\ttotalValor.setTipo(\"Valor\");\n\t\ttotalValor.setAno(anoTotal);\n\t\ttotalValor.setMeses(mesesTotaisValor);\n\t\tlistTotal.add(totalValor);\n\n\t\ttotalQuantidade.setCanalDeVenda(\"Total\");\n\t\ttotalQuantidade.setProduto(produtoTotal);\n\t\ttotalQuantidade.setTipo(\"Quantidade\");\n\t\ttotalQuantidade.setAno(anoTotal);\n\t\ttotalQuantidade.setMeses(mesesTotaisQuantidade);\n\t\tlistTotal.add(totalQuantidade);\n\n\t\t/*\n\t\t * ===Agora calculo os percentuais=========\n\t\t */\n\n\t\tfinal int VALOR = 0;\n\t\tfinal int QUANTIDADE = 1;\n\n\t\tDecimalFormat percentForm = new DecimalFormat(\"0.00%\");\n\t\tDecimalFormat roundForm = new DecimalFormat(\"0.00\");\n\t\tUteis uteis = new Uteis();\n\t\tList<MovimentoPorCanalDeVendaVO> listFinal = new ArrayList<MovimentoPorCanalDeVendaVO>();\n\n\t\tfor (int i = 0; i < list.size() / 2; i++) {\n\t\t\tMovimentoPorCanalDeVendaVO emissaoValor = new MovimentoPorCanalDeVendaVO();\n\t\t\t/* ===VALOR==== */\n\t\t\temissaoValor.setCanalDeVenda(list.get(i).getCanalDeVenda());\n\t\t\temissaoValor.setTipo(list.get(i).getTipo());\n\t\t\temissaoValor.setMeses(list.get(i).getMeses());\n\n\t\t\tMovimentoPorCanalDeVendaVO emissaoValorPercent = new MovimentoPorCanalDeVendaVO();\n\t\t\t/* ===%=VALOR==== */\n\t\t\temissaoValorPercent.setCanalDeVenda(list.get(i).getCanalDeVenda());\n\t\t\temissaoValorPercent.setTipo(\"% \" + list.get(i).getTipo());\n\n\t\t\tString[] mesesPercentValor = new String[12];\n\t\t\tfor (int k = 0; k < list.get(i).getMeses().length; k++) {\n\n\t\t\t\ttry {\n\t\t\t\t\tdouble total = Double.parseDouble(new BigDecimal(list.get(i).getMeses()[k])\n\t\t\t\t\t\t\t.divide(new BigDecimal(listTotal.get(VALOR).getMeses()[k]), 5, RoundingMode.HALF_DOWN)\n\t\t\t\t\t\t\t.toString());\n\t\t\t\t\tmesesPercentValor[k] = percentForm.format(total);\n\n\t\t\t\t} catch (ArithmeticException e) {\n\t\t\t\t\tmesesPercentValor[k] = \"0%\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\temissaoValorPercent.setMeses(mesesPercentValor);\n\n\t\t\tMovimentoPorCanalDeVendaVO emissaoQuantidade = new MovimentoPorCanalDeVendaVO();\n\t\t\t/* ===QUANTIDADE==== */\n\t\t\tint j = list.size() / 2;\n\t\t\temissaoQuantidade.setCanalDeVenda(list.get(j + i).getCanalDeVenda());\n\t\t\temissaoQuantidade.setTipo(list.get(j + i).getTipo());\n\t\t\temissaoQuantidade.setMeses(list.get(j + i).getMeses());\n\n\t\t\tMovimentoPorCanalDeVendaVO emissaoQuantidadePercent = new MovimentoPorCanalDeVendaVO();\n\t\t\t/* ===%=QUANTIDADE==== */\n\t\t\temissaoQuantidadePercent.setCanalDeVenda(list.get(j + i).getCanalDeVenda());\n\t\t\temissaoQuantidadePercent.setTipo(\"% \" + list.get(j + i).getTipo());\n\n\t\t\tString[] mesesPercentQuantidade = new String[12];\n\t\t\tfor (int k = 0; k < list.get(j + i).getMeses().length; k++) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tdouble total = Double.parseDouble(list.get(j + i).getMeses()[k])\n\t\t\t\t\t\t\t/ Double.parseDouble(listTotal.get(QUANTIDADE).getMeses()[k]);\n\t\t\t\t\tmesesPercentQuantidade[k] = percentForm\n\t\t\t\t\t\t\t.format(Double.toString(total).equalsIgnoreCase(\"NaN\") ? 0.0 : total);\n\n\t\t\t\t} catch (ArithmeticException e) {\n\t\t\t\t\tmesesPercentQuantidade[k] = \"0%\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\temissaoQuantidadePercent.setMeses(mesesPercentQuantidade);\n\n\t\t\tString[] valorFormatado = new String[12];\n\t\t\tfor (int k = 0; k < emissaoValor.getMeses().length; k++) {\n\t\t\t\tvalorFormatado[k] = uteis\n\t\t\t\t\t\t.insereSeparadoresMoeda(roundForm.format(Double.parseDouble(emissaoValor.getMeses()[k])));\n\n\t\t\t}\n\t\t\temissaoValor.setMeses(valorFormatado);\n\n\t\t\tString[] valorFormatado2 = new String[12];\n\t\t\tfor (int k = 0; k < emissaoQuantidade.getMeses().length; k++) {\n\t\t\t\tvalorFormatado2[k] = uteis.insereSeparadores(emissaoQuantidade.getMeses()[k]);\n\t\t\t}\n\t\t\temissaoQuantidade.setMeses(valorFormatado2);\n\n\t\t\tlistFinal.add(emissaoValor);\n\t\t\tlistFinal.add(emissaoValorPercent);\n\t\t\tlistFinal.add(emissaoQuantidade);\n\t\t\tlistFinal.add(emissaoQuantidadePercent);\n\n\t\t}\n\n\t\treturn listFinal;\n\n\t}", "public Queue mejoresPromediosMes(int TamañoArreglo, int mes )\n\t{\n\t\tQueue Respuesta = null;\n\n\t\t//Pasa los arreglos de queue mes a un arreglo temporal \n\t\tQueue f = queueMonthly;\n\t\tQueue pre = null;\n\t\tfor(int i = 0; i< (queueMonthly.darNumeroElementos()-1); i++)\n\t\t{\n\t\t\tdouble[] dato= (double[]) queueMonthly.dequeue();\n\t\t\tUBERTrip datof = new UBERTrip((short)dato[0],(short)dato[1], (short)dato[2],(float) dato[3],(float) dato[4], (float)dato[5],(float) dato[6]);\n\t\t\t\n\t\t\tpre.enqueue(datof);\n\t\t}\n\n\t\tUBERTrip[] arreglo = new UBERTrip[pre.darNumeroElementos()]; \n\n\t\tfor(int z= 0; z< pre.darNumeroElementos(); z ++)\n\t\t{\n\t\t\tUBERTrip y = (UBERTrip) pre.dequeue();\n\t\t\tarreglo[z] = y;\n\t\t}\n\n\t\t//Separo el arreglo por los datos del mes solicitado \n\t\tUBERTrip[] arregloMes= new UBERTrip[pre.darNumeroElementos()];\n\n\t\tint posicion = 0;\n\n\t\tfor(int j = 0; j< arreglo.length; j++)\n\t\t{\n\t\t\tdouble[] x = arreglo[j].darDatosViaje();\n\n\t\t\tif(x[2] == mes)\n\t\t\t{\n\t\t\t\tarregloMes[posicion] = arreglo[j]; \n\t\t\t\tposicion ++;\n\t\t\t}\n\t\t}\n\n\t\t// Ordenamiento por insercion\n\t\tfor (int i=1; i < arregloMes.length; i++) \n\t\t{\n\t\t\tUBERTrip aux = arregloMes[i];\n\n\t\t\tint j = 0;\n\n\t\t\tdouble datosArreglomes[] = arregloMes[j].darDatosViaje();\n\t\t\tdouble datosAux[] = aux.darDatosViaje();\n\n\t\t\tfor (j=i-1; j >= 0 && datosArreglomes[3] > datosAux[3]; j--)\n\t\t\t{\n\t\t\t\tarregloMes[j+1] = arregloMes[j];\n\t\t\t}\n\t\t\tarregloMes[j+1] = aux;\n\t\t}\n\n\t\t// Retorna los N elementos \n\t\tfor(int i =0; i< TamañoArreglo; i++)\n\t\t{\n\t\t\tRespuesta.enqueue(arregloMes[i]);\n\t\t}\n\n\t\treturn Respuesta;\n\t}" ]
[ "0.6486942", "0.6334985", "0.6298876", "0.6179184", "0.6075658", "0.60067904", "0.60050267", "0.5979842", "0.5971322", "0.59548366", "0.59081805", "0.59080476", "0.58723277", "0.58561367", "0.57928765", "0.5790458", "0.57832646", "0.57651234", "0.57508534", "0.57398367", "0.573409", "0.572614", "0.57064176", "0.5694137", "0.5690286", "0.568495", "0.56595576", "0.565705", "0.56507397", "0.5649199", "0.56464905", "0.5631821", "0.56266385", "0.5591246", "0.5586494", "0.5586381", "0.5585735", "0.55810094", "0.5580443", "0.55782104", "0.55730706", "0.5571923", "0.5569512", "0.55606586", "0.55524576", "0.55476123", "0.55463785", "0.55445427", "0.55402803", "0.5537745", "0.55369115", "0.5530788", "0.5518619", "0.5517321", "0.55152893", "0.5511242", "0.5494855", "0.5492549", "0.54873157", "0.54843694", "0.5480236", "0.54783744", "0.5477797", "0.547609", "0.54705256", "0.54670393", "0.5466626", "0.5464993", "0.5463671", "0.546259", "0.5455259", "0.5455095", "0.5448701", "0.54432786", "0.54430157", "0.54372096", "0.54304796", "0.54266596", "0.54234785", "0.54154557", "0.54097956", "0.540962", "0.54090464", "0.54018575", "0.53965527", "0.5391016", "0.53872126", "0.5385726", "0.53719497", "0.53616935", "0.53604716", "0.5360129", "0.5359777", "0.5357366", "0.5356917", "0.5346286", "0.53453296", "0.5345198", "0.5344255", "0.5341573", "0.5339638" ]
0.0
-1
Clientes con sus mascotas
public LinkedList<PetVO> getAllPetsCustomers() { xcon = MySQLConnection.getInstance(); LinkedList<PetVO> petList = new LinkedList<>(); try { PreparedStatement ps = xcon.getConnection().prepareCall("{call sp_getPetsCustomers_ReportExcel}"); ResultSet rs = ps.executeQuery(); while(rs.next()) { PetVO pet = new PetVO(); CustomerVO customer = new CustomerVO(); customer.setId(rs.getInt("CustomerID")); customer.setName(rs.getString("CusName")); customer.setLastname(rs.getString("CusLastname")); customer.setAddress(rs.getString("CusAddress")); customer.setPhone(rs.getString("CusPhone")); customer.setEmail(rs.getString("CusEmail")); pet.setCode(rs.getString("PetCode")); pet.setName(rs.getString("PetName")); pet.setAge(rs.getInt("PetAge")); pet.setWeight(rs.getFloat("PetWeight")); pet.setSpecie(rs.getString("PetSpecie")); pet.setCustomer(customer); petList.add(pet); } } catch (SQLException e) { JOptionPane.showMessageDialog(null, "Query error" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } catch (Exception e) { JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } finally { xcon.close_connection(); } return petList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }", "void realizarSolicitud(Cliente cliente);", "public void carregarCliente() {\n\t\tgetConnection();\n\t\ttry {\n\t\t\tString sql = \"SELECT CLIENTE FROM CLIENTE ORDER BY CLIENTE\";\n\t\t\tst = con.createStatement();\n\t\t\trs = st.executeQuery(sql);\n\t\t\twhile(rs.next()) {\n\t\t\t\tcbCliente.addItem(rs.getString(\"CLIENTE\"));\n\t\t\t}\n\t\t}catch(SQLException e) {\n\t\t\tSystem.out.println(\"ERRO\" + e.toString());\n\t\t}\n\t}", "public void Pedircarnet() {\n\t\tSystem.out.println(\"solicitar carnet para verificar si es cliente de ese consultorio\");\r\n\t}", "@Override\n\tpublic void cadastrar(Cliente o) {\n\t\t\n\t}", "public AgregarClientes(Directorio directorio) {\n initComponents();\n this.directorio=directorio;\n \n \n }", "private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}", "private void peticionDeCliente() throws IOException, InterruptedException {\n\t\tString mensaje = null;\n\t\tboolean salir = false;\n\t\twhile(!salir) {\n\t\t\tmensaje = in.readLine();\n\t\t\tif(mensaje!=null && !mensaje.split(\";\")[0].equals(\"Comprobacion\")) {\n\t\t\t\tthis.tcpServidor.colaPeticion.put(mensaje); //ALMACENA SOLICITUD EN COLA_PETICIONES\n\t\t\t\tSystem.out.println(\"Peticion del cliente \"+this.idCliente+\": \"+ mensaje);\n\t\t\t}\n\t\t}\n\t}", "public Cliente() {\r\n\t\tSystem.out.println(\"El cliente es: Diego Juarez \"+\"\\n\");\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\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}", "public static void main(String [ ] args){\n\t\t Fecha Hoy = new Fecha(12,12,2020);\r\n\t\t ArrayList<Cuenta> cuentas = new ArrayList<Cuenta>();\r\n\t\t \r\n\t\t Cuenta c0 = new CtaAhorros(10000,10);\r\n\t\t Cuenta c1 = new CtaCheques(256070,0);\r\n\t\t Cuenta c2 = new CtaCredito(13245,100);\r\n\t\t Cuenta c3 = new CtaCheques(765,20);\r\n\t\t Cuenta c4 = new CtaAhorros(9000,20);\r\n\t\t Cuenta c5 = new CtaAhorros(2300,10);\r\n\t\t Cuenta c6 = new CtaCredito(25000,12);\r\n\t\t \r\n\t\t cuentas.add(c0);\r\n\t\t cuentas.add(c1);\r\n\t\t cuentas.add(c2);\r\n\t\t cuentas.add(c3);\r\n\t\t cuentas.add(c4);\r\n\t\t cuentas.add(c5);\r\n\t\t \r\n\t\t Cliente C1=new Cliente(\"QUIJOTE\",cuentas,\"QX400\");\r\n\t\t Hoy.AvanzarTiempo(11,1,0);\r\n\t\t \r\n\t\t C1.depositar(1,1200, Hoy);\r\n\t\t C1.retirar(2,1100, Hoy);\r\n\t\t System.out.println(\"saldo cuenta 3:\"+C1.consultar(3,Hoy));\r\n\t\t C1.depositar(4,600, Hoy);\r\n\t\t \r\n\t\t //C1.reportarEdosCtas();\r\n\t\t \r\n\t\t }", "public Clientes() {\n\t\tclientes = new Cliente[MAX_CLIENTES];\n\t}", "private static void menuCadastroCliente() throws Exception {\r\n String nome, email, cpf;\r\n int id;\r\n boolean erro = false;\r\n System.out.println(\"\\n\\t*** Cadastro ***\\n\");\r\n System.out.print(\"Nome completo: \");\r\n nome = read.nextLine();\r\n System.out.print(\"Email: \");\r\n email = read.next();\r\n do {\r\n System.out.print(\"CPF: \");\r\n cpf = read.next().replace(\".\", \"\").replace(\"-\", \"\");\r\n System.out.println(cpf);\r\n if (cpf.length() != 11) {\r\n System.out.println(\"CPF inválido!\\nDigite novamente!\");\r\n erro = true;\r\n }\r\n } while (erro);\r\n if (getCliente(email) == null) {\r\n\r\n id = arqClientes.inserir(new Cliente(nome, email, cpf));\r\n System.out.println(\"Guarde seu email, pois é através dele que você efetua o login em nossa plataforma\");\r\n System.out.println(\"Cadastro efetuado!\");\r\n gerenciadorSistema();\r\n } else {\r\n System.out.println(\"\\nJá existe Usuario com esse email!\\nCadastro cancelado!\");\r\n }\r\n }", "private void enviarMensagem(String mensagem) {\n //Este for anda de acordo com o tamanho do array da mensagem\n for ( int a = 0; a < clientes.size(); a++ ) {\n //Enquanto o cliente estiver enviado ele pega a mensagem\n clientes.get(a).println(mensagem);\n clientes.get(a).flush();\n }\n }", "private static void esperarCliente() {\n try {\n socket = serverSocket.accept();\n System.out.println(\"Cliente conectado...\");\n } catch (IOException ex) {\n Logger.getLogger(ServidorUnicauca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void conectar() {\n \n try {\n String host = \"localhost\";\n int port = 19999;\n StringBuffer mensaje = new StringBuffer();\n \n InetAddress ia = InetAddress.getByName(host);\n Socket connection = new Socket(ia, port);\n \n BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());\n OutputStreamWriter osw = new OutputStreamWriter(bos);\n \n Random r = new Random();\n \n Integer i = r.nextInt(50);\n String s;\n s = i.toString() + (char) 13;\n osw.write(s);\n osw.flush();\n \n BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());\n InputStreamReader isr = new InputStreamReader(bis);\n \n int caracter;\n while ((caracter = isr.read()) != 13) {\n mensaje.append((char) caracter);\n }\n \n area.setText(mensaje.toString());\n \n connection.close();\n } catch (UnknownHostException ex) {\n System.out.println(ex.toString());\n \n } catch (IOException ex) {\n System.out.println(ex.toString());\n }\n \n }", "@Override\r\n\tpublic void buscarCliente(String dato) {\n\t\tList<Cliente> listaEncontrados = clienteDao.buscarContrato(dato);\r\n\t\tvistaCliente.mostrarClientes(listaEncontrados);\r\n\t}", "public void verificarDatosConsola(Cliente cliente, List<Cuenta> listaCuentas) {\n\n int codigoCliente = cliente.getCodigo();\n\n System.out.println(\"Codigo: \"+cliente.getCodigo());\n System.out.println(\"Nombre: \"+cliente.getNombre());\n System.out.println(\"DPI: \"+cliente.getDPI());\n System.out.println(\"Direccion: \"+cliente.getDireccion());\n System.out.println(\"Sexo: \"+cliente.getSexo());\n System.out.println(\"Password: \"+cliente.getPassword());\n System.out.println(\"Tipo de Usuario: \"+ 3);\n\n System.out.println(\"Nacimiento: \"+cliente.getNacimiento());\n System.out.println(\"ArchivoDPI: \"+cliente.getDPIEscaneado());\n System.out.println(\"Estado: \"+cliente.isEstado());\n \n \n for (Cuenta cuenta : listaCuentas) {\n System.out.println(\"CUENTAS DEL CLIENTE\");\n System.out.println(\"Numero de Cuenta: \"+cuenta.getNoCuenta());\n System.out.println(\"Fecha de Creacion: \"+cuenta.getFechaCreacion());\n System.out.println(\"Saldo: \"+cuenta.getSaldo());\n System.out.println(\"Codigo del Dueño: \"+codigoCliente);\n \n }\n \n\n\n }", "Cliente(){}", "public ClientesCadastrados() {\n initComponents();\n tabelaClientes();\n Tabela.setRowSelectionAllowed(false);\n Tabela.getTableHeader().setReorderingAllowed(false);\n setIcone();\n }", "public TelaCliente() {\n\n try {\n Handler console = new ConsoleHandler();\n Handler file = new FileHandler(\"/tmp/roquerou.log\");\n console.setLevel(Level.ALL);\n file.setLevel(Level.ALL);\n file.setFormatter(new SimpleFormatter());\n LOG.addHandler(file);\n LOG.addHandler(console);\n LOG.setUseParentHandlers(false);\n } catch (IOException io) {\n LOG.warning(\"O ficheiro hellologgin.xml não pode ser criado\");\n }\n\n initComponents();\n NivelDAO nd = new NivelDAO();\n if (nd.buscar() == 3) {\n botaoNovoCliente.setEnabled(false);\n buscarcli.setEnabled(false);\n tabelaCliente.setEnabled(false);\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n } else {\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n }\n }", "public void makeClient() {\n try {\n clienteFacade.create(cliente);\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cliente creado exitosamente\", null));\n } catch (Exception e) {\n System.err.println(\"Error en la creacion del usuario: \" + e.getMessage());\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_FATAL, e.getMessage(), null));\n }\n }", "public void run() {\n\t\ttry {\n\t\t\tin = new BufferedReader(new InputStreamReader(cliente.getInputStream()));\n\t\t\tmOut = new PrintWriter(new BufferedWriter(new OutputStreamWriter(cliente.getOutputStream())), true);\n\n\t\t\tint comparar = idCliente(); //recibe id del cliente\n\t\t\tif(comparar==0) { \n\t\t\t\t//ENVIA id PARA EL CLIENTE\n\t\t\t\tthis.tcpServidor.maxCliente++;\n\t\t\t\tenviarMensaje(\"ID;\"+this.tcpServidor.maxCliente);\n\t\t\t\t//ENVIA maxCliente A TODAS LAS REPLICAS\n\t\t\t\tfor (HiloReplica h : this.tcpServidor.hiloReplica) {\n\t\t\t\t\th.enviarMensaje(\"MAXCLIENTE;\"+this.tcpServidor.maxCliente);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.idCliente = comparar; //GUARDA id DEL CLIENTE\n\t\t\t}\n\t\n\t\t\tSystem.out.println(\"Cliente \"+this.idCliente+\" conectado a Balanceado \"+this.tcpServidor.id);\n\t\t\t\n\t\t\tpeticionDeCliente();\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t//System.out.println(\"HiloCliente\" + \": Error\" + e);\n\t\t}\n\t}", "public Client buscarClientePorId(String id){\n Client client = new Client();\n \n // Faltaaaa\n \n \n \n \n \n return client;\n }", "public void cadastrar(Cliente cliente){\n\t\tSystem.out.println(cliente.toString());\r\n\t\tint tamanho = this.clientes.length;\r\n\t\tthis.clientes = Arrays.copyOf(this.clientes, this.clientes.length + 1);\r\n\t\tthis.clientes[tamanho - 1] = cliente;\r\n\t}", "@Override\n\tpublic void asignarClienteAcobrador() {\n\t\tSet<ClienteProxy> lista=grid.getMultiSelectionModel().getSelectedSet();\t\t\n\t\tif(!lista.isEmpty()){\n\t\t\tFACTORY.initialize(EVENTBUS);\n\t\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\t\t\t\n\t\t\tRequest<Boolean> request=context.asignarClientesAlCobrador(lista, beanGestorCobranza.getIdUsuarioOwner(), beanGestorCobranza.getIdUsuarioCobrador() , beanGestorCobranza.getIdGestorCobranza());\n\t\t\trequest.fire(new Receiver<Boolean>(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(Boolean response) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tgoToBack();\n\t\t\t\t}});\n\t\t}else{\n\t\t\tNotification not=new Notification(Notification.ALERT,constants.seleccioneCliente());\n\t\t\tnot.showPopup();\n\t\t}\n\t}", "public VistaConsultarMovimientosPorCliente() {\n initComponents();\n continuarInicializandoComponentes();\n }", "public Cliente(String nombre,int comensales){\n\t\tthis.nombre = nombre;\n\t\tthis.comensales =comensales;\n\t}", "public void majAffichageConnectes() {\n effacerConnectes(); // on efface ce qui est deja ecrit dans la zone reservees a la liste des\n // connectes\n\n choixMessage.removeAllItems(); // Suppression de tous les items de la comboBox\n choixMessage.addItem(\"Tout le monde\");\n choixMessage.setSelectedIndex(0); // Par defaut => envoi a tout le monde\n\n // Parcours de la liste des personnes connectees\n for (Map.Entry<String, Color> entry : couleurs.entrySet()) {\n String nom = entry.getKey(); // recuperation du nom\n Color rgb = new Color(chercherCouleur(nom)); // recuperation de la couleur correspondante\n\n // Mise a jour de la combobox\n if(!fenetre.getClient().getNom().equals(nom)){\n choixMessage.addItem(nom);\n }\n\n // Mise a jour de l'affichage dans le panneau \"Connectes\"\n StyledDocument doc = connectes.getStyledDocument();\n StyleContext style = StyleContext.getDefaultStyleContext();\n // Modification de la couleur\n AttributeSet aset = style.addAttribute(style.getEmptySet(), StyleConstants.Foreground, rgb);\n // Mettre en gras\n aset = style.addAttributes(aset, style.addAttribute(style.getEmptySet(), StyleConstants.Bold, true));\n\n // ajout de la personne dans la liste avec la couleur correspondante\n try {\n doc.insertString(doc.getLength(), nom+\"\\n\", aset);\n } catch (BadLocationException e) {\n e.printStackTrace();\n }\n }\n\n System.out.println(\"maj de l'affichage de la liste des connectes\");\n }", "public TelaCliente() {\n initComponents();\n conexao=ModuloConexao.conector();\n }", "public void selecionarCliente() {\n int cod = tabCliente.getSelectionModel().getSelectedItem().getCodigo();\n cli = cli.buscar(cod);\n\n cxCPF.setText(cli.getCpf());\n cxNome.setText(cli.getNome());\n cxRua.setText(cli.getRua());\n cxNumero.setText(Integer.toString(cli.getNumero()));\n cxBairro.setText(cli.getBairro());\n cxComplemento.setText(cli.getComplemento());\n cxTelefone1.setText(cli.getTelefone1());\n cxTelefone2.setText(cli.getTelefone2());\n cxEmail.setText(cli.getEmail());\n btnSalvar.setText(\"Novo\");\n bloquear(false);\n }", "public void gravarCliente() {\n\t\tCliente cliente = new DAO<Cliente>(Cliente.class)\n\t\t\t\t.buscaPorId(this.clienteId);\n\t\tthis.solicitacao.adicionaCliente(cliente);\n\t\tSystem.out.println(\"Cliente a gravar é \" + cliente.getNome());\n\t}", "public ClienteConsultas() {\n listadeClientes = new ArrayList<>();\n clienteSeleccionado = new ArrayList<>();\n }", "@Override\n\tpublic void cargarClienteSinCobrador() {\n\t\tpopup.showPopup();\n\t\tif(UIHomeSesion.usuario!=null){\n\t\tlista = new ArrayList<ClienteProxy>();\n\t\tFACTORY.initialize(EVENTBUS);\n\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\n\t\tRequest<List<ClienteProxy>> request = context.listarClienteSinCobrador(UIHomeSesion.usuario.getIdUsuario()).with(\"beanUsuario\");\n\t\trequest.fire(new Receiver<List<ClienteProxy>>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<ClienteProxy> response) {\n\t\t\t\tlista.addAll(response);\t\t\t\t\n\t\t\t\tgrid.setData(lista);\t\t\t\t\n\t\t\t\tgrid.getSelectionModel().clear();\n\t\t\t\tpopup.hidePopup();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n public void onFailure(ServerFailure error) {\n popup.hidePopup();\n //Window.alert(error.getMessage());\n Notification not=new Notification(Notification.WARNING,error.getMessage());\n not.showPopup();\n }\n\t\t\t\n\t\t});\n\t\t}\n\t}", "public void iniciar() {\n abrirPuerto();\n\n while (true) {\n esperarCliente();\n lanzarHilo();\n }\n }", "public CadastrarCliente() {\n initComponents();\n initComponents();\n FormatCamp();\n setLocation(110, 0);\n }", "public DmaiClient() {\r\n\t\tthis.mainView = new MainView();\r\n\t\tconnexionServeur();\r\n\r\n\t}", "public void AfficherListClient() throws Exception{\n laListeClient = Client_Db_Connect.tousLesClients();\n laListeClient.forEach((c) -> {\n modelClient.addRow(new Object[]{ c.getIdent(),\n c.getRaison(),\n c.getTypeSo(),\n c.getDomaine(),\n c.getAdresse(),\n c.getTel(),\n c.getCa(),\n c.getComment(),\n c.getNbrEmp(),\n c.getDateContrat(),\n c.getAdresseMail()});\n });\n }", "public List<Cliente> mostrarClientes()\n\t{\n\t\tCliente p;\n\t\tif (! clientes.isEmpty())\n\t\t{\n\t\t\t\n\t\t\tSet<String> ll = clientes.keySet();\n\t\t\tList<String> li = new ArrayList<String>(ll);\n\t\t\tCollections.sort(li);\n\t\t\tListIterator<String> it = li.listIterator();\n\t\t\tList<Cliente> cc = new ArrayList<Cliente>();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tp = clientes.get(it.next());\n\t\t\t\tcc.add(p);\n\t\t\t\t\n\t\t\t}\n\t\t\t//Collections.sort(cc, new CompararCedulasClientes());\n\t\t\treturn cc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public void Conectar(){\n Executors.newSingleThreadExecutor().execute(() -> {\n try {\n ws.connect();\n // se indica que el proposito del mensaje es identificar este nodo.\n // para lo cual se manda en el cuerpo que se trata de una tablet origin\n // y se envia la identificacion.\n String mensaje = buildMessage(this.PROPOSITO_ID, this.id, this.TABLET_ORIG);\n ws.sendText(mensaje);\n } catch (WebSocketException e) {\n e.printStackTrace();\n }\n });\n }", "public ManterCliente() {\n try {\n initComponents();\n BloquearCampos();\n bt_salvar.setEnabled(false);\n bt_editar.setEnabled(false);\n txt_codigo.setEditable(true);\n mascaraCNPJ = new MaskFormatter(\"###.###.###/####-##\");\n mascaraCPF = new MaskFormatter(\"###.###.###-##\");\n } catch (ParseException ex) {\n JOptionPane.showMessageDialog(null, \"Erro ao carregar formulário. Contate o suporte.\");\n }\n }", "@Override\n public void run() {\n while(true) {\n try {\n // Caixa dorme até que algum cliente o acorde\n ativo.acquire();\n // atende o cliente\n atender(atendido);\n // volta a estar disponível para atender um novo cliente\n disponivel = true;\n // incrementa o número de caixas a dormir (pois ele passará a dormir)\n this.mutexCaixasDormindo.acquire();\n SystemManager.getInstance().setNumeroCaixasDormindo(SystemManager.getInstance().getNumeroCaixasDormindo() + 1);\n this.mutexCaixasDormindo.release();\n // acorda o próximo cliente, caso haja algum\n SystemManager.getInstance().chamarProximoCliente();\n // incrementa a quantidade de caixas que etão disponíveis\n caixas.release();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "public void ingresarCliente() {\n\tint cambio=0;\n\t\t\t\n\tsetNombre(JOptionPane.showInputDialog(\"Introduce el nombre\"));\n\tdo {\n\t\t\n\t\tsetDni(JOptionPane.showInputDialog(\"Introduce el DNI de \" + getNombre()+\".\"));\n\t\tif(getDni().length()<7||getDni().length()>7) {\n\t\t\tJOptionPane.showMessageDialog(null, \"El DNI debe contener 7 numeros!\");\n\t\t}else {\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}while(getDni().length()<7||getDni().length()>7);\n\t\n\t\n\tdo {\n\t\ttry {\n\t\t\tsetSalario(Double.parseDouble(JOptionPane.showInputDialog(\"Introduce el salario en � correspondiente a \" + getNombre()+\".\")));\n\t\t\tcambio=1;\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Ingrese unicamente numeros\");\n\t\t\tcambio=0;\n\t\t}\n\t} while (cambio==0);\n\t\n}", "public Sesion(Cliente cl) {\n this.cliente = cl;\n estado = Estado.inicioBot;\n accion = Accion.iniciarSesion;\n valor = ValorAIngresar.pin;\n mensajeRecibido = null;\n respuesta = new Respuesta();\n }", "private void enviarPaqueteACliente(DatagramPacket recibirPaquete) throws IOException {\n try {\n\n mostrarMensaje(\"\\n\\nRepitiendo datos al cliente...\");\n byte datos[] = new byte[100];\n datos = mensaje.getBytes();\n //crea paquete a enviar\n DatagramPacket enviarPaquete = new DatagramPacket(\n datos, datos.length,\n recibirPaquete.getAddress(), recibirPaquete.getPort());\n\n socket.send(enviarPaquete);//enviar el paquete\n mostrarMensaje(\"Paquete enviado\\n\");\n } catch (NullPointerException e) {\n }\n\n }", "public TelaCliente() {\n \n CadCli = new Dao_CadastroCliente();\n initComponents();\n BtPesquisarConsulta.setEnabled(false);\n BtSalvarCli.setEnabled(false);\n BtAlterarCli.setEnabled(false);\n TipodeViaCli.setEnabled(false);\n TxEstadoCli.setEnabled(false);\n BtBuscarCli.setEnabled(false);\n BtLimparCli.setEnabled(false);\n TxTipoPessoa.setEnabled(false);\n PnlPj.setVisible(false);\n PnlPf.setVisible(false);\n centralizarComponente();\n\n }", "public void clientRun() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\ttry {\r\n\t\t\t\t InetAddress address = InetAddress.getLocalHost();\r\n\t\t\t\tSocket clientSocket = new Socket(address, this.localport);\r\n\t\t\t\tPrintStream output = new PrintStream(clientSocket.getOutputStream());\r\n\t\t\t\tString text = Integer.toString(this.compteur);\r\n\t\t\t\tScanner sc = new Scanner(clientSocket.getInputStream());\r\n\t\t\t\tPrintWriter printWrite= new PrintWriter(output);\r\n\t\t\t\tprintWrite.println(text);\r\n\t\t\t\tprintWrite.flush();// Nécessaire pour le bon fonctionnement.\r\n\t\t\t\tif (sc.hasNext()) {\r\n\t\t\t\t\tString texte2 = sc.nextLine();\r\n\t\t\t\t\tthis.result = Integer.parseInt(texte2);\r\n\t\t\t\t}\r\n\t\t\t\tclientSocket.close();\r\n\t\t\t\tsc.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public static MeuResultSet getClientes() throws Exception\n {\n MeuResultSet resultado = null;\n\n try\n {\n String sql;\n\n sql = \"SELECT * \" +\n \"FROM PpCliente\";\n\n BDSQLServer.COMANDO.prepareStatement (sql); //Guarda os comandos\n\n resultado = (MeuResultSet)BDSQLServer.COMANDO.executeQuery (); //Guarda os resultados em uma variável\n }\n catch (SQLException erro)\n {\n throw new Exception (\"Erro ao recuperar clientes\");\n }\n\n return resultado;\n }", "public TelaPesquisarClientes() {\n initComponents();\n }", "public CadastroClientes() {\n initComponents();\n }", "void grabarCliente(){\n RequestParams params = new RequestParams();\n params.put(\"nombre\",edtNombre.getText().toString().trim());\n params.put(\"apellido\",edtApellido.getText().toString().trim());\n params.put(\"correo\", edtCorreo.getText().toString().trim());\n String claveMD5 = edtClave.getText().toString().trim();\n try {\n params.put(\"clave\", ws.getMD5(claveMD5));\n } catch (Exception e) {\n e.printStackTrace();\n }\n params.put(\"id_cargo\",idCargo);\n params.put(\"autoriza\",validarCheckBoxAutoriza());\n crearUsuarioWS(params);\n }", "public Cliente() {\r\n\t \tsetTitle(\" Cliente\");\r\n\t \r\n\t//Campo de Texto en la parte inferior\r\n\t ingresoMensaje = new JTextField();\r\n\t ingresoMensaje.setFont(new Font(\"Arial\", Font.PLAIN, 11));\r\n\t ingresoMensaje.setEditable(false);\r\n\t getContentPane().add(ingresoMensaje, BorderLayout.SOUTH);\r\n\r\n\t//Hoja del chat centrado\r\n\t pantallaChat = new JTextArea();\r\n\t pantallaChat.setFont(new Font(\"Arial\", Font.PLAIN, 15));\r\n\t pantallaChat.setEditable(false);\r\n\t getContentPane().add(new JScrollPane(pantallaChat), BorderLayout.CENTER);\r\n\t pantallaChat.setBackground(Color.white);\r\n\t pantallaChat.setForeground(Color.black);\r\n\t ingresoMensaje.setForeground(Color.BLACK);\r\n\r\n\t//Crea opcione de Salir\r\n\t JMenuItem salir = new JMenuItem(\"Salir\");\r\n\t salir.setFont(new Font(\"Arial\", Font.PLAIN, 15));\r\n\t salir.setBackground(Color.WHITE);\r\n\t salir.setForeground(Color.BLACK);\r\n\t \r\n\t JMenuBar barra = new JMenuBar();\r\n\t setJMenuBar(barra);\r\n\t barra.add(salir);\r\n\t \r\n\r\n\t//Accion que se realiza Salir\r\n\t salir.addActionListener(new ActionListener() {\r\n\t public void actionPerformed(ActionEvent e) {\r\n\t System.exit(0); //Sale de la aplicacion\r\n\t }\r\n\t });\r\n\r\n\r\n\t ipServidor = JOptionPane.showInputDialog(null, \"Introduzca IP del servidor: \");\r\n\t setSize(574, 341);//tamano de la ventana del chat\r\n\t setVisible(true);//hace visible a la ventana\r\n\t }", "@Override\n\tpublic void altaCliente(Cliente cliente) {\n\t}", "private void addClient () {\n ArrayList<String> info = loadOnePlayerInfo();\n Ntotal++;\n Nnow++;\n\n System.out.println(\"Vai ser inicializado o utilizador \" + info.get(0));\n initThread(info.get(0), info.get(1));\n }", "public AreaClientes() {\n initComponents();\n cargarTabla();\n editarCliente(false);\n \n }", "public ListaCliente() {\n\t\tClienteRepositorio repositorio = FabricaPersistencia.fabricarCliente();\n\t\tList<Cliente> clientes = null;\n\t\ttry {\n\t\t\tclientes = repositorio.getClientes();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tclientes = new ArrayList<Cliente>();\n\t\t}\n\t\tObject[][] grid = new Object[clientes.size()][3];\n\t\tfor (int ct = 0; ct < clientes.size(); ct++) {\n\t\t\tgrid[ct] = new Object[] {clientes.get(ct).getNome(),\n\t\t\t\t\tclientes.get(ct).getEmail()};\n\t\t}\n\t\tJTable table= new JTable(grid, new String[] {\"NOME\", \"EMAIL\"});\n\t\tJScrollPane scroll = new JScrollPane(table);\n\t\tgetContentPane().add(scroll, BorderLayout.CENTER);\n\t\tsetTitle(\"Clientes Cadastrados\");\n\t\tsetSize(600,400);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetLocationRelativeTo(null);\n\t}", "public Cliente(){\r\n this.nome = \"\";\r\n this.email = \"\";\r\n this.endereco = \"\";\r\n this.id = -1;\r\n }", "public void obtenerTipificacionesCliente(Participante cliente)\n throws MareException {\n \n UtilidadesLog.info(\" DAOSolicitudes.obtenerTipificacionesCliente(Par\"\n +\"ticipante cliente):Entrada\");\n BelcorpService bs;\n RecordSet respuesta;\n String codigoError;\n StringBuffer query = new StringBuffer();\n\n if (cliente.getOidCliente() == null) {\n cliente.setTipificacionCliente(null);\n if(log.isDebugEnabled()) {//sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"---- NULO : \");\n UtilidadesLog.debug(\"---- cliente : \" + cliente.getOidCliente());\n } \n } else {\n try {\n bs = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n try {\n query.append(\" SELECT CLIE_OID_CLIE, \");\n query.append(\" CLAS_OID_CLAS, \");\n query.append(\" SBTI_OID_SUBT_CLIE, \");\n query.append(\" TCCL_OID_TIPO_CLASI, \");\n query.append(\" TICL_OID_TIPO_CLIE \");\n query.append(\" FROM V_MAE_TIPIF_CLIEN \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + cliente\n .getOidCliente());\n respuesta = bs.dbService.executeStaticQuery(query.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"---- TIPIF : \" + respuesta);\n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n codigoError = CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS;\n throw new MareException(e, UtilidadesError.armarCodigoError(\n codigoError));\n }\n\n if (respuesta.esVacio()) {\n cliente.setTipificacionCliente(null);\n } else {\n TipificacionCliente[] tipificaciones = new TipificacionCliente[\n respuesta.getRowCount()];\n\n for (int i = 0; i < respuesta.getRowCount(); i++) {\n tipificaciones[i] = new TipificacionCliente();\n\n {\n BigDecimal oidClasificacionCliente = (BigDecimal) \n respuesta.getValueAt(i, \"CLAS_OID_CLAS\");\n tipificaciones[i].setOidClasificacionCliente((\n oidClasificacionCliente != null) ? new Long(\n oidClasificacionCliente.longValue()) : null);\n }\n\n tipificaciones[i].setOidSubTipoCliente(new Long((\n (BigDecimal) respuesta\n .getValueAt(i, \"SBTI_OID_SUBT_CLIE\")).longValue()));\n\n {\n BigDecimal oidTipoClasificacionCliente = (BigDecimal) \n respuesta.getValueAt(i, \"TCCL_OID_TIPO_CLASI\");\n tipificaciones[i].setOidTipoClasificacionCliente(\n (oidTipoClasificacionCliente != null)? new Long(\n oidTipoClasificacionCliente.longValue()) \n : null);\n }\n\n tipificaciones[i].setOidTipoCliente(new Long(((BigDecimal)\n respuesta.getValueAt(i, \"TICL_OID_TIPO_CLIE\"))\n .longValue()));\n }\n\n cliente.setTipificacionCliente(tipificaciones);\n }\n }\n UtilidadesLog.info(\" DAOSolicitudes.obtenerTipificacionesCliente(Par\"\n +\"ticipante cliente):Salida\");\n }", "@FXML\n\tpublic void xButtonConnectar(ActionEvent event) {\n\t\ttry {\n\t\t\tsocket = new Socket(\"localhost\", PORT);\n\t\t\txButtonConnectar.setDisable(true);\n\t\t\txButtonCalcular.setDisable(false);\n\t\t\txLabelInfo.setVisible(true);\n\t\t\t\n\t\t\t//recibir id\n\t\t\tobjetInputStream = new ObjectInputStream(socket.getInputStream());\n\t\t\tthis.idClient = (Integer) objetInputStream.readObject();\n\t\t\tSystem.out.println(\"(CLIENTE) cliente conectado [ID asignada: \"+idClient+\"]\");\n\t\t\tthis.xLabelID.setText(idClient+\"\");\n\t\t\t\n\t\t\t//enviar confirmacion\n\t\t\tobjetOutputStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tobjetOutputStream.writeObject(new Boolean(true));\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"(CLIENTE) No se ha podido conectar\");\n\t\t}\n\t}", "public void novo() {\n cliente = new Cliente();\n }", "public static void main(String[] args) {\r\n int puerto= 10762; //Predeterminados\r\n String nodo = \"localhost\";\r\n String dirD = \"\";\r\n System.out.println(args.length);\r\n switch(args.length){\r\n \r\n case 4:\r\n puerto = Integer.parseInt(args[1]);\r\n nodo = args[3];\r\n System.out.println(nodo);\r\n break;\r\n case 6:\r\n puerto = Integer.parseInt(args[1]);\r\n nodo = args[3];\r\n dirD = args[5];\r\n break;\r\n default:\r\n System.out.println(\"Par�metros inv�lidos.\");\r\n System.exit(0);\r\n }\r\n \r\n try{ \r\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); \r\n String text = in.readLine();\r\n cliente cliente = new cliente(nodo,puerto,dirD);\r\n text.trim();\r\n while(!text.equalsIgnoreCase(\"q\")){\r\n \r\n if (text.equalsIgnoreCase(\"a\")){\r\n String saludo = cliente.clientIn.readLine();\r\n cliente.clientOut.println(text+\"\\t\"+cliente.IP+\"\\t\"+\"N\");\r\n String nodosRecibidos = cliente.clientIn.readLine();\r\n System.out.println(\"Nodos alcanzables: \\n\");\r\n String[] linea = nodosRecibidos.split(\" \");\r\n for(int i=0; i<linea.length; i++){\r\n cliente.nodosAlc.add(linea[i]);\r\n System.out.println(\"\\t\"+linea[i]);\r\n }\r\n \r\n }\r\n \r\n else if (text.startsWith(\"c\") || text.startsWith(\"C\")){\r\n if (!cliente.cancionesEncontradas.isEmpty()){\r\n cliente.cancionesEncontradas.clear();\r\n }\r\n String saludo = cliente.clientIn.readLine();\r\n cliente.clientOut.println(text+\"\\t\"+cliente.IP+\"\\t\"+\"N\");\r\n String canciones=\" \";\r\n System.out.println(\"Resultado de las canciones \\n\");\r\n while ((canciones = (cliente.clientIn.readLine()).trim()).\r\n compareTo(\"corte\")!= 0){\r\n canciones.trim();\r\n System.out.println(canciones);\r\n String[] porlinea = canciones.split(\"\\t\");\r\n Cancion c = new Cancion(Integer.parseInt(porlinea[0].trim()),\r\n porlinea[2].trim(),porlinea[1].trim(),porlinea[5].trim(),porlinea[3].trim(),\r\n porlinea[4].trim());\r\n cliente.cancionesEncontradas.add(c); \r\n }\r\n }\r\n else if (text.startsWith(\"d\") || text.startsWith(\"D\")){\r\n // Conectarse al nodo dado y Descargar\r\n String linea[] = text.split(\" \");\r\n if (linea.length <= 1 || linea.length>2){\r\n System.err.print(\"Comando invalido\");\r\n break;\r\n }\r\n Cancion cancion = cliente.buscarCancionPorNumero(Integer.parseInt(linea[1]));\r\n System.out.println(\"Cancion por numero 0 :\"+cancion.toString());\r\n if (cancion.getNodoIP().compareTo(cliente.IP)==0){\r\n //Procedo a descargarme la cancion pues ya estoy conectada a el nodo\r\n cliente.clientOut.println(linea[0]+\"\\t\"+cancion.toString());\r\n System.out.println(\"\\tEnviada solicitud de descarga\");\r\n \r\n }\r\n else{\r\n //DEBO CONECTARME CON EL NODO QUE TIENE LA CANCION\r\n }\r\n /* **************************** */\r\n //Procedo a recibir la cancion\r\n cliente.recibirCancionMP3();\r\n\r\n \r\n }\r\n else{\r\n System.out.println(\"Consulta invalida. Intente de nuevo\");\r\n }\r\n System.out.println(\"Fin loopp cliente\\n\"); \r\n text = in.readLine();\r\n text.trim();\r\n }\r\n cliente.clientOut.println(\"q\");\r\n System.out.println(\"Bye\");\r\n if (cliente !=null){\r\n cliente.socket.close();\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(cliente.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "private String mostrarCliente(int pos) {\n String mostrar = \"Cedula: \"+getCedulaCliente(pos) + \"\\n\"\n + \"Nombre: \"+getNombreCliente(pos) + \"\\n\"\n + \"Articulo: \"+getCompraRealizada(pos) + \"\\n\"\n + \"Valor: \"+getValorCompra(pos) + \"\\n\\n\";\n return mostrar;\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}", "public TelaAlterarCliente() {\n\t\tinitComponents();\n\t}", "@Override\n\tpublic void run() {\n\t\twhile(true) {\n\t\t\tCliente c = criaCliente();\n\t\t\tArrayList<Integer> t = new ArrayList<Integer>();\t\t\t\n\t\t\tt = geraTempoServicos(c.getServicosSolicitados().size());\n\n\t\t\t// Atribui o tempo aos serviços da forma especificada na descrição do projeto\n\t\t\t// Obs: getServico() da classe serviço não gasta um serviço\n\t\t\tfor(Servico s: c.getServicosSolicitados()) {\n\t\t\t\tif(s.getTipo() == TipoServico.PENTEADO) {\n\t\t\t\t\ts.setTempo(t.get(0));\n\t\t\t\t\tt.remove(0);\n\t\t\t\t} else if(s.getTipo() == TipoServico.CORTE) {\n\t\t\t\t\ts.setTempo(t.get(0));\n\t\t\t\t\tt.remove(0);\n\t\t\t\t} else if(s.getTipo() == TipoServico.DEPILACAO) {\t\n\t\t\t\t\ts.setTempo(t.get(0));\n\t\t\t\t\tt.remove(0);\n\t\t\t\t} else if(s.getTipo() == TipoServico.PEDICURE) {\t\n\t\t\t\t\ts.setTempo(t.get(0));\n\t\t\t\t\tt.remove(0);\n\t\t\t\t} else if(s.getTipo() == TipoServico.MASSAGEM) {\t\n\t\t\t\t\ts.setTempo(t.get(0));\n\t\t\t\t\tt.remove(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfilas.insereEmFilaClientes(0, c);\n\t\t\t\n\t\t\ttry {\t\n\t\t\t\t// Tempo de geração de clientes: 1 ~ 5 segundos\n\t\t\t\tThread.sleep(500*(rand.nextInt(5)+1));\n\t\t\t} catch(InterruptedException ex) {\n\t\t\t\t Thread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t}", "public static List<ClientesVO> listarClientes() throws Exception {\r\n\r\n List<ClientesVO> vetorClientes = new ArrayList<ClientesVO>();\r\n\r\n try {\r\n ConexaoDAO.abreConexao();\r\n } catch (Exception erro) {\r\n throw new Exception(erro.getMessage());\r\n }\r\n\r\n try {\r\n\r\n //Construçao do objeto Statement e ligaçao com a variavel de conexao\r\n stClientes = ConexaoDAO.connSistema.createStatement();\r\n\r\n //SELECT NO BANCO\r\n String sqlLista = \"Select * from clientes\";\r\n\r\n //Executando select e armazenando dados no ResultSet\r\n rsClientes = stClientes.executeQuery(sqlLista);\r\n\r\n while (rsClientes.next()) {//enquanto houver clientes\r\n ClientesVO tmpCliente = new ClientesVO();\r\n\r\n tmpCliente.setIdCliente(rsClientes.getInt(\"id_cliente\"));\r\n tmpCliente.setCodigo(rsClientes.getInt(\"cod_cliente\"));\r\n tmpCliente.setNome(rsClientes.getString(\"nome_cliente\"));\r\n tmpCliente.setCidade(rsClientes.getString(\"cid_cliente\"));\r\n tmpCliente.setTelefone(rsClientes.getString(\"tel_cliente\"));\r\n\r\n vetorClientes.add(tmpCliente);\r\n\r\n }\r\n\r\n } catch (Exception erro) {\r\n throw new Exception(\"Falha na listagem de dados. Verifique a sintaxe da instruçao SQL\\nErro Original:\" + erro.getMessage());\r\n }\r\n\r\n try {\r\n ConexaoDAO.fechaConexao();\r\n } catch (Exception erro) {\r\n throw new Exception(erro.getMessage());\r\n }\r\n\r\n return vetorClientes;\r\n }", "public void connexionServeur() {\r\n\r\n\t\tString serverIp = JOptionPane\r\n\t\t\t\t.showInputDialog(\"Entrez le nom du serveur.\");\r\n\t\ttry {\r\n\t\t\tsocket = new Socket(serverIp, 4456);\r\n\t\t\tlogger.info(\"Connexion au socket serveur.\");\r\n\r\n\t\t\tThread t = new Thread(new EnvoiPresence(socket));\r\n\t\t\tt.start();\r\n\r\n\t\t\tThread t2 = new Thread(new ReceptionListUser(socket, mainView));\r\n\t\t\tt2.start();\r\n\r\n\t\t} catch (ConnectException e) {\r\n\t\t\tJOptionPane.showMessageDialog(new Frame(),\r\n\t\t\t\t\t\"Le serveur Draw Me An Idea n'est pas lancé\", \"Erreur\", 1);\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (UnknownHostException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void simulerCreditConso(Client client, float emprunt, int nbMois) {\n\t\tSystem.out.println(\"Proposition de credit consommation : \");\n\t\tCredit creditconso = new Credit(emprunt, nbMois);\n\t\tcreditconso.CreditConso(emprunt, nbMois);\n\t\t\n\t\t\n\t}", "public Sesion(String codigoCliente) {\n cliente = new Cliente(codigoCliente);\n estado = Estado.inicioBot;\n accion = Accion.registrar;\n valor = ValorAIngresar.nombre;\n mensajeRecibido = null;\n respuesta = new Respuesta();\n }", "@Override\r\n public List<Cliente> listarClientes() throws Exception {\r\n Query consulta = entity.createNamedQuery(Cliente.CONSULTA_TODOS_CLIENTES);\r\n List<Cliente> listaClientes = consulta.getResultList();//retorna una lista\r\n return listaClientes;\r\n }", "public String comunicarServidor(String[][] parametros) {\n\n\t\tString xmlString = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n\t\txmlString += \"<\" + parametros[0][0] + \" id=\\\"\" + parametros[0][1]\n\t\t\t\t+ \"\\\">\";\n\n\t\tfor (int i = 1; i < parametros.length; i++) {\n\t\t\txmlString += \"<\" + parametros[i][0] + \">\" + parametros[i][1] + \"</\"\n\t\t\t\t\t+ parametros[i][0] + \">\";\n\t\t}\n\t\txmlString += \"</\" + parametros[0][0] + \">\";\n\n\t\treturn clienteTCP(this.host, this.port, xmlString); // Retorna a mensagem de resposta do servidor \n\n\t}", "public static void promedioBoletaCliente() {\r\n\t\tPailTap clienteBoleta = getDataTap(\"C:/Paula/masterset/data/9\");\r\n\t\tPailTap boletaProperty = getDataTap(\"C:/Paula/masterset/data/4\");\r\n\t\t\r\n\t\tSubquery promedio = new Subquery(\"?Cliente_id\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(clienteBoleta, \"_\", \"?data\")\r\n\t\t\t\t.predicate(boletaProperty, \"_\", \"?data2\")\r\n\t\t\t\t.predicate(new ExtractClienteBoleta(), \"?data\").out(\"?Cliente_id\", \"?Boleta_id\", \"?Dia\")\r\n\t\t\t\t.predicate(new ExtractBoletaTotal(), \"?data2\").out(\"?Boleta_id\",\"?Total\")\r\n\t\t\t\t.predicate(new Avg(), \"?Total\").out(\"?Promedio\");\r\n\t\t\r\n\t\tSubquery tobatchview = new Subquery(\"?json\")\r\n\t\t\t\t.predicate(promedio, \"?Cliente\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(new ToJSON(), \"?Cliente\", \"?Promedio\", \"?Dia\").out(\"?json\");\r\n\t\tApi.execute(new batchview(), tobatchview);\r\n\t\t//Api.execute(new StdoutTap(), promedio);\r\n\t}", "public Cliente buscarCliente(int codigo) {\n Cliente cliente =new Cliente();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, \"\n + \"idioma, categoria FROM clientes where codigo=? \";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n ps.setInt(1, codigo);\n\t\tSavepoint sp1 = con.setSavepoint(\"SAVE_POINT_ONE\");\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n cliente.setCodigo(rs.getInt(\"codigo\"));\n cliente.setNit(rs.getString(\"nit\"));\n cliente.setEmail(rs.getString(\"email\"));\n cliente.setPais(rs.getString(\"pais\"));\n cliente.setFechaRegistro(rs.getDate(\"fecharegistro\"));\n cliente.setRazonSocial(rs.getString(\"razonsocial\"));\n cliente.setIdioma(rs.getString(\"idioma\"));\n cliente.setCategoria(rs.getString(\"categoria\")); \n\t\t} \n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return cliente;\n\t}", "private static void menuCliente(int idCliente) throws Exception {//Inicio menuCliente \r\n byte opcao;\r\n int idCompra;\r\n ArrayList<Compra> minhasCompras = null;\r\n ArrayList<ItemComprado> meusItensComprados = null;\r\n ArrayList<Produto> listProdutos = null;\r\n boolean encerrarPrograma = false;\r\n do {\r\n try {\r\n System.out.println(\r\n \"\\n\\t*** MENU CLIENTE ***\\n\"\r\n + \"0 - Nova compra\\n\"\r\n + \"1 - Minhas compras\\n\"\r\n + \"2 - Alterar meus dados\\n\"\r\n + \"3 - Excluir conta\\n\"\r\n + \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite sua opcao: \");\r\n opcao = read.nextByte();\r\n switch (opcao) {\r\n case 0:\r\n idCompra = arqCompra.inserir(new Compra(idCliente, new Date()));\r\n compraProdutos(idCliente, idCompra);\r\n break;\r\n case 1:\r\n listProdutos = arqProdutos.toList();\r\n minhasCompras = listComprasDoCliente(idCliente);\r\n for (Compra c : minhasCompras) {\r\n System.out.println(\"\\n*** Compra de ID: \" + c.getID() + \" Data: \" + dt.format(c.dataCompra));\r\n meusItensComprados = listarOsItensComprados(c.getID());\r\n for (ItemComprado ic : meusItensComprados) {\r\n for (Produto p : listProdutos) {\r\n if (p.getID() == ic.idProduto) {\r\n System.out.println(\r\n \"\\n\\tProduto: \" + p.nomeProduto\r\n + \"\\n\\tMarca: \" + p.marca\r\n + \"\\n\\tPreço: \" + tf.format(ic.precoUnitario)\r\n + \"\\n\\tQuant: \" + ic.qtdProduto\r\n );\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case 2:\r\n uptadeDados(idCliente);\r\n break;\r\n case 3:\r\n System.out.println(\"\\nConfirmar opção? \\n0 - Sim\\n1 - Nao\");\r\n System.out.println(\"Digite a opcao desejada: \");\r\n switch (read.nextInt()) {\r\n case 0:\r\n if (arqClientes.remover(idCliente - 1)) {\r\n System.out.println(\"Remoção feita com sucesso!\");\r\n }\r\n break;\r\n case 1:\r\n System.out.println(\"\\nObrigado por continuar!\");\r\n break;\r\n default:\r\n System.out.println(\"\\nOpcao invalida!\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n encerrarPrograma = true;\r\n break;\r\n case 4:\r\n encerrarPrograma = true;\r\n break;\r\n default:\r\n System.out.println(\"Opcao invalida!\\n\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n } catch (InputMismatchException inputMismatchException) {\r\n System.out.println(\"\\nErro !\\nTente novamente!\");\r\n Thread.sleep(1000);\r\n read.next();//Limpar buffer do Scanner\r\n }\r\n } while (!encerrarPrograma);\r\n }", "private void mostradados() {\r\n\t\tint in = 0;\r\n\r\n\t\tfor (Estado e : Estado.values()) {\r\n\t\t\tif (in == 0) {\r\n\t\t\t\tcmbx_estado.addItem(\"\");\r\n\t\t\t\tin = 1;\r\n\t\t\t}\r\n\t\t\tcmbx_estado.addItem(e.getNome());\r\n\t\t}\r\n\r\n\t\tfor (int x = 0; x < listacliente.size(); x++) {\r\n\t\t\tin = 0;\r\n\t\t\tif (x == 0) {\r\n\t\t\t\tcmbx_cidade.addItem(\"\");\r\n\t\t\t}\r\n\r\n\t\t\tfor (int y = 0; y < cmbx_cidade.getItemCount(); y++) {\r\n\t\t\t\tif (listacliente.get(x).getCidade().equals(cmbx_cidade.getItemAt(y).toString()))\r\n\t\t\t\t\tin++;\r\n\t\t\t\tif (in > 1)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (in < 1)\r\n\t\t\t\tcmbx_cidade.addItem(listacliente.get(x).getCidade());\r\n\t\t}\r\n\t}", "public void afficherConnexion() {\n connexion.removeIf(new Integer(0)::equals);\n switch (connexion.size()) {\n case 1:\n Circle arc = new Circle(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE, CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE, 10);\n arc.setFill(Couleur.getCouleurArc(connexion.get(0)));\n g.getChildren().add(arc);\n break;\n case 2:\n Arc arc1 = new Arc();\n arc1.setCenterX(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE);\n arc1.setCenterY(CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE);\n arc1.setRadiusX(10);\n arc1.setRadiusY(10);\n arc1.setStartAngle(90.0f);\n arc1.setLength(180.0f);\n arc1.setType(ArcType.ROUND);\n arc1.setFill(Couleur.getCouleurArc(connexion.get(0)));\n g.getChildren().add(arc1);\n\n Arc arc2 = new Arc();\n arc2.setCenterX(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE);\n arc2.setCenterY(CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE);\n arc2.setRadiusX(10);\n arc2.setRadiusY(10);\n arc2.setStartAngle(270.0f);\n arc2.setLength(180.0f);\n arc2.setType(ArcType.ROUND);\n arc2.setFill(Couleur.getCouleurArc(connexion.get(1)));\n g.getChildren().add(arc2);\n break;\n case 3:\n Arc arc3 = new Arc();\n arc3.setCenterX(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE);\n arc3.setCenterY(CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE);\n arc3.setRadiusX(10);\n arc3.setRadiusY(10);\n arc3.setStartAngle(90.0f);\n arc3.setLength(120.0f);\n arc3.setType(ArcType.ROUND);\n arc3.setFill(Couleur.getCouleurArc(connexion.get(0)));\n g.getChildren().add(arc3);\n\n Arc arc4 = new Arc();\n arc4.setCenterX(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE);\n arc4.setCenterY(CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE);\n arc4.setRadiusX(10);\n arc4.setRadiusY(10);\n arc4.setStartAngle(210.0f);\n arc4.setLength(120.0f);\n arc4.setType(ArcType.ROUND);\n arc4.setFill(Couleur.getCouleurArc(connexion.get(1)));\n g.getChildren().add(arc4);\n\n Arc arc5 = new Arc();\n arc5.setCenterX(CONSTANTE_TAILLE * posx + CONSTANTE_TAILLE);\n arc5.setCenterY(CONSTANTE_TAILLE * posy + CONSTANTE_TAILLE);\n arc5.setRadiusX(10);\n arc5.setRadiusY(10);\n arc5.setStartAngle(330.0f);\n arc5.setLength(120.0f);\n arc5.setType(ArcType.ROUND);\n arc5.setFill(Couleur.getCouleurArc(connexion.get(2)));\n g.getChildren().add(arc5);\n break;\n }\n\n if (hacker != null) {\n hacker.toFront();\n }\n }", "public void acessarBuscaCep() throws InterruptedException {\n navegador.findElement(By.xpath(\"//*[@class='bt-link-ic bt-login link-btn-meu-correios']\")).click();\n\n // REALIZAR O LOGIN COM USUARIO E SENHA\n navegador.findElement(By.id(\"username\")).click();\n navegador.findElement(By.id(\"username\")).sendKeys(\"31403971862\");\n navegador.findElement(By.id(\"password\")).click();\n navegador.findElement(By.id(\"password\")).sendKeys(\"haenois001\");\n\n //CLICAR NO BOTÃO ENTRAR\n navegador.findElement(By.xpath(\"//button[@class='primario']\")).click();\n\n // ESPERAR OPÇÕES E CLICAR EM BUSCA CEP\n WebDriverWait wait = new WebDriverWait(navegador, 20);\n wait.until(ExpectedConditions.elementToBeClickable(By.id(\"opcoes\")));\n navegador.findElement(By.id(\"busca-cep\")).click();\n Thread.sleep(1000);\n\n }", "private void cclient() throws Exception {\n\n\t\tws.xml c = this.ls.cclient();\n\t\tfor (String[] row : c.t) {\n\t\t\tString pat1 = row[0];\n\t\t\tcomboBox.addItem(pat1);\n\t\t}\n\t}", "public Cliente() {\n setUndecorated(true);\n initComponents();\n jLabel7.setText(\"Usted Cuenta con: \"+ connecion.dinero);\n llenarTablaReservaciones(jTableMostrarReserva,\"FK_Usuario\");\n// jTableMostrarReserva.removeColumn(jTableMostrarReserva.getColumn(\"Id\"));\n// jTableMostrarReserva.removeColumn(jTableMostrarReserva.getColumn(\"Id\"));\n connecion.MostarTEsta(\"ID_Estado\", \"1\");\n this.setSize(848, 512);\n this.setLocationRelativeTo(null);\n \n }", "public static void main (String args[]) throws IOException{\n\t\tint PUERTO=4444;\n\t\tServerSocket servidor = new ServerSocket(PUERTO);\n\t\tSystem.out.println(\"Servidor iniciado...\");\n\t\t\n\t\tSocket tabla[] = new Socket[MAXIMO];\n\t\tComunHilos comun = new ComunHilos(MAXIMO, 0,0, tabla);\n\t\t\n\t\twhile(comun.getCONEXIONES()<MAXIMO) {\n\t\t\tSocket socket= new Socket();\n\t\t\tsocket= servidor.accept(); //esperando cliente\n\t\t\t\n\t\t\t//OBKETO COMPARTIDO POR LOS HILOS\n\t\t\t\n\t\t\tcomun.addtabla(socket, comun.getCONEXIONES());\n\t\t\tcomun.setACTUALES(comun.getACTUALES()+1);\n\t\t\tcomun.setCONEXIONES(comun.getCONEXIONES()+1);\n\t\t\t\n\t\t\tHiloservidorChat hilo = new HiloservidorChat(socket, comun);\n\t\t\thilo.start();\n\t\t}\n\t\tservidor.close();\n\t}", "@Override\r\n public Cliente buscarCliente(String cedula) throws Exception {\r\n return entity.find(Cliente.class, cedula);//busca el cliente\r\n }", "private static void abrirPuerto() {\n try {\n serverSocket = new ServerSocket(PUERTO);\n System.out.println(\"Servidor escuchando por el puerto: \" + PUERTO);\n } catch (IOException ex) {\n Logger.getLogger(ServidorUnicauca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void main(String args[]) {\n\t\tclientes = new Vector();\r\n\t\tnomeClientes = new Vector();\r\n\t\ttry {\r\n\t\t\t// criando um socket que fica escutando a porta 2222.\r\n\t\t\tServerSocket s = new ServerSocket(2227);\r\n\t\t\t// Loop principal.\r\n\t\t\twhile (true) {\r\n\t\t\t\t// aguarda algum cliente se conectar. A execução do\r\n\t\t\t\t// servidor fica bloqueada na chamada do método accept da\r\n\t\t\t\t// classe ServerSocket. Quando algum cliente se conectar\r\n\t\t\t\t// ao servidor, o método desbloqueia e retorna com um\r\n\t\t\t\t// objeto da classe Socket, que é porta da comunicação.\r\n\t\t\t\tSystem.out.print(\"Esperando alguem se conectar...\\n\");\r\n\t\t\t\tSocket conexao = s.accept();\r\n\t\t\t\tInetAddress address = conexao.getInetAddress();\r\n\t\t\t\tint portinha = conexao.getPort();\r\n\t\t\t\t\r\n\r\n\t\t\t\tSystem.out.println(\" Conectou! no ip \"+address.toString());\r\n\t\t\t\t// cria uma nova thread para tratar essa conexão\r\n\t\t\t\tThread t = new Servidor(conexao);\r\n\t\t\t\tt.start();\r\n\t\t\t\t// voltando ao loop, esperando mais alguém se conectar.\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\t// caso ocorra alguma excessão de E/S, mostre qual foi.\r\n\t\t\tSystem.out.println(\"IOException: \" + e);\r\n\t\t}\r\n\r\n\t}", "public void execute()\n\t {\n\t // espera a que se conecte cada cliente\n\t for ( int i = 0; i < jugadores.length; i++ ) //<-- dos por defecto o de 0 a 1\n\t {\n\t try // espera la conexión, crea el objeto Jugador, inicia objeto Runnable\n\t {\n\t \t//el metodo accept() es bloqueante hasta recibir una conexion\n\t jugadores[i] = new Jugador( servidor.accept(), i );\n\t //el constructor de jugador recibe un objeto socket crea los flujos E/S\n\t ejecutarJuego.execute(jugadores[i]); // ejecuta el objeto Runnable subproceso\n\t } // fin de try\n\t catch ( IOException excepcionES ) \n\t {\n\t excepcionES.printStackTrace();\n\t System.exit(1);\n\t } // fin de catch\n\t } // fin de for\n\n\t bloqueoJuego.lock(); // bloquea el juego para avisar al subproceso del jugador Uno\n\n\t try\n\t {\n\t jugadores[JUGADOR_1].establecerSuspendido(false); // continúa el jugador Uno\n\t otroJugadorConectado.signal(); // despierta el subproceso del jugador Uno\n\t } // fin de try\n\t finally\n\t {\n\t bloqueoJuego.unlock(); // desbloquea el juego después de avisar al jugador Uno\n\t } // fin de finally\n\t }", "public List<Cliente> getListCliente(){//METODO QUE RETORNA LSITA DE CLIENTES DO BANCO\r\n\t\treturn dao.procurarCliente(atributoPesquisaCli, filtroPesquisaCli);\r\n\t}", "public void asociarMedidorACliente(Cliente c, Medidor m){\r\n\t\t//TODO Implementar metodo\r\n\t}", "public List<Cliente> mostrarClientesPos()\n\t{\n\t\tCliente p;\n\t\tif (! clientes.isEmpty())\n\t\t{\n\t\t\tSet<String> ll = clientes.keySet();\n\t\t\tList<String> li = new ArrayList<String>(ll);\n\t\t\tCollections.sort(li);\n\t\t\tListIterator<String> it = li.listIterator();\n\t\t\tList<Cliente> cc = new ArrayList<Cliente>();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tp = clientes.get(it.next());\n\t\t\t\tif(p.tienePost())\n\t\t\t\t\tcc.add(p);\n\t\t\t\t\n\t\t\t}\n\t\t\tCollections.sort(cc, new CompararCedulasClientes());\n\t\t\treturn cc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public static void menuClientes() throws ClienteException, PersistenciaException, DniException, DireccionException, PersonaException {\n boolean salir = false;\n int opcion;\n Cliente cliente;\n\n while (!salir) {\n System.out.println(\"\\n1. Insertar nuevo cliente\");\n System.out.println(\"2. Modificar cliente\");\n System.out.println(\"3. Eliminar cliente\");\n System.out.println(\"4. Listado de clientes\");\n System.out.println(\"5. Buscar cliente\");\n System.out.println(\"6. Salir\\n\");\n cliente = null;\n String dni = null;\n\n try {\n System.out.print(\"Intrduzca una de las opciones: \");\n opcion = teclado.nextInt();\n teclado.nextLine();\n System.out.println(\"\");\n\n switch (opcion) {\n case 1:\n cliente = generarDatosCliente(true);\n clienteController.insertar(cliente);\n System.out.println(\"\\nCliente insertado\");\n break;\n case 2:\n System.out.println(\"Proceda a introducir los datos, el DNI debe mantenerse igual\");\n cliente = generarDatosCliente(false);\n clienteController.modificar(cliente);\n System.out.println(\"\\nCliente modificado\");\n break;\n case 3:\n System.out.print(\"Introduzca el dni del cliente: \");\n dni = teclado.nextLine();\n validarDni(dni);\n clienteController.eliminar(clienteController.buscar(dni));\n System.out.println(\"\\nCliente eliminado\");\n break;\n case 4:\n System.out.println(\"Lista de clientes: \");\n ArrayList<Cliente> clientes = clienteController.listadoClientes();\n for (Cliente cliente2 : clientes) {\n System.out.println(cliente2.toString());\n }\n break;\n case 5:\n System.out.print(\"Introduzca el dni del cliente: \");\n dni = teclado.next();\n validarDni(dni);\n cliente = clienteController.buscar(dni);\n System.out.println(cliente.toString());\n break;\n case 6:\n salir = true;\n break;\n default:\n System.out.println(\"Solo numeros entre 1 y 6\");\n }\n } catch (InputMismatchException e) {\n System.out.println(\"Debe insertar una opcion correcta\");\n teclado.next();\n }\n }\n }", "private void vCarg()\n {\n /*Contiene la MAC del equipo*/\n String sMAC;\n\n /*Obtiene la MAC del equipo*/\n InetAddress ip;\n try \n {\n /*Obtiene la ip local del equipo*/\n ip = InetAddress.getLocalHost(); \n\n /*Obtiene otros parámetros de conexión*/\n NetworkInterface network = NetworkInterface.getByInetAddress(ip);\n\n /*Obtiene en bytes la MAC*/\n byte[] mac = network.getHardwareAddress();\n\n /*Dale formato a la MAC*/\n StringBuilder sb = new StringBuilder();\n for(int i = 0; i < mac.length; i++) \n sb.append(String.format(\"%02X%s\", mac[i], (i < mac.length - 1) ? \"-\" : \"\")); \n\n /*Inicia la MAC*/\n sMAC = sb.toString();\n }\n catch(UnknownHostException expnUnknowHos) \n {\n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnUnknowHos.getMessage(), Star.sErrUnknowHos, expnUnknowHos.getStackTrace()); \n return; \n }\n catch(SocketException expnSock)\n {\n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnSock.getMessage(), Star.sErrSock, expnSock.getStackTrace()); \n return; \n }\n \n /*Obtiene del web service los mensajes de esta MAC ya desencriptados*/\n String sResp;\n try\n {\n sResp = Star.sDecryp(msjmac(Star.sEncrip(sMAC)));\n }\n catch(Exception expnExcep)\n { \n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnExcep.getMessage(), Star.sErrExcep, expnExcep.getStackTrace()); \n return; \n } \n\n /*Agrega en el control la respuesta del servidor*/\n jED1.setText(sResp); \n \n }", "public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}", "private void llenarEntidadConLosDatosDeLosControles() {\n clienteActual.setNombre(txtNombre.getText());\n clienteActual.setApellido(txtApellido.getText());\n clienteActual.setDui(txtDui.getText());\n //clienteActual.setNumero(txtNumero.getText());\n //clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n }", "@Override\r\n\tpublic void aggiornaUI() {\r\n\t\tString valore = input_ricerca_cliente.getText();\r\n\t\tthis.clienti.setAll(AppFacadeController.getInstance().getGestisciClientiController().cercaCliente(valore));\r\n\t}", "public List<Cliente> consultarClientes();", "public static void adicionaMesas() {\n\t\tScanner sc = new Scanner(System.in);\t\n\t\tString idE, local;\n\t\tint check = 0;\n\t\t\n\t\tSystem.out.println(\"\\nInsira o id da eleicao a qual pretende adicionar uma mesa de voto:\");\n\t\tidE = sc.nextLine();\n\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o departamento em que a mesa de voto irá ficar:\");\n\t\t\tlocal = sc.nextLine();\n\t\t\tif(verificarLetras(local) && local.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome do departamento so pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.adicionaMesaVoto(idE, local);\n\t\t\t\tSystem.out.println(msgServer);\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}", "private void LoadClients(boolean Traitement) {\n\n\t\ttry {\n\t\t\tpanelBouton.getBtnCarteClient().setVisible(false);\n\t\t\tint i = 0;\n\t\t\tGetClientTableModel().clear();\n\t\t\tif (Traitement) {\n\t\t\t\tthis.nom = panelRecherche.getEtNom().getText();\n\t\t\t\tthis.prenom = panelRecherche.getEtPrenom().getText();\n\t\t\t\tliste = gestion.getClients(nom, prenom);\n\t\t\t} else {\n\t\t\t\tString numclient = panelRecherche.getEtNumclient().getText().toString();\n\t\t\t\tif (numclient.isEmpty()) {\n\t\t\t\t\ti = 0;\n\t\t\t\t} else {\n\t\t\t\t\tString patternId = \"^[0-9]+$\";\n\t\t\t\t\tboolean checkId = Pattern.matches(patternId, numclient);\n\t\t\t\t\tif (checkId) {\n\t\t\t\t\t\ti = Integer.parseInt(numclient);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Ce champ peut contenir uniquement des valeurs numériques\");\n\t\t\t\t\t\tRunnable clearText = new Runnable() {\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tpanelRecherche.getEtNumclient().setText(\"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tSwingUtilities.invokeLater(clearText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tliste = gestion.getClient(i);\n\t\t\t}\n\t\t\tif (liste == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (Client client : liste) {\n\t\t\t\tGetClientTableModel().addRow(client);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t\tArrayList<Commande> cdes = null;\n\t\ttry {\n\t\t\tcdes = gestion.getCdes(resultat);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}", "private void onCadastrarCliente() {\n prepFieldsNovoCliente();\n mainCliente = null;\n }", "public static ArrayList<Cliente> getClientes()\n {\n return SimulaDB.getInstance().getClientes();\n }", "private static void Relatorio() throws Exception \r\n {//Inicio menuRelatorio\r\n byte opcao;\r\n boolean fecharMenu = false;\r\n int idCliente, idProduto, quant;\r\n Produto p = null;\r\n Cliente c = null;\r\n do{\r\n System.out.println(\r\n \"\\n\\t*** MENU RELATORIO ***\\n\" +\r\n \"0 - Mostrar os N produtos mais Vendidos\\n\" +\r\n \"1 - Mostrar os N melhores clientes\\n\" +\r\n \"2 - Mostrar os produtos comprados por um cliente\\n\" +\r\n \"3 - Mostrar Clientes que compraram um produto\\n\" +\r\n \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite sua opcao: \");\r\n opcao = read.nextByte();\r\n switch(opcao){\r\n case 0:\r\n ArrayList<Produto> listP = arqProdutos.toList();\r\n if(listP.isEmpty()) System.out.println(\"\\nNão tem produtos em nosso sistema ainda!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de produtos que deseja saber: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listP.sort((p1,p2) -> - Integer.compare(p1.getQuantVendidos(), p2.getQuantVendidos()));\r\n for(Produto n: listP){\r\n System.out.println(\"Produto de ID: \" + n.getID() + \" Nome: \" + n.nomeProduto + \"\\tQuantidade vendida: \" + n.getQuantVendidos());\r\n quant--;\r\n if(quant == 0) break;\r\n }\r\n }\r\n break;\r\n case 1:\r\n ArrayList<Cliente> listC = arqClientes.toList();\r\n if(listC.isEmpty()) System.out.println(\"Não ha clientes para mostrar!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de Clientes: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listC.sort((c1,c2) -> - Float.compare(c1.getTotalGasto(), c2.getTotalGasto()));\r\n for(Cliente n: listC){\r\n System.out.println(\"Cliente de ID: \" + n.getID() + \" Nome: \" + n.nomeCliente + \"\\tGasto total: \" + tf.format(n.getTotalGasto()));\r\n quant--;\r\n if(quant == 0) break; \r\n }\r\n }\r\n break;\r\n case 2:\r\n System.out.print(\"Digite o id do cliente: \");\r\n idCliente = read.nextInt();\r\n c = arqClientes.pesquisar(idCliente - 1);\r\n if (c != null){\r\n int[] idsProdutos = indice_Cliente_Produto.lista(idCliente);\r\n System.out.println(\"\\nO cliente \" + c.nomeCliente + \" de ID \" + c.getID() + \" comprou: \");\r\n for(int i = 0; i < idsProdutos.length; i++){\r\n p = arqProdutos.pesquisar(idsProdutos[i] - 1);\r\n System.out.println(\r\n \"\\n\\tProduto \" + i + \" -> \" + \r\n \" ID: \" + p.getID() + \r\n \" Nome: \" + p.nomeProduto + \r\n \" Marca: \" + p.marca\r\n );\r\n }\r\n }\r\n else {\r\n System.out.println(\"\\nID Invalido!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 3:\r\n System.out.print(\"Digite o id do Produto a consultar: \");\r\n idProduto = read.nextInt();\r\n p = arqProdutos.pesquisar(idProduto - 1);\r\n if(p != null){\r\n int[] idsClientes = indice_Produto_Cliente.lista(idProduto);\r\n System.out.println(\"\\nO produto '\" + p.nomeProduto + \"' de ID \" + p.getID() + \" foi comprado por: \");\r\n for(int i = 0; i < idsClientes.length; i++){\r\n c = arqClientes.pesquisar(idsClientes[i] - 1);\r\n System.out.println();\r\n System.out.println(c);\r\n }\r\n }\r\n else{\r\n System.out.println(\"\\nProduto Inexistende!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 4:\r\n fecharMenu = true;\r\n break; \r\n default:\r\n System.out.println(\"Opcao invalida!\\n\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n }while(!fecharMenu); \r\n }", "private void associarContaCliente(){\n Scanner s = new Scanner(System.in);\n int i=0;\n while (i==0) {\n System.out.println(\"Introduza o seu Codigo de Utilizador\");\n String cod = s.nextLine();\n if(a_armazena.existeCodUser(cod)) {\n i=1;\n Utilizador u = a_armazena.getUtilizador(cod);\n System.out.println(u.toString());\n System.out.println(\"Introduza o seu Username\");\n String username = s.nextLine();\n System.out.println(\"Introduza o seu Password\");\n String pass = s.nextLine();\n\n try {\n b_dados.associaUtilizador(u.getCodUtilizador(), u.getNome(), u.getGps(), username, pass);\n } catch (UtilizadorExisteException e) {\n System.out.println(e.getMessage());\n } catch (UsernameJaEstaEmUsoException e) {\n System.out.println(e.getMessage());\n }\n }\n else\n System.out.println(\"Esse código não existe tente de novo\");\n }\n }", "private void obtenerClienteRecomendante(Cliente clienteParametro, Long \n oidPais) throws MareException {\n UtilidadesLog.info(\" DAOSolicitudes.obtenerClienteRecomendante(Cliente\"\n +\"clienteParametro, Long oidPais):Entrada\");\n // query sobre INC\n BelcorpService bsInc = null;\n RecordSet respuestaInc = null;\n StringBuffer queryInc = new StringBuffer();\n\n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n\n try {\n //jrivas 17/8/2005\n //Inc 20556 \n queryInc.append(\" SELECT RECT.CLIE_OID_CLIE, FEC_INIC, FEC_FINA \");\n queryInc.append(\" FROM INC_CLIEN_RECDO RDO, CRA_PERIO, \");\n queryInc.append(\" INC_CLIEN_RECTE RECT \");\n queryInc.append(\" WHERE PERD_OID_PERI = OID_PERI \");\n queryInc.append(\" AND RDO.CLIE_OID_CLIE = \" + clienteParametro.getOidCliente());\n queryInc.append(\" AND CLR3_OID_CLIE_RETE = OID_CLIE_RETE \");\n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n\n // query sobre MAE\n BelcorpService bsMae = null;\n RecordSet respuestaMae = null;\n StringBuffer queryMae = new StringBuffer();\n\n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n }\n\n ClienteRecomendante clienteRecomendante = new ClienteRecomendante();\n boolean hayRecomendante;\n\n if (!respuestaInc.esVacio()) {\n // tomo los datos de INC\n hayRecomendante = true;\n\n {\n BigDecimal recomendante = (BigDecimal) respuestaInc\n .getValueAt(0, \"CLIE_OID_CLIE\");\n clienteRecomendante.setRecomendante((recomendante != null) \n ? new Long(recomendante.longValue()) : null);\n }\n\n clienteRecomendante.setFechaInicio((Date) respuestaInc\n .getValueAt(0, \"FEC_INIC\"));\n // fecha fin de INC\n {\n Date fechaFin = (Date) respuestaInc.getValueAt(0, \"FEC_FINA\");\n clienteRecomendante.setFechaFin((fechaFin != null) \n ? fechaFin : null);\n }\n \n /* */\n // JVM, sicc 20070381 , agrega bloque que recupera datos del periodo \n // {\n Date fec_desd = (Date) respuestaInc.getValueAt(0, \"FEC_INIC\");\n\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n \n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n } \n \n queryInc = new StringBuffer();\n \n try {\n queryInc.append(\" select x.n, x.oid_peri, x.fec_inic, x.fec_fina, x.pais_oid_pais, x.marc_oid_marc, x.cana_oid_cana \"); \n queryInc.append(\" from ( \"); \n queryInc.append(\" select 1 n, b.oid_peri as oid_peri, \"); \n queryInc.append(\" b.fec_inic as fec_inic, \"); \n queryInc.append(\" b.fec_fina as fec_fina, \"); \n queryInc.append(\" b.pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" b.marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" b.cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from mae_clien_prime_conta a, cra_perio b, seg_perio_corpo c \"); \n queryInc.append(\" where a.clie_oid_clie = \" + clienteParametro.getOidCliente()); \n queryInc.append(\" and a.perd_oid_peri = b.oid_peri \"); \n queryInc.append(\" and b.peri_oid_peri = c.oid_peri \"); \n queryInc.append(\" and b.oid_peri in ( \"); \n queryInc.append(\" select oid_peri \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date ('\"+ df.format(fec_desd) +\"', 'DD/MM/YYYY') <= fec_fina ) \");\n queryInc.append(\" union \"); \n queryInc.append(\" select rownum + 1 as n, oid_peri as oid_peri, \"); \n queryInc.append(\" fec_inic as fec_inic, \"); \n queryInc.append(\" fec_fina as fec_fina, \"); \n queryInc.append(\" pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') <= fec_fina \");\n queryInc.append(\" order by oid_peri asc \"); \n queryInc.append(\" ) x \"); \n queryInc.append(\" order by n \"); \n \n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n BigDecimal bd;\n Periodo periodo = new Periodo();\n \n if (!respuestaInc.esVacio()) {\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"OID_PERI\");\n periodo.setOidPeriodo(new Long(bd.longValue()));\n periodo.setFechaDesde((Date) respuestaInc.getValueAt(0, \"FEC_INIC\"));\n periodo.setFechaHasta((Date) respuestaInc.getValueAt(0, \"FEC_FINA\")); \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"PAIS_OID_PAIS\");\n periodo.setOidPais(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"MARC_OID_MARC\");\n periodo.setOidMarca(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"CANA_OID_CANA\");\n periodo.setOidCanal(new Long(bd.longValue()));\n } \n \n clienteParametro.setPeriodo(periodo);\n\n/* */\n } else {\n // BELC300022542 - gPineda - 24/08/06\n try {\n queryInc = new StringBuffer();\n \n //jrivas 4/7/2005\n //Inc 16978\n queryInc.append(\" SELECT CLIE_OID_CLIE_VNTE, FEC_DESD, FEC_HAST \");\n queryInc.append(\" FROM MAE_CLIEN_VINCU, MAE_TIPO_VINCU \");\n queryInc.append(\" WHERE CLIE_OID_CLIE_VNDO = \" + clienteParametro.getOidCliente());\n queryInc.append(\" AND TIVC_OID_TIPO_VINC = OID_TIPO_VINC \");\n queryInc.append(\" AND PAIS_OID_PAIS = \" + oidPais);\n \n // BELC300022542 - gPineda - 24/08/06\n //queryInc.append(\" AND COD_TIPO_VINC = '\" + ConstantesMAE.TIPO_VINCULO_RECOMENDADA + \"'\");\n queryInc.append(\" AND IND_RECO = 1 \");\n \n respuestaMae = bsInc.dbService.executeStaticQuery(queryInc.toString());\n \n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaMae \" + respuestaMae); \n \n \n // JVM, sicc 20070381 , agrega bloque que recupera datos del periodo \n // {\n if (!respuestaMae.esVacio()) { \n Date fec_desd = (Date) respuestaMae.getValueAt(0, \"FEC_DESD\");\n \n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n \n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n } \n \n queryInc = new StringBuffer();\n \n try {\n queryInc.append(\" select x.n, x.oid_peri, x.fec_inic, x.fec_fina, x.pais_oid_pais, x.marc_oid_marc, x.cana_oid_cana \"); \n queryInc.append(\" from ( \"); \n queryInc.append(\" select 1 n, b.oid_peri as oid_peri, \"); \n queryInc.append(\" b.fec_inic as fec_inic, \"); \n queryInc.append(\" b.fec_fina as fec_fina, \"); \n queryInc.append(\" b.pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" b.marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" b.cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from mae_clien_prime_conta a, cra_perio b, seg_perio_corpo c \"); \n queryInc.append(\" where a.clie_oid_clie = \" + clienteParametro.getOidCliente()); \n queryInc.append(\" and a.perd_oid_peri = b.oid_peri \"); \n queryInc.append(\" and b.peri_oid_peri = c.oid_peri \"); \n queryInc.append(\" and b.oid_peri in ( \"); \n queryInc.append(\" select oid_peri \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date ('\"+ df.format(fec_desd) +\"', 'DD/MM/YYYY') <= fec_fina ) \");\n queryInc.append(\" union \"); \n queryInc.append(\" select rownum + 1 as n, oid_peri as oid_peri, \"); \n queryInc.append(\" fec_inic as fec_inic, \"); \n queryInc.append(\" fec_fina as fec_fina, \"); \n queryInc.append(\" pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date('\"+ df.format(fec_desd) +\"', 'DD-MM-YYYY') <= fec_fina \");\n queryInc.append(\" order by oid_peri asc \"); \n queryInc.append(\" ) x \"); \n queryInc.append(\" order by n \"); \n \n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n BigDecimal bd;\n Periodo periodo = new Periodo();\n \n if (!respuestaInc.esVacio()) {\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"OID_PERI\");\n periodo.setOidPeriodo(new Long(bd.longValue()));\n periodo.setFechaDesde((Date) respuestaInc.getValueAt(0, \"FEC_INIC\"));\n periodo.setFechaHasta((Date) respuestaInc.getValueAt(0, \"FEC_FINA\")); \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"PAIS_OID_PAIS\");\n periodo.setOidPais(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"MARC_OID_MARC\");\n periodo.setOidMarca(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"CANA_OID_CANA\");\n periodo.setOidCanal(new Long(bd.longValue()));\n } \n \n clienteParametro.setPeriodo(periodo);\n } \n // } \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n if (!respuestaMae.esVacio()) {\n hayRecomendante = true;\n clienteRecomendante.setRecomendante(new Long(((BigDecimal) \n respuestaMae.getValueAt(0, \"CLIE_OID_CLIE_VNTE\"))\n .longValue()));\n\n {\n Date fechaInicio = (Date) respuestaMae\n .getValueAt(0, \"FEC_DESD\");\n clienteRecomendante.setFechaInicio((fechaInicio != null) \n ? fechaInicio : null);\n }\n // fecha fin de MAE\n {\n Date fechaFin = (Date) respuestaMae\n .getValueAt(0, \"FEC_HAST\");\n clienteRecomendante.setFechaFin((fechaFin != null) \n ? fechaFin : null);\n }\n } else {\n hayRecomendante = false;\n }\n }\n // tomo los datos de MAE\n if (hayRecomendante) {\n \n // JVM, sicc 20070381 , agrega bloque que recupera datos del periodo \n // {\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n \n try {\n bsInc = BelcorpService.getInstance();\n } catch (MareMiiServiceNotFoundException e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_PEDIR_UN_SERVICIO_MARE));\n } \n \n queryInc = new StringBuffer();\n \n try {\n queryInc.append(\" select x.n, x.oid_peri, x.fec_inic, x.fec_fina, x.pais_oid_pais, x.marc_oid_marc, x.cana_oid_cana \"); \n queryInc.append(\" from ( \"); \n queryInc.append(\" select 1 n, b.oid_peri as oid_peri, \"); \n queryInc.append(\" b.fec_inic as fec_inic, \"); \n queryInc.append(\" b.fec_fina as fec_fina, \"); \n queryInc.append(\" b.pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" b.marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" b.cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from mae_clien_prime_conta a, cra_perio b, seg_perio_corpo c \"); \n queryInc.append(\" where a.clie_oid_clie = \" + clienteRecomendante.getRecomendante()); \n queryInc.append(\" and a.perd_oid_peri = b.oid_peri \"); \n queryInc.append(\" and b.peri_oid_peri = c.oid_peri \"); \n queryInc.append(\" and b.oid_peri in ( \"); \n queryInc.append(\" select oid_peri \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(clienteRecomendante.getFechaInicio()) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date ('\"+ df.format(clienteRecomendante.getFechaInicio()) +\"', 'DD/MM/YYYY') <= fec_fina ) \");\n queryInc.append(\" union \"); \n queryInc.append(\" select rownum + 1 as n, oid_peri as oid_peri, \"); \n queryInc.append(\" fec_inic as fec_inic, \"); \n queryInc.append(\" fec_fina as fec_fina, \"); \n queryInc.append(\" pais_oid_pais as pais_oid_pais, \"); \n queryInc.append(\" marc_oid_marc as marc_oid_marc, \"); \n queryInc.append(\" cana_oid_cana as cana_oid_cana \"); \n queryInc.append(\" from cra_perio \"); \n queryInc.append(\" where fec_inic <= to_date ('\"+ df.format(clienteRecomendante.getFechaInicio()) +\"', 'DD-MM-YYYY') \");\n queryInc.append(\" and to_date('\"+ df.format(clienteRecomendante.getFechaInicio()) +\"', 'DD-MM-YYYY') <= fec_fina \");\n queryInc.append(\" order by oid_peri asc \"); \n queryInc.append(\" ) x \"); \n queryInc.append(\" order by n \"); \n \n respuestaInc = bsInc.dbService.executeStaticQuery(queryInc.toString());\n\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"******* respuestaInc \" + respuestaInc); \n \n } catch (Exception e) {\n UtilidadesLog.error(\"ERROR \", e);\n throw new MareException(e, UtilidadesError.armarCodigoError(\n CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n \n BigDecimal bd;\n Periodo periodo = new Periodo();\n \n if (!respuestaInc.esVacio()) {\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"OID_PERI\");\n periodo.setOidPeriodo(new Long(bd.longValue()));\n periodo.setFechaDesde((Date) respuestaInc.getValueAt(0, \"FEC_INIC\"));\n periodo.setFechaHasta((Date) respuestaInc.getValueAt(0, \"FEC_FINA\")); \n bd = (BigDecimal) respuestaInc.getValueAt(0, \"PAIS_OID_PAIS\");\n periodo.setOidPais(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"MARC_OID_MARC\");\n periodo.setOidMarca(new Long(bd.longValue()));\n bd = (BigDecimal) respuestaInc.getValueAt(0, \"CANA_OID_CANA\");\n periodo.setOidCanal(new Long(bd.longValue()));\n } \n\n clienteRecomendante.setPeriodo(periodo);\n // } \n \n Cliente clienteLocal = new Cliente();\n clienteLocal.setOidCliente(clienteRecomendante.getRecomendante());\n this.obtenerPeriodosConPedidosCliente(clienteLocal);\n clienteRecomendante.setPeriodosConPedidos(clienteLocal.getPeriodosConPedidos());\n clienteParametro.setClienteRecomendante(clienteRecomendante);\n \n } else {\n clienteParametro.setClienteRecomendante(null);\n }\n UtilidadesLog.info(\" DAOSolicitudes.obtenerClienteRecomendante(Cliente\"\n +\" clienteParametro, Long oidPais):Salida\");\n }", "public ServeurGestion(int portClient){\r\n try {\r\n ecoute=new ServerSocket(portClient);\r\n appels=new Vector<>();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ServeurGestion.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }" ]
[ "0.6971014", "0.68412364", "0.6834584", "0.6821415", "0.6808021", "0.67909455", "0.67261994", "0.66625", "0.659252", "0.65715766", "0.6564813", "0.64798313", "0.6473804", "0.6462532", "0.6425832", "0.6379102", "0.6378278", "0.6373932", "0.6372646", "0.63584256", "0.634652", "0.6342974", "0.63414615", "0.632597", "0.6311597", "0.6311446", "0.63058555", "0.6304053", "0.6300119", "0.6297497", "0.62973946", "0.62936866", "0.62884104", "0.62822914", "0.62771267", "0.6250713", "0.6237744", "0.62368596", "0.62281805", "0.62279564", "0.6220014", "0.62173873", "0.6213555", "0.6206659", "0.62064916", "0.6205016", "0.61943173", "0.6194195", "0.6193166", "0.6193035", "0.61925066", "0.6189397", "0.61820906", "0.6146786", "0.61435694", "0.61414325", "0.613687", "0.6136392", "0.6132548", "0.6121548", "0.61175084", "0.6116077", "0.6104734", "0.60980177", "0.6097231", "0.60956174", "0.60904014", "0.60864097", "0.6080821", "0.6073876", "0.60718375", "0.60690564", "0.6066718", "0.6066497", "0.60538167", "0.6053118", "0.60521406", "0.6051747", "0.6049683", "0.6044432", "0.60441077", "0.60335904", "0.60279465", "0.6025362", "0.6024555", "0.6023316", "0.6021954", "0.6017623", "0.59949946", "0.5981978", "0.5979563", "0.59731257", "0.59682655", "0.5963633", "0.5958682", "0.59543264", "0.5948684", "0.5940733", "0.59405524", "0.5939203", "0.59371376" ]
0.0
-1
Creates a new instance.
public JavaRandomSampleOperator(int sampleSize, DataSetType type) { super(sampleSize, type, Methods.RANDOM); rand = new Random(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Instance createInstance();", "public void create(){}", "public Instance() {\n }", "private Instantiation(){}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "void create(T instance) throws IOException;", "public void create() {\n\t\t\n\t}", "Reproducible newInstance();", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public T newInstance();", "public void makeInstance() {\n\t\t// Create the attributes, class and text\n\t\tFastVector fvNominalVal = new FastVector(2);\n\t\tfvNominalVal.addElement(\"ad1\");\n\t\tfvNominalVal.addElement(\"ad2\");\n\t\tAttribute attribute1 = new Attribute(\"class\", fvNominalVal);\n\t\tAttribute attribute2 = new Attribute(\"text\",(FastVector) null);\n\t\t// Create list of instances with one element\n\t\tFastVector fvWekaAttributes = new FastVector(2);\n\t\tfvWekaAttributes.addElement(attribute1);\n\t\tfvWekaAttributes.addElement(attribute2);\n\t\tinstances = new Instances(\"Test relation\", fvWekaAttributes, 1); \n\t\t// Set class index\n\t\tinstances.setClassIndex(0);\n\t\t// Create and add the instance\n\t\tInstance instance = new Instance(2);\n\t\tinstance.setValue(attribute2, text);\n\t\t// Another way to do it:\n\t\t// instance.setValue((Attribute)fvWekaAttributes.elementAt(1), text);\n\t\tinstances.add(instance);\n \t\tSystem.out.println(\"===== Instance created with reference dataset =====\");\n\t\tSystem.out.println(instances);\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "T create();", "T create();", "@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }", "public CMObject newInstance();", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "void createNewInstance(String filename)\n {\n iIncomingLobsFactory = new incomingLobsFactory();\n iIncomingLobsFactory.setPackageName(\"com.loadSample\");\n \n // include schemaLocation hint for validation\n iIncomingLobsFactory.setXSDFileName(\"LoadSample.xsd\");\n \n // encoding for output document\n iIncomingLobsFactory.setEncoding(\"UTF8\");\n \n // encoding tag for xml declaration\n iIncomingLobsFactory.setEncodingTag(\"UTF-8\");\n \n // Create the root element in the document using the specified root element name\n iIncomingLobs = (incomingLobs) iIncomingLobsFactory.createRoot(\"incomingLobs\");\n createincomingLobs();\n \n iIncomingLobsFactory.save(filename);\n }", "private synchronized static void createInstance(){\r\n\t\tif (instance == null){\r\n\t\t\tinstance = new Casino();\r\n\t\t}\r\n\t}", "public abstract void create();", "InstanceModel createInstanceOfInstanceModel();", "public static void createInstance()\n {\n if (instance == null) {\n // Create the instance\n instance = new SalesOrderDataSingleton();\n }\n }", "public Instance() {\n super(Routing.NAMESPACE, \"instance\");\n }", "@Override\r\n\tpublic void create() {\n\r\n\t}", "private Vehicle createNewVehicle() {\n\t\tString make = generateMake();\n\t\tString model = generateModel();\n\t\tdouble weight = generateWeight(model);\n\t\tdouble engineSize = generateEngineSize(model);\n\t\tint numberOfDoors = generateNumberOfDoors(model);\n\t\tboolean isImport = generateIsImport(make);\n\t\t\n\t\tVehicle vehicle = new Vehicle(make, model, weight, engineSize, numberOfDoors, isImport);\n\t\treturn vehicle;\t\t\n\t}", "public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "public Factory() {\n\t\tsuper();\n\t}", "private synchronized static void createInstance() {\n if (INSTANCE == null) { \n INSTANCE = new DataConnection();\n }\n }", "@SuppressWarnings(\"unchecked\")\n public T newInstance()\n throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n if (constructor_ == null) {\n constructor_ = getRawClass().getConstructor();\n }\n\n return (T)constructor_.newInstance();\n }", "public static void createInstance(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) {\r\n\t\tBase.createInstance(model, RDFS_CLASS, instanceResource);\r\n\t}", "@Override\r\n\tpublic CMObject newInstance()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn this.getClass().getDeclaredConstructor().newInstance();\r\n\t\t}\r\n\t\tcatch(final Exception e)\r\n\t\t{\r\n\t\t\tLog.errOut(ID(),e);\r\n\t\t}\r\n\t\treturn new StdBehavior();\r\n\t}", "public abstract boolean create(T newInstance);", "private static synchronized void createInstance() {\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new LOCFacade();\r\n\t}", "public static QuinzicalModel createInstance() throws Exception {\n\t\tif (instance == null) {\n\t\t\tinstance = new QuinzicalModel();\n\t\t}\n\t\treturn instance;\n\t}", "@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}", "<T> T newInstance(URI description) throws EnvironmentException;", "public Idea create() {\n \t\t\tIdea idea = new Idea();\n \n \t\t\treturn idea;\n \t\t}", "public static void createInstance(Model model, Resource instanceResource) {\r\n\t\tBase.createInstance(model, RDFS_CLASS, instanceResource);\r\n\t}", "public Taginstance() {\n\t\tthis(\"taginstance\", null);\n\t}", "@Override\n\tpublic ModIndexedInstance createNewInstance() {\n\t\tModIndexedInstance newInst = new ModIndexedInstance(); // create the new instance\n\t\tnewInst.setRegComp(this); // set component type of new instance\n\t\taddInstanceOf(newInst); // add instance to list for this comp\n\t\treturn newInst;\n\t}", "public static StaticFactoryInsteadOfConstructors create(){\n return new StaticFactoryInsteadOfConstructors();\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public Factory() {\n this(getInternalClient());\n }", "For createFor();", "public ObjectFactory() {\n super(grammarInfo);\n }", "public Game getNewInstance() {\n try {\n return classObj.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(\"Error generating \" + this + \" game\");\n }\n }", "T create() throws PersistException;", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public ApplicationCreator() {\n }", "@Override\r\n public void instantiate() {\r\n }", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "public SingleRequest<?> create() {\n return new SingleRequest<>();\n }", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\r\n\t}", "public Open() {\n //creates a new open instance\n }", "protected abstract void construct();", "public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }", "@Override\r\n\tpublic ItemInstance createItemInstance() {\n\t\treturn new HpInstance();\r\n\t}", "private static void createInstance() {\n if (mApiInterface == null) {\n synchronized(APIClient.class) {\n if (mApiInterface == null) {\n mApiInterface = buildApiClient();\n }\n }\n }\n }", "Klassenstufe createKlassenstufe();", "Snapshot create();", "public static Book createEntity() {\n Book book = new Book()\n .idBook(DEFAULT_ID_BOOK)\n .isbn(DEFAULT_ISBN)\n .title(DEFAULT_TITLE)\n .author(DEFAULT_AUTHOR)\n .year(DEFAULT_YEAR)\n .publisher(DEFAULT_PUBLISHER)\n .url_s(DEFAULT_URL_S)\n .url_m(DEFAULT_URL_M)\n .url_l(DEFAULT_URL_L);\n return book;\n }", "public static synchronized void constructInstance()\n {\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, false );\n\n if ( ourInstance != null )\n {\n throw new IllegalStateException( myName + \" Already Constructed\" );\n }\n ourInstance = new ElbowSubsystem();\n\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, true );\n }", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "public Object createNew(String typename, Object... args) \n\t\tthrows \tIllegalAccessException, \n\t\t\tInstantiationException, \n\t\t\tClassNotFoundException,\n\t\t\tNoSuchMethodException,\n\t\t\tInvocationTargetException \n\t{\n\t\tswitch(args.length) \n\t\t{\n\t\tcase 1 : return Class.forName(typename).getConstructor(args[0].getClass()).newInstance(args[0]);\n\t\tcase 2 : return Class.forName(typename).getConstructor(args[0].getClass(), args[1].getClass()).\n\t\t\tnewInstance(args[0], args[1]);\n\t\t}\n\t\treturn null;\n\t}", "public static IPCGCallDetailCreator instance()\r\n {\r\n if (instance == null)\r\n {\r\n instance = new IPCGCallDetailCreator();\r\n }\r\n return instance;\r\n }", "public Object buildNewInstance() throws DescriptorException {\n if (this.isUsingDefaultConstructor()) {\n return this.buildNewInstanceUsingDefaultConstructor();\n } else {\n return this.buildNewInstanceUsingFactory();\n }\n }", "void create(T t);", "void create( State state );", "public Activator() {\r\n\t}", "OBJECT createOBJECT();", "public Produto() {}", "public T safeNewInstance() {\n try {\n return newInstance();\n } catch (NoSuchMethodException e) {\n throw new IllegalArgumentException(e);\n } catch (IllegalAccessException e) {\n throw new IllegalArgumentException(e);\n } catch (InvocationTargetException e) {\n throw new IllegalArgumentException(e);\n } catch (InstantiationException e) {\n throw new IllegalArgumentException(e);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic AnalysisGraph createNewInstance() {\n\t\tAnalysisGraph graph = new AnalysisGraph();\n\t\tgraph.currentIndex = currentIndex;\n\t\t\n\t\tgraph.nodes = (HashMap<String, Node>) nodes.clone();\n\t\tgraph.nodeList = (ArrayList<Node>)((ArrayList<Node>) nodeList).clone();\n\t\tgraph.links = (ArrayList<Link>)((ArrayList<Link>) links).clone();\n\t\treturn graph;\n\t}", "DynamicInstance createDynamicInstance();", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "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.7834167", "0.72893584", "0.70771503", "0.7048765", "0.70209944", "0.6839274", "0.67782235", "0.6770133", "0.67429745", "0.6701039", "0.6690158", "0.6630354", "0.66046286", "0.6600776", "0.6600776", "0.6597608", "0.6592152", "0.6564594", "0.65268713", "0.652679", "0.6475239", "0.6442598", "0.63414943", "0.63365746", "0.63303816", "0.63249475", "0.627689", "0.627521", "0.6227869", "0.620804", "0.6167403", "0.6164787", "0.610737", "0.6102229", "0.60939527", "0.60640883", "0.60597515", "0.60330635", "0.60064733", "0.600185", "0.59933734", "0.59891814", "0.5978862", "0.5975761", "0.59642875", "0.59642875", "0.59642875", "0.595006", "0.5948986", "0.5939949", "0.5935609", "0.59320545", "0.5930863", "0.5930863", "0.5930808", "0.59303784", "0.59288776", "0.59219015", "0.5912657", "0.5900076", "0.58830214", "0.5879637", "0.5878685", "0.58779675", "0.58684635", "0.5859659", "0.5852349", "0.5844357", "0.5844119", "0.58357304", "0.582402", "0.581462", "0.58129567", "0.5803098", "0.58003926", "0.5787434", "0.5786469", "0.57835597", "0.578337", "0.5780014", "0.57761306", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006" ]
0.0
-1
Creates a new instance.
public JavaRandomSampleOperator(int sampleSize, long datasetSize, DataSetType type) { super(sampleSize, datasetSize, type, Methods.RANDOM); rand = new Random(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Instance createInstance();", "public void create(){}", "public Instance() {\n }", "private Instantiation(){}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "void create(T instance) throws IOException;", "public void create() {\n\t\t\n\t}", "Reproducible newInstance();", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public T newInstance();", "public void makeInstance() {\n\t\t// Create the attributes, class and text\n\t\tFastVector fvNominalVal = new FastVector(2);\n\t\tfvNominalVal.addElement(\"ad1\");\n\t\tfvNominalVal.addElement(\"ad2\");\n\t\tAttribute attribute1 = new Attribute(\"class\", fvNominalVal);\n\t\tAttribute attribute2 = new Attribute(\"text\",(FastVector) null);\n\t\t// Create list of instances with one element\n\t\tFastVector fvWekaAttributes = new FastVector(2);\n\t\tfvWekaAttributes.addElement(attribute1);\n\t\tfvWekaAttributes.addElement(attribute2);\n\t\tinstances = new Instances(\"Test relation\", fvWekaAttributes, 1); \n\t\t// Set class index\n\t\tinstances.setClassIndex(0);\n\t\t// Create and add the instance\n\t\tInstance instance = new Instance(2);\n\t\tinstance.setValue(attribute2, text);\n\t\t// Another way to do it:\n\t\t// instance.setValue((Attribute)fvWekaAttributes.elementAt(1), text);\n\t\tinstances.add(instance);\n \t\tSystem.out.println(\"===== Instance created with reference dataset =====\");\n\t\tSystem.out.println(instances);\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "T create();", "T create();", "@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }", "public CMObject newInstance();", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "void createNewInstance(String filename)\n {\n iIncomingLobsFactory = new incomingLobsFactory();\n iIncomingLobsFactory.setPackageName(\"com.loadSample\");\n \n // include schemaLocation hint for validation\n iIncomingLobsFactory.setXSDFileName(\"LoadSample.xsd\");\n \n // encoding for output document\n iIncomingLobsFactory.setEncoding(\"UTF8\");\n \n // encoding tag for xml declaration\n iIncomingLobsFactory.setEncodingTag(\"UTF-8\");\n \n // Create the root element in the document using the specified root element name\n iIncomingLobs = (incomingLobs) iIncomingLobsFactory.createRoot(\"incomingLobs\");\n createincomingLobs();\n \n iIncomingLobsFactory.save(filename);\n }", "private synchronized static void createInstance(){\r\n\t\tif (instance == null){\r\n\t\t\tinstance = new Casino();\r\n\t\t}\r\n\t}", "public abstract void create();", "InstanceModel createInstanceOfInstanceModel();", "public static void createInstance()\n {\n if (instance == null) {\n // Create the instance\n instance = new SalesOrderDataSingleton();\n }\n }", "public Instance() {\n super(Routing.NAMESPACE, \"instance\");\n }", "@Override\r\n\tpublic void create() {\n\r\n\t}", "private Vehicle createNewVehicle() {\n\t\tString make = generateMake();\n\t\tString model = generateModel();\n\t\tdouble weight = generateWeight(model);\n\t\tdouble engineSize = generateEngineSize(model);\n\t\tint numberOfDoors = generateNumberOfDoors(model);\n\t\tboolean isImport = generateIsImport(make);\n\t\t\n\t\tVehicle vehicle = new Vehicle(make, model, weight, engineSize, numberOfDoors, isImport);\n\t\treturn vehicle;\t\t\n\t}", "public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "public Factory() {\n\t\tsuper();\n\t}", "private synchronized static void createInstance() {\n if (INSTANCE == null) { \n INSTANCE = new DataConnection();\n }\n }", "@SuppressWarnings(\"unchecked\")\n public T newInstance()\n throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n if (constructor_ == null) {\n constructor_ = getRawClass().getConstructor();\n }\n\n return (T)constructor_.newInstance();\n }", "public static void createInstance(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) {\r\n\t\tBase.createInstance(model, RDFS_CLASS, instanceResource);\r\n\t}", "@Override\r\n\tpublic CMObject newInstance()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn this.getClass().getDeclaredConstructor().newInstance();\r\n\t\t}\r\n\t\tcatch(final Exception e)\r\n\t\t{\r\n\t\t\tLog.errOut(ID(),e);\r\n\t\t}\r\n\t\treturn new StdBehavior();\r\n\t}", "public abstract boolean create(T newInstance);", "private static synchronized void createInstance() {\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new LOCFacade();\r\n\t}", "public static QuinzicalModel createInstance() throws Exception {\n\t\tif (instance == null) {\n\t\t\tinstance = new QuinzicalModel();\n\t\t}\n\t\treturn instance;\n\t}", "@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}", "<T> T newInstance(URI description) throws EnvironmentException;", "public Idea create() {\n \t\t\tIdea idea = new Idea();\n \n \t\t\treturn idea;\n \t\t}", "public static void createInstance(Model model, Resource instanceResource) {\r\n\t\tBase.createInstance(model, RDFS_CLASS, instanceResource);\r\n\t}", "public Taginstance() {\n\t\tthis(\"taginstance\", null);\n\t}", "@Override\n\tpublic ModIndexedInstance createNewInstance() {\n\t\tModIndexedInstance newInst = new ModIndexedInstance(); // create the new instance\n\t\tnewInst.setRegComp(this); // set component type of new instance\n\t\taddInstanceOf(newInst); // add instance to list for this comp\n\t\treturn newInst;\n\t}", "public static StaticFactoryInsteadOfConstructors create(){\n return new StaticFactoryInsteadOfConstructors();\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public Factory() {\n this(getInternalClient());\n }", "For createFor();", "public ObjectFactory() {\n super(grammarInfo);\n }", "public Game getNewInstance() {\n try {\n return classObj.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(\"Error generating \" + this + \" game\");\n }\n }", "T create() throws PersistException;", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public static Builder create() {\n\t\treturn new Builder();\n\t}", "public ApplicationCreator() {\n }", "@Override\r\n public void instantiate() {\r\n }", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "public SingleRequest<?> create() {\n return new SingleRequest<>();\n }", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\r\n\t}", "public Open() {\n //creates a new open instance\n }", "protected abstract void construct();", "public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }", "@Override\r\n\tpublic ItemInstance createItemInstance() {\n\t\treturn new HpInstance();\r\n\t}", "private static void createInstance() {\n if (mApiInterface == null) {\n synchronized(APIClient.class) {\n if (mApiInterface == null) {\n mApiInterface = buildApiClient();\n }\n }\n }\n }", "Klassenstufe createKlassenstufe();", "Snapshot create();", "public static Book createEntity() {\n Book book = new Book()\n .idBook(DEFAULT_ID_BOOK)\n .isbn(DEFAULT_ISBN)\n .title(DEFAULT_TITLE)\n .author(DEFAULT_AUTHOR)\n .year(DEFAULT_YEAR)\n .publisher(DEFAULT_PUBLISHER)\n .url_s(DEFAULT_URL_S)\n .url_m(DEFAULT_URL_M)\n .url_l(DEFAULT_URL_L);\n return book;\n }", "public static synchronized void constructInstance()\n {\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, false );\n\n if ( ourInstance != null )\n {\n throw new IllegalStateException( myName + \" Already Constructed\" );\n }\n ourInstance = new ElbowSubsystem();\n\n SmartDashboard.putBoolean( TelemetryNames.Elbow.status, true );\n }", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "public Object createNew(String typename, Object... args) \n\t\tthrows \tIllegalAccessException, \n\t\t\tInstantiationException, \n\t\t\tClassNotFoundException,\n\t\t\tNoSuchMethodException,\n\t\t\tInvocationTargetException \n\t{\n\t\tswitch(args.length) \n\t\t{\n\t\tcase 1 : return Class.forName(typename).getConstructor(args[0].getClass()).newInstance(args[0]);\n\t\tcase 2 : return Class.forName(typename).getConstructor(args[0].getClass(), args[1].getClass()).\n\t\t\tnewInstance(args[0], args[1]);\n\t\t}\n\t\treturn null;\n\t}", "public static IPCGCallDetailCreator instance()\r\n {\r\n if (instance == null)\r\n {\r\n instance = new IPCGCallDetailCreator();\r\n }\r\n return instance;\r\n }", "public Object buildNewInstance() throws DescriptorException {\n if (this.isUsingDefaultConstructor()) {\n return this.buildNewInstanceUsingDefaultConstructor();\n } else {\n return this.buildNewInstanceUsingFactory();\n }\n }", "void create(T t);", "void create( State state );", "public Activator() {\r\n\t}", "OBJECT createOBJECT();", "public Produto() {}", "public T safeNewInstance() {\n try {\n return newInstance();\n } catch (NoSuchMethodException e) {\n throw new IllegalArgumentException(e);\n } catch (IllegalAccessException e) {\n throw new IllegalArgumentException(e);\n } catch (InvocationTargetException e) {\n throw new IllegalArgumentException(e);\n } catch (InstantiationException e) {\n throw new IllegalArgumentException(e);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic AnalysisGraph createNewInstance() {\n\t\tAnalysisGraph graph = new AnalysisGraph();\n\t\tgraph.currentIndex = currentIndex;\n\t\t\n\t\tgraph.nodes = (HashMap<String, Node>) nodes.clone();\n\t\tgraph.nodeList = (ArrayList<Node>)((ArrayList<Node>) nodeList).clone();\n\t\tgraph.links = (ArrayList<Link>)((ArrayList<Link>) links).clone();\n\t\treturn graph;\n\t}", "DynamicInstance createDynamicInstance();", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "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.7834167", "0.72893584", "0.70771503", "0.7048765", "0.70209944", "0.6839274", "0.67782235", "0.6770133", "0.67429745", "0.6701039", "0.6690158", "0.6630354", "0.66046286", "0.6600776", "0.6600776", "0.6597608", "0.6592152", "0.6564594", "0.65268713", "0.652679", "0.6475239", "0.6442598", "0.63414943", "0.63365746", "0.63303816", "0.63249475", "0.627689", "0.627521", "0.6227869", "0.620804", "0.6167403", "0.6164787", "0.610737", "0.6102229", "0.60939527", "0.60640883", "0.60597515", "0.60330635", "0.60064733", "0.600185", "0.59933734", "0.59891814", "0.5978862", "0.5975761", "0.59642875", "0.59642875", "0.59642875", "0.595006", "0.5948986", "0.5939949", "0.5935609", "0.59320545", "0.5930863", "0.5930863", "0.5930808", "0.59303784", "0.59288776", "0.59219015", "0.5912657", "0.5900076", "0.58830214", "0.5879637", "0.5878685", "0.58779675", "0.58684635", "0.5859659", "0.5852349", "0.5844357", "0.5844119", "0.58357304", "0.582402", "0.581462", "0.58129567", "0.5803098", "0.58003926", "0.5787434", "0.5786469", "0.57835597", "0.578337", "0.5780014", "0.57761306", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006", "0.5772006" ]
0.0
-1
mejor iteracion de una estrategia
public DatosIteracion mejorIteracionCapturados() { ArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>(); for (DatosEstrategia e : this.getValoresEstrategias()) { array.add(this.mejorIteracionCapturados(e.getValoresIteraciones())); } return this.mejorIteracionCapturados(array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public DatosIteracion mejorIteracionCapturados(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masCapturadas();\r\n\t}", "public DatosIteracion mejorIteracionVisibles(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public Iterator<IPessoa> getAtores();", "public void setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }", "@Test\n public void testIterator() {\n System.out.println(\"iterator\");\n Goban g = createGoban();\n ArrayList<PierrePoint> groupeAttendu = new ArrayList<>();\n groupeAttendu.add(g.getPierre(0, 0));\n groupeAttendu.add(g.getPierre(0, 1));\n groupeAttendu.add(g.getPierre(1, 0));\n GroupeDePierres groupe = new GroupeDePierres(g.getPierre(0, 0), g);\n \n for( PierrePoint p : groupe)\n {\n assertTrue(groupeAttendu.contains(p));\n }\n \n assertEquals(groupeAttendu.size(),groupe.size());\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public DatosIteracion mejorIteracionVisibles() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionVisibles(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionVisibles(array);\r\n\t}", "public Iterator<T> byGenerations() {\r\n ArrayIterator<T> iter = new ArrayIterator<T>();\r\n\r\n for (int i = 0; i < SIZE; i++) {\r\n iter.add(tree[i]);\r\n }\r\n\r\n return iter;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\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 }", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public String generarEstadisticasGenerales(){\n \n String estadisticaGeneral = \"En general en la universidad del valle: \\n\";\n estadisticaGeneral += \"se encuentran: \" + EmpleadosPrioridadAlta.size() + \" empleados en prioridad alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMediaAlta.size() + \" empleados en prioridad media alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMediaAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMedia.size() + \" empleados en prioridad media\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMedia)\n + \"se encuentran: \" + EmpleadosPrioridadBaja.size() + \" empleados en prioridad baja\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadBaja);\n return estadisticaGeneral;\n }", "List<E> resoudre (\n ProblemeAbstrait <E, A> probleme, \n HeuristiqueAbstrait<E> heuristique\n );", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setIteraciones(int iteraciones) {\r\n this.iteraciones = iteraciones;\r\n }", "public List<Commande> commandesAvecCriteres(Map<String, String> criteres, String idClient) {\n List<Commande> targetCommandes = new ArrayList<Commande>();\n //Trouver tous les factures correspondants\n List<String> targetFactures = new ArrayList<String>();\n for (String f : nomsFactures()) {\n if (f.contains(idClient)) {\n targetFactures.add(f);\n }\n };\n\n int targetCritere = 0;\n for (String filepath : targetFactures) {\n\n List<String> plats = new ArrayList<String>();\n List<String> films = new ArrayList<String>();\n String prix = \"\";\n String id = \"\";\n String date = \"\";\n String adresseLivraison = \"\";\n String idClientStr = \"\";\n\n boolean matchingCommand = false;\n boolean bCommande = false;\n boolean bIdPlat = false;\n boolean bIdClient = false;\n boolean bFilm = false;\n try {\n XMLInputFactory factory = XMLInputFactory.newInstance();\n XMLEventReader eventReader\n = factory.createXMLEventReader(new FileReader(\"factures/\" + filepath));\n\n while (eventReader.hasNext()) {\n XMLEvent event = eventReader.nextEvent();\n\n for (Map.Entry<String, String> o : criteres.entrySet()) {\n switch (event.getEventType()) {\n\n case XMLStreamConstants.START_ELEMENT:\n StartElement startElement = event.asStartElement();\n String qName = startElement.getName().getLocalPart();\n\n if (qName.equalsIgnoreCase(\"facture\")) {\n\n id = startElement.getAttributeByName(QName.valueOf(\"id\")).getValue();\n prix = startElement.getAttributeByName(QName.valueOf(\"prix\")).getValue();\n adresseLivraison = startElement.getAttributeByName(QName.valueOf(\"adresseLivraison\")).getValue();\n date = startElement.getAttributeByName(QName.valueOf(\"date\")).getValue();\n bCommande = true;\n } else if (qName.equalsIgnoreCase(\"idClient\")) {\n\n bIdClient = true;\n } else if (qName.equalsIgnoreCase(\"idPlat\")) {\n bIdPlat = true;\n } else if (qName.equalsIgnoreCase(\"film\")) {\n bFilm = true;\n }\n\n break;\n\n case XMLStreamConstants.CHARACTERS:\n Characters characters = event.asCharacters();\n\n if (bIdPlat) {\n plats.add(characters.getData());\n bIdPlat = false;\n } else if (bFilm) {\n films.add(characters.getData());\n bFilm = false;\n } else if (bIdClient) {\n idClientStr = characters.getData();\n bIdClient = false;\n }\n\n break;\n\n case XMLStreamConstants.END_ELEMENT:\n EndElement endElement = event.asEndElement();\n\n if (endElement.getName().getLocalPart().equalsIgnoreCase(\"facture\")) {\n\n Commande commande = new Commande();\n commande.setAdresseLivraison(adresseLivraison);\n commande.setDate(date);\n commande.setId(id);\n commande.setPrix(Double.parseDouble(prix));\n commande.setIdClient(idClientStr);\n commande.getIdFilms().addAll(films);\n commande.getIdPlats().addAll(plats);\n targetCommandes.add(commande);\n }\n break;\n }\n }\n }\n\n } catch (Exception e) {\n System.out.println(\"Exception: \" + e);\n }\n }\n return targetCommandes;\n }", "@Override\n public Iterator<T> inOrden(){\n return (super.inOrden());\n }", "public final <E extends com.matisse.reflect.MtObject> com.matisse.MtObjectIterator<E> gestionaIterator() {\n return this.<E>successorIterator(getGestionaRelationship(getMtDatabase()), gest_proyectos.Proyecto.class);\n }", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "public void IteratorParcoAuto(){\n Iterator<AbstractAuto> auto=new AutoIterator();\n auto=parco.lista.iterator();\n int i=1;\n while(auto.hasNext())\n {\n Object element=auto.next();\n if(element instanceof Auto)\n {\n System.out.print(i+\" \"+element +\" \\n\");\n }\n i++;\n }\n }", "public static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "SingelIterator() {\n neste = listehode;\n forrige = listehode;\n }", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public List<String> go() throws Exception {\n //start timer\n// long start = System.currentTimeMillis();\n\n // first we generate the candidates of size 1\n createItemsetsOfSize1();\n int itemsetNumber = 1; //the current itemset being looked at\n// int nbFrequentSets = 0;\n\n // the variable numberOfRound represent the max length of the association rules. \n // e.g 3 stay for max 3 words for each rules\n //int numberOfRound = 3;\n int numberOfRound = 3;\n\n //for(int i=0;i<numberOfRound;i++){\n int i = 0;\n while (itemsets.size() > 0 && i < numberOfRound) {\n calculateFrequentItemsets();\n\n if (!itemsets.isEmpty() && i + 1 < numberOfRound) {\n// nbFrequentSets += itemsets.size();\n\n Logger.getLogger(Apriori.class.getName()).log(Level.INFO, \"Found {0} frequent itemsets of size {1} (with support {2}%)\", new Object[]{itemsets.size(), itemsetNumber, minSup * 100});;\n createNewItemsetsFromPreviousOnes();\n }\n i++;\n itemsetNumber++;\n }\n\n return listOfItemsets;\n }", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public Iterable<Arista> aristas() {\n Cola<Arista> mst = new Cola<Arista>();\n for (int v = 0; v < aristaHacia.length; v++) {\n Arista a = aristaHacia[v];\n if (a != null) {\n mst.entrarACola(a);\n }\n }\n return mst;\n }", "private List<Individual<T>> selectIndividuals(Deme<T> deme) {\n return IntStream.range(0, tournamentSize).mapToObj(i -> selRandomOp.select(deme.getIndividuals()))\n .collect(Collectors.toList());\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "@Override\n public void map(InductionChart chart) throws Exception {\n try {\n Sentence sent = chart.sentence;\n for (int i = 0; i < sent.length_noP() - 1; i++) {\n POS curT = sent.getNP(i).tag();\n POS nextT = sent.getNP(i + 1).tag();\n if (!Tagset.CONJ(nextT) && (!Tagset.CONJ(curT) || i == 0)) {\n if (tagsToInduce.contains(curT)) {\n if (!grammar.LexCats.containsKey(nextT))\n System.err.println(nextT);\n grammar.LexCats.get(nextT).keySet().stream().filter(R -> !useCFG(R)).forEach(R -> induceRight(curT, R));\n }\n if (tagsToInduce.contains(nextT)) {\n grammar.LexCats.get(curT).keySet().stream().filter(L -> !useCFG(L) || Tagset.CONJ(nextT)).forEach(L -> induceLeft(L, nextT));\n }\n }\n }\n } catch (Exception e) {\n System.err.println(\"Failed to Induce \" + chart.sentence.asTags());\n throw e;\n }\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "public List<Seance> listeSeances(Groupe g, Enseignant e);", "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 Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\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 getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void generateIndividual() {\n ordering.add(1);\n ordering.add(2);\n ordering.add(3);\n ordering.add(3);\n ordering.add(5);\n ordering.add(6);\n ordering.add(6);\n ordering.add(1);\n\n numKingdoms = cost.length;\n\t\tfor(int i = 0; i < ordering.size() - 1; i++) {\n\t\t\t//if ith is the same as i+1th, it's conquered\n\t\t\tif(ordering.get(i) == ordering.get(i+1)) {\n\t\t\t\tconquered.add(ordering.get(i));\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n void mostraTutti() {\n EAMese[] matrice = EAMese.values();\n assertNotNull(matrice);\n assertEquals(12, matrice.length);\n\n System.out.println();\n String sep = \" - \";\n int k=0;\n for (EAMese mese : matrice) {\n System.out.println(++k+sep+mese.getLungo() + sep + mese.getBreve() + sep + mese.getGiorni());\n }// end of for cycle\n\n }", "Iterator features();", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "protected abstract RuleExplanationSet transformGenotypes(EvolutionResult<BitGene, Double> evolutionResult);", "public interface AlgorithmeAbstrait <E, A>\n{\n /**\n * Methode permettant de resoudre un probleme\n * a l'aide d'un algorithme de resolution \n * et une heuristique correspondante.\n * @param probleme celui sur lequel il faut executer l'algorithme\n * @param heuristique celle qu'il faut appliquer a l'algorithme, a condition qu'elle soit admissible\n * @return Une arraylist contenant la resolution du probleme\n */\n List<E> resoudre (\n ProblemeAbstrait <E, A> probleme, \n HeuristiqueAbstrait<E> heuristique\n );\n}", "public void run() {\n for (List<Boolean> include : includeConstituents) {\r\n // now select an alternative for each constituent\r\n selectConstituent(0, include);\r\n }\r\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "public void inOrderTraverseIterative();", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }", "public void iterateMainEntity(Entity e, OsmDbAccessorContext ctx) throws SQLException {\n \t\tif (e instanceof Way && e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null ){\n \t\t\tBuildingInterpolation type = null;\n \t\t\tint interpolationInterval = 0;\n \t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\ttry {\n \t\t\t\t\ttype = BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase());\n \t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tinterpolationInterval = Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION));\n \t\t\t\t\t} catch(NumberFormatException ex2) {\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (type != null && interpolationInterval > 0) {\n \t\t\t\tList<Node> nodesWithHno = new ArrayList<Node>();\n \t\t\t\tfor (Node n : ((Way) e).getNodes()) {\n \t\t\t\t\tif (n.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && n.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\t\t\t\tnodesWithHno.add(n);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (nodesWithHno.size() > 1) {\n \t\t\t\t\tfor (int i = 1; i < nodesWithHno.size(); i++) {\n \t\t\t\t\t\tNode first = nodesWithHno.get(i - 1);\n \t\t\t\t\t\tNode second = nodesWithHno.get(i);\n \t\t\t\t\t\tboolean exist = streetDAO.findBuilding(first);\n \t\t\t\t\t\tif (exist) {\n \t\t\t\t\t\t\tstreetDAO.removeBuilding(first);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\t\t\tSet<Long> idsOfStreet = getStreetInCity(first.getIsInNames(), first.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\t\t\tBuilding building = new Building(first);\n \t\t\t\t\t\t\tbuilding.setInterpolationInterval(interpolationInterval);\n \t\t\t\t\t\t\tbuilding.setInterpolationType(type);\n \t\t\t\t\t\t\tbuilding.setName(first.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setName2(second.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setLatLon2(second.getLatLon());\n \t\t\t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\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\tif (e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && e.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\tboolean exist = streetDAO.findBuilding(e);\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tBuilding building = new Building(e);\n \t\t\t\t\tString hno = e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER);\n \t\t\t\t\tint i = hno.indexOf('-');\n \t\t\t\t\tif(i != -1) {\n \t\t\t\t\t\tbuilding.setInterpolationInterval(1);\n \t\t\t\t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tbuilding.setInterpolationType(BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase()));\n \t\t\t\t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tbuilding.setInterpolationInterval(Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION)));\n \t\t\t\t\t\t\t\t} catch(NumberFormatException ex2) {\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\tbuilding.setName(hno.substring(0, i));\n \t\t\t\t\t\tbuilding.setName2(hno.substring(i + 1));\n \t\t\t\t\t} else {\n \t\t\t\t\t\tbuilding.setName(hno);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\n \t\t\t\t}\n \t\t\t}\n \t\t} else if (e instanceof Way /* && OSMSettings.wayForCar(e.getTag(OSMTagKey.HIGHWAY)) */\n \t\t\t\t&& e.getTag(OSMTagKey.HIGHWAY) != null && e.getTag(OSMTagKey.NAME) != null) {\n \t\t\t// suppose that streets with names are ways for car\n \t\t\t// Ignore all ways that have house numbers and highway type\n \t\t\t\n \t\t\t// if we saved address ways we could checked that we registered before\n \t\t\tboolean exist = streetDAO.findStreetNode(e);\n \n \n \n \t\t\t// check that street way is not registered already\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.NAME), e.getTag(OSMTagKey.NAME_EN), l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tstreetDAO.writeStreetWayNodes(idsOfStreet, (Way) e);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (e instanceof Relation) {\n \t\t\tif (e.getTag(OSMTagKey.POSTAL_CODE) != null) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tpostalCodeRelations.add((Relation) e);\n \t\t\t}\n \t\t}\n \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 }", "public FrmResult(ArrayList<DataReview> dataRvw) {\n this.dataRvw = dataRvw;\n ArrayList<Results> arrRes = new ArrayList<Results>();\n // ArrayList<Results> arrResFinal = new ArrayList<Results>();\n Results resLower = null;\n initComponents();\n \n Iterator<DataReview> itrDr = this.dataRvw.iterator();\n while(itrDr.hasNext()){\n DataReview dr = itrDr.next();\n String code = dr.getCode();\n float ave = dr.getAverage();\n \n // Data\n Results r = new Results();\n ArrayList<Feature> arrFea = new ArrayList<Feature>(); //Array de Features\n \n // System.out.println(\"code: \"+code+\" ave: \"+ave);\n \n int limit = 1; // Cut String limite\n for (int i = 0; i < code.length()-1; i++) {\n Feature f = new Feature();\n f.setFtr(Integer.parseInt(code.substring(i,limit)));\n limit += 1;\n \n arrFea.add(f);\n }\n \n r.setCode(arrFea);\n r.setAve(ave);\n \n arrRes.add(r);\n }\n \n// Iterator<Results> itrRes = arrRes.iterator();\n// while (itrRes.hasNext()){\n// Results res = itrRes.next();\n// ArrayList<Feature> arrFea2 = res.getCode();\n// float ave = res.getAve();\n// \n// System.out.print(\"ArrayFeatures: \");\n// Iterator<Feature> itrFea = arrFea2.iterator();\n// while (itrFea.hasNext()) {\n// Feature f = itrFea.next();\n// System.out.print(f.getFtr());\n// }\n// System.out.println(\" Average: \"+res.getAve());\n// }\n \n resLower = arrRes.get(0); // Take teh lower result to get the neighbors.\n \n Iterator<Results> itrRes = arrRes.iterator();\n while (itrRes.hasNext()){\n Results res = itrRes.next();\n ArrayList<Feature> arrFeaRes = res.getCode();\n float ave = res.getAve();\n \n ArrayList<Feature> arrFeaRLower = resLower.getCode();\n \n int cont = 0;\n \n for (int i = 0; i < arrFeaRes.size(); i++) {\n if (arrFeaRes.get(i).getFtr()!=arrFeaRLower.get(i).getFtr()) {\n // System.out.println(\"AR: \"+arrFeaRes.get(i).getFtr()+\" >> \"+arrFeaRLower.get(i).getFtr());\n cont += 1;\n }\n }\n \n // System.out.println(\"\");\n \n // Create de Result Final\n Results resFinal = new Results();\n resFinal.setCode(arrFeaRes);\n resFinal.setAve(ave);\n resFinal.setDist(cont);\n \n if(cont!=0){\n this.arrResFinal.add(resFinal);\n }\n }\n \n\n System.out.println(\"<< RESULTS >>\");\n System.out.print(\"Lower Node: \");\n Iterator<Feature> itrFeaResLow = resLower.getCode().iterator();\n while (itrFeaResLow.hasNext()) {\n System.out.print(itrFeaResLow.next().getFtr()); \n }\n System.out.println(\"\");\n \n Iterator<Results> itrResFinal = this.arrResFinal.iterator();\n while (itrResFinal.hasNext()) {\n Results r = itrResFinal.next();\n ArrayList<Feature> arrFea = r.getCode();\n float ave = r.getAve();\n int dist = r.getDist();\n \n System.out.print(\"Features: \");\n Iterator<Feature> itrArrFea = arrFea.iterator();\n while (itrArrFea.hasNext()) {\n Feature f = itrArrFea.next();\n System.out.print(f.getFtr());\n }\n System.out.println(\" Average: \"+ave+\" Distance: \"+dist);\n }\n \n // take the first object DataReview cause it's lower.\n for (int i = 0; i < 1; i++) {\n DataReview dr = this.dataRvw.get(i);\n KnnId.setText(dr.getCode());\n KnnAve.setText(String.valueOf(dr.getAverage()));\n }\n }", "public Iterable<Board> solution()\n {\n SearchNode element = getSolutionNode();\n\n Stack<Board> returnList= new Stack<>();\n returnList.push(element.board);\n while (element!=null &&element.previusNode!=null){\n\n element = element.previusNode;\n returnList.push(element.board);\n }\n\n return new Iterable<Board>() {\n @Override\n public Iterator<Board> iterator()\n {\n return returnList.iterator();\n }\n };\n }", "private void findConceptsForInstances() {\n\t\tSet<String> temp = new HashSet<String>();\n\n\t\tfor (String s : taskInput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskInput.clear();\n\t\ttaskInput.addAll(temp);\n\n\t\ttemp.clear();\n\t\tfor (String s : taskOutput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskOutput.clear();\n\t\ttaskOutput.addAll(temp);\n\n\t\tfor (Node s : serviceMap.values()) {\n\t\t\ttemp.clear();\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tfor (String i : inputs)\n\t\t\t\ttemp.add(taxonomyMap.get(i).parents.get(0).value);\n\t\t\tinputs.clear();\n\t\t\tinputs.addAll(temp);\n\n\t\t\ttemp.clear();\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tfor (String o : outputs)\n\t\t\t\ttemp.add(taxonomyMap.get(o).parents.get(0).value);\n\t\t\toutputs.clear();\n\t\t\toutputs.addAll(temp);\n\t\t}\n\t}", "public void aggregateResults()\n\t{\n\t\ttry {\n\t\t\tAggregateableEvaluation aggContNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(0));\n\t\t\tAggregateableEvaluation aggContSMO = new AggregateableEvaluation(this.evalSMOList.get(0));\n\t\t\tAggregateableEvaluation aggDonaNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(15));\n\t\t\tAggregateableEvaluation aggDonaSMO = new AggregateableEvaluation(this.evalSMOList.get(15));\n\t\t\tAggregateableEvaluation aggOffiNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(30));\n\t\t\tAggregateableEvaluation aggOffiSMO = new AggregateableEvaluation(this.evalSMOList.get(30));\n\t\t\tAggregateableEvaluation aggAdviNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(45));\n\t\t\tAggregateableEvaluation aggAdviSMO = new AggregateableEvaluation(this.evalSMOList.get(45));\n\t\t\tAggregateableEvaluation aggMultNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(60));\n\t\t\tAggregateableEvaluation aggMultSMO = new AggregateableEvaluation(this.evalSMOList.get(60));\n\t\t\tAggregateableEvaluation aggGoodNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(75));\n\t\t\tAggregateableEvaluation aggGoodSMO = new AggregateableEvaluation(this.evalSMOList.get(75));\n\t\t\t\n\n\t\t\tfor (int i = 1; i < 15; i++)\n\t\t\t{\n\t\t\t\taggContNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggContSMO.aggregate(this.evalSMOList.get(i));\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 16; i < 30; i++)\n\t\t\t{\n\t\t\t\taggDonaNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggDonaSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 31; i < 45; i++)\n\t\t\t{\n\t\t\t\taggOffiNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggOffiSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 46; i < 60; i++)\n\t\t\t{\n\t\t\t\taggAdviNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggAdviSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 61; i < 75; i++)\n\t\t\t{\n\t\t\t\taggMultNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggMultSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 76; i < 90; i++)\n\t\t\t{\n\t\t\t\taggGoodNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggGoodSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int a = 0; a < 6; a++)\n\t\t\t{\n\t\t\t\tString aggregateText;\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0: aggregateText = \"ContinuingNewsAggregateResults.txt\"; break;\n\t\t\t\tcase 1: aggregateText = \"DonationsAggregateResults.txt\"; break;\n\t\t\t\tcase 2: aggregateText = \"OfficialAggregateResults.txt\"; break;\n\t\t\t\tcase 3: aggregateText = \"AdviceAggregateResults.txt\"; break;\n\t\t\t\tcase 4: aggregateText = \"MultimediaAggregateResults.txt\"; break;\n\t\t\t\tcase 5: aggregateText = \"GoodsAggregateResults.txt\"; break;\n\t\t\t\tdefault: aggregateText = \"CompleteAggregateResults.txt\";\n\t\t\t\t}\n\n\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(aggregateText));\n\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContNaive.toSummaryString());\n\t\t\t\tbw.write(aggContNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggContNaive.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaNaive.toSummaryString());\n\t\t\t\tbw.write(aggDonaNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaNaive.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiNaive.toSummaryString());\n\t\t\t\tbw.write(aggOffiNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiNaive.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviNaive.toSummaryString());\n\t\t\t\tbw.write(aggAdviNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviNaive.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultNaive.toSummaryString());\n\t\t\t\tbw.write(aggMultNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggMultNaive.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodNaive.toSummaryString());\n\t\t\t\tbw.write(aggGoodNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodNaive.toMatrixString()); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContSMO.toSummaryString());\n\t\t\t\tbw.write(aggContSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggContSMO.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaSMO.toSummaryString());\n\t\t\t\tbw.write(aggDonaSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaSMO.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiSMO.toSummaryString());\n\t\t\t\tbw.write(aggOffiSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiSMO.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviSMO.toSummaryString());\n\t\t\t\tbw.write(aggAdviSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviSMO.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultSMO.toSummaryString());\n\t\t\t\tbw.write(aggMultSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggMultSMO.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodSMO.toSummaryString());\n\t\t\t\tbw.write(aggGoodSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodSMO.toMatrixString()); \t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.close();\n\t\t\t}\n\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void iterateUpdate()\n\t{\n\t\tSystem.out.println(\"ITERATE\");\n\t\t\t\n\t\tfor (Organism org : simState.getOrganisms()) \n\t\t{\n\t\t\torganismViewData.resetOrganismView(org);\n\t\t}\n\t\t\n\t\tIterationResult result = simEngine.iterate();\n\t\t\n\t\t// Process born and dead organisms\n\t\taddBornModels(result.getBorn());\n\t\tremoveDeadModels(result.getLastDead());\n\t\t\n\t\trotateAnimals();\t\t\n\t}", "public void crearAtracciones(){\n \n //Añado atracciones tipo A\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new A();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo B\n for (int i = 0; i < 6 ; i++){\n Atraccion atraccion = new B();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo C\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new C();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo D\n for (int i = 0; i < 3 ; i++){\n Atraccion atraccion = new D();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo E\n for (int i = 0; i < 7 ; i++){\n Atraccion atraccion = new E();\n atracciones.add(atraccion);\n }\n \n }", "List<Videogioco> retriveByGenere(String genere);", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\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 }", "public void setAtores(Iterator<IPessoa> atores);", "public static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public abstract Combinacion elegirCombinacionOculta();", "public void evaluate() {\n for (Chromosome chromo : chromosomes) {\n double chromoGH = chromo.getTotalGH();\n if (chromo.isValid()) {\n this.validChromosomes++;\n if (chromoGH > this.getBestScore()) {\n this.bestScore = chromoGH;\n this.setBestChromo(chromo);\n }\n }\n //Log.debugMsg(chromo.getTotalGH().toString());\n// this.map.put(chromoGH, chromo);\n }\n }", "@Override\n public List<Pair<Candidatura, FAE>> atribui() {\n \n List<FAE> listaFaeEvento = evento.getListaFaeEvento();\n List<Candidatura> listaCandidaturaEvento = evento.getListaCandidaturasEvento();\n List<Pair<Candidatura, FAE>> listaAtribuicoes = new ArrayList();\n \n Random geradorAleatorio = new Random();\n int indiceFae = geradorAleatorio.nextInt(listaFaeEvento.size());\n \n for (Candidatura cand : listaCandidaturaEvento){\n listaAtribuicoes.add( new Pair<>(cand, listaFaeEvento.get(indiceFae)));\n }\n \n return listaAtribuicoes;\n }", "void EvolutionWithElitism(){\n\t\t \tint i, j, l, k;\n\t\t\t//individual[] temp;\n\t\t\tbyte _flippc=0,_flippm=0;\n//\t\t\tString _temp1=\"\", _temp2=\"\";\n\t\t\tint[] _cp;\n\t\t\tnode[] _nd,_nm;\n\t\t\t// Khoi tao quan the dau tien \n\t\t\tRampedInit(6, 0.5);\n\t\t\t//RampedInitOffLine(6, 0.5,15);\n\t\t\t\n//\t\t\tconstructiveRate = new double[NUMGEN];\n//\t\t\tsemanticDistance = new double[NUMGEN];\n\t\t\t\n\t\t\tgen = 0;\n\t\t\twhile(gen < generation) {\n\t\t\t\t\n\t\t\t\tComputeFitness();\n\t\t\t\t\n//\t\t\t\tint g_ncross = 0;\n//\t\t\t\tdouble g_sd = 0;\n//\t\t\t\tPrintToFile();\n\t//----------------------\n//\t\t\t\tFileInputStream instream = null;\n//\t\t\t\tPrintStream outstream = null;\n//\t\t\t\tPrintStream console = System.out;\n//\t\t\t\ttry {\n//\t\t\t\t\toutstream = new PrintStream(new FileOutputStream(\"c:/result/\" + \"detail_\"+ gen + \".txt\"));\n//\t\t\t\t\tSystem.setOut(outstream);\n//\t\t\t\t} catch(Exception e) {\n//\t\t\t\t\tSystem.err.println(\"Error Occurred.\");\n//\t\t\t\t}\n//\t\t\t\tfor(i = 0; i < poplen; i++) {\n//\t\t\t\t\tSystem.out.printf(\"%3.5f \",oldpop[i].fitness);\n//\t\t\t\t\tif((i+1) % 10 == 0) {\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(oldpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// copy anh tot nhat sang the he sau\t \t\n\t\t\t\tnewpop[0].CopyIndividual(bestcurrent[gen], TRUE);\n\t\t\t\t// dot bien anh thu 2\n\t\t\t \n\t\t\t\tl=1;\t\n\t\t\t\ti = TourSelect(TOURSIZE);\n//\t\t\t\t\n\t\t\t\t\n\t\t\t newpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\tindividual[] m_individual0=new individual[1];\n\t\t\t\tint[] _mt0=new int[1];\n\t\t\t\t_nm=new node[1];\n\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual0, 15, TRUE,_mt0,_nm);\n\t\t\t\tnewpop[l]=new individual();\n\t\t\t\tnewpop[l].CopyIndividual(m_individual0[0], TRUE);\t\t\t\n\t\t\t\tnewpop[l].evaluated=FALSE;\t\t\n//\t\t\t\t\n//\t\t\t\tm_individual0=null;\n\t\t\t\t\n\t//------------------------\t\t\n\t\t\t\tl = 2;\t\t\t\n\t\t\t\twhile(l < poplen) {\n\t\t\t\t//\tSystem.out.println(\"Generation \"+ String.valueOf(gen)+\":\");\n\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\n\t\t\t\t\ti = TourSelect(TOURSIZE);\n\t\t\t\t\tj = TourSelect(TOURSIZE);\n\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t\t\n\t\t\t\t _flippc=Flip(pcross);\n//\t\t\t\t System.out.printf(\"pcross:%d\", _flippc);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippc == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] i_temp=new individual[2];\n\t\t\t\t\t\t_cp=new int[2];\n\t\t\t\t\t\t_nd=new node[2];\n\t\t\t\t//\t\n\t\t\t\t//\t\tif(SubTreeSwapWithTTest(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(SubTreeSwap(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(i_temp[0],TRUE);\n\t\t\t\t\t\t\tnewpop[l+1].CopyIndividual(i_temp[1],TRUE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tncross++;\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// semantic distance\n//\t\t\t\t\t\t\tg_sd += newpop[l].getSemanticDistance(oldpop[i]);\n//\t\t\t\t\t\t\tg_sd += newpop[l+1].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tg_sd += oldpop[i].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\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{\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// mutation test\n\t\t\t\t\t_flippm=Flip(pmutate);\n//\t\t\t\t\tSystem.out.printf(\"pmutation:%d\", _flippm);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippm == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] m_individual=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l]=new individual();\n\t\t\t\t\t\tnewpop[l].CopyIndividual(m_individual[0], TRUE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+l+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual=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_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(Flip(pmutate) == 1) {\n\t\t\t\t\t\tindividual[] m_individual1=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l + 1], m_individual1, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l+1]=new individual();\n\t\t\t\t\t\tnewpop[l+1].CopyIndividual(m_individual1[0], TRUE);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+(l+1)+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual1=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_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\tl += 2;\n\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(newpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n//\t\t\t\toutstream.close();\n//\t\t\t\tSystem.setOut(console);\n\t\t\t\t// Thống kê tỷ lệ tTest\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t//\t\t\tsemanticDistance[gen] = g_sd / (2.0 * g_ncross);\n//\t\t\t\tsemanticDistance[gen] = g_sd /g_ncross;\n\t\t\t\t\n\t\t\t\tgen++;\n\t\t\t\tfor(k = 0; k < poplen; k++)\n\t\t\t\t{\n\t\t\t\t\toldpop[k]=null;\n\t\t\t\t\toldpop[k]=new individual();\n\t\t\t\t\toldpop[k].CopyIndividual(newpop[k], TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void estendre( Casella inici )\n\t{\n\t\tjo = tauler.getEstatCasella( inici );\n\n\t\tList<Casella> pendents = new LinkedList<Casella>();\n\t\tpendents.add( inici );\n\n\t\twhile ( !pendents.isEmpty() ) //mentres hi hagi caselles a la llista, seguir iterant.\n\t\t{\n\t\t\tCasella casella = pendents.get( 0 ); //obtenim el vei\n\n\t\t\tpendents.remove( casella ); //el treiem de pendents\n\t\t\tgrup.add( casella ); //l'afegim al grup.\n\n\t\t\t//Comprovem si esta a la cantonada, primer pel jugador A i despres pel B i si ho està mirem totes les cantonades.\n\t\t\tif ( jo == EstatCasella.JUGADOR_A &&\n\t\t\t ( casella.getColumna() == 0 || casella.getColumna() == tauler.getMida() - 1 ) )\n\t\t\t{\n\t\t\t\tfor ( int i = 0; i < tauler.getMida(); i++ )\n\t\t\t\t{\n\t\t\t\t\tCasella casellaLateral = new Casella( i, casella.getColumna() );\n\t\t\t\t\tif ( esPotAfegir( casellaLateral, pendents, jo ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpendents.add( casellaLateral );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( jo == EstatCasella.JUGADOR_B &&\n\t\t\t ( casella.getFila() == 0 || casella.getFila() == tauler.getMida() - 1 ) )\n\t\t\t{\n\t\t\t\tfor ( int i = 0; i < tauler.getMida(); i++ )\n\t\t\t\t{\n\t\t\t\t\tCasella casellaLateral = new Casella( casella.getFila(), i );\n\t\t\t\t\tif ( esPotAfegir( casellaLateral, pendents, jo ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpendents.add( casellaLateral );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tList<Casella> veins = tauler.getVeins( casella ); //obtenim els veins.\n\t\t\tfor ( int i = 0; i < veins.size(); i++ )\n\t\t\t{\n\t\t\t\tCasella vei = veins.get( i );\n\t\t\t\tif ( esPotAfegir( vei, pendents, jo ) )\n\t\t\t\t{\n\t\t\t\t\t//si te el mateix estat i no està afegida al grup, la fiquem a pendents.\n\t\t\t\t\tpendents.add( vei );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "private static void iterator() {\n\t\t\r\n\t}", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public static void main(String[] args) {\n int indexMin = -3;\n int indexMax = 1;\n RangeArray squares = new RangeArray(indexMin, indexMax);\n\n for (int index = squares.getIndexMin() ; index <= squares.getIndexMax() ; index++)\n squares.set(index, index*index);\n\n for (int index = squares.getIndexMin() ; index <= squares.getIndexMax() ; index++)\n System.out.println(index + \" -> \" + squares.get(index));\n\n System.out.println(squares.rangeSize());\n\n // 2.\n RangeArray<String> habitations = new RangeArray<String>(3, 5);\n habitations.set(3, \"Maison\");\n habitations.set(4, \"Immeuble\");\n habitations.set(5, \"Hutte\");\n for (int index = habitations.getIndexMin() ; index <= habitations.getIndexMax() ; index++)\n System.out.print(habitations.get(index).length() + \" \");\n\n // 3.\n // TODO : Fonctionnel, mais chercher le fonctionnement précis de Iterable et changer le stream par un code plus propre\n for (String habitation : habitations)\n System.out.print(habitation + \" \");\n\n // Exercice 2 : Iterateur sur des grilles\n // 1.\n String[][] elements = {{\"A\",\"C\",\"E\",\"G\"},{\"B\",\"D\",\"F\",\"H\"}};\n Grid<String> grid = new Grid<>(elements);\n for (int line = 0 ; line < grid.nbLines() ; line++)\n for (int column = 0 ; column < grid.nbColumns() ; column++)\n {\n String element = grid.get(line, column);\n System.out.print(element + \" \");\n }\n System.out.println();\n\n // 2.\n // TODO : Methodes T next() et hasNext() de Iterator<T> pour rendre cette syntaxe fonctionnelle.\n for (String element : grid)\n System.out.print(element + \" \");\n System.out.println();\n }", "public static void main (String [] args){\r\n Jefatura jefe_RR=new Jefatura(\"Jeanpool\",55000,2006,9,25);\r\n jefe_RR.estableceIncentivo(2570);\r\n Empleado [] misEmpleados=new Empleado[6];\r\n misEmpleados[0]=new Empleado(\"Paco Gomez\",85000,1990,12,17);\r\n misEmpleados[1]=new Empleado(\"Ana Lopez\",95000,1995,06,02);\r\n misEmpleados[2]=new Empleado(\"Maria Martin\",105000,2002,03,15);\r\n misEmpleados[3]=new Empleado(\"Jeanpool Guerrero\");\r\n misEmpleados[4]=jefe_RR;/**--Polimorfismo: Prinicipio de sustitucion*/\r\n misEmpleados[5]=new Jefatura(\"Maria\",95000,1999,5,26);\r\n Jefatura jefa_Finanzas=(Jefatura)misEmpleados[5];/** CASTING CONVERTIR UN OBJETO A otro */\r\n jefa_Finanzas.estableceIncentivo(55000);\r\n \r\n \r\n \r\n /** for(int i=0;i<3; i++){\r\n misEmpleados[i].subeSueldo(5);\r\n \r\n }\r\n \r\n for(int i=0;i<3;i++){\r\n System.out.println(\"Nombre \"+misEmpleados[i].dimeNombre() + \"Sueldo: \"+misEmpleados[i].dimeSueldo()+ \"Fecha Alta: \"+misEmpleados[i].dameFechaContrato());\r\n }\r\n */\r\n\r\n for(Empleado elementos:misEmpleados){\r\n \r\n elementos.subeSueldo(5);\r\n \r\n }\r\n \r\n for(Empleado elementos:misEmpleados){\r\n System.out.println(\"Nombre: \"+elementos.dimeNombre()+ \" Sueldo: \"+elementos.dimeSueldo()+ \" Alta Contrato: \"+elementos.dameFechaContrato());\r\n }\r\n \r\n }", "public void affiche() {\n System.out.println(\"le tapis porte \"+this.tapis.size()+\" caisse(s)\");\n for (Iterator it = this.tapis.iterator(); it.hasNext(); ) {\n System.out.println(it.next().toString());\n } \n }", "public void colorearSecuencial() {\n\t\t// Collections.shuffle(nodos);\n\t\tcolorearSecuencialAlternativo();\n\t}", "public Iterable<M> iterateAll();", "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 }", "@Override public T next(){\n Vertice v = pila.saca();\n T e = v.elemento;\n v = v.derecho;\n while (v != null) {\n pila.mete(v);\n v = v.izquierdo;\n }\n\t\treturn e;\n }", "@Override\n\tpublic ArrayList<Edge> makeMove(Graph graph, int iteration) {\n\t\t// Create a value associated with each position\n\t\tIterator<Edge> edges = graph.edges();\n\t\twhile (edges.hasNext()) {\n\t\t\tEdge edge = edges.next();\n\t\t\tVertex v1 = edge.getFromVertex();\n\t\t\tVertex v2 = edge.getToVertex();\n\t\t\t// We favor free spots\n\t\t\tif (edge.getProperty().equals(Property.FREE)) {\n\t\t\t\t// We dislike being close to opposing settlements\n\t\t\t\tif (v1.getProperty().equals(Property.FREE) && v2.getProperty().equals(Property.FREE)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// We favor areas close by\n\t\t\t\tif (v1.getProperty().equals(super.getProperty())) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// Early in the game we want roads and settlements\n\t\t\t\tif (iteration < Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.BRICK) || v1.getResources().contains(Resource.LUMBER)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Towards the end of the game we want cities\n\t\t\t\tif (iteration >= Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.ORE) || v1.getResources().contains(Resource.GRAIN)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We favor hexes with high probability rolls\n\t\t\t\tif (v1.getRolls().contains(5) || v1.getRolls().contains(6) || v1.getRolls().contains(8)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tKruskalAlgo kruskal = new KruskalAlgo(graph);\n\t\treturn kruskal.getMinSpanForest(graph);\n\t}", "public Iterador() {\n pila = new Pila<Nodo>();\n if (raiz != null) {\n pila.push(raiz);\n Nodo<T> nodo = pila.peek();\n while(nodo != null){\n if (nodo.izquierdo != null) {\n pila.push(nodo.izquierdo);\n }\n nodo = nodo.izquierdo;\n }\n }\n\n }", "@Override\n\tpublic Iterator<Arco<T>> obtenerArcos() {\n\t\tList arcos = new ArrayList<Arco<T>>();\n\t\tfor (Vertice v: listVertices){//agarro todos los arcos de todos los vertices\n\t\t\tarcos.add(v.getArcos());\n\t\t}\n \t\tIterator<Arco<T>> arcosIT = arcos.iterator();\n\t\treturn new IteradorArco(arcosIT);\n\t}", "private static List<Etudiant> creationListeEtudiants(List<String> datas,boolean modele){\n\t\tList<String> dataEtudiant = new ArrayList<String>();\n\t\tList<Etudiant> etudiants = new ArrayList<Etudiant>();\n\t\tIterator<String> it = datas.iterator();\n\t\twhile (it.hasNext()) {//on parcourt les donnees\n\t\t\tString data = it.next();\n\t\t\tif(RecherchePattern.rechercheDebutEtudiant(data)){\t//si on change d'etudiant on reset les donnees concernant l'ancien etudiant\n\t\t\t\treset();\n\t\t\t\tdataEtudiant = new ArrayList<String>();//on reset les donnees\n\t\t\t\tsetNbEtudiant(getNbEtudiant() + 1);\n\t\t\t}\n\t\t\telse{//si on a pas changer d'etudiant on stocke ces donnees\n\t\t\t\tif(RecherchePattern.rechercheFinEtudiant(data)){//si on est a la fin des donnees on creer l'etudiant\n\t\t\t\t\tdataEtudiant.add(data); //on ajoute le dernier element au donnee\n\t\t\t\t\tif(!modele)\n\t\t\t\t\t\tetudiants.add(ajoutEtudiant(dataEtudiant));\n\t\t\t\t\telse\n\t\t\t\t\t\tetudiants.add(ajoutEtudiantModele(dataEtudiant));\n\t\t\t\t\treset();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdataEtudiant.add(data);//on est pas a la fin on attend\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tetudiants = suppressionDoublons(etudiants); //on supprime les\n\t\treturn etudiants;\n\t}" ]
[ "0.64652073", "0.6257098", "0.6118809", "0.610349", "0.5793893", "0.56823957", "0.561325", "0.53590775", "0.5293248", "0.5273585", "0.52687013", "0.52355474", "0.52195454", "0.52152926", "0.51958716", "0.51624423", "0.51547223", "0.5145475", "0.5140895", "0.5119826", "0.5118282", "0.50797457", "0.5075372", "0.507389", "0.50721836", "0.5056421", "0.5056324", "0.5055726", "0.5055523", "0.50474876", "0.5045453", "0.503483", "0.50303656", "0.503036", "0.49952865", "0.4993304", "0.49819267", "0.49796653", "0.49778804", "0.4977433", "0.49740782", "0.49734402", "0.49663153", "0.49656412", "0.49650452", "0.49610797", "0.49568617", "0.49554008", "0.49498776", "0.49497503", "0.49483153", "0.49407837", "0.49397674", "0.49325928", "0.49296638", "0.49179977", "0.49167812", "0.48999044", "0.48966274", "0.48962814", "0.48922887", "0.48911572", "0.48888627", "0.48836768", "0.48805803", "0.48736537", "0.48720977", "0.48540688", "0.4849428", "0.48475772", "0.4843133", "0.4840771", "0.48321906", "0.48263416", "0.48255083", "0.48253933", "0.48240224", "0.48221114", "0.48205048", "0.48200387", "0.4811292", "0.48105237", "0.48086488", "0.4803359", "0.47969162", "0.47953543", "0.479229", "0.4790113", "0.47880003", "0.478293", "0.47809985", "0.47794095", "0.4775217", "0.47742504", "0.47733617", "0.4765288", "0.47651944", "0.47641054", "0.47639212", "0.47622547" ]
0.56068695
7
mejor iteracion de una estrategia
public DatosIteracion mejorIteracionCapturados(String estrategia) { int i; for (i = 0; i < this.getValoresEstrategias().size(); i++) { if (this.getValoresEstrategias(i).getNombreEstrategia() .equals(estrategia)) break; } return this.getValoresEstrategias(i).masCapturadas(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public DatosIteracion mejorIteracionVisibles(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "public DatosIteracion mejorIteracionCapturados() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionCapturados(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionCapturados(array);\r\n\t}", "public Iterator<IPessoa> getAtores();", "public void setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }", "@Test\n public void testIterator() {\n System.out.println(\"iterator\");\n Goban g = createGoban();\n ArrayList<PierrePoint> groupeAttendu = new ArrayList<>();\n groupeAttendu.add(g.getPierre(0, 0));\n groupeAttendu.add(g.getPierre(0, 1));\n groupeAttendu.add(g.getPierre(1, 0));\n GroupeDePierres groupe = new GroupeDePierres(g.getPierre(0, 0), g);\n \n for( PierrePoint p : groupe)\n {\n assertTrue(groupeAttendu.contains(p));\n }\n \n assertEquals(groupeAttendu.size(),groupe.size());\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public DatosIteracion mejorIteracionVisibles() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionVisibles(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionVisibles(array);\r\n\t}", "public Iterator<T> byGenerations() {\r\n ArrayIterator<T> iter = new ArrayIterator<T>();\r\n\r\n for (int i = 0; i < SIZE; i++) {\r\n iter.add(tree[i]);\r\n }\r\n\r\n return iter;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\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 }", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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 }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public String generarEstadisticasGenerales(){\n \n String estadisticaGeneral = \"En general en la universidad del valle: \\n\";\n estadisticaGeneral += \"se encuentran: \" + EmpleadosPrioridadAlta.size() + \" empleados en prioridad alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMediaAlta.size() + \" empleados en prioridad media alta\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMediaAlta)\n + \"se encuentran: \" + EmpleadosPrioridadMedia.size() + \" empleados en prioridad media\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadMedia)\n + \"se encuentran: \" + EmpleadosPrioridadBaja.size() + \" empleados en prioridad baja\\n\"\n + empleadosPorPrioridad(EmpleadosPrioridadBaja);\n return estadisticaGeneral;\n }", "List<E> resoudre (\n ProblemeAbstrait <E, A> probleme, \n HeuristiqueAbstrait<E> heuristique\n );", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setIteraciones(int iteraciones) {\r\n this.iteraciones = iteraciones;\r\n }", "public List<Commande> commandesAvecCriteres(Map<String, String> criteres, String idClient) {\n List<Commande> targetCommandes = new ArrayList<Commande>();\n //Trouver tous les factures correspondants\n List<String> targetFactures = new ArrayList<String>();\n for (String f : nomsFactures()) {\n if (f.contains(idClient)) {\n targetFactures.add(f);\n }\n };\n\n int targetCritere = 0;\n for (String filepath : targetFactures) {\n\n List<String> plats = new ArrayList<String>();\n List<String> films = new ArrayList<String>();\n String prix = \"\";\n String id = \"\";\n String date = \"\";\n String adresseLivraison = \"\";\n String idClientStr = \"\";\n\n boolean matchingCommand = false;\n boolean bCommande = false;\n boolean bIdPlat = false;\n boolean bIdClient = false;\n boolean bFilm = false;\n try {\n XMLInputFactory factory = XMLInputFactory.newInstance();\n XMLEventReader eventReader\n = factory.createXMLEventReader(new FileReader(\"factures/\" + filepath));\n\n while (eventReader.hasNext()) {\n XMLEvent event = eventReader.nextEvent();\n\n for (Map.Entry<String, String> o : criteres.entrySet()) {\n switch (event.getEventType()) {\n\n case XMLStreamConstants.START_ELEMENT:\n StartElement startElement = event.asStartElement();\n String qName = startElement.getName().getLocalPart();\n\n if (qName.equalsIgnoreCase(\"facture\")) {\n\n id = startElement.getAttributeByName(QName.valueOf(\"id\")).getValue();\n prix = startElement.getAttributeByName(QName.valueOf(\"prix\")).getValue();\n adresseLivraison = startElement.getAttributeByName(QName.valueOf(\"adresseLivraison\")).getValue();\n date = startElement.getAttributeByName(QName.valueOf(\"date\")).getValue();\n bCommande = true;\n } else if (qName.equalsIgnoreCase(\"idClient\")) {\n\n bIdClient = true;\n } else if (qName.equalsIgnoreCase(\"idPlat\")) {\n bIdPlat = true;\n } else if (qName.equalsIgnoreCase(\"film\")) {\n bFilm = true;\n }\n\n break;\n\n case XMLStreamConstants.CHARACTERS:\n Characters characters = event.asCharacters();\n\n if (bIdPlat) {\n plats.add(characters.getData());\n bIdPlat = false;\n } else if (bFilm) {\n films.add(characters.getData());\n bFilm = false;\n } else if (bIdClient) {\n idClientStr = characters.getData();\n bIdClient = false;\n }\n\n break;\n\n case XMLStreamConstants.END_ELEMENT:\n EndElement endElement = event.asEndElement();\n\n if (endElement.getName().getLocalPart().equalsIgnoreCase(\"facture\")) {\n\n Commande commande = new Commande();\n commande.setAdresseLivraison(adresseLivraison);\n commande.setDate(date);\n commande.setId(id);\n commande.setPrix(Double.parseDouble(prix));\n commande.setIdClient(idClientStr);\n commande.getIdFilms().addAll(films);\n commande.getIdPlats().addAll(plats);\n targetCommandes.add(commande);\n }\n break;\n }\n }\n }\n\n } catch (Exception e) {\n System.out.println(\"Exception: \" + e);\n }\n }\n return targetCommandes;\n }", "@Override\n public Iterator<T> inOrden(){\n return (super.inOrden());\n }", "public final <E extends com.matisse.reflect.MtObject> com.matisse.MtObjectIterator<E> gestionaIterator() {\n return this.<E>successorIterator(getGestionaRelationship(getMtDatabase()), gest_proyectos.Proyecto.class);\n }", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "public void IteratorParcoAuto(){\n Iterator<AbstractAuto> auto=new AutoIterator();\n auto=parco.lista.iterator();\n int i=1;\n while(auto.hasNext())\n {\n Object element=auto.next();\n if(element instanceof Auto)\n {\n System.out.print(i+\" \"+element +\" \\n\");\n }\n i++;\n }\n }", "public static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "SingelIterator() {\n neste = listehode;\n forrige = listehode;\n }", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public List<String> go() throws Exception {\n //start timer\n// long start = System.currentTimeMillis();\n\n // first we generate the candidates of size 1\n createItemsetsOfSize1();\n int itemsetNumber = 1; //the current itemset being looked at\n// int nbFrequentSets = 0;\n\n // the variable numberOfRound represent the max length of the association rules. \n // e.g 3 stay for max 3 words for each rules\n //int numberOfRound = 3;\n int numberOfRound = 3;\n\n //for(int i=0;i<numberOfRound;i++){\n int i = 0;\n while (itemsets.size() > 0 && i < numberOfRound) {\n calculateFrequentItemsets();\n\n if (!itemsets.isEmpty() && i + 1 < numberOfRound) {\n// nbFrequentSets += itemsets.size();\n\n Logger.getLogger(Apriori.class.getName()).log(Level.INFO, \"Found {0} frequent itemsets of size {1} (with support {2}%)\", new Object[]{itemsets.size(), itemsetNumber, minSup * 100});;\n createNewItemsetsFromPreviousOnes();\n }\n i++;\n itemsetNumber++;\n }\n\n return listOfItemsets;\n }", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public Iterable<Arista> aristas() {\n Cola<Arista> mst = new Cola<Arista>();\n for (int v = 0; v < aristaHacia.length; v++) {\n Arista a = aristaHacia[v];\n if (a != null) {\n mst.entrarACola(a);\n }\n }\n return mst;\n }", "private List<Individual<T>> selectIndividuals(Deme<T> deme) {\n return IntStream.range(0, tournamentSize).mapToObj(i -> selRandomOp.select(deme.getIndividuals()))\n .collect(Collectors.toList());\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "@Override\n public void map(InductionChart chart) throws Exception {\n try {\n Sentence sent = chart.sentence;\n for (int i = 0; i < sent.length_noP() - 1; i++) {\n POS curT = sent.getNP(i).tag();\n POS nextT = sent.getNP(i + 1).tag();\n if (!Tagset.CONJ(nextT) && (!Tagset.CONJ(curT) || i == 0)) {\n if (tagsToInduce.contains(curT)) {\n if (!grammar.LexCats.containsKey(nextT))\n System.err.println(nextT);\n grammar.LexCats.get(nextT).keySet().stream().filter(R -> !useCFG(R)).forEach(R -> induceRight(curT, R));\n }\n if (tagsToInduce.contains(nextT)) {\n grammar.LexCats.get(curT).keySet().stream().filter(L -> !useCFG(L) || Tagset.CONJ(nextT)).forEach(L -> induceLeft(L, nextT));\n }\n }\n }\n } catch (Exception e) {\n System.err.println(\"Failed to Induce \" + chart.sentence.asTags());\n throw e;\n }\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "public List<Seance> listeSeances(Groupe g, Enseignant e);", "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 Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\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 getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void generateIndividual() {\n ordering.add(1);\n ordering.add(2);\n ordering.add(3);\n ordering.add(3);\n ordering.add(5);\n ordering.add(6);\n ordering.add(6);\n ordering.add(1);\n\n numKingdoms = cost.length;\n\t\tfor(int i = 0; i < ordering.size() - 1; i++) {\n\t\t\t//if ith is the same as i+1th, it's conquered\n\t\t\tif(ordering.get(i) == ordering.get(i+1)) {\n\t\t\t\tconquered.add(ordering.get(i));\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n void mostraTutti() {\n EAMese[] matrice = EAMese.values();\n assertNotNull(matrice);\n assertEquals(12, matrice.length);\n\n System.out.println();\n String sep = \" - \";\n int k=0;\n for (EAMese mese : matrice) {\n System.out.println(++k+sep+mese.getLungo() + sep + mese.getBreve() + sep + mese.getGiorni());\n }// end of for cycle\n\n }", "Iterator features();", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "protected abstract RuleExplanationSet transformGenotypes(EvolutionResult<BitGene, Double> evolutionResult);", "public interface AlgorithmeAbstrait <E, A>\n{\n /**\n * Methode permettant de resoudre un probleme\n * a l'aide d'un algorithme de resolution \n * et une heuristique correspondante.\n * @param probleme celui sur lequel il faut executer l'algorithme\n * @param heuristique celle qu'il faut appliquer a l'algorithme, a condition qu'elle soit admissible\n * @return Une arraylist contenant la resolution du probleme\n */\n List<E> resoudre (\n ProblemeAbstrait <E, A> probleme, \n HeuristiqueAbstrait<E> heuristique\n );\n}", "public void run() {\n for (List<Boolean> include : includeConstituents) {\r\n // now select an alternative for each constituent\r\n selectConstituent(0, include);\r\n }\r\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "public void inOrderTraverseIterative();", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }", "public void iterateMainEntity(Entity e, OsmDbAccessorContext ctx) throws SQLException {\n \t\tif (e instanceof Way && e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null ){\n \t\t\tBuildingInterpolation type = null;\n \t\t\tint interpolationInterval = 0;\n \t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\ttry {\n \t\t\t\t\ttype = BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase());\n \t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tinterpolationInterval = Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION));\n \t\t\t\t\t} catch(NumberFormatException ex2) {\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (type != null && interpolationInterval > 0) {\n \t\t\t\tList<Node> nodesWithHno = new ArrayList<Node>();\n \t\t\t\tfor (Node n : ((Way) e).getNodes()) {\n \t\t\t\t\tif (n.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && n.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\t\t\t\tnodesWithHno.add(n);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (nodesWithHno.size() > 1) {\n \t\t\t\t\tfor (int i = 1; i < nodesWithHno.size(); i++) {\n \t\t\t\t\t\tNode first = nodesWithHno.get(i - 1);\n \t\t\t\t\t\tNode second = nodesWithHno.get(i);\n \t\t\t\t\t\tboolean exist = streetDAO.findBuilding(first);\n \t\t\t\t\t\tif (exist) {\n \t\t\t\t\t\t\tstreetDAO.removeBuilding(first);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\t\t\tSet<Long> idsOfStreet = getStreetInCity(first.getIsInNames(), first.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\t\t\tBuilding building = new Building(first);\n \t\t\t\t\t\t\tbuilding.setInterpolationInterval(interpolationInterval);\n \t\t\t\t\t\t\tbuilding.setInterpolationType(type);\n \t\t\t\t\t\t\tbuilding.setName(first.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setName2(second.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));\n \t\t\t\t\t\t\tbuilding.setLatLon2(second.getLatLon());\n \t\t\t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\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\tif (e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER) != null && e.getTag(OSMTagKey.ADDR_STREET) != null) {\n \t\t\tboolean exist = streetDAO.findBuilding(e);\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.ADDR_STREET), null, l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tBuilding building = new Building(e);\n \t\t\t\t\tString hno = e.getTag(OSMTagKey.ADDR_HOUSE_NUMBER);\n \t\t\t\t\tint i = hno.indexOf('-');\n \t\t\t\t\tif(i != -1) {\n \t\t\t\t\t\tbuilding.setInterpolationInterval(1);\n \t\t\t\t\t\tif(e.getTag(OSMTagKey.ADDR_INTERPOLATION) != null) {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tbuilding.setInterpolationType(BuildingInterpolation.valueOf(e.getTag(OSMTagKey.ADDR_INTERPOLATION).toUpperCase()));\n \t\t\t\t\t\t\t} catch (RuntimeException ex) {\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tbuilding.setInterpolationInterval(Integer.parseInt(e.getTag(OSMTagKey.ADDR_INTERPOLATION)));\n \t\t\t\t\t\t\t\t} catch(NumberFormatException ex2) {\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\tbuilding.setName(hno.substring(0, i));\n \t\t\t\t\t\tbuilding.setName2(hno.substring(i + 1));\n \t\t\t\t\t} else {\n \t\t\t\t\t\tbuilding.setName(hno);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tstreetDAO.writeBuilding(idsOfStreet, building);\n \t\t\t\t}\n \t\t\t}\n \t\t} else if (e instanceof Way /* && OSMSettings.wayForCar(e.getTag(OSMTagKey.HIGHWAY)) */\n \t\t\t\t&& e.getTag(OSMTagKey.HIGHWAY) != null && e.getTag(OSMTagKey.NAME) != null) {\n \t\t\t// suppose that streets with names are ways for car\n \t\t\t// Ignore all ways that have house numbers and highway type\n \t\t\t\n \t\t\t// if we saved address ways we could checked that we registered before\n \t\t\tboolean exist = streetDAO.findStreetNode(e);\n \n \n \n \t\t\t// check that street way is not registered already\n \t\t\tif (!exist) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tLatLon l = e.getLatLon();\n \t\t\t\tSet<Long> idsOfStreet = getStreetInCity(e.getIsInNames(), e.getTag(OSMTagKey.NAME), e.getTag(OSMTagKey.NAME_EN), l);\n \t\t\t\tif (!idsOfStreet.isEmpty()) {\n \t\t\t\t\tstreetDAO.writeStreetWayNodes(idsOfStreet, (Way) e);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (e instanceof Relation) {\n \t\t\tif (e.getTag(OSMTagKey.POSTAL_CODE) != null) {\n \t\t\t\tctx.loadEntityData(e);\n \t\t\t\tpostalCodeRelations.add((Relation) e);\n \t\t\t}\n \t\t}\n \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 }", "public FrmResult(ArrayList<DataReview> dataRvw) {\n this.dataRvw = dataRvw;\n ArrayList<Results> arrRes = new ArrayList<Results>();\n // ArrayList<Results> arrResFinal = new ArrayList<Results>();\n Results resLower = null;\n initComponents();\n \n Iterator<DataReview> itrDr = this.dataRvw.iterator();\n while(itrDr.hasNext()){\n DataReview dr = itrDr.next();\n String code = dr.getCode();\n float ave = dr.getAverage();\n \n // Data\n Results r = new Results();\n ArrayList<Feature> arrFea = new ArrayList<Feature>(); //Array de Features\n \n // System.out.println(\"code: \"+code+\" ave: \"+ave);\n \n int limit = 1; // Cut String limite\n for (int i = 0; i < code.length()-1; i++) {\n Feature f = new Feature();\n f.setFtr(Integer.parseInt(code.substring(i,limit)));\n limit += 1;\n \n arrFea.add(f);\n }\n \n r.setCode(arrFea);\n r.setAve(ave);\n \n arrRes.add(r);\n }\n \n// Iterator<Results> itrRes = arrRes.iterator();\n// while (itrRes.hasNext()){\n// Results res = itrRes.next();\n// ArrayList<Feature> arrFea2 = res.getCode();\n// float ave = res.getAve();\n// \n// System.out.print(\"ArrayFeatures: \");\n// Iterator<Feature> itrFea = arrFea2.iterator();\n// while (itrFea.hasNext()) {\n// Feature f = itrFea.next();\n// System.out.print(f.getFtr());\n// }\n// System.out.println(\" Average: \"+res.getAve());\n// }\n \n resLower = arrRes.get(0); // Take teh lower result to get the neighbors.\n \n Iterator<Results> itrRes = arrRes.iterator();\n while (itrRes.hasNext()){\n Results res = itrRes.next();\n ArrayList<Feature> arrFeaRes = res.getCode();\n float ave = res.getAve();\n \n ArrayList<Feature> arrFeaRLower = resLower.getCode();\n \n int cont = 0;\n \n for (int i = 0; i < arrFeaRes.size(); i++) {\n if (arrFeaRes.get(i).getFtr()!=arrFeaRLower.get(i).getFtr()) {\n // System.out.println(\"AR: \"+arrFeaRes.get(i).getFtr()+\" >> \"+arrFeaRLower.get(i).getFtr());\n cont += 1;\n }\n }\n \n // System.out.println(\"\");\n \n // Create de Result Final\n Results resFinal = new Results();\n resFinal.setCode(arrFeaRes);\n resFinal.setAve(ave);\n resFinal.setDist(cont);\n \n if(cont!=0){\n this.arrResFinal.add(resFinal);\n }\n }\n \n\n System.out.println(\"<< RESULTS >>\");\n System.out.print(\"Lower Node: \");\n Iterator<Feature> itrFeaResLow = resLower.getCode().iterator();\n while (itrFeaResLow.hasNext()) {\n System.out.print(itrFeaResLow.next().getFtr()); \n }\n System.out.println(\"\");\n \n Iterator<Results> itrResFinal = this.arrResFinal.iterator();\n while (itrResFinal.hasNext()) {\n Results r = itrResFinal.next();\n ArrayList<Feature> arrFea = r.getCode();\n float ave = r.getAve();\n int dist = r.getDist();\n \n System.out.print(\"Features: \");\n Iterator<Feature> itrArrFea = arrFea.iterator();\n while (itrArrFea.hasNext()) {\n Feature f = itrArrFea.next();\n System.out.print(f.getFtr());\n }\n System.out.println(\" Average: \"+ave+\" Distance: \"+dist);\n }\n \n // take the first object DataReview cause it's lower.\n for (int i = 0; i < 1; i++) {\n DataReview dr = this.dataRvw.get(i);\n KnnId.setText(dr.getCode());\n KnnAve.setText(String.valueOf(dr.getAverage()));\n }\n }", "public Iterable<Board> solution()\n {\n SearchNode element = getSolutionNode();\n\n Stack<Board> returnList= new Stack<>();\n returnList.push(element.board);\n while (element!=null &&element.previusNode!=null){\n\n element = element.previusNode;\n returnList.push(element.board);\n }\n\n return new Iterable<Board>() {\n @Override\n public Iterator<Board> iterator()\n {\n return returnList.iterator();\n }\n };\n }", "private void findConceptsForInstances() {\n\t\tSet<String> temp = new HashSet<String>();\n\n\t\tfor (String s : taskInput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskInput.clear();\n\t\ttaskInput.addAll(temp);\n\n\t\ttemp.clear();\n\t\tfor (String s : taskOutput)\n\t\t\ttemp.add(taxonomyMap.get(s).parents.get(0).value);\n\t\ttaskOutput.clear();\n\t\ttaskOutput.addAll(temp);\n\n\t\tfor (Node s : serviceMap.values()) {\n\t\t\ttemp.clear();\n\t\t\tSet<String> inputs = s.getInputs();\n\t\t\tfor (String i : inputs)\n\t\t\t\ttemp.add(taxonomyMap.get(i).parents.get(0).value);\n\t\t\tinputs.clear();\n\t\t\tinputs.addAll(temp);\n\n\t\t\ttemp.clear();\n\t\t\tSet<String> outputs = s.getOutputs();\n\t\t\tfor (String o : outputs)\n\t\t\t\ttemp.add(taxonomyMap.get(o).parents.get(0).value);\n\t\t\toutputs.clear();\n\t\t\toutputs.addAll(temp);\n\t\t}\n\t}", "public void aggregateResults()\n\t{\n\t\ttry {\n\t\t\tAggregateableEvaluation aggContNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(0));\n\t\t\tAggregateableEvaluation aggContSMO = new AggregateableEvaluation(this.evalSMOList.get(0));\n\t\t\tAggregateableEvaluation aggDonaNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(15));\n\t\t\tAggregateableEvaluation aggDonaSMO = new AggregateableEvaluation(this.evalSMOList.get(15));\n\t\t\tAggregateableEvaluation aggOffiNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(30));\n\t\t\tAggregateableEvaluation aggOffiSMO = new AggregateableEvaluation(this.evalSMOList.get(30));\n\t\t\tAggregateableEvaluation aggAdviNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(45));\n\t\t\tAggregateableEvaluation aggAdviSMO = new AggregateableEvaluation(this.evalSMOList.get(45));\n\t\t\tAggregateableEvaluation aggMultNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(60));\n\t\t\tAggregateableEvaluation aggMultSMO = new AggregateableEvaluation(this.evalSMOList.get(60));\n\t\t\tAggregateableEvaluation aggGoodNaive = new AggregateableEvaluation(this.evalNaiveBayesList.get(75));\n\t\t\tAggregateableEvaluation aggGoodSMO = new AggregateableEvaluation(this.evalSMOList.get(75));\n\t\t\t\n\n\t\t\tfor (int i = 1; i < 15; i++)\n\t\t\t{\n\t\t\t\taggContNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggContSMO.aggregate(this.evalSMOList.get(i));\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 16; i < 30; i++)\n\t\t\t{\n\t\t\t\taggDonaNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggDonaSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 31; i < 45; i++)\n\t\t\t{\n\t\t\t\taggOffiNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggOffiSMO.aggregate(this.evalSMOList.get(i));\t\t\t\t\n\t\t\t}\n\n\t\t\tfor (int i = 46; i < 60; i++)\n\t\t\t{\n\t\t\t\taggAdviNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggAdviSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 61; i < 75; i++)\n\t\t\t{\n\t\t\t\taggMultNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggMultSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = 76; i < 90; i++)\n\t\t\t{\n\t\t\t\taggGoodNaive.aggregate(this.evalNaiveBayesList.get(i));\n\t\t\t\taggGoodSMO.aggregate(this.evalSMOList.get(i));\n\t\t\t}\n\n\t\t\tfor (int a = 0; a < 6; a++)\n\t\t\t{\n\t\t\t\tString aggregateText;\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0: aggregateText = \"ContinuingNewsAggregateResults.txt\"; break;\n\t\t\t\tcase 1: aggregateText = \"DonationsAggregateResults.txt\"; break;\n\t\t\t\tcase 2: aggregateText = \"OfficialAggregateResults.txt\"; break;\n\t\t\t\tcase 3: aggregateText = \"AdviceAggregateResults.txt\"; break;\n\t\t\t\tcase 4: aggregateText = \"MultimediaAggregateResults.txt\"; break;\n\t\t\t\tcase 5: aggregateText = \"GoodsAggregateResults.txt\"; break;\n\t\t\t\tdefault: aggregateText = \"CompleteAggregateResults.txt\";\n\t\t\t\t}\n\n\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(aggregateText));\n\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContNaive.toSummaryString());\n\t\t\t\tbw.write(aggContNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggContNaive.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaNaive.toSummaryString());\n\t\t\t\tbw.write(aggDonaNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaNaive.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiNaive.toSummaryString());\n\t\t\t\tbw.write(aggOffiNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiNaive.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviNaive.toSummaryString());\n\t\t\t\tbw.write(aggAdviNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviNaive.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultNaive.toSummaryString());\n\t\t\t\tbw.write(aggMultNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggMultNaive.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodNaive.toSummaryString());\n\t\t\t\tbw.write(aggGoodNaive.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodNaive.toMatrixString()); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\n\t\t\t\tswitch (a)\n\t\t\t\t{\n\t\t\t\tcase 0:\tbw.write(aggContSMO.toSummaryString());\n\t\t\t\tbw.write(aggContSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggContSMO.toMatrixString()); break;\n\t\t\t\tcase 1:\tbw.write(aggDonaSMO.toSummaryString());\n\t\t\t\tbw.write(aggDonaSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggDonaSMO.toMatrixString()); break;\n\t\t\t\tcase 2:\tbw.write(aggOffiSMO.toSummaryString());\n\t\t\t\tbw.write(aggOffiSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggOffiSMO.toMatrixString()); break;\n\t\t\t\tcase 3:\tbw.write(aggAdviSMO.toSummaryString());\n\t\t\t\tbw.write(aggAdviSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggAdviSMO.toMatrixString()); break;\n\t\t\t\tcase 4:\tbw.write(aggMultSMO.toSummaryString());\n\t\t\t\tbw.write(aggMultSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggMultSMO.toMatrixString()); break;\n\t\t\t\tdefault:\tbw.write(aggGoodSMO.toSummaryString());\n\t\t\t\tbw.write(aggGoodSMO.toClassDetailsString());\n\t\t\t\tbw.write(aggGoodSMO.toMatrixString()); \t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbw.close();\n\t\t\t}\n\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void iterateUpdate()\n\t{\n\t\tSystem.out.println(\"ITERATE\");\n\t\t\t\n\t\tfor (Organism org : simState.getOrganisms()) \n\t\t{\n\t\t\torganismViewData.resetOrganismView(org);\n\t\t}\n\t\t\n\t\tIterationResult result = simEngine.iterate();\n\t\t\n\t\t// Process born and dead organisms\n\t\taddBornModels(result.getBorn());\n\t\tremoveDeadModels(result.getLastDead());\n\t\t\n\t\trotateAnimals();\t\t\n\t}", "public void crearAtracciones(){\n \n //Añado atracciones tipo A\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new A();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo B\n for (int i = 0; i < 6 ; i++){\n Atraccion atraccion = new B();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo C\n for (int i = 0; i < 4 ; i++){\n Atraccion atraccion = new C();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo D\n for (int i = 0; i < 3 ; i++){\n Atraccion atraccion = new D();\n atracciones.add(atraccion);\n }\n //Añado atracciones tipo E\n for (int i = 0; i < 7 ; i++){\n Atraccion atraccion = new E();\n atracciones.add(atraccion);\n }\n \n }", "List<Videogioco> retriveByGenere(String genere);", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\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 }", "public void setAtores(Iterator<IPessoa> atores);", "public static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public abstract Combinacion elegirCombinacionOculta();", "public void evaluate() {\n for (Chromosome chromo : chromosomes) {\n double chromoGH = chromo.getTotalGH();\n if (chromo.isValid()) {\n this.validChromosomes++;\n if (chromoGH > this.getBestScore()) {\n this.bestScore = chromoGH;\n this.setBestChromo(chromo);\n }\n }\n //Log.debugMsg(chromo.getTotalGH().toString());\n// this.map.put(chromoGH, chromo);\n }\n }", "@Override\n public List<Pair<Candidatura, FAE>> atribui() {\n \n List<FAE> listaFaeEvento = evento.getListaFaeEvento();\n List<Candidatura> listaCandidaturaEvento = evento.getListaCandidaturasEvento();\n List<Pair<Candidatura, FAE>> listaAtribuicoes = new ArrayList();\n \n Random geradorAleatorio = new Random();\n int indiceFae = geradorAleatorio.nextInt(listaFaeEvento.size());\n \n for (Candidatura cand : listaCandidaturaEvento){\n listaAtribuicoes.add( new Pair<>(cand, listaFaeEvento.get(indiceFae)));\n }\n \n return listaAtribuicoes;\n }", "void EvolutionWithElitism(){\n\t\t \tint i, j, l, k;\n\t\t\t//individual[] temp;\n\t\t\tbyte _flippc=0,_flippm=0;\n//\t\t\tString _temp1=\"\", _temp2=\"\";\n\t\t\tint[] _cp;\n\t\t\tnode[] _nd,_nm;\n\t\t\t// Khoi tao quan the dau tien \n\t\t\tRampedInit(6, 0.5);\n\t\t\t//RampedInitOffLine(6, 0.5,15);\n\t\t\t\n//\t\t\tconstructiveRate = new double[NUMGEN];\n//\t\t\tsemanticDistance = new double[NUMGEN];\n\t\t\t\n\t\t\tgen = 0;\n\t\t\twhile(gen < generation) {\n\t\t\t\t\n\t\t\t\tComputeFitness();\n\t\t\t\t\n//\t\t\t\tint g_ncross = 0;\n//\t\t\t\tdouble g_sd = 0;\n//\t\t\t\tPrintToFile();\n\t//----------------------\n//\t\t\t\tFileInputStream instream = null;\n//\t\t\t\tPrintStream outstream = null;\n//\t\t\t\tPrintStream console = System.out;\n//\t\t\t\ttry {\n//\t\t\t\t\toutstream = new PrintStream(new FileOutputStream(\"c:/result/\" + \"detail_\"+ gen + \".txt\"));\n//\t\t\t\t\tSystem.setOut(outstream);\n//\t\t\t\t} catch(Exception e) {\n//\t\t\t\t\tSystem.err.println(\"Error Occurred.\");\n//\t\t\t\t}\n//\t\t\t\tfor(i = 0; i < poplen; i++) {\n//\t\t\t\t\tSystem.out.printf(\"%3.5f \",oldpop[i].fitness);\n//\t\t\t\t\tif((i+1) % 10 == 0) {\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(oldpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// copy anh tot nhat sang the he sau\t \t\n\t\t\t\tnewpop[0].CopyIndividual(bestcurrent[gen], TRUE);\n\t\t\t\t// dot bien anh thu 2\n\t\t\t \n\t\t\t\tl=1;\t\n\t\t\t\ti = TourSelect(TOURSIZE);\n//\t\t\t\t\n\t\t\t\t\n\t\t\t newpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\tindividual[] m_individual0=new individual[1];\n\t\t\t\tint[] _mt0=new int[1];\n\t\t\t\t_nm=new node[1];\n\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual0, 15, TRUE,_mt0,_nm);\n\t\t\t\tnewpop[l]=new individual();\n\t\t\t\tnewpop[l].CopyIndividual(m_individual0[0], TRUE);\t\t\t\n\t\t\t\tnewpop[l].evaluated=FALSE;\t\t\n//\t\t\t\t\n//\t\t\t\tm_individual0=null;\n\t\t\t\t\n\t//------------------------\t\t\n\t\t\t\tl = 2;\t\t\t\n\t\t\t\twhile(l < poplen) {\n\t\t\t\t//\tSystem.out.println(\"Generation \"+ String.valueOf(gen)+\":\");\n\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\n\t\t\t\t\ti = TourSelect(TOURSIZE);\n\t\t\t\t\tj = TourSelect(TOURSIZE);\n\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t\t\n\t\t\t\t _flippc=Flip(pcross);\n//\t\t\t\t System.out.printf(\"pcross:%d\", _flippc);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippc == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] i_temp=new individual[2];\n\t\t\t\t\t\t_cp=new int[2];\n\t\t\t\t\t\t_nd=new node[2];\n\t\t\t\t//\t\n\t\t\t\t//\t\tif(SubTreeSwapWithTTest(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(SubTreeSwap(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(i_temp[0],TRUE);\n\t\t\t\t\t\t\tnewpop[l+1].CopyIndividual(i_temp[1],TRUE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tncross++;\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// semantic distance\n//\t\t\t\t\t\t\tg_sd += newpop[l].getSemanticDistance(oldpop[i]);\n//\t\t\t\t\t\t\tg_sd += newpop[l+1].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tg_sd += oldpop[i].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\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{\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// mutation test\n\t\t\t\t\t_flippm=Flip(pmutate);\n//\t\t\t\t\tSystem.out.printf(\"pmutation:%d\", _flippm);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippm == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] m_individual=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l]=new individual();\n\t\t\t\t\t\tnewpop[l].CopyIndividual(m_individual[0], TRUE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+l+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual=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_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(Flip(pmutate) == 1) {\n\t\t\t\t\t\tindividual[] m_individual1=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l + 1], m_individual1, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l+1]=new individual();\n\t\t\t\t\t\tnewpop[l+1].CopyIndividual(m_individual1[0], TRUE);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+(l+1)+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual1=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_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\tl += 2;\n\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(newpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n//\t\t\t\toutstream.close();\n//\t\t\t\tSystem.setOut(console);\n\t\t\t\t// Thống kê tỷ lệ tTest\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t//\t\t\tsemanticDistance[gen] = g_sd / (2.0 * g_ncross);\n//\t\t\t\tsemanticDistance[gen] = g_sd /g_ncross;\n\t\t\t\t\n\t\t\t\tgen++;\n\t\t\t\tfor(k = 0; k < poplen; k++)\n\t\t\t\t{\n\t\t\t\t\toldpop[k]=null;\n\t\t\t\t\toldpop[k]=new individual();\n\t\t\t\t\toldpop[k].CopyIndividual(newpop[k], TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void estendre( Casella inici )\n\t{\n\t\tjo = tauler.getEstatCasella( inici );\n\n\t\tList<Casella> pendents = new LinkedList<Casella>();\n\t\tpendents.add( inici );\n\n\t\twhile ( !pendents.isEmpty() ) //mentres hi hagi caselles a la llista, seguir iterant.\n\t\t{\n\t\t\tCasella casella = pendents.get( 0 ); //obtenim el vei\n\n\t\t\tpendents.remove( casella ); //el treiem de pendents\n\t\t\tgrup.add( casella ); //l'afegim al grup.\n\n\t\t\t//Comprovem si esta a la cantonada, primer pel jugador A i despres pel B i si ho està mirem totes les cantonades.\n\t\t\tif ( jo == EstatCasella.JUGADOR_A &&\n\t\t\t ( casella.getColumna() == 0 || casella.getColumna() == tauler.getMida() - 1 ) )\n\t\t\t{\n\t\t\t\tfor ( int i = 0; i < tauler.getMida(); i++ )\n\t\t\t\t{\n\t\t\t\t\tCasella casellaLateral = new Casella( i, casella.getColumna() );\n\t\t\t\t\tif ( esPotAfegir( casellaLateral, pendents, jo ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpendents.add( casellaLateral );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( jo == EstatCasella.JUGADOR_B &&\n\t\t\t ( casella.getFila() == 0 || casella.getFila() == tauler.getMida() - 1 ) )\n\t\t\t{\n\t\t\t\tfor ( int i = 0; i < tauler.getMida(); i++ )\n\t\t\t\t{\n\t\t\t\t\tCasella casellaLateral = new Casella( casella.getFila(), i );\n\t\t\t\t\tif ( esPotAfegir( casellaLateral, pendents, jo ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpendents.add( casellaLateral );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tList<Casella> veins = tauler.getVeins( casella ); //obtenim els veins.\n\t\t\tfor ( int i = 0; i < veins.size(); i++ )\n\t\t\t{\n\t\t\t\tCasella vei = veins.get( i );\n\t\t\t\tif ( esPotAfegir( vei, pendents, jo ) )\n\t\t\t\t{\n\t\t\t\t\t//si te el mateix estat i no està afegida al grup, la fiquem a pendents.\n\t\t\t\t\tpendents.add( vei );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "private static void iterator() {\n\t\t\r\n\t}", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public static void main(String[] args) {\n int indexMin = -3;\n int indexMax = 1;\n RangeArray squares = new RangeArray(indexMin, indexMax);\n\n for (int index = squares.getIndexMin() ; index <= squares.getIndexMax() ; index++)\n squares.set(index, index*index);\n\n for (int index = squares.getIndexMin() ; index <= squares.getIndexMax() ; index++)\n System.out.println(index + \" -> \" + squares.get(index));\n\n System.out.println(squares.rangeSize());\n\n // 2.\n RangeArray<String> habitations = new RangeArray<String>(3, 5);\n habitations.set(3, \"Maison\");\n habitations.set(4, \"Immeuble\");\n habitations.set(5, \"Hutte\");\n for (int index = habitations.getIndexMin() ; index <= habitations.getIndexMax() ; index++)\n System.out.print(habitations.get(index).length() + \" \");\n\n // 3.\n // TODO : Fonctionnel, mais chercher le fonctionnement précis de Iterable et changer le stream par un code plus propre\n for (String habitation : habitations)\n System.out.print(habitation + \" \");\n\n // Exercice 2 : Iterateur sur des grilles\n // 1.\n String[][] elements = {{\"A\",\"C\",\"E\",\"G\"},{\"B\",\"D\",\"F\",\"H\"}};\n Grid<String> grid = new Grid<>(elements);\n for (int line = 0 ; line < grid.nbLines() ; line++)\n for (int column = 0 ; column < grid.nbColumns() ; column++)\n {\n String element = grid.get(line, column);\n System.out.print(element + \" \");\n }\n System.out.println();\n\n // 2.\n // TODO : Methodes T next() et hasNext() de Iterator<T> pour rendre cette syntaxe fonctionnelle.\n for (String element : grid)\n System.out.print(element + \" \");\n System.out.println();\n }", "public static void main (String [] args){\r\n Jefatura jefe_RR=new Jefatura(\"Jeanpool\",55000,2006,9,25);\r\n jefe_RR.estableceIncentivo(2570);\r\n Empleado [] misEmpleados=new Empleado[6];\r\n misEmpleados[0]=new Empleado(\"Paco Gomez\",85000,1990,12,17);\r\n misEmpleados[1]=new Empleado(\"Ana Lopez\",95000,1995,06,02);\r\n misEmpleados[2]=new Empleado(\"Maria Martin\",105000,2002,03,15);\r\n misEmpleados[3]=new Empleado(\"Jeanpool Guerrero\");\r\n misEmpleados[4]=jefe_RR;/**--Polimorfismo: Prinicipio de sustitucion*/\r\n misEmpleados[5]=new Jefatura(\"Maria\",95000,1999,5,26);\r\n Jefatura jefa_Finanzas=(Jefatura)misEmpleados[5];/** CASTING CONVERTIR UN OBJETO A otro */\r\n jefa_Finanzas.estableceIncentivo(55000);\r\n \r\n \r\n \r\n /** for(int i=0;i<3; i++){\r\n misEmpleados[i].subeSueldo(5);\r\n \r\n }\r\n \r\n for(int i=0;i<3;i++){\r\n System.out.println(\"Nombre \"+misEmpleados[i].dimeNombre() + \"Sueldo: \"+misEmpleados[i].dimeSueldo()+ \"Fecha Alta: \"+misEmpleados[i].dameFechaContrato());\r\n }\r\n */\r\n\r\n for(Empleado elementos:misEmpleados){\r\n \r\n elementos.subeSueldo(5);\r\n \r\n }\r\n \r\n for(Empleado elementos:misEmpleados){\r\n System.out.println(\"Nombre: \"+elementos.dimeNombre()+ \" Sueldo: \"+elementos.dimeSueldo()+ \" Alta Contrato: \"+elementos.dameFechaContrato());\r\n }\r\n \r\n }", "public void affiche() {\n System.out.println(\"le tapis porte \"+this.tapis.size()+\" caisse(s)\");\n for (Iterator it = this.tapis.iterator(); it.hasNext(); ) {\n System.out.println(it.next().toString());\n } \n }", "public void colorearSecuencial() {\n\t\t// Collections.shuffle(nodos);\n\t\tcolorearSecuencialAlternativo();\n\t}", "public Iterable<M> iterateAll();", "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 }", "@Override public T next(){\n Vertice v = pila.saca();\n T e = v.elemento;\n v = v.derecho;\n while (v != null) {\n pila.mete(v);\n v = v.izquierdo;\n }\n\t\treturn e;\n }", "@Override\n\tpublic ArrayList<Edge> makeMove(Graph graph, int iteration) {\n\t\t// Create a value associated with each position\n\t\tIterator<Edge> edges = graph.edges();\n\t\twhile (edges.hasNext()) {\n\t\t\tEdge edge = edges.next();\n\t\t\tVertex v1 = edge.getFromVertex();\n\t\t\tVertex v2 = edge.getToVertex();\n\t\t\t// We favor free spots\n\t\t\tif (edge.getProperty().equals(Property.FREE)) {\n\t\t\t\t// We dislike being close to opposing settlements\n\t\t\t\tif (v1.getProperty().equals(Property.FREE) && v2.getProperty().equals(Property.FREE)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// We favor areas close by\n\t\t\t\tif (v1.getProperty().equals(super.getProperty())) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// Early in the game we want roads and settlements\n\t\t\t\tif (iteration < Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.BRICK) || v1.getResources().contains(Resource.LUMBER)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Towards the end of the game we want cities\n\t\t\t\tif (iteration >= Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.ORE) || v1.getResources().contains(Resource.GRAIN)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We favor hexes with high probability rolls\n\t\t\t\tif (v1.getRolls().contains(5) || v1.getRolls().contains(6) || v1.getRolls().contains(8)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tKruskalAlgo kruskal = new KruskalAlgo(graph);\n\t\treturn kruskal.getMinSpanForest(graph);\n\t}", "public Iterador() {\n pila = new Pila<Nodo>();\n if (raiz != null) {\n pila.push(raiz);\n Nodo<T> nodo = pila.peek();\n while(nodo != null){\n if (nodo.izquierdo != null) {\n pila.push(nodo.izquierdo);\n }\n nodo = nodo.izquierdo;\n }\n }\n\n }", "@Override\n\tpublic Iterator<Arco<T>> obtenerArcos() {\n\t\tList arcos = new ArrayList<Arco<T>>();\n\t\tfor (Vertice v: listVertices){//agarro todos los arcos de todos los vertices\n\t\t\tarcos.add(v.getArcos());\n\t\t}\n \t\tIterator<Arco<T>> arcosIT = arcos.iterator();\n\t\treturn new IteradorArco(arcosIT);\n\t}", "private static List<Etudiant> creationListeEtudiants(List<String> datas,boolean modele){\n\t\tList<String> dataEtudiant = new ArrayList<String>();\n\t\tList<Etudiant> etudiants = new ArrayList<Etudiant>();\n\t\tIterator<String> it = datas.iterator();\n\t\twhile (it.hasNext()) {//on parcourt les donnees\n\t\t\tString data = it.next();\n\t\t\tif(RecherchePattern.rechercheDebutEtudiant(data)){\t//si on change d'etudiant on reset les donnees concernant l'ancien etudiant\n\t\t\t\treset();\n\t\t\t\tdataEtudiant = new ArrayList<String>();//on reset les donnees\n\t\t\t\tsetNbEtudiant(getNbEtudiant() + 1);\n\t\t\t}\n\t\t\telse{//si on a pas changer d'etudiant on stocke ces donnees\n\t\t\t\tif(RecherchePattern.rechercheFinEtudiant(data)){//si on est a la fin des donnees on creer l'etudiant\n\t\t\t\t\tdataEtudiant.add(data); //on ajoute le dernier element au donnee\n\t\t\t\t\tif(!modele)\n\t\t\t\t\t\tetudiants.add(ajoutEtudiant(dataEtudiant));\n\t\t\t\t\telse\n\t\t\t\t\t\tetudiants.add(ajoutEtudiantModele(dataEtudiant));\n\t\t\t\t\treset();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdataEtudiant.add(data);//on est pas a la fin on attend\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tetudiants = suppressionDoublons(etudiants); //on supprime les\n\t\treturn etudiants;\n\t}" ]
[ "0.64652073", "0.6118809", "0.610349", "0.5793893", "0.56823957", "0.561325", "0.56068695", "0.53590775", "0.5293248", "0.5273585", "0.52687013", "0.52355474", "0.52195454", "0.52152926", "0.51958716", "0.51624423", "0.51547223", "0.5145475", "0.5140895", "0.5119826", "0.5118282", "0.50797457", "0.5075372", "0.507389", "0.50721836", "0.5056421", "0.5056324", "0.5055726", "0.5055523", "0.50474876", "0.5045453", "0.503483", "0.50303656", "0.503036", "0.49952865", "0.4993304", "0.49819267", "0.49796653", "0.49778804", "0.4977433", "0.49740782", "0.49734402", "0.49663153", "0.49656412", "0.49650452", "0.49610797", "0.49568617", "0.49554008", "0.49498776", "0.49497503", "0.49483153", "0.49407837", "0.49397674", "0.49325928", "0.49296638", "0.49179977", "0.49167812", "0.48999044", "0.48966274", "0.48962814", "0.48922887", "0.48911572", "0.48888627", "0.48836768", "0.48805803", "0.48736537", "0.48720977", "0.48540688", "0.4849428", "0.48475772", "0.4843133", "0.4840771", "0.48321906", "0.48263416", "0.48255083", "0.48253933", "0.48240224", "0.48221114", "0.48205048", "0.48200387", "0.4811292", "0.48105237", "0.48086488", "0.4803359", "0.47969162", "0.47953543", "0.479229", "0.4790113", "0.47880003", "0.478293", "0.47809985", "0.47794095", "0.4775217", "0.47742504", "0.47733617", "0.4765288", "0.47651944", "0.47641054", "0.47639212", "0.47622547" ]
0.6257098
1
mejor iteracion de un array de iteraciones
public DatosIteracion mejorIteracionCapturados( ArrayList<DatosIteracion> datos) { DatosIteracion d = new DatosIteracion("auxiliar"); Lectura l = new Lectura(999999, 0, 0); d.getValoresLecturas().add(l); for (int i = 0; i < datos.size(); i++) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() < datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados()) { d = datos.get(i); } if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() == datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados()) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getTiempo() > datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getTiempo()) { d = datos.get(i); } } if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() == datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados()) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getTiempo() == datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getTiempo()) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getnNodos() <= datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getnNodos()) { d = datos.get(i); } } } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator<Item> iterator(){\n return new ArrayIterator();\n }", "public Iterable<M> iterateAll();", "public int[][] iterate()\n {\n Random r = new Random();\n for (int i = 0; i < buffersize; i++) {\n if (unprocessed.isEmpty()) \n {\n finished = true;\n break;\n }\n int randomIndex = r.nextInt(unprocessed.size());\n nodemap.changeColor(unprocessed.get(randomIndex), 1);\n unprocessed.remove(randomIndex);\n }\n return nodemap.getIntMap();\n }", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "public Iterator<T> iterator(){\r\n\t\treturn new ChainedArraysIterator();\r\n\t}", "@SuppressWarnings(\"unchecked\")\n private <X> Iterator<X> itx(Iterator<X>[] ita) {\n if (ita == null || ita.length == 0) \n return (Iterator<X>)Arrays.stream(ofDim(Iterator.class,0)).iterator();\n return new Iterator<X>() {\n private int i = 0;\n public boolean hasNext() {\n while ( i < ita.length && !ita[i].hasNext()) i++;\n return i < ita.length;\n }\n public X next() {\n while ( i < ita.length && !ita[i].hasNext()) i++;\n return ita[i].next();\n }\n };\n }", "public Iterator<T> byGenerations() {\r\n ArrayIterator<T> iter = new ArrayIterator<T>();\r\n\r\n for (int i = 0; i < SIZE; i++) {\r\n iter.add(tree[i]);\r\n }\r\n\r\n return iter;\r\n }", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "public static void iterate(){\n int[] array={1,3,5,7,9,13};\n for (int i = 0; i < array.length; i++) {\n int x = array[i];\n System.out.println(x + \" \");\n\n }\n }", "@Parameters\n // Método public static que devuelve un elemento iterable de array de objetos\n public static Iterable<Object[]> getData() {\n return Arrays.asList(new Object[][] {\n // Indicamos todas las pruebas {a, b, esperado}\n { 3, 1, 4 }, { 2, 3, 5 }, { 3, 3, 6 } });\n }", "public T[] next(){\n\n if(hasNext()){\n int numElements = Math.min(window,lst.length - currentIndex);\n ArrayList<T> returnElements = new ArrayList<T>(numElements);\n for(int i = currentIndex; i < currentIndex + window && i < lst.length; i++ ){\n returnElements.add(lst[i]);\n if(i == lst.length-1){\n hasMore = Boolean.FALSE;\n }\n }\n currentIndex += step;\n return returnElements.toArray((T[]) Array.newInstance(returnElements.get(0).getClass(),0));\n }else{\n throw new NoSuchElementException(\"no elements to iterate \");\n }\n\n }", "Iteration(T[] array, int amount) { \r\n items = array;\r\n count = amount;\r\n now = 0;\r\n }", "public Iterator<Item> iterator() {\n Item[] temp = (Item[]) new Object[size];\n System.arraycopy(array, 0, temp, 0, size);\n return (new RandomIterator(temp));\n }", "@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }", "public Iterator<IDatasetItem> iterateOverDatasetItems();", "public JaggedArrayIterator(int[][] array) {\n this.array = array;\n }", "private static Object[] m59444a(Iterable<?> iterable, Object[] objArr) {\n int i = 0;\n for (Object obj : iterable) {\n int i2 = i + 1;\n objArr[i] = obj;\n i = i2;\n }\n return objArr;\n }", "@Test\r\n\tpublic void testIterator()\r\n\t{\r\n\t\tInteger[] results =\r\n\t\t{ 5, 7, 3 };\r\n\t\tint i = 0;\r\n\t\tfor (Integer item : threeElementsInOrder)\r\n\t\t{\r\n\t\t\tassertEquals(results[i], item);\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "@Test\n public void testIterator() {\n System.out.println(\"iterator\");\n Goban g = createGoban();\n ArrayList<PierrePoint> groupeAttendu = new ArrayList<>();\n groupeAttendu.add(g.getPierre(0, 0));\n groupeAttendu.add(g.getPierre(0, 1));\n groupeAttendu.add(g.getPierre(1, 0));\n GroupeDePierres groupe = new GroupeDePierres(g.getPierre(0, 0), g);\n \n for( PierrePoint p : groupe)\n {\n assertTrue(groupeAttendu.contains(p));\n }\n \n assertEquals(groupeAttendu.size(),groupe.size());\n }", "public ChainedArraysIterator(){\r\n\t\t\tcurrentNode = beginMarker.next;\r\n\t\t\tcurrent = currentNode.getFirst();\r\n\t\t\tidx = 0;\r\n\t\t\texpectedModCount=modCount;\r\n\t\t}", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "@Override\n public Iterator<E> iterator() {\n return new ArrayIterator(); // create a new instance of the inner class\n }", "public DatosIteracion mejorIteracionCapturados() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionCapturados(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionCapturados(array);\r\n\t}", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "public static void main(String[] args) {\n\n String[] [] newArr =\n {\n {\"a\",\"c\",\"d\"},\n {\"e\",\"f\",\"g\"},\n {\"h\",\"i\",\"j\"}\n };\n\n for(String[] element : newArr){\n for(String el : element){\n System.out.println(el + \" \");\n }\n }\n\n\n }", "public Iterator<Entry> iterator() {\n return new ArrayIterator<Entry>(fEntries);\n }", "@Override\r\n Iterator<E> iterator();", "public void inOrderTraverseIterative();", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn new CircularArrayIterator<T>(items);\n\t}", "@Override\n Iterator<T> iterator();", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn new CircularArrayIterator<T>(this);\n\t}", "Iterator<TabularData> dataIterator();", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "public Iterator<T> iterator() {\r\n return new ArrayIterator(elements, size);\r\n }", "@Override\n public Iterator<Value> iterator()\n {\n return values.iterator();\n }", "public static void arrayAlgoritm(List<int[]> ints) {\n int size=1;\n for (int[] array: ints) {\n size *= array.length;\n }\n\n // Creating a list of indexes. Every index corresponds\n // to a single array\n List<Index> indexList = new ArrayList<>( );\n ints.forEach( array -> indexList.add( new Index( array ) ) );\n\n int[] result;\n List<int[]> finalArrays = new ArrayList<>( );\n\n boolean flag = true;\n\n while (flag) {\n // Creating an array by taking one number from each\n result = new int[ints.size()];\n for (int i=0; i<ints.size(); i++) {\n result[i] = ints.get( i )[indexList.get( i ).getCurrentIndex()];\n }\n\n finalArrays.add( result );\n incrementIndexes(indexList);\n\n // If the size has been reached, this means that all\n // the possible combinations have been extracted\n if (finalArrays.size() == size) flag = false;\n }\n System.out.println(\"Final list size = \" + finalArrays.size());\n finalArrays.forEach( array -> {\n for (int i: array) {\n System.out.print(i + \", \");\n }\n System.out.println(\"==============================\");\n } );\n\n\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new ArrayMapIterator<>(this.entries);\n }", "@Override\n public Iterator<E> iterator() {\n return new Iterator<E>() {\n private int nextIndex = 0;\n private int lastNextIndex = -1;\n private int rest = size();\n\n @Override\n public boolean hasNext() {\n return rest > 0;\n }\n\n @Override\n public E next() {\n if(!hasNext()){\n throw new NoSuchElementException();\n }\n rest--;\n lastNextIndex = nextIndex++;\n siftDown(nextIndex);\n\n return (E) array[lastNextIndex];\n }\n\n @Override\n public void remove() {\n if (lastNextIndex == -1) {\n throw new IllegalStateException();\n }\n removeElement(lastNextIndex);\n nextIndex--;\n lastNextIndex = -1;\n }\n };\n }", "@Test\n public void loopTest() {\n Object[] resultActual = new Object[] {this.work1, this.work2, this.work3, this.work4};\n Object[] resultExpected = new Object[4];\n int index = 0;\n while (this.it.hasNext()) {\n resultExpected[index++] = this.it.next();\n }\n assertThat(resultActual, is(resultExpected));\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new ArrayMapIterator<>(this.entries, this.size);\n }", "public static void main(String[] args) {\n\n for(int i=0; i<3;i++){\n // arr[i] = new Array1(i+3,i*2);\n //arr[0] = arr.getArray(3,5);\n\n }\n\n }", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "public Iterable<E> getData(){\n return new Iterable<E>(){\n @Override\n public Iterator<E> iterator() {\n return structure.iterator();\n }\n };\n }", "public void setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }", "public Integer iterate(int[] arr1){\n\t\tfor(int b = 0; b < arr1.length; b++){\n\t\t\tSystem.out.println(arr1[b]);\n\t\t}\n\t\treturn 0;\n\t}", "@Override\n\t\t\tpublic Iterator<T> iterator() {\n\t\t\t\treturn convertData(data.iterator(), targetClass);\n\t\t\t}", "@Override\n public Iterator<Entry<Integer, T>> iterator() {\n List<Entry<Integer, T>> pairs = new ArrayList<Entry<Integer, T>>(count);\n\n for(int i = 0; i < count; i++) {\n pairs.add(new MapEntry<T>(extractKey(buckets[i]), (T)data[i]));\n }\n\n return pairs.iterator();\n }", "@Override\n public Iterator<Space> iterator() {\n return row.iterator();\n }", "private static void iterationArr(int n) {\n int[][] ints = new int[n][n];\n ints[0][0] = 1;\n for (int i = 0; i < n - 1; i++) {\n ints[i + 1][0] = ints[i][0] + i + 1;\n }\n for (int i = 1; i < n; i++) {//表列\n for (int j = 0; j < n - 1; j++) {//表行\n ints[j][i] = ints[j + 1][i - 1] + 1;\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n - i; j++) {\n System.out.printf(ints[i][j] + \"\\t\");\n }\n System.out.println();\n }\n }", "public int getIteration();", "public RunIterator iterator() {\n // Replace the following line with your solution.\n return new RunIterator(runs.getFirst());\n // You'll want to construct a new RunIterator, but first you'll need to\n // write a constructor in the RunIterator class.\n \n \n }", "@Test\n public void testArray()\n throws Exception\n {\n initialize();\n genericTests();\n for (int i = 0; i < 10; i++)\n {\n permutateArrays();\n genericTests();\n }\n }", "public ArrayIntListIterator iterator() {\n\t return new ArrayIntListIterator(this);\n\t }", "@Override\n\tpublic Iterator<T> iterator() {\n\t\t\n\t\treturn lista.iterator();\n\t}", "public void iterateEventList();", "@Override\n public Iterator<E> iterator() {\n\n Iterator<E> myIt = new Iterator<E>() {\n\n private int currIndex = head;\n\n @Override\n public boolean hasNext() {\n if (currIndex < ringArray.length && ringArray[currIndex] != null) { //Checking if we got to the end and if there are no null elements\n return false;\n }\n return true;\n }\n\n @Override\n public E next() {\n if (!hasNext()) //If there isnt another element then throw an exception\n throw new NoSuchElementException(\"No element\");\n Object nextElement = ringArray[currIndex]; //Getting the next element\n currIndex--; //Decrease the current index by one\n if (currIndex < 0) //If we get to the beginning of the\n currIndex = ringArray.length - 1;\n return (E) nextElement;\n }\n\n @Override\n public void remove() throws UnsupportedOperationException {\n throw new UnsupportedOperationException(\"Remove is not supported\");\n }\n };\n return myIt;\n }", "@Test\r\n public void iteratorWorksGood() throws Exception {\r\n int[] expected1 = {1, 2, 3, 4, 5};\r\n int i = 0;\r\n for (int el : sInt) {\r\n assertEquals(expected1[i], el);\r\n i++;\r\n }\r\n i = 0;\r\n String[] expected2 = {\"kek\", \"lel\", \"lol\"};\r\n for (String el : sStr) {\r\n assertEquals(expected2[i], el);\r\n i++;\r\n }\r\n }", "@Override\n\tpublic Iterator<Arco<T>> obtenerArcos() {\n\t\tList arcos = new ArrayList<Arco<T>>();\n\t\tfor (Vertice v: listVertices){//agarro todos los arcos de todos los vertices\n\t\t\tarcos.add(v.getArcos());\n\t\t}\n \t\tIterator<Arco<T>> arcosIT = arcos.iterator();\n\t\treturn new IteradorArco(arcosIT);\n\t}", "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public Iterator<ElementType> iterator(){\n return new InnerIterator();\n }", "public Iterator getIterator(int i) {\r\n return table[i].iterator();\r\n }", "@Parameters\n public static Iterable<Object[]> getData() {\n List<Object[]> obj = new ArrayList<>();\n obj.add(new Object[] {3, 12});\n obj.add(new Object[] {2, 8});\n obj.add(new Object[] {1, 4});\n \n return obj;\n }", "@Override\r\n\tpublic void visit(Array array) {\n\r\n\t}", "public Iterable<Arista> aristas() {\n Cola<Arista> mst = new Cola<Arista>();\n for (int v = 0; v < aristaHacia.length; v++) {\n Arista a = aristaHacia[v];\n if (a != null) {\n mst.entrarACola(a);\n }\n }\n return mst;\n }", "public List<Field> iterateThroughAllFields() {\n\n List<Field> listOfFields = new ArrayList<Field>(fields.length * fields.length);\n // TODO: n**m complexity\n for (int i = 0; i < this.fields.length; i++) {\n for (int j = 0; j < this.fields.length; j++) {\n listOfFields.add(this.fields[i][j]);\n }\n }\n return listOfFields;\n }", "@Override\n public Iterator<Object> iterator() {\n return new Iterator<Object>() {\n\n private int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < data.length;\n }\n\n @Override\n public Object next() {\n Object result = data[i];\n i = i + 1;\n return result;\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"Tuples are immutable\");\n }\n };\n }", "@Test\r\n public void descendingIterator() throws Exception {\r\n Iterator<Integer> it = sInt.descendingIterator();\r\n int[] arr = {5, 4, 3, 2, 1};\r\n int[] res = new int[5];\r\n int i = 0;\r\n while (it.hasNext()) {\r\n res[i++] = it.next();\r\n }\r\n assertArrayEquals(arr, res);\r\n }", "@Override\n\tpublic void forEach(Processor processor) {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tprocessor.process(elements[i]);\n\t\t}\n\t}", "public static void print2( int[][] a )\n {\n for ( int[] i : a) { //for each int in array a\n\t for ( int j : i) { //and for each slot of array i\n\t System.out.println(j); //print out j\n\t }\n }\n }", "@Override\n public Iterator<T> iterator() {\n return new Iterator<T>(){\n private int ci = 0;\n \n /**\n * Checks if ArrayList has next element \n * @return \n */\n public boolean hasNext(){\n return ci < size;\n }\n \n /**\n * Returns next element and moves iterator forward\n * @return \n */\n public T next(){\n return (T)data[ci++];\n }\n \n /**\n * Does nothing\n */\n public void remove(){\n \n }\n };\n }", "public ListaConPI<Adyacente> adyacentesDe(int i) { \n return elArray[i]; \n }", "public Iterator getIterator() {\n return myElements.iterator();\n }", "@Override\n\tpublic Iterator<Forme> iterator() {\n\t\treturn this.formes.iterator();\n\t}", "public AntiClockwiseSpiralIterator(E[][] array){\n list = new ArrayList<E>();\n row = array.length;\n column = array[0].length;\n\n int total = row * column;\n int counter = 0;\n\n while(x < row && y < column){\n if(counter == total)\n break;\n\n for(int i = x; i < row; ++i){\n list.add(array[i][y]);\n counter++;\n }\n y++;\n\n if(counter == total)\n break;\n\n for(int i = y; i < column; ++i){\n list.add(array[row-1][i]);\n counter++;\n }\n row--;\n\n if(counter == total)\n break;\n\n if(x < row){\n for(int i = row-1; i >= x; --i){\n list.add(array[i][column-1]);\n counter++;\n }\n column--;\n }\n\n if(counter == total)\n break;\n\n if(y < column){\n for(int i = column-1; i >= y; --i){\n list.add(array[x][i]);\n counter++;\n }\n x++;\n }\n }\n\n iterator = list.iterator();\n }", "public Iterator<Coord> iterator() {\n\t\treturn new CoordListIterator(array, index);\n\t}", "public Iterator<ResultItem> iterateItems() {\r\n\t\treturn items.iterator();\r\n\t}", "public native IterableIterator<V> values();", "@Override\n public Iterator<Pair<K, V>> iterator() {\n return new Iterator<Pair<K, V>>() {\n private int i = 0, j = -1;\n private boolean _hasNext = true;\n\n @Override\n public boolean hasNext() {\n return _hasNext;\n }\n\n @Override\n public Pair<K, V> next() {\n Pair<K, V> r = null;\n if (j >= 0) {\n List<Pair<K, V>> inl = l.get(i);\n r = inl.get(j++);\n if (j > inl.size())\n j = -1;\n }\n else {\n for (; i < l.size(); ++i) {\n List<Pair<K, V>> inl = l.get(i);\n if (inl == null)\n continue;\n r = inl.get(0);\n j = 1;\n }\n }\n if (r == null)\n _hasNext = false;\n return r;\n }\n };\n }", "@Override\n public Iterator<T> inOrden(){\n return (super.inOrden());\n }", "public OpIterator iterator() {\n // some code goes here\n // throw new\n // UnsupportedOperationException(\"please implement me for lab2\");\n return new InterAggrIterator();\n }", "@Override\r\n\tpublic void iterateCount() {\n\t\t\r\n\t}", "Itr(int batch) {\n this.batch = batch;\n }", "public Iterator<Shape> iterator(){\n\t\treturn shapes.iterator();\n\t}", "public static void main(String[] args) {\n\n int[] input = generateArray(4,5);//new int[]{4, 5, 0, 1};\n ArrayList<ArrayList<ArrayList<Integer>>> results = getPaths(input);\n// Output results:\n results.forEach((n) -> System.out.println(n));\n }", "public Iterable<DataSegment> iterateAllSegments()\n {\n return () -> dataSources.values().stream().flatMap(dataSource -> dataSource.getSegments().stream()).iterator();\n }", "public void setIteraciones(int iteraciones) {\r\n this.iteraciones = iteraciones;\r\n }", "private void iterateEnemyShots() {\n\t\tfor (Shot s : enemyShotList) {\n\t\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\t\tfor(Invader a : row) {\n\t\t\t\t\ta.shouldAttack(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private Iterator<Integer> getIterator(Iterator<Iterator<Integer>> iter) {\n Iterator<Integer> iterator = null;\n while (iter.hasNext()) {\n iterator = iter.next();\n break;\n }\n return iterator;\n }", "@Test\n public void test0() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(544,\"org.apache.commons.collections4.iterators.IteratorIterableEvoSuiteTest.test0\");\n EntrySetMapIterator<Integer, Object>[] entrySetMapIteratorArray0 = (EntrySetMapIterator<Integer, Object>[]) Array.newInstance(EntrySetMapIterator.class, 7);\n ObjectArrayIterator<EntrySetMapIterator<Integer, Object>> objectArrayIterator0 = new ObjectArrayIterator<EntrySetMapIterator<Integer, Object>>(entrySetMapIteratorArray0, 0, 0);\n IteratorIterable<Object> iteratorIterable0 = new IteratorIterable<Object>((Iterator<?>) objectArrayIterator0, true);\n }", "@Override\r\n public Iterator iterator(){\n return new MyIterator(this);\r\n }", "public Iterator<Item> iterator() {\n return new RandomArrayIterator();\n }", "public Iterator<Type> iterator();", "@Override\n\tpublic void run() {\n\t\tresult =\n\t\t\tStream.iterate(new int[]{0, 1}, s -> new int[]{s[1], s[0] + s[1]})\n\t\t\t\t.limit(limit)\n\t\t\t\t.map(n -> n[0])\n\t\t\t\t.collect(toList());\n\n\t}", "@Override\n protected void runOneIteration() throws Exception {\n }", "@Override\r\n\tpublic Iterator<T> iterator() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.iteratorInOrder();\r\n\t}", "public void IteratorParcoAuto(){\n Iterator<AbstractAuto> auto=new AutoIterator();\n auto=parco.lista.iterator();\n int i=1;\n while(auto.hasNext())\n {\n Object element=auto.next();\n if(element instanceof Auto)\n {\n System.out.print(i+\" \"+element +\" \\n\");\n }\n i++;\n }\n }" ]
[ "0.6168245", "0.6128489", "0.60639966", "0.6061959", "0.60594964", "0.6021503", "0.5981431", "0.59746253", "0.5969426", "0.5958817", "0.58986986", "0.5862179", "0.58451", "0.5836272", "0.5801711", "0.58009195", "0.5753751", "0.57471967", "0.57376766", "0.5737245", "0.5736133", "0.5698809", "0.5698173", "0.5698173", "0.5698173", "0.5698173", "0.56893057", "0.5660565", "0.5650187", "0.5648434", "0.5611634", "0.5611597", "0.55977196", "0.5582509", "0.557867", "0.5560164", "0.55536294", "0.55429834", "0.5531327", "0.5526297", "0.55227596", "0.55156106", "0.5503184", "0.5465515", "0.54549193", "0.54540306", "0.54404885", "0.5416626", "0.5412879", "0.5412538", "0.54111266", "0.5405546", "0.54020274", "0.5390645", "0.5386341", "0.5382227", "0.5379014", "0.53783906", "0.5376079", "0.53730553", "0.5372557", "0.5365912", "0.5354111", "0.5353841", "0.5343296", "0.5340229", "0.5339571", "0.53381693", "0.5331466", "0.5328551", "0.53140664", "0.53117436", "0.53113174", "0.5296256", "0.5289595", "0.527969", "0.52765065", "0.5276419", "0.5268458", "0.5260896", "0.52440095", "0.52401584", "0.5240125", "0.5238828", "0.52325386", "0.52284235", "0.5227975", "0.52245337", "0.52202904", "0.5217948", "0.52128696", "0.52108055", "0.5209122", "0.5204523", "0.51998186", "0.51832736", "0.51824325", "0.51791114", "0.5171116", "0.5166496", "0.5161174" ]
0.0
-1
iteracion mas optimizada de una estrategia
public DatosIteracion mejorIteracionOptimizada() { ArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>(); for (DatosEstrategia e : this.getValoresEstrategias()) { array.add(this.mejorIteracionOptimizada(e.getValoresIteraciones())); } return this.mejorIteracionOptimizada(array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "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 }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\n\t}", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\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 static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byCoseno(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudCoseno(it1, it2, test);\r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "public ChampionnatComplexe (int [] Eq12,Matrice mat,Options o ) {\n\t\topt = o;\n\t\tint equilibrea = 0;\n\t\tint equilibreb = 0;\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3]; \n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibrea = grpA1[z] + grpA2[z] ;\n\t\t\tequilibreb = grpB1[z] + grpB2[z] ;\n\t\t}\n\t\tequilibreDesPoule = Integer.max(equilibrea, equilibreb) - Integer.min(equilibreb, equilibreb);\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\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}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public void determinarEstadoSalud(){\n \n for (int i = 0; i < listaEmpleados.size(); i++) {\n //Este for chequea si tiene alguna enfermedad preexistente -> asigna puntajes de acuerdo\n for (int j = 0; j < factoresRiesgo.length; j++) {\n \n if(listaEmpleados.get(i).getFactoresRiesgo().contains(factoresRiesgo[j])){ \n listaEmpleados.get(i).setEstadoSalud(30);\n }\n }\n //Verifica el rango de edad de la persona -> asigna puntajes de acuerdo\n if(listaEmpleados.get(i).getEdad() >= 70){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+50);\n }\n if(listaEmpleados.get(i).getEdad() >= 40 && listaEmpleados.get(i).getEdad() < 70 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+30);\n }\n if(listaEmpleados.get(i).getEdad() >= 20 && listaEmpleados.get(i).getEdad() < 40 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+10);\n }\n //Los hombre tienen mas probabilidades de morir por la mayoria de enfermedad, incluyendo el covid-19\n if(listaEmpleados.get(i).getSexo().equals(\"hombre\")){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+15);\n \n }\n //Verifica los diferentes puntajes y almacena los empleados en diferentes arraylist dependiendo su prioridad\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 80){\n EmpleadosPrioridadAlta.add(listaEmpleados.get(i)); \n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 60 && listaEmpleados.get(i).getEstadoSalud() < 80){\n EmpleadosPrioridadMediaAlta.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 35 && listaEmpleados.get(i).getEstadoSalud() < 60){\n EmpleadosPrioridadMedia.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 0 && listaEmpleados.get(i).getEstadoSalud() < 35){\n EmpleadosPrioridadBaja.add(listaEmpleados.get(i));\n }\n \n } \n \n }", "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\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//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "private void gerarConjuntosFuzzy(){\n\t\tthis.conjuntosFuzzy = new ArrayList<ConjuntoFuzzy>();\n\t\tdouble tamanhoDominio = this.valorMaximo - this.valorMinimo;\n\t\t//System.out.println(\"Extensão do domínio: \" + tamanhoDominio + \"[\" + this.limiteInferior + \", \" + this.limiteSuperior + \"]\");\n\t\tdouble range = tamanhoDominio/(this.quantRegioesFuzzy - 1);\n\t\tdouble inf = this.valorMinimo;\n\t\tdouble sup = this.valorMinimo + range;\n\t\t\n\t\t//Definição dos limites das regiões de pertinencia triangular\n\t\tfor(int i = 0; i < this.quantRegioesFuzzy; i++){\n\t\t\tString idConjunto = new String(this.nome + \"_\" + i);\n\t\t\tConjuntoFuzzy conjunto = new ConjuntoFuzzy(this.nome, idConjunto, inf, sup, i);\n\t\t\tthis.conjuntosFuzzy.add(conjunto);\n\t\t\t//System.out.println(\"Conjunto: \" + i + \" [\" + inf + \", \" + sup + \"]\");\n\t\t\tinf += range/2;\n\t\t\tsup += range/2;\n\t\t}\n\t\t\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byPearson(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudPearson(it1, it2, test);\r\n \r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\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 }", "public void resolver() {\r\n\t\tfor(int i = 0; i<casillas.length; i++) {\r\n\t\t\tfor(int j = 0; j<casillas[0].length; j ++) {\r\n\t\t\t\tif(casillas[i][j].darSeleccionada() == false) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tcasillas[i][j].modificarValor(cantidadMinasAlrededor(i, j));\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\n\t}", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "public void solucion() {\r\n System.out.println(\"Intervalo : [\" + a + \", \" + b + \"]\");\r\n System.out.println(\"Error : \" + porce);\r\n System.out.println(\"decimales : \"+ deci);\r\n System.out.println(\"Iteraciones : \" + iteraciones);\r\n System.out\r\n .println(\"------------------------------------------------ \\n\");\r\n \r\n double c = 0;\r\n double fa = 0;\r\n double fb = 0;\r\n double fc = 0;\r\n int iteracion = 1;\r\n \r\n do {\r\n // Aqui esta la magia\r\n c = (a + b) / 2; \r\n System.out.println(\"Iteracion (\" + iteracion + \") : \" + c);\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n fc = funcion(c);\r\n if (fa * fc == 0) {\r\n if (fa == 0) {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+a);\r\n System.out.println(a);\r\n System.exit(0);\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+c);\r\n System.out.println(c);\r\n System.exit(0);\r\n }}\r\n \r\n if (fc * fa < 0) {\r\n b = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n } else {\r\n a = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n }\r\n iteracion++;\r\n // Itera mientras se cumpla la cantidad de iteraciones establecidas\r\n // y la funcion se mantenga dentro del margen de error\r\n \r\n er = Math.abs(((c - x) / c)* 100);\r\n BigDecimal bd = new BigDecimal(aux1);\r\n bd = bd.setScale(deci, RoundingMode.HALF_UP);\r\n BigDecimal bdpm = new BigDecimal(pm);\r\n bdpm = bdpm.setScale(deci, RoundingMode.HALF_UP);\r\n cont++;\r\n fc=c ;\r\n JOptionPane.showMessageDialog(null, \"conteos: \" + cont + \" Pm: \" + bd.doubleValue() + \" Funcion: \" + bdpm.doubleValue() + \" Error: \" + er +\"%\"+ \"\\n\");\r\n } while (er <=porce);\r\n \r\n \r\n }", "public void getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<String> ExcutarCalculo(ArrayList<String> linha, String tipo){\n ArrayList<String> cod = new ArrayList();\n String reg, rv1, rv2;\n \n /*Verifica se a variavel tem registrador*/\n reg = r.getRegistrador(linha.get(0));\n if(linha.size() == 3){//x = n\n rv1 = r.getRegistrador(linha.get(2));//Verifica se é variavel\n \n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n } \n \n if(rv1 == null)\n cod.add(\"load \"+reg+\", \"+linha.get(2));\n else\n cod.add(\"load \"+reg+\", \"+rv1);\n }else{\n ArrayList<String> aux = new ArrayList();\n String[] ordem = new String[100];\n String [][]operador = {{\"(\",\"\"},{\"*\",\"mult\"},{\"/\",\"div\"},{\"+\",\"add\"},{\"-\",\"sub\"}};\n String []temp = {\"ra\",\"rb\",\"rc\",\"rd\",\"re\",\"rf\"};\n Boolean ctr = false;\n int i, j, k, tl, ctrTemp, r1, r2, pos;\n \n for(i = 0; i < 100; i++){\n ordem[i] = \"\";\n } \n \n tl = ctrTemp = 0;\n for(i = 0; i < 5; i++){\n for(j = 0; j < linha.size(); j++){\n if(linha.get(j).contains(operador[i][0])){\n if(i == 0){\n /* min = verificaRegistradores(linha.get(j+1),linha.get(j+3),temp);\n \n if(min == -1){\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t1\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+3);//Carrega val no registrador t2\n }\n \n \n for(k = 0; k < 5; k++){\n if(linha.get(j+2).contains(operador[k][0])){ \n if(operador[k][1].equals(\"add\")){\n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n }\n \n k = 5;\n }\n }\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3 por conta de reuso\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n \n for(k = 0; k < 5; k++)//( ate )\n linha.remove(j);\n linha.add(j,temp[ctrTemp-2]);\n \n if(min == -1)\n ctrTemp -= 1;\n else\n ctrTemp = 0;*/\n }else{\n rv1 = r.getRegistrador(linha.get(j-1));\n rv2 = r.getRegistrador(linha.get(j+1));\n \n r1 = verificaRegistradores(linha.get(j-1),temp);\n if(r1 == -1){//Nenhum registrador\n if(rv1 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j-1);//Carrega val no registrador t1\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv1;\n }\n r2 = verificaRegistradores(linha.get(j+1),temp);\n if(r2 == -1){//Nenhum registrador\n if(rv2 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t2\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv2;//Carrega val no registrador t2\n } \n \n pos = ctrTemp;//como posso entrar no mult ou no add\n if(operador[i][1].equals(\"mult\") || operador[i][1].equals(\"div\")){\n ctrTemp -= 2;\n \n if(operador[i][1].equals(\"mult\")){\n aux = mult(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }else\n if(operador[i][1].equals(\"div\")){\n aux = div(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }\n \n tl -= 2;\n for(k = 0; k < aux.size(); k++){\n ordem[tl++] = aux.get(k);\n }\n pos = ctrTemp-1;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n /*else\n ctrTemp -= 1;*/\n }else\n if(operador[i][1].equals(\"add\") || operador[i][1].equals(\"sub\")){\n if(operador[i][1].equals(\"sub\")){\n ordem[tl-1] = \"load \"+temp[ctrTemp-1]+\", -\"+linha.get(j+1);\n }\n \n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n pos = ctrTemp-2;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n else\n ctrTemp -= 1;\n }\n \n for(k = 0; k < 3; k++)\n linha.remove(j-1);\n linha.add(j-1,temp[pos]);\n }\n ctr = true;//Faz repetir denovo caso adicione;\n }\n }\n if(ctr){\n i--;//Controla pra só sair quando tiver excluido todas operacoes desse tipo\n ctr = false;\n }\n }\n for(k = 0; k < tl; k++){\n cod.add(ordem[k]);\n }\n\n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n }\n cod.add(\"move \"+reg+\", \"+temp[ctrTemp-1]);\n ctrTemp = 0;\n }\n \n return cod;\n }", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\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 static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public void joueDeuxHumains()\n\t{\n\t\tboolean fin = false;\n\t\tboolean result = false;\n\t\tint etoiles;\n\t\tint choix;\n\t\tint i = 0;\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint x2 = 0;\n\t\tint y2 = 0;\n\t\tString couleur;\n\t\tetoiles = initialiser();\n\t\twhile (!fin)\n\t\t{\n\t\t\tif (i % 2 == 0)\n\t\t\t{\n\t\t\t\tcouleur = \"bleu\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcouleur = \"rouge\";\n\t\t\t}\n\t\t\tSystem.out.println(\"1-Jouer\");\n\t\t\tSystem.out.println(\"2-Afficher une composante\");\n\t\t\tSystem.out.println(\"3-Vérifier si une case relie une composante\");\n\t\t\tSystem.out.println(\"4-Regarder s'il existe un chemin entre deux cases d'une couleur donnée\");\n\t\t\tSystem.out.println(\"5-Afficher le nombre minimum de cases entre deux cases données (x,y) et (z,t)\");\n\t\t\tSystem.out.println(\"6-Quitter\");\n\t\t\tchoix = clavier.nextInt();\n\t\t\tafficher(i);\n\t\t\tswitch (choix)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"### Ajout d'une case pour jouer ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tresult = tableauPeres_[x][y].colorerCase(couleur);\n\t\t\t\t\t//System.out.println(existeCheminCases(getLesVoisins(x, y, couleur), tableauPeres_[x][y], couleur));\n\t\t\t\t\tif (getNbEtoiles(x, y, couleur) < getNbEtoiles(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), x, y);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(x, y, getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY());\n\t\t\t\t\t}\n\t\t\t\t\tpreparerScore(x, y, couleur);\n\t\t\t\t\tafficheScores(couleur);\n\t\t\t\t\tnombresEtoiles(x, y, couleur);\n\t\t\t\t\t++i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"### Afficher une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tafficheComposante(x, y, couleur);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"### Tester si une case relie une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tif(!relieComposantes(x, y, couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case ne relie aucune composante.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case relie une ou plusieurs composante(s).\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"### Tester s'il existe un chemin entre deux cases données ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tif (existeCheminCases(tableauPeres_[x][y], tableauPeres_[x2][y2], couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il existe un chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il n'existe pas de chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"### Afficher nombre minimum de cases qui relie deux cases ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tSystem.out.println(relierCasesMin(x, y, x2, y2, couleur));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tfin = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (scoreJ2_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur bleu a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\t\t\telse if (scoreJ1_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur rouge a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\n\t\t}\n\t}", "public Ruteo setCovering(){\n\t\tRuteo resultado=null;\n\t\t double time1= System.currentTimeMillis();\n\t\t Integer [][]a=new Integer[Auxiliar.OBRAS.size()][listaSetCovering.size()];\n\t\t List<Double>c=new ArrayList<Double>();\n\t\t List<Double>t=new ArrayList<Double>();\n\t\t List<Obra>listObras=Auxiliar.OBRAS;\n\t\t for(int i=0;i<listaSetCovering.size();i++){\n\t\t\t c.add(listaSetCovering.get(i).costosTotales);\n\t\t\t t.add(listaSetCovering.get(i).tiempoTotal);\n\t\t }\n\t\t for(int i=0;i<Auxiliar.OBRAS.size();i++){\n\t\t\t for(int j=0;j<listaSetCovering.size();j++){\n\t\t\t\t if(listaSetCovering.get(j).estaObraEnRuta(listObras.get(i))){\n\t\t\t\t\t a[i][j]=1;\n\t\t\t\t }else{\n\t\t\t\t\t a[i][j]=0;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t List<Integer>respuesta=new ArrayList<Integer>();\n\t\tif(fo==FO1){\n\t\t\tSetCovering sc=new SetCovering();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\t\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tobjval=sc.fo;\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO2){\n\t\t\tSetCovering2 sc=new SetCovering2();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO3){\n\t\t\tSetCovering3 sc=new SetCovering3();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO4){\n\t\t\tSetCovering4 sc=new SetCovering4();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalSetCovering=(time2-time1)/1000.0;\n\t\t return resultado;\n\t}", "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 }", "public static void main(String[] args) {\n ArrayList<Integer> taszkok = new ArrayList<>();\r\n String text = null;\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\r\n try {\r\n text = reader.readLine();\r\n\r\n String[] taszkfeltolt = text.split(\",\");\r\n for(int i = 0; i<taszkfeltolt.length ;i++){\r\n taszkok.add(Integer.parseInt(taszkfeltolt[i])) ;\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n\r\n }\r\n\r\n int laphibak=0;\r\n ArrayList<String> abc = new ArrayList<>();\r\n ArrayList<Integer> fagyi = new ArrayList<>();\r\n ArrayList<Integer> szam = new ArrayList<>();\r\n for(int i = 0; i<taszkok.size();i++){\r\n boolean csillag=false;\r\n boolean nemvoltlaphiba=false;\r\n int fagyilesz=-1;\r\n //System.out.print(taszkok.get(i));\r\n\r\n if(0>taszkok.get(i)){\r\n //valami történik\r\n taszkok.set(i, taszkok.get(i)*(-1));\r\n fagyilesz=0;\r\n }\r\n if(abc.size()<3){\r\n\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){\r\n if (abc.size()==2){\r\n abc.add(\"C\");\r\n System.out.print(\"C\");\r\n }\r\n else if (abc.size()==1){\r\n abc.add(\"B\");\r\n System.out.print(\"B\");\r\n }\r\n else if (abc.size()==0){\r\n abc.add(\"A\");\r\n System.out.print(\"A\");\r\n }\r\n szam.add(taszkok.get(i));\r\n if(fagyilesz!=0){\r\n fagyi.add(4); // a kör végén ugy is csökkentem 1el elsőre is\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n //System.out.print(abc);\r\n int tempfagyi=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n if(fagyilesz!=0){\r\n fagyi.add(tempfagyi);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n //System.out.print(temp+\"e,\");\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n }\r\n else if(abc.size()==3){\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){ //ha ez egy uj szam\r\n int hanyadikbet=vanszabad(fagyi);\r\n if(hanyadikbet!=-1){\r\n String temp=abc.get(hanyadikbet);\r\n szam.remove(hanyadikbet);\r\n szam.add(taszkok.get(i));\r\n abc.remove(hanyadikbet); //a tömb végére rakom és 4 ra allitom a fagyasztast\r\n abc.add(temp);\r\n\r\n fagyi.remove(hanyadikbet);\r\n if(fagyilesz!=0){\r\n fagyi.add(4);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n\r\n System.out.print(temp);\r\n }\r\n else{\r\n csillag=true;\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n int fagyitemp=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n fagyi.add(fagyitemp);\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n\r\n }\r\n\r\n if (csillag==true){\r\n System.out.print(\"*\");\r\n }\r\n if(nemvoltlaphiba==true){\r\n System.out.print(\"-\");\r\n }\r\n else{\r\n laphibak++;\r\n }\r\n for(int j = 0; j<fagyi.size();j++){\r\n if(fagyi.get(j)!=0){\r\n fagyi.set(j,fagyi.get(j)-1); //csokkentem a fagyasztast\r\n }\r\n }\r\n }\r\n\r\n\r\n System.out.println();\r\n System.out.print(laphibak);\r\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public GenerarInformePlanificacion(Curso[] cursos, Apoderado[] apoderados) {\n this.apoderados = new PlanificacionApoderado[apoderados.length];\n for (int i = 0; i < apoderados.length; i++) {\n this.apoderados[i] = new PlanificacionApoderado();\n }\n\n int cantidadCurso = 0;\n\n for (int apTotal = 0; apTotal < this.apoderados.length; apTotal++) {\n this.apoderados[apTotal].nombre = apoderados[apTotal].getNombre();\n this.apoderados[apTotal].apellido = apoderados[apTotal].getApellido();\n this.apoderados[apTotal].run = apoderados[apTotal].getRun();\n for (int cantPupilos = 0; cantPupilos < apoderados[apTotal].getPupilos().size(); cantPupilos++) {\n\n PlanificacionAlumno alumnoAgregar = new PlanificacionAlumno();\n alumnoAgregar.nombre = apoderados[apTotal].getPupilos().get(cantPupilos).getNombre();\n alumnoAgregar.apellido = apoderados[apTotal].getPupilos().get(cantPupilos).getApellido();\n alumnoAgregar.run = apoderados[apTotal].getPupilos().get(cantPupilos).getRun();\n for (int j = 0; j < 16; j++) {\n for (int alum = 0; alum < 30; alum++) {\n if (cursos[j].getAlumnos()[alum].getRun().equals(apoderados[apTotal].getPupilos().get(cantPupilos).getRun())) {\n cantidadCurso = j;\n break;\n }\n }\n }\n for (int i = 0; i < 50; i++) {\n alumnoAgregar.plan[i] = cursos[cantidadCurso].getAsignaturas()[(int) i / 10].getPlan()[i % 10];\n }\n this.apoderados[apTotal].pupilos.add(alumnoAgregar);\n\n }\n }\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 DatosIteracion mejorIteracionVisibles(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public static void main(String[] args) {\n\t\t\tScanner tastiera=new Scanner(System.in);\r\n\t\t\tint k=0, j=0;\r\n\t\t\tint conta=0;\r\n\t\t\tString risposta=\"\";\r\n\t\t\tRandom r=new Random();\r\n\t\t\tArrayList<Giocatore> partecipantiOrdinati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> partecipantiMescolati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> perdenti=new ArrayList<Giocatore>();\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tpartecipantiOrdinati.add(new Giocatore(GIOCATORI[i]));\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tint indice=Math.abs(r.nextInt()%partecipantiOrdinati.size());\r\n\t\t\t\tpartecipantiMescolati.add(partecipantiOrdinati.get(indice));\r\n\t\t\t\tpartecipantiOrdinati.remove(indice);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"INIZIA IL TORNEO DI BRISCOLA!\");\r\n\t\t\twhile(partecipantiMescolati.size()!=1) {\r\n\t\t\t\tSystem.out.println(\"Fase \"+(j+1));\r\n\t\t\twhile(conta<partecipantiMescolati.size()) {\r\n\t\t\t\tMazzo m=new Mazzo();\r\n\t\t\t\tm.ordinaMazzo();\r\n\t\t\t\tm.mescolaMazzo();\r\n\t\t\t\tGiocatore g1=partecipantiMescolati.get(conta);\r\n\t\t\t\tGiocatore g2=partecipantiMescolati.get(conta+1);\r\n\t\t\t\tPartita p=new Partita(g1,g2,m);\r\n\t\t\t\tSystem.out.println(\"Inizia la partita tra \"+g1.getNickName()+\" e \"+g2.getNickName());\r\n\t\t\t\tSystem.out.println(\"La briscola è: \"+p.getBriscola().getCarta());\r\n\t\t\t\tSystem.out.println(\"Vuoi skippare la partita? \"); risposta=tastiera.next();\r\n\t\t\t\tif(risposta.equalsIgnoreCase(\"si\")) {\r\n\t\t\t\t\tg1.setPunteggio(p.skippa());\r\n\t\t\t\t\tg2.setPunteggio(PUNTI_MASSIMI-g1.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g1.getNickName());//vince g1\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g2.getNickName());// vince g2\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g1);\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\tp.daiLePrimeCarte();\r\n\t\t\t\t\tCarta c1=new Carta(g1.gioca().getCarta());\r\n\t\t\t\t\tCarta c2=new Carta(g2.gioca().getCarta());\r\n\t\t\t\t\tg1.eliminaDaMano(c1); g2.eliminaDaMano(c2);\r\n\t\t\t\t\tint tracciatore=1; //parte dal giocatore 1\r\n\t\t\t\t\twhile(!m.mazzoMescolato.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g1); p.pesca(g2);\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g2); p.pesca(g1);\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2); \r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{tracciatore = 1; k--;}\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Manche Finale\");\r\n\t\t\t\t\twhile(!g1.carteInMano.isEmpty() || !g2.carteInMano.isEmpty()) {\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttracciatore = 1;\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Situazione: \"+g1.getNickName()+\": \"+g1.getPunteggio());\r\n\t\t\t\t\tSystem.out.println(g2.getNickName()+\": \"+g2.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g1.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g2.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tconta+=2;\r\n\t\t\t\tSystem.out.println(\"Premi una lettera per continuare: \"); risposta=tastiera.next();\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\tconta=0;\r\n\t\t\tfor(int i=0;i<perdenti.size();i++)\r\n\t\t\t\tpartecipantiMescolati.remove(perdenti.get(i));\r\n\t\t\tSystem.out.println(\"Restano i seguenti partecipanti: \");\r\n\t\t\tfor(int i=0;i<partecipantiMescolati.size();i++) {\r\n\t\t\t\tSystem.out.println(partecipantiMescolati.get(i).getNickName());\r\n\t\t\t\tpartecipantiMescolati.get(i).setPunteggio(0);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Il vincitore del torneo è: \"+partecipantiMescolati.get(0).getNickName());\r\n\t\t\t\t\r\n\t}", "public int[] choisir(int[] coord)\r\n {\r\n int[] res = new int[3]; //tableau a rendre\r\n int x = coord[0];\r\n int y = coord[1]; //récupération des coordonnées\r\n int[] voisinage= new int[4]; //tableau qui regardera les cases adjacentes à la case cherchée\r\n voisinage[0] = getValHaut(x,y);\r\n voisinage[1] = getValDroite(x,y);\r\n voisinage[2] = getValBas(x,y);\r\n voisinage[3] = getValGauche(x,y);\r\n System.out.println(\"je choisis la case \"+x+\" \"+y+\"\");\r\n for(int i = 0; i<voisinage.length; i++ ) //parcours des possibilités si on joue sans créer d'opportunités adverses\r\n {\r\n if (Vision[x][y][i+1] == 0) //si il n'y a pas de trait déja tracé\r\n {\r\n if (voisinage[i] != 2) //si la case adjacente n'a pas déja deux traits dessinés\r\n {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n //fin du si la case adjacente a déja 2 traits dessinés\r\n }\r\n //si il n'y a pas de trait déja tracé\r\n }\r\n //fin du for de parcours des possibilités de jouers sans créer d'opportunités adverses\r\n\r\n for(int i=0; i<voisinage.length ; i++ ) //Parcours des possibilités sans recherche d'opportunités\r\n {\r\n if (Vision[x][y][i+1] == 0) {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n }\r\n //fin du parcours de possibilité sans recherche\r\n return tabVide;\r\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 static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "@Override\n public Combinacion comprobarColores(Combinacion filaIntroducida) {\n Combinacion respuesta;\n\n\n ArrayList<Ficha> combinacionRespuesta = new ArrayList<>();\n ArrayList<Integer> fichasNegrasUtilizadas = new ArrayList<>();\n ArrayList<Integer> fichasTotalesUtilizadas = new ArrayList<>();\n boolean comprobado = false;\n Colores color = Colores.SC;\n\n // COMPROBAMOS LAS NEGRAS\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[i])) {\n combinacionRespuesta.add(new Ficha(Colores.NEGRO));\n fichasNegrasUtilizadas.add(i);\n }\n }\n\n fichasTotalesUtilizadas.addAll(fichasNegrasUtilizadas);\n // SEPARAMOS NEGRAS DE BLANCAS\n\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (!fichasNegrasUtilizadas.contains(i)) {\n for (int j = 0; j < filaIntroducida.getCodigo().length && !comprobado; j++) {\n if (!fichasTotalesUtilizadas.contains(j)) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[j])) {\n color = Colores.BLANCO;\n fichasTotalesUtilizadas.add(j);\n comprobado = true;\n } else {\n color = Colores.SC;\n }\n }\n }\n combinacionRespuesta.add(new Ficha(color));\n comprobado = false;\n }\n }\n\n combinacionRespuesta.sort(new Comparator<Ficha>() {\n @Override\n public int compare(Ficha o1, Ficha o2) {\n return o1.getColor().compareTo(o2.getColor());\n }\n });\n\n respuesta = new Combinacion(combinacionRespuesta.toArray(new Ficha[combinacionRespuesta.size()]));\n\n // MODO MEDIO Y FACIL\n\n return respuesta;\n }", "private List<PlanTrabajo> generarPlanesTrabajo( Date fecPrgn, \n\t\t\tList<Cuadrilla> cuadrillas,Map<Long, GrupoAtencion> mpGrupos, \n\t\t\tMap<Long, Long> asignaciones ){\n\t\t\n\t\t\tList<PlanTrabajo> planTrabajoList = new ArrayList<PlanTrabajo>();\n\t\t\tSet<Long> grupos = asignaciones.keySet();\t\n\t\t\tlong np = 1;\n\t\t\tfor (Long ngrupo : grupos) {\n\t\t\t\t Long ncuadrilla = asignaciones.get(ngrupo);\n\t\t\t\t GrupoAtencion grupoAtencion = mpGrupos.get(ngrupo);\n\t\t\t\t //GrupoAtencion grupoAtencion = asignar(cuadrilla, idx, mpGruposCached);\n\t\t\t\t PlanTrabajo planTrabajo = new PlanTrabajo(np);\n\t\t\t\t int nsp = 1;\n\t\t\t\t planTrabajo.setFechaProgramacion(new Timestamp(fecPrgn.getTime()));\n\t\t\t\t int i = cuadrillas.indexOf( new Cuadrilla(ncuadrilla));\n\t\t\t\t if(i!=-1){\n\t\t\t\t\t \n\t\t\t\t\t Cuadrilla cuadrilla = cuadrillas.get(i);\n\t\t\t\t\t planTrabajo.setCuadrilla(cuadrilla);\n\t\t\t\t\t planTrabajo.setGrupoAtencion(grupoAtencion);\n\t\t\t\t\t \n\t\t\t\t\t if(grupoAtencion!=null){\n\t\t\t\t\t\t for( GrupoAtencionDetalle d : grupoAtencion.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\t // añadiendo las solicitudes de servicio\t\n\t\t\t\t\t\t\t SolicitudServicio s = d.getSolicitudServicio();\n\t\t\t\t\t\t\t //System.out.println(\" #### añadiendo solicitud \"+s.getNumeroSolicitud());\n\t\t\t\t\t\t\t if(planTrabajo.getPlanTrabajoDetalles()==null){\n\t\t\t\t\t\t\t\t planTrabajo.setPlanTrabajoDetalles(new ArrayList<PlanTrabajoDetalle>());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t PlanTrabajoDetalle pd = new PlanTrabajoDetalle(np, nsp);\n\t\t\t\t\t\t\t pd.setSolicitudServicio(s);\n\t\t\t\t\t\t\t //planTrabajo.addPlanTrabajoDetalle( new PlanTrabajoDetalle(s));;\n\t\t\t\t\t\t\t planTrabajo.addPlanTrabajoDetalle(pd);\n\t\t\t\t\t\t\t nsp++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t planTrabajoList.add(planTrabajo);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t np++;\n\t\t\t}\n\t\t\t\n\t\treturn planTrabajoList;\n\t}", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public OptimismPessimismCalculator() {\n mostPositive = 0;\n mostPositiveDoc = null;\n mostNegative = 0;\n mostNegativeDoc = null;\n biggestDifference = 0;\n biggestDifferenceDoc = null;\n \n publisherOptimism = new HashMap<>();\n publisherPessimism = new HashMap<>();\n regionOptimism = new HashMap<>();\n regionPessimism = new HashMap<>();\n dayOptimism = new HashMap<>();\n dayPessimism = new HashMap<>();\n weekdayOptimism = new HashMap<>();\n weekdayPessimism = new HashMap<>();\n }", "public DatosIteracion mejorIteracionCapturados(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masCapturadas();\r\n\t}", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "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 }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public Tournee chercheSolution(int tpsLimite, ContraintesTournee contraintes, Map<String, Map<String, Chemin>> plusCourtsChemins){\n\t\t//HashMap avec l'id et le point pour pouvoir recuperer le point a partir de l'id\n\t\tHashMap<String, Intersection> intersections = new HashMap<String, Intersection>();\n\t\tIterator<PointEnlevement> itEnlev = (Iterator<PointEnlevement>)contraintes.getPointsEnlevement().iterator();\n\t\tIterator<PointLivraison> itLiv = (Iterator<PointLivraison>)contraintes.getPointsLivraison().iterator();\n\t\t\n\t\t//Remplissage HashMap des intersections \n\t\tintersections.put(contraintes.getDepot().getId(), contraintes.getDepot());\n\t\tint nbSommets = 1;\n\t\twhile(itEnlev.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itEnlev.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\twhile(itLiv.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itLiv.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\t\n\t\t//Initialisation de la HashMap vuDispo - contenant les attributs boolean vu et dispo\n\t\tHashMap<String, Paire> vuDispo = initVuDispo(contraintes, intersections);\n\t\t\n\t\tTournee tournee = new Tournee(contraintes);\n\t\t//Sequentiel et MinFirst\n//\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\t\n\t\t//MinFirst + 2-Opt\n\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\ttwoOpt(tpsLimite, System.currentTimeMillis(), tournee, plusCourtsChemins, intersections);\n\t\t\n\t\treturn tournee;\n\t}", "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 static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "public void ordenarRanking(){\n for(int i = 0; i < clasificacion.length; i++) {\n boolean flag = false;\n for(int j = 0; j < clasificacion.length-1; j++) {\n\n /*Si el elemento de la posicion j+1 es mayor que el anterior se intercambian\n los valores de esas posiciones*/\n if((clasificacion[j].getMediana())<(clasificacion[j+1].getMediana())) {\n Ranking k = new Ranking();\n k=clasificacion[j];\n clasificacion[j] = clasificacion[i];\n clasificacion[i] = k;\n flag=true; //Se pone a true para indicar que se ha hecho un cambio\n }//END_IF\n }//END_FOR\n\n if(!flag) break; //Si flag es igual a falso quiere decir que en la ultima iteracion\n //no hubo ningun intercambio y por lo tanto el metodo puede terminar\n //ya que el vector esta ordenado\n }//END_FOR\n\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public void fusion(Monceau autre) throws DifferentOrderTrees {\r\n // à compléter\r\n \tArrayList<Node> temp = new ArrayList<Node>();\r\n\t\tboolean fini = false;\r\n \t\r\n \tif (arbres.isEmpty())\r\n \t\tarbres = autre.arbres;\r\n \t\r\n \telse if (!arbres.isEmpty() || !autre.arbres.isEmpty()) {\r\n \t\t//remplir la arraylist (ou arbre temp)\r\n \t\tfor (int i = 0; i < arbres.size(); i++)\r\n \t\t\ttemp.add(arbres.get(i));\r\n \t\t\r\n \t\tfor (int i = 0; i < autre.arbres.size(); i++)\r\n \t\t\ttemp.add(autre.arbres.get(i));\r\n \t\t\r\n \t\t//trier la arraylist qui contient l'arbre temp\r\n \t\tCollections.sort(temp, new Comparator<Node>() {\r\n \t\t\t@Override\r\n \t\t\tpublic int compare(Node objet1, Node objet2) {\r\n \t\t\t\tInteger noeud1 = new Integer(objet1.ordre);\r\n \t\t\t\tInteger noeud2 = new Integer(objet2.ordre);\r\n \t\t\t\treturn noeud1.compareTo(noeud2);}\r\n \t\t});\r\n \t\t\r\n \t\twhile (!fini) { \t\t\t\r\n \t\t\tfini = true;\r\n \t\t\tfor (int j = 0; j < temp.size(); j++) {\r\n \t\t\t\tfor (int k = j+1; k < temp.size(); k++) {\r\n \t\t\t\t\tif (temp.get(j).ordre == temp.get(k).ordre)\r\n \t\t\t\t\t\tfini = false; //faut pas avoir le meme ordre\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tfor (int j = 0; j < temp.size()-1; j++) {\r\n \t\t\t\tif (temp.get(j).ordre == temp.get(j + 1).ordre) {\r\n \t\t\t\t\t//les elements doivent conserver leur ordre\r\n \t\t\t\t\ttemp.set(j, temp.get(j).fusion(temp.get(j+1)));\r\n \t\t\t\t\ttemp.remove(j+1);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tarbres = temp;\r\n \t}\r\n \t\r\n \treturn;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "private List<Estado> estadosHijos(Estado estado){\r\n EstadoMancala estadom=(EstadoMancala)estado;\r\n Jugador jugadorEstado=estadom.jugadores()[estadom.jugadoractual];\r\n Movimiento[] movimientos=estadom.movimientos(jugadorEstado);\r\n List<Estado> estados=new ArrayList<Estado>();\r\n int cantmovs=0;\r\n if(movimientos!=null)\r\n cantmovs=movimientos.length;\r\n for (int i=0; i<cantmovs;i++){\r\n estados.add(estadom.clone().siguiente(movimientos[i]));\r\n }\r\n return estados;\r\n }", "public void getGerarEscala(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<Voluntario> listaVoluntario = repository.buscarVoluntarioCor(cor);\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t\t//Date agora = new Date();\r\n\t\t\r\n\t\tlong tempoIncial = System.currentTimeMillis();\r\n\t\tif(cor!=null) {\t\r\n//\t\t\tFor de verificação para não repetição dos campos sorteados\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\t//População inicial\t\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\r\n\t\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\r\n\r\n\t\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\t\r\n\r\n\t\t\t\tlistPopulacaoI.add(listaVoluntario.get(conteudoSorteado));\r\n\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Gera os pais\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\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//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Cruzamento\r\n\t\t\tint tamanhoA = equipeA.size();\r\n\t\t\tint tamanhoB = equipeB.size();\r\n\t\t\tint metadeA = (int) tamanhoA/2;\r\n\t\t\tint metadeB = (int) tamanhoB/2;\r\n\t\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//grava dados na base\r\n\t\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\r\n\t\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Tempo Total %.3f ms%n: \"+(System.currentTimeMillis()-tempoIncial));\r\n\t\tSystem.out.println(listPopulacaoI);\r\n//\t\tlong tempoFinal = System.currentTimeMillis();\r\n//\t\tlong tempoExecucao = tempoFinal-tempoIncial;\r\n\r\n\t\t\r\n\t\t/*System.out.println(\"tempo inicial:\"+tempoIncial);\r\n\t\tSystem.out.println(\"tempo inicial:\"+tempoFinal);\r\n\t\tSystem.out.println(\"Tempo execução do Metodo de gera escala equipe: \"+(tempoFinal-tempoIncial)/1000d);*/\r\n\t}", "private void calculateFitness() {\n\t\tint day1=this.getNumberOfHours()*this.getNumberOfClasses();\n\t\tint day2=2*day1;\n\t\tint day3=3*day1;\n\t\tint day4=4*day1;\n\t\tint day5=5*day1;\n\t\tTeacher_lesson temp=null;\n\t\t//day 1//\n\t\tHashSet<Integer> closedSet=new HashSet<Integer>();\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<day1;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day1;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\t\n\t\t\n\t\t//day2//\n\t\tclosedSet.clear();;\n\t\t\n\t\tfor(int i=day1;i<day2;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day2;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day3//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day2;i<day3;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day3;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//day4//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day3;i<day4;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day4;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\t\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day5//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day4;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t\t\t\n\t\t}\n\t\t\t/*if(temp.get_td_hour()<0){this.fitness=this.fitness-100;}//adunato na ginei giati o ka8igitis exei parapanw wres apo oti mporei na kanei//\n\t\t\t\telse if (temp.get_td_hour()==0){this.fitness=this.fitness-2;}//meiwnoume giati o ka8igitis 8a epivarin8ei oles tou tis wres thn idia mera//\n\t\t\t\telse{++this.fitness;}//kalh prosegisi*/\n\t\t}\n\t\t//*********************END OF DAILY EVALUATION*****************************//\n\t\t\n\t\t//**********************START OF WEEKLY EVALUATION************************//\n\t\t\n\t\tclosedSet.clear();\n\t\t\n\t int \t_weeklyhours = 1;\n\t \n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tif(!closedSet.contains(this.genes[i])){\n\t\t\t\t\n\t\t\t\n\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\t\t++_weeklyhours; }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t/*if(_weeklyhours>temp.get_tw_hour()){\n\t\t\t\tthis.fitness=this.fitness-100 ; //adunato na kanei parapanw wres ma8hma//\n\t\t\t}else\n\t\t\t\t{++this.fitness;}*/\n\t\t\tif(_weeklyhours<temp.get_tw_hour()){++this.fitness;}\n\t\t\tclosedSet.add(this.genes[i]);}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//*************END OF WEEKLY EVALUATION**********//\n\t\n\t\t//**START OF LESSON EVALUATION***//\n\t\tArraylistLesson set=new ArraylistLesson();\n\t\tclass_lid templ=null;\n\t\tTeacher_lesson tempj=null;\n\t\tint lid=0;\n\t\tString _class;\n\t\tint _classhours=1;\n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tlid=temp.get_lid();\n\t\t\t_class=temp.get_class();\n\t\t\ttempl=new class_lid(lid,_class);\n\t\t\tif(!set.contains(templ)){\n\t\t\t\t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\t\ttempj=getdata(this.genes[j]);{\n\t\t\t\t\t\tif(tempj!=null){\n\t\t\t\t\t\t\tif(temp.get_tid()==tempj.get_tid()){\n\t\t\t\t\t\t\t\tif(temp.get_lid()==tempj.get_lid()&&temp.get_class().equalsIgnoreCase(tempj.get_class())){\n\t\t\t\t\t\t\t\t\t++_classhours;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tint hours;\n\t\t\t\thours=temp.get_lhours();\n\t\t\t\n\t\tif(_classhours==hours){\n\t\t\t++this.fitness;\n\t\t}\n\t\tset.add(templ);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "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 }", "private Karta kartaErabaki(ArrayList<ArrayList<Karta>> pMatrizea) \r\n\t{\r\n\t\tKarta karta = (Karta) new KartaNormala(ElementuMota.ELURRA,0,KoloreMota.BERDEA);\r\n\t\tfor(int i=0;i<pMatrizea.size();i++) \r\n\t\t{\r\n\t\t\tfor(int x=0;x<5;x++) \r\n\t\t\t{\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()!=pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()==pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = this.lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn karta;\r\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\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\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void enemigosCatacumba(){\n esq81 = new Esqueleto(1, 8, 400, 160, 30);\n esq82 = new Esqueleto(2, 8, 400, 160, 30);\n esq111 = new Esqueleto(1, 11, 800, 255, 50);\n esq112 = new Esqueleto(2, 11, 800, 255, 50);\n esq141 = new Esqueleto(1, 14, 1000, 265, 60);\n esq142 = new Esqueleto(2, 14, 1000, 265, 60);\n //\n zom81 = new Zombie(1, 8, 1000, 170, 40);\n zom82 = new Zombie(2, 8, 1000, 170, 40);\n zom111 = new Zombie(1, 11, 1300, 250, 50);\n zom112 = new Zombie(2, 11, 1300, 250, 50);\n zom141 = new Zombie(1, 14, 1700, 260, 60);\n zom142 = new Zombie(2, 14, 1700, 260, 60);\n //\n fana81 = new Fanatico(1, 8, 400, 190, 40);\n fana82 = new Fanatico(2, 8, 400, 190, 40);\n fana111 = new Fanatico(1, 11, 700, 250, 50);\n fana112 = new Fanatico(2, 11, 700, 250, 50);\n fana141 = new Fanatico(1, 14, 900, 260, 60);\n fana142 = new Fanatico(2, 14, 900, 260, 60);\n //\n mi81 = new Mimico(1, 8, 3, 1, 3000);\n mi111 = new Mimico(1, 11, 4, 1, 3000);\n mi141 = new Mimico(1, 14, 5, 1, 3200);\n }", "private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "public void effetDeCarte(int idEffet, Joueur joueurQuiJoueLaCarte, Plateau plateau) {\n switch (idEffet) {\n case 0:\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 1:\n joueurQuiJoueLaCarte.deck.piocher(2);\n break;\n case 2:\n joueurQuiJoueLaCarte.deck.piocher(3);\n break;\n case 3:\n joueurQuiJoueLaCarte.gagnerDegats(1);\n break;\n case 4:\n joueurQuiJoueLaCarte.gagnerDegats(2);\n break;\n case 5:\n joueurQuiJoueLaCarte.gagnerDegats(3);\n\n break;\n case 6:\n joueurQuiJoueLaCarte.gagnerDegats(4);\n break;\n case 7:\n joueurQuiJoueLaCarte.gagnerRunes(1);\n break;\n case 8:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n break;\n case 9:\n gagnerDesRunes(joueurQuiJoueLaCarte,3);\n break;\n case 11:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n break;\n case 12:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n break;\n case 14:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n joueurQuiJoueLaCarte.piocher(1);\n break;\n case 15:\n joueurQuiJoueLaCarte.tuerUneCarteAvecDeLattaqueGratuitement(plateau);\n System.out.println(\"DEfeat a monster that has 4 D or less without paying it cost\");\n break;\n case 16:\n System.out.println(\"DEfeat a monster that has 6 D or less without paying it cost\");\n break;\n case 17:\n //joueurQuiJoueLaCarte.deck.piocher(1);\n System.out.println(\" You may banish a card in the center row\");\n break;\n case 18:\n System.out.println(\"Discard a card, if you do, draw two cards\");\n break;\n case 19:\n System.out.println(\"Copy l'effet d'un Héros joué ce tour-ci\");\n break;\n case 20:\n System.out.println(\"Once per turn you may draw a card\");\n break;\n case 21:\n System.out.println(\"You may banish this Construct to take an additional turn after this one.\");\n break;\n case 22:\n System.out.println(\"Acquire a Hero without paying its cost. Place in on top of your deck.\");\n break;\n case 23:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n break;\n case 24:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n verifLifebound(joueurQuiJoueLaCarte);\n break;\n case 25:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 26:\n System.out.println(\"Once per turn, gain 1 runes, the first time you play a lifebound hero, each turn gain 1 recompense\");\n break;\n case 27:\n System.out.println(\"Once per turn , gain 1d\" +\n \"Once per turn, you may spend 4r to gain 3 recompense\");\n break;\n case 28:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n plusDeDeuxConstructeur(joueurQuiJoueLaCarte);\n System.out.println(\"Draw a card if you control 2 or moreConstrcut\");\n break;\n case 29:\n System.out.println(\"Gain 1d or 1r\");\n break;\n case 30:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Gain 2r You pay 1R less the next time you acquire a Construc this turn\");\n break;\n case 31:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, when you put a Mechana Construc into play (including this one) , draw a card\");\n break;\n case 32:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, gain 2d.You may spend it only to acquire Mechana Construct\");\n break;\n case 33:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\" Once per turn\");\n gagner1DParTourPourChaqueMechaConstruct(joueurQuiJoueLaCarte);\n\n break;\n case 34:\n System.out.println(\"You may treat all Construcs as Mechana Construcs\");\n break;\n case 35:\n System.out.println(\"Once per turn, when you acquire another Mechana Construc, you may put it directly into play\");\n break;\n case 36:\n System.out.println(\"Once per turn ,gain 1 r . you may spend it only to acquire Mechana Construc\");\n break;\n case 37:\n joueurQuiJoueLaCarte.deck.piocher(2);\n System.out.println(\"Banish a card in you hand\");\n break;\n case 38:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 39:\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 40:\n System.out.println(\"Once per turn, gain 3d\");\n break;\n case 41:\n System.out.println(\"Once per turn, gain 1d\");\n break;\n case 42:\n System.out.println(\"Once per turn gain 1 The first time you deafeat a monster in the center row each turn, gain 1 R\");\n break;\n case 43:\n System.out.println(\"Unbanishable You may acquire or defeat any car in the center row without paying its cost\");\n break;\n case 44:\n System.out.println(\"Each opponent must destryo a Construc he controls\");\n break;\n case 45:\n System.out.println(\"Banish a card un the center row and/or in you discard pile\");\n break;\n case 46:\n System.out.println(\"Banish a card un the center row\");\n break;\n case 47:\n System.out.println(\"If an opponent has more than one construct, that player must destroy all but one Construct he controls\");\n break;\n case 48:\n System.out.println(\"Take a card at random from each oppenent's hand and add that card to your hands\");\n break;\n }\n\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void preenchePosicoes(List<Par<Integer,Integer>> posicoes, \n\t\t\tEstadoAmbiente estado) {\n\t\tfor (Par<Integer,Integer> p : posicoes) {\n\t\t\tthis.quadricula[p.primeiro()][p.segundo()] = estado;\n\t\t}\n\t}", "private ArrayList<Estado> generar_sucesores(Estado actual) {\r\n\t\tArrayList<Estado> sucesores = new ArrayList<>();\r\n\t\tsucesores.add(actual.derecha().addHeuristica(estado_final)); //Añado los puntos hijos del estado actual\r\n\t\tsucesores.add(actual.izquierda().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.arriba().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.abajo().addHeuristica(estado_final));\r\n\r\n\t\tif (sucesores.contains(estado_inicial)) { //Limpio posible estado inicial\r\n\t\t\tsucesores.remove(estado_inicial);\r\n\t\t}\r\n\t\tArrayList<Estado> aux = new ArrayList<>(); // Para evitar error de concurrencia creo una lista auxiliar con los sucesores\r\n\t\tfor (int i = 0; i < sucesores.size(); i++) {\r\n\t\t\taux.add(sucesores.get(i));\r\n\t\t}\r\n\t\tfor (Estado p : aux) { //Limpio muros\r\n\t\t\tif (matriz[p.getX() - 1][p.getY() - 1] == muro) {\r\n\t\t\t\tsucesores.remove(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sucesores;\r\n\t}", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "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}", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public String execute() {\n\t\ttry {\n\t\t\tHashMap<Integer, RigaVenditeCommercianti> map = new HashMap<Integer, RigaVenditeCommercianti>();\n\t\t\tlistaTotali = new LinkedList<RigaVenditeCommercianti>();\n\t\t\t\n\t\t\tFatture fatture = new Fatture();\n\t\t\tfatture.setOrderByCliente();\n\t\t\tCollection colFatture = fatture.getFatture(dataDal, dataAl);\n\t\t\tIterator itr = colFatture.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tFattura fattura = (Fattura) itr.next();\t\n\t\t\t\tfattura.calcolaTotali();\n\t\t\t\tif (map.containsKey(fattura.getIdCliente().intValue())) {\n\t\t\t\t\t//Aggiungi totali alla riga attuale\n\t\t\t\t\tRigaVenditeCommercianti riga = map.get(fattura.getIdCliente().intValue());\n\t\t\t\t\triga.setTotaleFattura(riga.getTotaleFattura().add(fattura.getTotaleFattura()));\n\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tfattura.calcolaTotali();\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 4\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva1())) { //IVA AL 4\n\t\t\t\t\t\triga.setImponibile1(riga.getImponibile1().add(imponibili.get(riga.getIva1())[0]));\n\t\t\t\t\t\triga.setImposta1(riga.getImposta1().add(imponibili.get(riga.getIva1())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 10\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile2(riga.getImponibile2().add(imponibili.get(riga.getIva2())[0]));\n\t\t\t\t\t\triga.setImposta2(riga.getImposta2().add(imponibili.get(riga.getIva2())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 20\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile3(riga.getImponibile3().add(imponibili.get(riga.getIva3())[0]));\n\t\t\t\t\t\triga.setImposta3(riga.getImposta3().add(imponibili.get(riga.getIva3())[1]));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//Crea riga per cliente\n\t\t\t\t\tRigaVenditeCommercianti riga = new RigaVenditeCommercianti();\n\t\t\t\t\triga.setCliente(fattura.getCliente());\n\t\t\t\t\triga.setTotaleFattura(fattura.getTotaleFattura());\n\t\t\t\t\t\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\tIvas dao = new Ivas();\n\t\t\t\t\tdao.setOrderByDescrizione(DataAccessObject.ORDER_ASC);\n\t\t\t\t\tCollection aliquote = dao.getElements();\n\t\t\t\t\t\n\t\t\t\t\tint index = 1;\n\t\t\t\t\tfor(Object obj : aliquote)\n\t\t\t\t\t{\n\t\t\t\t\t\tIva iva = (Iva)obj;\n\t\t\t\t\t\tif(iva.getValore().floatValue() < 4) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tBigDecimal imponibile = new BigDecimal(0);\n\t\t\t\t\t\tBigDecimal imposta = new BigDecimal(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(imponibili.containsKey(iva.getValore()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timponibile = imponibili.get(iva.getValore())[0];\n\t\t\t\t\t\t\timposta = imponibili.get(iva.getValore())[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva1(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile1(imponibile);\n\t\t\t\t\t\t\triga.setImposta1(imposta);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva2(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile2(imponibile);\n\t\t\t\t\t\t\triga.setImposta2(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva3(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile3(imponibile);\n\t\t\t\t\t\t\triga.setImposta3(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 3) break;\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tmap.put(fattura.getIdCliente().intValue(), riga);\n\t\t\t\t\tlistaTotali.add(riga);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tstampaErrore(\"PrintVendite.execute()\", e);\n\t\t\treturn ERROR;\n\t\t}\n\t\treturn SUCCESS;\n\t}", "private int getResult() {\n ArrayList<Character> operanzi = new ArrayList<Character>();\n ArrayList<Character> operatori = new ArrayList<Character>();\n for(int i = 1; i <= n; i++){\n // System.out.println(i);\n if ((expr[i] == 'T' ) || (expr[i] == 'F'))\n operanzi.add(expr[i]);\n else \n operatori.add(expr[i]);\n }\n System.out.println(operanzi.get(0));\n int n1 = operanzi.size();\n System.out.println(n1);\n long [][] T = new long[n1][n1];\n long [][] F = new long[n1][n1];\n\n for (int i = 0; i < operanzi.size(); i++) {\n \n if (operanzi.get(i) == 'T') {\n T[i][i] = 1;\n F[i][i] = 0;\n } else if (operanzi.get(i) == 'F') {\n T[i][i] = 0;\n F[i][i] = 1;\n }\n }\n long aux=0;\n for (int l=1; l<n1; ++l) \n { \n for (int i=0, j=l; j<n1; ++i, ++j) \n { \n T[i][j] = F[i][j] = 0; \n for (int g=0; g<l; g++) \n { \n int k = i + g; \n long total_i_k = evaluate(T[i][k],F[i][k],'+'); \n long total_k_j = evaluate(T[k+1][j] , F[k+1][j],'+'); \n long total = evaluate(total_i_k,total_k_j,'*');\n if (operatori.get(k) == '&') \n { \n aux = evaluate(T[i][k],T[k+1][j],'*');\n T[i][j] = evaluate(T[i][j],aux,'+'); \n \n\n F[i][j] = evaluate( F[i][j],evaluate(total,aux,'-'),'+'); \n } \n if (operatori.get(k) == '|') \n { \n aux = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate(F[i][j],aux,'+'); \n \n T[i][j] =evaluate( T[i][j],evaluate(total, aux,'-'),'+'); \n } \n if (operatori.get(k) == '^') \n { \n aux = evaluate(F[i][k],T[k+1][j],'*');\n long aux1= evaluate(T[i][k],F[k+1][j],'*');\n T[i][j] = evaluate( T[i][j],evaluate( aux , aux1,'+'),'+'); \n aux = evaluate(T[i][k],T[k+1][j],'*');\n aux1 = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate( F[i][j],evaluate(aux,aux1,'+'),'+');\n } \n } \n } \n } \n return (int)T[0][n1-1]; \n }", "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 }", "private List<ObligacionCoactivoDTO> calcularCostasProcesales(List<ObligacionCoactivoDTO> obligaciones,\n BigDecimal valorAbsoluto, BigDecimal porcentaje) throws CirculemosNegocioException {\n // No aplica costas\n if (valorAbsoluto == null && porcentaje == null) {\n return obligaciones;\n } else if (valorAbsoluto != null) {\n // Aplica valor absoluto\n if (obligaciones.size() == 1) {\n obligaciones.get(0).setValorCostasProcesales(valorAbsoluto);\n return obligaciones;\n } else {\n BigDecimal porcentajeDeuda;\n BigDecimal totalDeuda = new BigDecimal(0);\n\n // Calculo de deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n totalDeuda = totalDeuda\n .add(obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()));\n\n }\n\n // Calculo de porcentaje y valor\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n porcentajeDeuda = ((obligacion.getValorCostasProcesales()\n .add(obligacion.getValorInteresMoratorios())).multiply(new BigDecimal(100)))\n .divide(totalDeuda);\n\n obligacion\n .setValorCostasProcesales(totalDeuda.multiply(porcentajeDeuda).divide(new BigDecimal(100)));\n\n }\n return obligaciones;\n\n }\n } else if (porcentaje != null) {\n // Aplica porcentaje de la deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n obligacion.setValorCostasProcesales(\n (obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()))\n .multiply(porcentaje).divide(new BigDecimal(100)).setScale(2,\n BigDecimal.ROUND_HALF_UP));\n\n }\n return obligaciones;\n } else {\n throw new CirculemosNegocioException(ErrorCoactivo.GenerarCoactivo.COAC_002005);\n }\n }", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "public static Resultado PCF(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n //*Definicion de variables las variables\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n \n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n double slotsDemanda = demanda.getNroFS();\n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n \n \n \n // double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n //FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n FcmtAux = ((saltos*slotsDemanda) + corte + desalineamiento)/capacidadLibre;\n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public static Resultado KSP_FF_Algorithm_MBBR(GrafoMatriz G, GrafoMatriz Gaux, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n /*Definicion de variables las variables*/\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n \n /*Probamos para cada camino, si exite espectro para ubicar la damanda*/\n int k=0;\n while(k<ksp.length && ksp[k]!=null && demandaColocada==0){\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n /*Calcular la ocupacion del espectro para cada camino k*/\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ||\n Gaux.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ){\n OE[i]=0;\n break;\n }\n }\n }\n /*Teniendo la ocupacion del espectro del camino k, buscamos un bloque continuo de FS\n * que satisfazca la demanda.\n */\n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n demandaColocada=1;\n break;\n }\n }\n }\n if(demandaColocada==1){\n break;\n }\n }\n k++;\n }\n \n if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }\n /*Bloque contiguoo encontrado, asignamos los indices del espectro a utilizar \n * y retornamos el resultado\n */\n Resultado r= new Resultado();\n r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);\n return r;\n }" ]
[ "0.6369091", "0.6290835", "0.62273735", "0.61889815", "0.59769803", "0.5968935", "0.59103996", "0.5896852", "0.5879993", "0.58483267", "0.57968515", "0.574093", "0.5701246", "0.5688302", "0.564915", "0.5641294", "0.56298786", "0.56267923", "0.5623532", "0.5619576", "0.5593624", "0.55916077", "0.5588625", "0.55830806", "0.557453", "0.5571601", "0.55687743", "0.5566994", "0.55655783", "0.5550565", "0.5546241", "0.55159426", "0.55027574", "0.55021155", "0.5493501", "0.548865", "0.5466397", "0.5460493", "0.5460261", "0.5456445", "0.5451198", "0.54412407", "0.5440667", "0.54325503", "0.54207826", "0.54179674", "0.54168737", "0.5416588", "0.5402674", "0.53988373", "0.5392815", "0.5390069", "0.53816295", "0.5371171", "0.53703547", "0.5362547", "0.5354948", "0.5354428", "0.53523725", "0.5351815", "0.5349358", "0.534028", "0.5336789", "0.53294593", "0.5324443", "0.5322742", "0.5320947", "0.5313928", "0.529563", "0.5293606", "0.5292493", "0.5279235", "0.5276801", "0.5273606", "0.5272331", "0.52674794", "0.5262569", "0.5260719", "0.5255163", "0.5250809", "0.52483845", "0.524259", "0.5236238", "0.5230499", "0.52254945", "0.5225043", "0.5224143", "0.52219313", "0.52191454", "0.5218492", "0.52074766", "0.51949996", "0.51944727", "0.5191369", "0.5189786", "0.518541", "0.5180373", "0.5175139", "0.5171705", "0.51698005" ]
0.6659077
0
iteracion mas optimizada de una estrategia
public DatosIteracion mejorIteracionOptimizada(String estrategia) { int i; for (i = 0; i < this.getValoresEstrategias().size(); i++) { if (this.getValoresEstrategias(i).getNombreEstrategia() .equals(estrategia)) break; } return this.getValoresEstrategias(i).masEficiente(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "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 }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\n\t}", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\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 static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byCoseno(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudCoseno(it1, it2, test);\r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "public ChampionnatComplexe (int [] Eq12,Matrice mat,Options o ) {\n\t\topt = o;\n\t\tint equilibrea = 0;\n\t\tint equilibreb = 0;\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3]; \n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibrea = grpA1[z] + grpA2[z] ;\n\t\t\tequilibreb = grpB1[z] + grpB2[z] ;\n\t\t}\n\t\tequilibreDesPoule = Integer.max(equilibrea, equilibreb) - Integer.min(equilibreb, equilibreb);\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\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}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public void determinarEstadoSalud(){\n \n for (int i = 0; i < listaEmpleados.size(); i++) {\n //Este for chequea si tiene alguna enfermedad preexistente -> asigna puntajes de acuerdo\n for (int j = 0; j < factoresRiesgo.length; j++) {\n \n if(listaEmpleados.get(i).getFactoresRiesgo().contains(factoresRiesgo[j])){ \n listaEmpleados.get(i).setEstadoSalud(30);\n }\n }\n //Verifica el rango de edad de la persona -> asigna puntajes de acuerdo\n if(listaEmpleados.get(i).getEdad() >= 70){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+50);\n }\n if(listaEmpleados.get(i).getEdad() >= 40 && listaEmpleados.get(i).getEdad() < 70 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+30);\n }\n if(listaEmpleados.get(i).getEdad() >= 20 && listaEmpleados.get(i).getEdad() < 40 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+10);\n }\n //Los hombre tienen mas probabilidades de morir por la mayoria de enfermedad, incluyendo el covid-19\n if(listaEmpleados.get(i).getSexo().equals(\"hombre\")){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+15);\n \n }\n //Verifica los diferentes puntajes y almacena los empleados en diferentes arraylist dependiendo su prioridad\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 80){\n EmpleadosPrioridadAlta.add(listaEmpleados.get(i)); \n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 60 && listaEmpleados.get(i).getEstadoSalud() < 80){\n EmpleadosPrioridadMediaAlta.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 35 && listaEmpleados.get(i).getEstadoSalud() < 60){\n EmpleadosPrioridadMedia.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 0 && listaEmpleados.get(i).getEstadoSalud() < 35){\n EmpleadosPrioridadBaja.add(listaEmpleados.get(i));\n }\n \n } \n \n }", "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\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//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "private void gerarConjuntosFuzzy(){\n\t\tthis.conjuntosFuzzy = new ArrayList<ConjuntoFuzzy>();\n\t\tdouble tamanhoDominio = this.valorMaximo - this.valorMinimo;\n\t\t//System.out.println(\"Extensão do domínio: \" + tamanhoDominio + \"[\" + this.limiteInferior + \", \" + this.limiteSuperior + \"]\");\n\t\tdouble range = tamanhoDominio/(this.quantRegioesFuzzy - 1);\n\t\tdouble inf = this.valorMinimo;\n\t\tdouble sup = this.valorMinimo + range;\n\t\t\n\t\t//Definição dos limites das regiões de pertinencia triangular\n\t\tfor(int i = 0; i < this.quantRegioesFuzzy; i++){\n\t\t\tString idConjunto = new String(this.nome + \"_\" + i);\n\t\t\tConjuntoFuzzy conjunto = new ConjuntoFuzzy(this.nome, idConjunto, inf, sup, i);\n\t\t\tthis.conjuntosFuzzy.add(conjunto);\n\t\t\t//System.out.println(\"Conjunto: \" + i + \" [\" + inf + \", \" + sup + \"]\");\n\t\t\tinf += range/2;\n\t\t\tsup += range/2;\n\t\t}\n\t\t\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byPearson(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudPearson(it1, it2, test);\r\n \r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\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 }", "public void resolver() {\r\n\t\tfor(int i = 0; i<casillas.length; i++) {\r\n\t\t\tfor(int j = 0; j<casillas[0].length; j ++) {\r\n\t\t\t\tif(casillas[i][j].darSeleccionada() == false) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tcasillas[i][j].modificarValor(cantidadMinasAlrededor(i, j));\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\n\t}", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "public void solucion() {\r\n System.out.println(\"Intervalo : [\" + a + \", \" + b + \"]\");\r\n System.out.println(\"Error : \" + porce);\r\n System.out.println(\"decimales : \"+ deci);\r\n System.out.println(\"Iteraciones : \" + iteraciones);\r\n System.out\r\n .println(\"------------------------------------------------ \\n\");\r\n \r\n double c = 0;\r\n double fa = 0;\r\n double fb = 0;\r\n double fc = 0;\r\n int iteracion = 1;\r\n \r\n do {\r\n // Aqui esta la magia\r\n c = (a + b) / 2; \r\n System.out.println(\"Iteracion (\" + iteracion + \") : \" + c);\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n fc = funcion(c);\r\n if (fa * fc == 0) {\r\n if (fa == 0) {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+a);\r\n System.out.println(a);\r\n System.exit(0);\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+c);\r\n System.out.println(c);\r\n System.exit(0);\r\n }}\r\n \r\n if (fc * fa < 0) {\r\n b = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n } else {\r\n a = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n }\r\n iteracion++;\r\n // Itera mientras se cumpla la cantidad de iteraciones establecidas\r\n // y la funcion se mantenga dentro del margen de error\r\n \r\n er = Math.abs(((c - x) / c)* 100);\r\n BigDecimal bd = new BigDecimal(aux1);\r\n bd = bd.setScale(deci, RoundingMode.HALF_UP);\r\n BigDecimal bdpm = new BigDecimal(pm);\r\n bdpm = bdpm.setScale(deci, RoundingMode.HALF_UP);\r\n cont++;\r\n fc=c ;\r\n JOptionPane.showMessageDialog(null, \"conteos: \" + cont + \" Pm: \" + bd.doubleValue() + \" Funcion: \" + bdpm.doubleValue() + \" Error: \" + er +\"%\"+ \"\\n\");\r\n } while (er <=porce);\r\n \r\n \r\n }", "public void getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<String> ExcutarCalculo(ArrayList<String> linha, String tipo){\n ArrayList<String> cod = new ArrayList();\n String reg, rv1, rv2;\n \n /*Verifica se a variavel tem registrador*/\n reg = r.getRegistrador(linha.get(0));\n if(linha.size() == 3){//x = n\n rv1 = r.getRegistrador(linha.get(2));//Verifica se é variavel\n \n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n } \n \n if(rv1 == null)\n cod.add(\"load \"+reg+\", \"+linha.get(2));\n else\n cod.add(\"load \"+reg+\", \"+rv1);\n }else{\n ArrayList<String> aux = new ArrayList();\n String[] ordem = new String[100];\n String [][]operador = {{\"(\",\"\"},{\"*\",\"mult\"},{\"/\",\"div\"},{\"+\",\"add\"},{\"-\",\"sub\"}};\n String []temp = {\"ra\",\"rb\",\"rc\",\"rd\",\"re\",\"rf\"};\n Boolean ctr = false;\n int i, j, k, tl, ctrTemp, r1, r2, pos;\n \n for(i = 0; i < 100; i++){\n ordem[i] = \"\";\n } \n \n tl = ctrTemp = 0;\n for(i = 0; i < 5; i++){\n for(j = 0; j < linha.size(); j++){\n if(linha.get(j).contains(operador[i][0])){\n if(i == 0){\n /* min = verificaRegistradores(linha.get(j+1),linha.get(j+3),temp);\n \n if(min == -1){\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t1\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+3);//Carrega val no registrador t2\n }\n \n \n for(k = 0; k < 5; k++){\n if(linha.get(j+2).contains(operador[k][0])){ \n if(operador[k][1].equals(\"add\")){\n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n }\n \n k = 5;\n }\n }\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3 por conta de reuso\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n \n for(k = 0; k < 5; k++)//( ate )\n linha.remove(j);\n linha.add(j,temp[ctrTemp-2]);\n \n if(min == -1)\n ctrTemp -= 1;\n else\n ctrTemp = 0;*/\n }else{\n rv1 = r.getRegistrador(linha.get(j-1));\n rv2 = r.getRegistrador(linha.get(j+1));\n \n r1 = verificaRegistradores(linha.get(j-1),temp);\n if(r1 == -1){//Nenhum registrador\n if(rv1 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j-1);//Carrega val no registrador t1\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv1;\n }\n r2 = verificaRegistradores(linha.get(j+1),temp);\n if(r2 == -1){//Nenhum registrador\n if(rv2 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t2\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv2;//Carrega val no registrador t2\n } \n \n pos = ctrTemp;//como posso entrar no mult ou no add\n if(operador[i][1].equals(\"mult\") || operador[i][1].equals(\"div\")){\n ctrTemp -= 2;\n \n if(operador[i][1].equals(\"mult\")){\n aux = mult(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }else\n if(operador[i][1].equals(\"div\")){\n aux = div(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }\n \n tl -= 2;\n for(k = 0; k < aux.size(); k++){\n ordem[tl++] = aux.get(k);\n }\n pos = ctrTemp-1;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n /*else\n ctrTemp -= 1;*/\n }else\n if(operador[i][1].equals(\"add\") || operador[i][1].equals(\"sub\")){\n if(operador[i][1].equals(\"sub\")){\n ordem[tl-1] = \"load \"+temp[ctrTemp-1]+\", -\"+linha.get(j+1);\n }\n \n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n pos = ctrTemp-2;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n else\n ctrTemp -= 1;\n }\n \n for(k = 0; k < 3; k++)\n linha.remove(j-1);\n linha.add(j-1,temp[pos]);\n }\n ctr = true;//Faz repetir denovo caso adicione;\n }\n }\n if(ctr){\n i--;//Controla pra só sair quando tiver excluido todas operacoes desse tipo\n ctr = false;\n }\n }\n for(k = 0; k < tl; k++){\n cod.add(ordem[k]);\n }\n\n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n }\n cod.add(\"move \"+reg+\", \"+temp[ctrTemp-1]);\n ctrTemp = 0;\n }\n \n return cod;\n }", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\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 static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public void joueDeuxHumains()\n\t{\n\t\tboolean fin = false;\n\t\tboolean result = false;\n\t\tint etoiles;\n\t\tint choix;\n\t\tint i = 0;\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint x2 = 0;\n\t\tint y2 = 0;\n\t\tString couleur;\n\t\tetoiles = initialiser();\n\t\twhile (!fin)\n\t\t{\n\t\t\tif (i % 2 == 0)\n\t\t\t{\n\t\t\t\tcouleur = \"bleu\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcouleur = \"rouge\";\n\t\t\t}\n\t\t\tSystem.out.println(\"1-Jouer\");\n\t\t\tSystem.out.println(\"2-Afficher une composante\");\n\t\t\tSystem.out.println(\"3-Vérifier si une case relie une composante\");\n\t\t\tSystem.out.println(\"4-Regarder s'il existe un chemin entre deux cases d'une couleur donnée\");\n\t\t\tSystem.out.println(\"5-Afficher le nombre minimum de cases entre deux cases données (x,y) et (z,t)\");\n\t\t\tSystem.out.println(\"6-Quitter\");\n\t\t\tchoix = clavier.nextInt();\n\t\t\tafficher(i);\n\t\t\tswitch (choix)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"### Ajout d'une case pour jouer ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tresult = tableauPeres_[x][y].colorerCase(couleur);\n\t\t\t\t\t//System.out.println(existeCheminCases(getLesVoisins(x, y, couleur), tableauPeres_[x][y], couleur));\n\t\t\t\t\tif (getNbEtoiles(x, y, couleur) < getNbEtoiles(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), x, y);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(x, y, getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY());\n\t\t\t\t\t}\n\t\t\t\t\tpreparerScore(x, y, couleur);\n\t\t\t\t\tafficheScores(couleur);\n\t\t\t\t\tnombresEtoiles(x, y, couleur);\n\t\t\t\t\t++i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"### Afficher une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tafficheComposante(x, y, couleur);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"### Tester si une case relie une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tif(!relieComposantes(x, y, couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case ne relie aucune composante.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case relie une ou plusieurs composante(s).\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"### Tester s'il existe un chemin entre deux cases données ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tif (existeCheminCases(tableauPeres_[x][y], tableauPeres_[x2][y2], couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il existe un chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il n'existe pas de chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"### Afficher nombre minimum de cases qui relie deux cases ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tSystem.out.println(relierCasesMin(x, y, x2, y2, couleur));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tfin = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (scoreJ2_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur bleu a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\t\t\telse if (scoreJ1_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur rouge a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\n\t\t}\n\t}", "public Ruteo setCovering(){\n\t\tRuteo resultado=null;\n\t\t double time1= System.currentTimeMillis();\n\t\t Integer [][]a=new Integer[Auxiliar.OBRAS.size()][listaSetCovering.size()];\n\t\t List<Double>c=new ArrayList<Double>();\n\t\t List<Double>t=new ArrayList<Double>();\n\t\t List<Obra>listObras=Auxiliar.OBRAS;\n\t\t for(int i=0;i<listaSetCovering.size();i++){\n\t\t\t c.add(listaSetCovering.get(i).costosTotales);\n\t\t\t t.add(listaSetCovering.get(i).tiempoTotal);\n\t\t }\n\t\t for(int i=0;i<Auxiliar.OBRAS.size();i++){\n\t\t\t for(int j=0;j<listaSetCovering.size();j++){\n\t\t\t\t if(listaSetCovering.get(j).estaObraEnRuta(listObras.get(i))){\n\t\t\t\t\t a[i][j]=1;\n\t\t\t\t }else{\n\t\t\t\t\t a[i][j]=0;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t List<Integer>respuesta=new ArrayList<Integer>();\n\t\tif(fo==FO1){\n\t\t\tSetCovering sc=new SetCovering();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\t\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tobjval=sc.fo;\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO2){\n\t\t\tSetCovering2 sc=new SetCovering2();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO3){\n\t\t\tSetCovering3 sc=new SetCovering3();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO4){\n\t\t\tSetCovering4 sc=new SetCovering4();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalSetCovering=(time2-time1)/1000.0;\n\t\t return resultado;\n\t}", "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 }", "public static void main(String[] args) {\n ArrayList<Integer> taszkok = new ArrayList<>();\r\n String text = null;\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\r\n try {\r\n text = reader.readLine();\r\n\r\n String[] taszkfeltolt = text.split(\",\");\r\n for(int i = 0; i<taszkfeltolt.length ;i++){\r\n taszkok.add(Integer.parseInt(taszkfeltolt[i])) ;\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n\r\n }\r\n\r\n int laphibak=0;\r\n ArrayList<String> abc = new ArrayList<>();\r\n ArrayList<Integer> fagyi = new ArrayList<>();\r\n ArrayList<Integer> szam = new ArrayList<>();\r\n for(int i = 0; i<taszkok.size();i++){\r\n boolean csillag=false;\r\n boolean nemvoltlaphiba=false;\r\n int fagyilesz=-1;\r\n //System.out.print(taszkok.get(i));\r\n\r\n if(0>taszkok.get(i)){\r\n //valami történik\r\n taszkok.set(i, taszkok.get(i)*(-1));\r\n fagyilesz=0;\r\n }\r\n if(abc.size()<3){\r\n\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){\r\n if (abc.size()==2){\r\n abc.add(\"C\");\r\n System.out.print(\"C\");\r\n }\r\n else if (abc.size()==1){\r\n abc.add(\"B\");\r\n System.out.print(\"B\");\r\n }\r\n else if (abc.size()==0){\r\n abc.add(\"A\");\r\n System.out.print(\"A\");\r\n }\r\n szam.add(taszkok.get(i));\r\n if(fagyilesz!=0){\r\n fagyi.add(4); // a kör végén ugy is csökkentem 1el elsőre is\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n //System.out.print(abc);\r\n int tempfagyi=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n if(fagyilesz!=0){\r\n fagyi.add(tempfagyi);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n //System.out.print(temp+\"e,\");\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n }\r\n else if(abc.size()==3){\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){ //ha ez egy uj szam\r\n int hanyadikbet=vanszabad(fagyi);\r\n if(hanyadikbet!=-1){\r\n String temp=abc.get(hanyadikbet);\r\n szam.remove(hanyadikbet);\r\n szam.add(taszkok.get(i));\r\n abc.remove(hanyadikbet); //a tömb végére rakom és 4 ra allitom a fagyasztast\r\n abc.add(temp);\r\n\r\n fagyi.remove(hanyadikbet);\r\n if(fagyilesz!=0){\r\n fagyi.add(4);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n\r\n System.out.print(temp);\r\n }\r\n else{\r\n csillag=true;\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n int fagyitemp=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n fagyi.add(fagyitemp);\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n\r\n }\r\n\r\n if (csillag==true){\r\n System.out.print(\"*\");\r\n }\r\n if(nemvoltlaphiba==true){\r\n System.out.print(\"-\");\r\n }\r\n else{\r\n laphibak++;\r\n }\r\n for(int j = 0; j<fagyi.size();j++){\r\n if(fagyi.get(j)!=0){\r\n fagyi.set(j,fagyi.get(j)-1); //csokkentem a fagyasztast\r\n }\r\n }\r\n }\r\n\r\n\r\n System.out.println();\r\n System.out.print(laphibak);\r\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public GenerarInformePlanificacion(Curso[] cursos, Apoderado[] apoderados) {\n this.apoderados = new PlanificacionApoderado[apoderados.length];\n for (int i = 0; i < apoderados.length; i++) {\n this.apoderados[i] = new PlanificacionApoderado();\n }\n\n int cantidadCurso = 0;\n\n for (int apTotal = 0; apTotal < this.apoderados.length; apTotal++) {\n this.apoderados[apTotal].nombre = apoderados[apTotal].getNombre();\n this.apoderados[apTotal].apellido = apoderados[apTotal].getApellido();\n this.apoderados[apTotal].run = apoderados[apTotal].getRun();\n for (int cantPupilos = 0; cantPupilos < apoderados[apTotal].getPupilos().size(); cantPupilos++) {\n\n PlanificacionAlumno alumnoAgregar = new PlanificacionAlumno();\n alumnoAgregar.nombre = apoderados[apTotal].getPupilos().get(cantPupilos).getNombre();\n alumnoAgregar.apellido = apoderados[apTotal].getPupilos().get(cantPupilos).getApellido();\n alumnoAgregar.run = apoderados[apTotal].getPupilos().get(cantPupilos).getRun();\n for (int j = 0; j < 16; j++) {\n for (int alum = 0; alum < 30; alum++) {\n if (cursos[j].getAlumnos()[alum].getRun().equals(apoderados[apTotal].getPupilos().get(cantPupilos).getRun())) {\n cantidadCurso = j;\n break;\n }\n }\n }\n for (int i = 0; i < 50; i++) {\n alumnoAgregar.plan[i] = cursos[cantidadCurso].getAsignaturas()[(int) i / 10].getPlan()[i % 10];\n }\n this.apoderados[apTotal].pupilos.add(alumnoAgregar);\n\n }\n }\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 DatosIteracion mejorIteracionVisibles(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public static void main(String[] args) {\n\t\t\tScanner tastiera=new Scanner(System.in);\r\n\t\t\tint k=0, j=0;\r\n\t\t\tint conta=0;\r\n\t\t\tString risposta=\"\";\r\n\t\t\tRandom r=new Random();\r\n\t\t\tArrayList<Giocatore> partecipantiOrdinati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> partecipantiMescolati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> perdenti=new ArrayList<Giocatore>();\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tpartecipantiOrdinati.add(new Giocatore(GIOCATORI[i]));\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tint indice=Math.abs(r.nextInt()%partecipantiOrdinati.size());\r\n\t\t\t\tpartecipantiMescolati.add(partecipantiOrdinati.get(indice));\r\n\t\t\t\tpartecipantiOrdinati.remove(indice);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"INIZIA IL TORNEO DI BRISCOLA!\");\r\n\t\t\twhile(partecipantiMescolati.size()!=1) {\r\n\t\t\t\tSystem.out.println(\"Fase \"+(j+1));\r\n\t\t\twhile(conta<partecipantiMescolati.size()) {\r\n\t\t\t\tMazzo m=new Mazzo();\r\n\t\t\t\tm.ordinaMazzo();\r\n\t\t\t\tm.mescolaMazzo();\r\n\t\t\t\tGiocatore g1=partecipantiMescolati.get(conta);\r\n\t\t\t\tGiocatore g2=partecipantiMescolati.get(conta+1);\r\n\t\t\t\tPartita p=new Partita(g1,g2,m);\r\n\t\t\t\tSystem.out.println(\"Inizia la partita tra \"+g1.getNickName()+\" e \"+g2.getNickName());\r\n\t\t\t\tSystem.out.println(\"La briscola è: \"+p.getBriscola().getCarta());\r\n\t\t\t\tSystem.out.println(\"Vuoi skippare la partita? \"); risposta=tastiera.next();\r\n\t\t\t\tif(risposta.equalsIgnoreCase(\"si\")) {\r\n\t\t\t\t\tg1.setPunteggio(p.skippa());\r\n\t\t\t\t\tg2.setPunteggio(PUNTI_MASSIMI-g1.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g1.getNickName());//vince g1\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g2.getNickName());// vince g2\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g1);\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\tp.daiLePrimeCarte();\r\n\t\t\t\t\tCarta c1=new Carta(g1.gioca().getCarta());\r\n\t\t\t\t\tCarta c2=new Carta(g2.gioca().getCarta());\r\n\t\t\t\t\tg1.eliminaDaMano(c1); g2.eliminaDaMano(c2);\r\n\t\t\t\t\tint tracciatore=1; //parte dal giocatore 1\r\n\t\t\t\t\twhile(!m.mazzoMescolato.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g1); p.pesca(g2);\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g2); p.pesca(g1);\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2); \r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{tracciatore = 1; k--;}\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Manche Finale\");\r\n\t\t\t\t\twhile(!g1.carteInMano.isEmpty() || !g2.carteInMano.isEmpty()) {\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttracciatore = 1;\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Situazione: \"+g1.getNickName()+\": \"+g1.getPunteggio());\r\n\t\t\t\t\tSystem.out.println(g2.getNickName()+\": \"+g2.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g1.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g2.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tconta+=2;\r\n\t\t\t\tSystem.out.println(\"Premi una lettera per continuare: \"); risposta=tastiera.next();\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\tconta=0;\r\n\t\t\tfor(int i=0;i<perdenti.size();i++)\r\n\t\t\t\tpartecipantiMescolati.remove(perdenti.get(i));\r\n\t\t\tSystem.out.println(\"Restano i seguenti partecipanti: \");\r\n\t\t\tfor(int i=0;i<partecipantiMescolati.size();i++) {\r\n\t\t\t\tSystem.out.println(partecipantiMescolati.get(i).getNickName());\r\n\t\t\t\tpartecipantiMescolati.get(i).setPunteggio(0);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Il vincitore del torneo è: \"+partecipantiMescolati.get(0).getNickName());\r\n\t\t\t\t\r\n\t}", "public int[] choisir(int[] coord)\r\n {\r\n int[] res = new int[3]; //tableau a rendre\r\n int x = coord[0];\r\n int y = coord[1]; //récupération des coordonnées\r\n int[] voisinage= new int[4]; //tableau qui regardera les cases adjacentes à la case cherchée\r\n voisinage[0] = getValHaut(x,y);\r\n voisinage[1] = getValDroite(x,y);\r\n voisinage[2] = getValBas(x,y);\r\n voisinage[3] = getValGauche(x,y);\r\n System.out.println(\"je choisis la case \"+x+\" \"+y+\"\");\r\n for(int i = 0; i<voisinage.length; i++ ) //parcours des possibilités si on joue sans créer d'opportunités adverses\r\n {\r\n if (Vision[x][y][i+1] == 0) //si il n'y a pas de trait déja tracé\r\n {\r\n if (voisinage[i] != 2) //si la case adjacente n'a pas déja deux traits dessinés\r\n {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n //fin du si la case adjacente a déja 2 traits dessinés\r\n }\r\n //si il n'y a pas de trait déja tracé\r\n }\r\n //fin du for de parcours des possibilités de jouers sans créer d'opportunités adverses\r\n\r\n for(int i=0; i<voisinage.length ; i++ ) //Parcours des possibilités sans recherche d'opportunités\r\n {\r\n if (Vision[x][y][i+1] == 0) {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n }\r\n //fin du parcours de possibilité sans recherche\r\n return tabVide;\r\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 static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "@Override\n public Combinacion comprobarColores(Combinacion filaIntroducida) {\n Combinacion respuesta;\n\n\n ArrayList<Ficha> combinacionRespuesta = new ArrayList<>();\n ArrayList<Integer> fichasNegrasUtilizadas = new ArrayList<>();\n ArrayList<Integer> fichasTotalesUtilizadas = new ArrayList<>();\n boolean comprobado = false;\n Colores color = Colores.SC;\n\n // COMPROBAMOS LAS NEGRAS\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[i])) {\n combinacionRespuesta.add(new Ficha(Colores.NEGRO));\n fichasNegrasUtilizadas.add(i);\n }\n }\n\n fichasTotalesUtilizadas.addAll(fichasNegrasUtilizadas);\n // SEPARAMOS NEGRAS DE BLANCAS\n\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (!fichasNegrasUtilizadas.contains(i)) {\n for (int j = 0; j < filaIntroducida.getCodigo().length && !comprobado; j++) {\n if (!fichasTotalesUtilizadas.contains(j)) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[j])) {\n color = Colores.BLANCO;\n fichasTotalesUtilizadas.add(j);\n comprobado = true;\n } else {\n color = Colores.SC;\n }\n }\n }\n combinacionRespuesta.add(new Ficha(color));\n comprobado = false;\n }\n }\n\n combinacionRespuesta.sort(new Comparator<Ficha>() {\n @Override\n public int compare(Ficha o1, Ficha o2) {\n return o1.getColor().compareTo(o2.getColor());\n }\n });\n\n respuesta = new Combinacion(combinacionRespuesta.toArray(new Ficha[combinacionRespuesta.size()]));\n\n // MODO MEDIO Y FACIL\n\n return respuesta;\n }", "private List<PlanTrabajo> generarPlanesTrabajo( Date fecPrgn, \n\t\t\tList<Cuadrilla> cuadrillas,Map<Long, GrupoAtencion> mpGrupos, \n\t\t\tMap<Long, Long> asignaciones ){\n\t\t\n\t\t\tList<PlanTrabajo> planTrabajoList = new ArrayList<PlanTrabajo>();\n\t\t\tSet<Long> grupos = asignaciones.keySet();\t\n\t\t\tlong np = 1;\n\t\t\tfor (Long ngrupo : grupos) {\n\t\t\t\t Long ncuadrilla = asignaciones.get(ngrupo);\n\t\t\t\t GrupoAtencion grupoAtencion = mpGrupos.get(ngrupo);\n\t\t\t\t //GrupoAtencion grupoAtencion = asignar(cuadrilla, idx, mpGruposCached);\n\t\t\t\t PlanTrabajo planTrabajo = new PlanTrabajo(np);\n\t\t\t\t int nsp = 1;\n\t\t\t\t planTrabajo.setFechaProgramacion(new Timestamp(fecPrgn.getTime()));\n\t\t\t\t int i = cuadrillas.indexOf( new Cuadrilla(ncuadrilla));\n\t\t\t\t if(i!=-1){\n\t\t\t\t\t \n\t\t\t\t\t Cuadrilla cuadrilla = cuadrillas.get(i);\n\t\t\t\t\t planTrabajo.setCuadrilla(cuadrilla);\n\t\t\t\t\t planTrabajo.setGrupoAtencion(grupoAtencion);\n\t\t\t\t\t \n\t\t\t\t\t if(grupoAtencion!=null){\n\t\t\t\t\t\t for( GrupoAtencionDetalle d : grupoAtencion.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\t // añadiendo las solicitudes de servicio\t\n\t\t\t\t\t\t\t SolicitudServicio s = d.getSolicitudServicio();\n\t\t\t\t\t\t\t //System.out.println(\" #### añadiendo solicitud \"+s.getNumeroSolicitud());\n\t\t\t\t\t\t\t if(planTrabajo.getPlanTrabajoDetalles()==null){\n\t\t\t\t\t\t\t\t planTrabajo.setPlanTrabajoDetalles(new ArrayList<PlanTrabajoDetalle>());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t PlanTrabajoDetalle pd = new PlanTrabajoDetalle(np, nsp);\n\t\t\t\t\t\t\t pd.setSolicitudServicio(s);\n\t\t\t\t\t\t\t //planTrabajo.addPlanTrabajoDetalle( new PlanTrabajoDetalle(s));;\n\t\t\t\t\t\t\t planTrabajo.addPlanTrabajoDetalle(pd);\n\t\t\t\t\t\t\t nsp++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t planTrabajoList.add(planTrabajo);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t np++;\n\t\t\t}\n\t\t\t\n\t\treturn planTrabajoList;\n\t}", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public OptimismPessimismCalculator() {\n mostPositive = 0;\n mostPositiveDoc = null;\n mostNegative = 0;\n mostNegativeDoc = null;\n biggestDifference = 0;\n biggestDifferenceDoc = null;\n \n publisherOptimism = new HashMap<>();\n publisherPessimism = new HashMap<>();\n regionOptimism = new HashMap<>();\n regionPessimism = new HashMap<>();\n dayOptimism = new HashMap<>();\n dayPessimism = new HashMap<>();\n weekdayOptimism = new HashMap<>();\n weekdayPessimism = new HashMap<>();\n }", "public DatosIteracion mejorIteracionCapturados(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masCapturadas();\r\n\t}", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "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 }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public Tournee chercheSolution(int tpsLimite, ContraintesTournee contraintes, Map<String, Map<String, Chemin>> plusCourtsChemins){\n\t\t//HashMap avec l'id et le point pour pouvoir recuperer le point a partir de l'id\n\t\tHashMap<String, Intersection> intersections = new HashMap<String, Intersection>();\n\t\tIterator<PointEnlevement> itEnlev = (Iterator<PointEnlevement>)contraintes.getPointsEnlevement().iterator();\n\t\tIterator<PointLivraison> itLiv = (Iterator<PointLivraison>)contraintes.getPointsLivraison().iterator();\n\t\t\n\t\t//Remplissage HashMap des intersections \n\t\tintersections.put(contraintes.getDepot().getId(), contraintes.getDepot());\n\t\tint nbSommets = 1;\n\t\twhile(itEnlev.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itEnlev.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\twhile(itLiv.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itLiv.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\t\n\t\t//Initialisation de la HashMap vuDispo - contenant les attributs boolean vu et dispo\n\t\tHashMap<String, Paire> vuDispo = initVuDispo(contraintes, intersections);\n\t\t\n\t\tTournee tournee = new Tournee(contraintes);\n\t\t//Sequentiel et MinFirst\n//\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\t\n\t\t//MinFirst + 2-Opt\n\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\ttwoOpt(tpsLimite, System.currentTimeMillis(), tournee, plusCourtsChemins, intersections);\n\t\t\n\t\treturn tournee;\n\t}", "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 static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "public void ordenarRanking(){\n for(int i = 0; i < clasificacion.length; i++) {\n boolean flag = false;\n for(int j = 0; j < clasificacion.length-1; j++) {\n\n /*Si el elemento de la posicion j+1 es mayor que el anterior se intercambian\n los valores de esas posiciones*/\n if((clasificacion[j].getMediana())<(clasificacion[j+1].getMediana())) {\n Ranking k = new Ranking();\n k=clasificacion[j];\n clasificacion[j] = clasificacion[i];\n clasificacion[i] = k;\n flag=true; //Se pone a true para indicar que se ha hecho un cambio\n }//END_IF\n }//END_FOR\n\n if(!flag) break; //Si flag es igual a falso quiere decir que en la ultima iteracion\n //no hubo ningun intercambio y por lo tanto el metodo puede terminar\n //ya que el vector esta ordenado\n }//END_FOR\n\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public void fusion(Monceau autre) throws DifferentOrderTrees {\r\n // à compléter\r\n \tArrayList<Node> temp = new ArrayList<Node>();\r\n\t\tboolean fini = false;\r\n \t\r\n \tif (arbres.isEmpty())\r\n \t\tarbres = autre.arbres;\r\n \t\r\n \telse if (!arbres.isEmpty() || !autre.arbres.isEmpty()) {\r\n \t\t//remplir la arraylist (ou arbre temp)\r\n \t\tfor (int i = 0; i < arbres.size(); i++)\r\n \t\t\ttemp.add(arbres.get(i));\r\n \t\t\r\n \t\tfor (int i = 0; i < autre.arbres.size(); i++)\r\n \t\t\ttemp.add(autre.arbres.get(i));\r\n \t\t\r\n \t\t//trier la arraylist qui contient l'arbre temp\r\n \t\tCollections.sort(temp, new Comparator<Node>() {\r\n \t\t\t@Override\r\n \t\t\tpublic int compare(Node objet1, Node objet2) {\r\n \t\t\t\tInteger noeud1 = new Integer(objet1.ordre);\r\n \t\t\t\tInteger noeud2 = new Integer(objet2.ordre);\r\n \t\t\t\treturn noeud1.compareTo(noeud2);}\r\n \t\t});\r\n \t\t\r\n \t\twhile (!fini) { \t\t\t\r\n \t\t\tfini = true;\r\n \t\t\tfor (int j = 0; j < temp.size(); j++) {\r\n \t\t\t\tfor (int k = j+1; k < temp.size(); k++) {\r\n \t\t\t\t\tif (temp.get(j).ordre == temp.get(k).ordre)\r\n \t\t\t\t\t\tfini = false; //faut pas avoir le meme ordre\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tfor (int j = 0; j < temp.size()-1; j++) {\r\n \t\t\t\tif (temp.get(j).ordre == temp.get(j + 1).ordre) {\r\n \t\t\t\t\t//les elements doivent conserver leur ordre\r\n \t\t\t\t\ttemp.set(j, temp.get(j).fusion(temp.get(j+1)));\r\n \t\t\t\t\ttemp.remove(j+1);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tarbres = temp;\r\n \t}\r\n \t\r\n \treturn;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "private List<Estado> estadosHijos(Estado estado){\r\n EstadoMancala estadom=(EstadoMancala)estado;\r\n Jugador jugadorEstado=estadom.jugadores()[estadom.jugadoractual];\r\n Movimiento[] movimientos=estadom.movimientos(jugadorEstado);\r\n List<Estado> estados=new ArrayList<Estado>();\r\n int cantmovs=0;\r\n if(movimientos!=null)\r\n cantmovs=movimientos.length;\r\n for (int i=0; i<cantmovs;i++){\r\n estados.add(estadom.clone().siguiente(movimientos[i]));\r\n }\r\n return estados;\r\n }", "public void getGerarEscala(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<Voluntario> listaVoluntario = repository.buscarVoluntarioCor(cor);\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t\t//Date agora = new Date();\r\n\t\t\r\n\t\tlong tempoIncial = System.currentTimeMillis();\r\n\t\tif(cor!=null) {\t\r\n//\t\t\tFor de verificação para não repetição dos campos sorteados\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\t//População inicial\t\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\r\n\t\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\r\n\r\n\t\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\t\r\n\r\n\t\t\t\tlistPopulacaoI.add(listaVoluntario.get(conteudoSorteado));\r\n\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Gera os pais\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\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//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Cruzamento\r\n\t\t\tint tamanhoA = equipeA.size();\r\n\t\t\tint tamanhoB = equipeB.size();\r\n\t\t\tint metadeA = (int) tamanhoA/2;\r\n\t\t\tint metadeB = (int) tamanhoB/2;\r\n\t\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//grava dados na base\r\n\t\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\r\n\t\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Tempo Total %.3f ms%n: \"+(System.currentTimeMillis()-tempoIncial));\r\n\t\tSystem.out.println(listPopulacaoI);\r\n//\t\tlong tempoFinal = System.currentTimeMillis();\r\n//\t\tlong tempoExecucao = tempoFinal-tempoIncial;\r\n\r\n\t\t\r\n\t\t/*System.out.println(\"tempo inicial:\"+tempoIncial);\r\n\t\tSystem.out.println(\"tempo inicial:\"+tempoFinal);\r\n\t\tSystem.out.println(\"Tempo execução do Metodo de gera escala equipe: \"+(tempoFinal-tempoIncial)/1000d);*/\r\n\t}", "private void calculateFitness() {\n\t\tint day1=this.getNumberOfHours()*this.getNumberOfClasses();\n\t\tint day2=2*day1;\n\t\tint day3=3*day1;\n\t\tint day4=4*day1;\n\t\tint day5=5*day1;\n\t\tTeacher_lesson temp=null;\n\t\t//day 1//\n\t\tHashSet<Integer> closedSet=new HashSet<Integer>();\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<day1;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day1;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\t\n\t\t\n\t\t//day2//\n\t\tclosedSet.clear();;\n\t\t\n\t\tfor(int i=day1;i<day2;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day2;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day3//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day2;i<day3;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day3;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//day4//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day3;i<day4;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day4;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\t\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day5//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day4;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t\t\t\n\t\t}\n\t\t\t/*if(temp.get_td_hour()<0){this.fitness=this.fitness-100;}//adunato na ginei giati o ka8igitis exei parapanw wres apo oti mporei na kanei//\n\t\t\t\telse if (temp.get_td_hour()==0){this.fitness=this.fitness-2;}//meiwnoume giati o ka8igitis 8a epivarin8ei oles tou tis wres thn idia mera//\n\t\t\t\telse{++this.fitness;}//kalh prosegisi*/\n\t\t}\n\t\t//*********************END OF DAILY EVALUATION*****************************//\n\t\t\n\t\t//**********************START OF WEEKLY EVALUATION************************//\n\t\t\n\t\tclosedSet.clear();\n\t\t\n\t int \t_weeklyhours = 1;\n\t \n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tif(!closedSet.contains(this.genes[i])){\n\t\t\t\t\n\t\t\t\n\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\t\t++_weeklyhours; }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t/*if(_weeklyhours>temp.get_tw_hour()){\n\t\t\t\tthis.fitness=this.fitness-100 ; //adunato na kanei parapanw wres ma8hma//\n\t\t\t}else\n\t\t\t\t{++this.fitness;}*/\n\t\t\tif(_weeklyhours<temp.get_tw_hour()){++this.fitness;}\n\t\t\tclosedSet.add(this.genes[i]);}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//*************END OF WEEKLY EVALUATION**********//\n\t\n\t\t//**START OF LESSON EVALUATION***//\n\t\tArraylistLesson set=new ArraylistLesson();\n\t\tclass_lid templ=null;\n\t\tTeacher_lesson tempj=null;\n\t\tint lid=0;\n\t\tString _class;\n\t\tint _classhours=1;\n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tlid=temp.get_lid();\n\t\t\t_class=temp.get_class();\n\t\t\ttempl=new class_lid(lid,_class);\n\t\t\tif(!set.contains(templ)){\n\t\t\t\t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\t\ttempj=getdata(this.genes[j]);{\n\t\t\t\t\t\tif(tempj!=null){\n\t\t\t\t\t\t\tif(temp.get_tid()==tempj.get_tid()){\n\t\t\t\t\t\t\t\tif(temp.get_lid()==tempj.get_lid()&&temp.get_class().equalsIgnoreCase(tempj.get_class())){\n\t\t\t\t\t\t\t\t\t++_classhours;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tint hours;\n\t\t\t\thours=temp.get_lhours();\n\t\t\t\n\t\tif(_classhours==hours){\n\t\t\t++this.fitness;\n\t\t}\n\t\tset.add(templ);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "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 }", "private Karta kartaErabaki(ArrayList<ArrayList<Karta>> pMatrizea) \r\n\t{\r\n\t\tKarta karta = (Karta) new KartaNormala(ElementuMota.ELURRA,0,KoloreMota.BERDEA);\r\n\t\tfor(int i=0;i<pMatrizea.size();i++) \r\n\t\t{\r\n\t\t\tfor(int x=0;x<5;x++) \r\n\t\t\t{\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()!=pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()==pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = this.lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn karta;\r\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\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\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void enemigosCatacumba(){\n esq81 = new Esqueleto(1, 8, 400, 160, 30);\n esq82 = new Esqueleto(2, 8, 400, 160, 30);\n esq111 = new Esqueleto(1, 11, 800, 255, 50);\n esq112 = new Esqueleto(2, 11, 800, 255, 50);\n esq141 = new Esqueleto(1, 14, 1000, 265, 60);\n esq142 = new Esqueleto(2, 14, 1000, 265, 60);\n //\n zom81 = new Zombie(1, 8, 1000, 170, 40);\n zom82 = new Zombie(2, 8, 1000, 170, 40);\n zom111 = new Zombie(1, 11, 1300, 250, 50);\n zom112 = new Zombie(2, 11, 1300, 250, 50);\n zom141 = new Zombie(1, 14, 1700, 260, 60);\n zom142 = new Zombie(2, 14, 1700, 260, 60);\n //\n fana81 = new Fanatico(1, 8, 400, 190, 40);\n fana82 = new Fanatico(2, 8, 400, 190, 40);\n fana111 = new Fanatico(1, 11, 700, 250, 50);\n fana112 = new Fanatico(2, 11, 700, 250, 50);\n fana141 = new Fanatico(1, 14, 900, 260, 60);\n fana142 = new Fanatico(2, 14, 900, 260, 60);\n //\n mi81 = new Mimico(1, 8, 3, 1, 3000);\n mi111 = new Mimico(1, 11, 4, 1, 3000);\n mi141 = new Mimico(1, 14, 5, 1, 3200);\n }", "private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "public void effetDeCarte(int idEffet, Joueur joueurQuiJoueLaCarte, Plateau plateau) {\n switch (idEffet) {\n case 0:\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 1:\n joueurQuiJoueLaCarte.deck.piocher(2);\n break;\n case 2:\n joueurQuiJoueLaCarte.deck.piocher(3);\n break;\n case 3:\n joueurQuiJoueLaCarte.gagnerDegats(1);\n break;\n case 4:\n joueurQuiJoueLaCarte.gagnerDegats(2);\n break;\n case 5:\n joueurQuiJoueLaCarte.gagnerDegats(3);\n\n break;\n case 6:\n joueurQuiJoueLaCarte.gagnerDegats(4);\n break;\n case 7:\n joueurQuiJoueLaCarte.gagnerRunes(1);\n break;\n case 8:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n break;\n case 9:\n gagnerDesRunes(joueurQuiJoueLaCarte,3);\n break;\n case 11:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n break;\n case 12:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n break;\n case 14:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n joueurQuiJoueLaCarte.piocher(1);\n break;\n case 15:\n joueurQuiJoueLaCarte.tuerUneCarteAvecDeLattaqueGratuitement(plateau);\n System.out.println(\"DEfeat a monster that has 4 D or less without paying it cost\");\n break;\n case 16:\n System.out.println(\"DEfeat a monster that has 6 D or less without paying it cost\");\n break;\n case 17:\n //joueurQuiJoueLaCarte.deck.piocher(1);\n System.out.println(\" You may banish a card in the center row\");\n break;\n case 18:\n System.out.println(\"Discard a card, if you do, draw two cards\");\n break;\n case 19:\n System.out.println(\"Copy l'effet d'un Héros joué ce tour-ci\");\n break;\n case 20:\n System.out.println(\"Once per turn you may draw a card\");\n break;\n case 21:\n System.out.println(\"You may banish this Construct to take an additional turn after this one.\");\n break;\n case 22:\n System.out.println(\"Acquire a Hero without paying its cost. Place in on top of your deck.\");\n break;\n case 23:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n break;\n case 24:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n verifLifebound(joueurQuiJoueLaCarte);\n break;\n case 25:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 26:\n System.out.println(\"Once per turn, gain 1 runes, the first time you play a lifebound hero, each turn gain 1 recompense\");\n break;\n case 27:\n System.out.println(\"Once per turn , gain 1d\" +\n \"Once per turn, you may spend 4r to gain 3 recompense\");\n break;\n case 28:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n plusDeDeuxConstructeur(joueurQuiJoueLaCarte);\n System.out.println(\"Draw a card if you control 2 or moreConstrcut\");\n break;\n case 29:\n System.out.println(\"Gain 1d or 1r\");\n break;\n case 30:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Gain 2r You pay 1R less the next time you acquire a Construc this turn\");\n break;\n case 31:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, when you put a Mechana Construc into play (including this one) , draw a card\");\n break;\n case 32:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, gain 2d.You may spend it only to acquire Mechana Construct\");\n break;\n case 33:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\" Once per turn\");\n gagner1DParTourPourChaqueMechaConstruct(joueurQuiJoueLaCarte);\n\n break;\n case 34:\n System.out.println(\"You may treat all Construcs as Mechana Construcs\");\n break;\n case 35:\n System.out.println(\"Once per turn, when you acquire another Mechana Construc, you may put it directly into play\");\n break;\n case 36:\n System.out.println(\"Once per turn ,gain 1 r . you may spend it only to acquire Mechana Construc\");\n break;\n case 37:\n joueurQuiJoueLaCarte.deck.piocher(2);\n System.out.println(\"Banish a card in you hand\");\n break;\n case 38:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 39:\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 40:\n System.out.println(\"Once per turn, gain 3d\");\n break;\n case 41:\n System.out.println(\"Once per turn, gain 1d\");\n break;\n case 42:\n System.out.println(\"Once per turn gain 1 The first time you deafeat a monster in the center row each turn, gain 1 R\");\n break;\n case 43:\n System.out.println(\"Unbanishable You may acquire or defeat any car in the center row without paying its cost\");\n break;\n case 44:\n System.out.println(\"Each opponent must destryo a Construc he controls\");\n break;\n case 45:\n System.out.println(\"Banish a card un the center row and/or in you discard pile\");\n break;\n case 46:\n System.out.println(\"Banish a card un the center row\");\n break;\n case 47:\n System.out.println(\"If an opponent has more than one construct, that player must destroy all but one Construct he controls\");\n break;\n case 48:\n System.out.println(\"Take a card at random from each oppenent's hand and add that card to your hands\");\n break;\n }\n\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void preenchePosicoes(List<Par<Integer,Integer>> posicoes, \n\t\t\tEstadoAmbiente estado) {\n\t\tfor (Par<Integer,Integer> p : posicoes) {\n\t\t\tthis.quadricula[p.primeiro()][p.segundo()] = estado;\n\t\t}\n\t}", "private ArrayList<Estado> generar_sucesores(Estado actual) {\r\n\t\tArrayList<Estado> sucesores = new ArrayList<>();\r\n\t\tsucesores.add(actual.derecha().addHeuristica(estado_final)); //Añado los puntos hijos del estado actual\r\n\t\tsucesores.add(actual.izquierda().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.arriba().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.abajo().addHeuristica(estado_final));\r\n\r\n\t\tif (sucesores.contains(estado_inicial)) { //Limpio posible estado inicial\r\n\t\t\tsucesores.remove(estado_inicial);\r\n\t\t}\r\n\t\tArrayList<Estado> aux = new ArrayList<>(); // Para evitar error de concurrencia creo una lista auxiliar con los sucesores\r\n\t\tfor (int i = 0; i < sucesores.size(); i++) {\r\n\t\t\taux.add(sucesores.get(i));\r\n\t\t}\r\n\t\tfor (Estado p : aux) { //Limpio muros\r\n\t\t\tif (matriz[p.getX() - 1][p.getY() - 1] == muro) {\r\n\t\t\t\tsucesores.remove(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sucesores;\r\n\t}", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "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}", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public String execute() {\n\t\ttry {\n\t\t\tHashMap<Integer, RigaVenditeCommercianti> map = new HashMap<Integer, RigaVenditeCommercianti>();\n\t\t\tlistaTotali = new LinkedList<RigaVenditeCommercianti>();\n\t\t\t\n\t\t\tFatture fatture = new Fatture();\n\t\t\tfatture.setOrderByCliente();\n\t\t\tCollection colFatture = fatture.getFatture(dataDal, dataAl);\n\t\t\tIterator itr = colFatture.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tFattura fattura = (Fattura) itr.next();\t\n\t\t\t\tfattura.calcolaTotali();\n\t\t\t\tif (map.containsKey(fattura.getIdCliente().intValue())) {\n\t\t\t\t\t//Aggiungi totali alla riga attuale\n\t\t\t\t\tRigaVenditeCommercianti riga = map.get(fattura.getIdCliente().intValue());\n\t\t\t\t\triga.setTotaleFattura(riga.getTotaleFattura().add(fattura.getTotaleFattura()));\n\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tfattura.calcolaTotali();\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 4\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva1())) { //IVA AL 4\n\t\t\t\t\t\triga.setImponibile1(riga.getImponibile1().add(imponibili.get(riga.getIva1())[0]));\n\t\t\t\t\t\triga.setImposta1(riga.getImposta1().add(imponibili.get(riga.getIva1())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 10\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile2(riga.getImponibile2().add(imponibili.get(riga.getIva2())[0]));\n\t\t\t\t\t\triga.setImposta2(riga.getImposta2().add(imponibili.get(riga.getIva2())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 20\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile3(riga.getImponibile3().add(imponibili.get(riga.getIva3())[0]));\n\t\t\t\t\t\triga.setImposta3(riga.getImposta3().add(imponibili.get(riga.getIva3())[1]));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//Crea riga per cliente\n\t\t\t\t\tRigaVenditeCommercianti riga = new RigaVenditeCommercianti();\n\t\t\t\t\triga.setCliente(fattura.getCliente());\n\t\t\t\t\triga.setTotaleFattura(fattura.getTotaleFattura());\n\t\t\t\t\t\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\tIvas dao = new Ivas();\n\t\t\t\t\tdao.setOrderByDescrizione(DataAccessObject.ORDER_ASC);\n\t\t\t\t\tCollection aliquote = dao.getElements();\n\t\t\t\t\t\n\t\t\t\t\tint index = 1;\n\t\t\t\t\tfor(Object obj : aliquote)\n\t\t\t\t\t{\n\t\t\t\t\t\tIva iva = (Iva)obj;\n\t\t\t\t\t\tif(iva.getValore().floatValue() < 4) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tBigDecimal imponibile = new BigDecimal(0);\n\t\t\t\t\t\tBigDecimal imposta = new BigDecimal(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(imponibili.containsKey(iva.getValore()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timponibile = imponibili.get(iva.getValore())[0];\n\t\t\t\t\t\t\timposta = imponibili.get(iva.getValore())[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva1(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile1(imponibile);\n\t\t\t\t\t\t\triga.setImposta1(imposta);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva2(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile2(imponibile);\n\t\t\t\t\t\t\triga.setImposta2(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva3(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile3(imponibile);\n\t\t\t\t\t\t\triga.setImposta3(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 3) break;\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tmap.put(fattura.getIdCliente().intValue(), riga);\n\t\t\t\t\tlistaTotali.add(riga);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tstampaErrore(\"PrintVendite.execute()\", e);\n\t\t\treturn ERROR;\n\t\t}\n\t\treturn SUCCESS;\n\t}", "private int getResult() {\n ArrayList<Character> operanzi = new ArrayList<Character>();\n ArrayList<Character> operatori = new ArrayList<Character>();\n for(int i = 1; i <= n; i++){\n // System.out.println(i);\n if ((expr[i] == 'T' ) || (expr[i] == 'F'))\n operanzi.add(expr[i]);\n else \n operatori.add(expr[i]);\n }\n System.out.println(operanzi.get(0));\n int n1 = operanzi.size();\n System.out.println(n1);\n long [][] T = new long[n1][n1];\n long [][] F = new long[n1][n1];\n\n for (int i = 0; i < operanzi.size(); i++) {\n \n if (operanzi.get(i) == 'T') {\n T[i][i] = 1;\n F[i][i] = 0;\n } else if (operanzi.get(i) == 'F') {\n T[i][i] = 0;\n F[i][i] = 1;\n }\n }\n long aux=0;\n for (int l=1; l<n1; ++l) \n { \n for (int i=0, j=l; j<n1; ++i, ++j) \n { \n T[i][j] = F[i][j] = 0; \n for (int g=0; g<l; g++) \n { \n int k = i + g; \n long total_i_k = evaluate(T[i][k],F[i][k],'+'); \n long total_k_j = evaluate(T[k+1][j] , F[k+1][j],'+'); \n long total = evaluate(total_i_k,total_k_j,'*');\n if (operatori.get(k) == '&') \n { \n aux = evaluate(T[i][k],T[k+1][j],'*');\n T[i][j] = evaluate(T[i][j],aux,'+'); \n \n\n F[i][j] = evaluate( F[i][j],evaluate(total,aux,'-'),'+'); \n } \n if (operatori.get(k) == '|') \n { \n aux = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate(F[i][j],aux,'+'); \n \n T[i][j] =evaluate( T[i][j],evaluate(total, aux,'-'),'+'); \n } \n if (operatori.get(k) == '^') \n { \n aux = evaluate(F[i][k],T[k+1][j],'*');\n long aux1= evaluate(T[i][k],F[k+1][j],'*');\n T[i][j] = evaluate( T[i][j],evaluate( aux , aux1,'+'),'+'); \n aux = evaluate(T[i][k],T[k+1][j],'*');\n aux1 = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate( F[i][j],evaluate(aux,aux1,'+'),'+');\n } \n } \n } \n } \n return (int)T[0][n1-1]; \n }", "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 }", "private List<ObligacionCoactivoDTO> calcularCostasProcesales(List<ObligacionCoactivoDTO> obligaciones,\n BigDecimal valorAbsoluto, BigDecimal porcentaje) throws CirculemosNegocioException {\n // No aplica costas\n if (valorAbsoluto == null && porcentaje == null) {\n return obligaciones;\n } else if (valorAbsoluto != null) {\n // Aplica valor absoluto\n if (obligaciones.size() == 1) {\n obligaciones.get(0).setValorCostasProcesales(valorAbsoluto);\n return obligaciones;\n } else {\n BigDecimal porcentajeDeuda;\n BigDecimal totalDeuda = new BigDecimal(0);\n\n // Calculo de deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n totalDeuda = totalDeuda\n .add(obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()));\n\n }\n\n // Calculo de porcentaje y valor\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n porcentajeDeuda = ((obligacion.getValorCostasProcesales()\n .add(obligacion.getValorInteresMoratorios())).multiply(new BigDecimal(100)))\n .divide(totalDeuda);\n\n obligacion\n .setValorCostasProcesales(totalDeuda.multiply(porcentajeDeuda).divide(new BigDecimal(100)));\n\n }\n return obligaciones;\n\n }\n } else if (porcentaje != null) {\n // Aplica porcentaje de la deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n obligacion.setValorCostasProcesales(\n (obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()))\n .multiply(porcentaje).divide(new BigDecimal(100)).setScale(2,\n BigDecimal.ROUND_HALF_UP));\n\n }\n return obligaciones;\n } else {\n throw new CirculemosNegocioException(ErrorCoactivo.GenerarCoactivo.COAC_002005);\n }\n }", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "public static Resultado PCF(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n //*Definicion de variables las variables\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n \n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n double slotsDemanda = demanda.getNroFS();\n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n \n \n \n // double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n //FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n FcmtAux = ((saltos*slotsDemanda) + corte + desalineamiento)/capacidadLibre;\n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public static Resultado KSP_FF_Algorithm_MBBR(GrafoMatriz G, GrafoMatriz Gaux, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n /*Definicion de variables las variables*/\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n \n /*Probamos para cada camino, si exite espectro para ubicar la damanda*/\n int k=0;\n while(k<ksp.length && ksp[k]!=null && demandaColocada==0){\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n /*Calcular la ocupacion del espectro para cada camino k*/\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ||\n Gaux.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ){\n OE[i]=0;\n break;\n }\n }\n }\n /*Teniendo la ocupacion del espectro del camino k, buscamos un bloque continuo de FS\n * que satisfazca la demanda.\n */\n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n demandaColocada=1;\n break;\n }\n }\n }\n if(demandaColocada==1){\n break;\n }\n }\n k++;\n }\n \n if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }\n /*Bloque contiguoo encontrado, asignamos los indices del espectro a utilizar \n * y retornamos el resultado\n */\n Resultado r= new Resultado();\n r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);\n return r;\n }" ]
[ "0.6659077", "0.6290835", "0.62273735", "0.61889815", "0.59769803", "0.5968935", "0.59103996", "0.5896852", "0.5879993", "0.58483267", "0.57968515", "0.574093", "0.5701246", "0.5688302", "0.564915", "0.5641294", "0.56298786", "0.56267923", "0.5623532", "0.5619576", "0.5593624", "0.55916077", "0.5588625", "0.55830806", "0.557453", "0.5571601", "0.55687743", "0.5566994", "0.55655783", "0.5550565", "0.5546241", "0.55159426", "0.55027574", "0.55021155", "0.5493501", "0.548865", "0.5466397", "0.5460493", "0.5460261", "0.5456445", "0.5451198", "0.54412407", "0.5440667", "0.54325503", "0.54207826", "0.54179674", "0.54168737", "0.5416588", "0.5402674", "0.53988373", "0.5392815", "0.5390069", "0.53816295", "0.5371171", "0.53703547", "0.5362547", "0.5354948", "0.5354428", "0.53523725", "0.5351815", "0.5349358", "0.534028", "0.5336789", "0.53294593", "0.5324443", "0.5322742", "0.5320947", "0.5313928", "0.529563", "0.5293606", "0.5292493", "0.5279235", "0.5276801", "0.5273606", "0.5272331", "0.52674794", "0.5262569", "0.5260719", "0.5255163", "0.5250809", "0.52483845", "0.524259", "0.5236238", "0.5230499", "0.52254945", "0.5225043", "0.5224143", "0.52219313", "0.52191454", "0.5218492", "0.52074766", "0.51949996", "0.51944727", "0.5191369", "0.5189786", "0.518541", "0.5180373", "0.5175139", "0.5171705", "0.51698005" ]
0.6369091
1
iteracion mas optimizada de un array de datosIteracion
public DatosIteracion mejorIteracionOptimizada( ArrayList<DatosIteracion> datos) { DatosIteracion d = new DatosIteracion("auxiliar"); Lectura l = new Lectura(999999, 0, 0); d.getValoresLecturas().add(l); for (int i = 0; i < datos.size(); i++) { if ((d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() / (d.getValoresLecturas( d.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados() / (datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getTiempo() + 1))) { d = datos.get(i); } if ((d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() / (d.getValoresLecturas( d.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados() / (datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getTiempo() + 1))) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getTiempo() > datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getTiempo()) { d = datos.get(i); } } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public DatosIteracion mejorIteracionCapturados(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() < datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados()) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() == datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados()) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() == datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados()) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() == datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t\t.getnNodos() <= datos\r\n\t\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t\t.getnNodos()) {\r\n\r\n\t\t\t\t\t\td = datos.get(i);\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 d;\r\n\t}", "public EnemigoGenerico[] cargaBichos()\n {\n \n //Crear la bicheria (hardCoded)\n CoordCasilla[] origen={new CoordCasilla(1,1), new CoordCasilla(18,1), new CoordCasilla(14,8), new CoordCasilla(17,17), new CoordCasilla(13,5)};\n CoordCasilla[] destino={new CoordCasilla(6,18) , new CoordCasilla(1,1), new CoordCasilla(1,8), new CoordCasilla(18,1) , new CoordCasilla(13,18) };\n \n \n DefBicho pelota=this.atlasBicheria.get(\"Pelota Maligna\");\n EnemigoGenerico bichos[]=new EnemigoGenerico[origen.length];\n \n for(int x=0;x<origen.length;x++)\n {\n List<CoordCasilla> camino = this.getCamino(origen[x], destino[x]);\n Gdx.app.log(\"CAMINO:\", \"DESDE (\"+origen[x].x+\",\"+origen[x].y+\") HASTA ( \"+destino[x].x+\",\"+destino[x].y+\")\");\n for (CoordCasilla cc : camino)\n Gdx.app.log(\"CASILLA.\", String.format(\"(%2d ,%2d )\", cc.x, cc.y));\n \n \n bichos[x] = new EnemigoGenerico(pelota, this.mapaAnimaciones.get(pelota.archivoAnim), pelota.pv, pelota.tasaRegen, pelota.velocidad, camino, pelota.distanciaPercepcion, pelota.ataques);\n }\n \n return bichos;\n }", "public Object[][]getDatos()\n {\n int registros=0;\n //obtener la cantidad de registros que hay en la tabla pacientes\n try\n {\n PreparedStatement pstm=(PreparedStatement)\n con.getConnection().prepareStatement(\"SELECT count(1) as total FROM paciente\");//cuenta el total de registros de la tabla pacientes\n ResultSet res=pstm.executeQuery();\n res.next();\n registros = res.getInt(\"total\");\n res.close();\n }\n catch(SQLException e)\n {\n System.out.println(e); \n }\n \n Object[][] data=new String [registros][9];\n \n //realizamos la consulta sql y llenamos los datos del Object\n \n try\n {\n PreparedStatement pstm=(PreparedStatement)\n con.getConnection().prepareStatement(\"SELECT * FROM paciente ORDER BY IdPaciente\");\n ResultSet res=pstm.executeQuery();\n \n int i=0;\n \n while (res.next())\n {\n String estIdPaciente = res.getString(\"IdPaciente\");\n String estDNI = res.getString(\"DNI\");\n String estNombres = res.getString(\"nombres\");\n String estApellidos = res.getString(\"apellidos\");\n String estDireccion = res.getString(\"direccion\");\n String estUbig = res.getString(\"ubigeo\");\n \n String estTelefono1 = res.getString(\"telefono1\");\n String estTelefono2 = res.getString(\"telefono2\");\n String estFechaNac = res.getString(\"edad\"); \n \n data [i][0]=estIdPaciente;\n data [i][1]=estDNI;\n data [i][2]=estNombres;\n data [i][3]=estApellidos;\n data [i][4]=estDireccion;\n data [i][5]=estUbig;\n \n data [i][6]=estTelefono1;\n data [i][7]=estTelefono2;\n data [i][8]=estFechaNac;\n \n i++;//retorna el ciclo hasta finalizar\n \n }\n \n res.close();\n }\n catch(SQLException e)\n {\n System.out.println(e);\n }\n return data;\n }", "public DatosIteracion mejorIteracionCapturados() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionCapturados(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionCapturados(array);\r\n\t}", "public static String[][] leerPrestados() {\n int cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM prestado\");\n while (result.next()) {\n cont++;\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //matriz para guardar los registros\n String[][] reporte = new String[cont][11];\n cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM prestado\");\n while (result.next()) {\n //leolos registros y los guardo cada uno en un renglon de la matriz\n System.out.println(\"ResultSet: \" + result.getString(1));\n \n reporte[cont][0] = result.getString(1);\n reporte[cont][1] = result.getString(2);\n reporte[cont][2] = result.getString(3);\n reporte[cont][3] = result.getString(4);\n reporte[cont][4] = result.getString(5);\n reporte[cont][5] = result.getString(6);\n reporte[cont][6] = result.getString(7);\n reporte[cont][7] = result.getString(8);\n reporte[cont][8] = result.getString(9);\n reporte[cont][9] = result.getString(10);\n reporte[cont][10] = result.getString(11);\n cont++;\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //regreso reporte completo\n return reporte;\n }", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public static DataSetIterator loadData1() throws IOException, InterruptedException{\t\t\n\t\ttry {\n\t\t\tLOG.info(\"Leyendo Imagnes...\");\n\t\t\tRecordReader imageReader = new ImageRecordReader(Utileria.WIDTH, Utileria.HEIGHT, Utileria.N_CANALES, false);\n\t\t\timageReader.initialize(new FileSplit(new File(Utileria.DIR_IMGS_ENTR)));\n\t\t\tLOG.info(\"Leyendo Imagnes <ok>\");\n\t\t\tLOG.info(\"Leyendo Etiquetas...\");\n\t\t\tRecordReader labelsReader = new CSVRecordReader();\n\t\t\tlabelsReader.initialize(new FileSplit(new File(Utileria.DIR_LABELS)));\n\t\t\tLOG.info(\"Leyendo Etiquetas <ok>\");\n\n\t\t\tRecordReader recordReader = new ComposableRecordReader(imageReader, labelsReader);\n\t\t\t\n\t\t\tDataSetIterator dataSetIterator = new RecordReaderDataSetIterator(recordReader, new WritableConverter() {\n\t\t\t\t@Override\n\t\t\t\tpublic Writable convert(Writable writable) throws WritableConverterException {\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif (writable instanceof Text) {\n\t\t\t\t\t\t\tString label = writable.toString().replaceAll(\"\\u0000\", \"\");\n\t\t\t\t\t\t\tint index = Utileria.ETIQUETAS.indexOf(label);\n\t\t\t\t\t\t\treturn new IntWritable(index);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthrow new InstanceNotFoundException(\"ERROR: No es una instancia de Text. [dataSetIterator]\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}catch(InstanceNotFoundException infe){\n\t\t\t\t\t\tLOG.error(\"Tratando de convertir algo que no es texto: \"+infe.getMessage());\n\t\t\t\t\t\tinfe.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tLOG.error(\"Error inesperado: \"+e.getMessage());\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\treturn writable;\n\t\t\t\t}\n\t\t\t}, Utileria.TAM_LOTE, Utileria.HEIGHT*Utileria.WIDTH*Utileria.N_CANALES, 10);\n\t\t\t\n\t\t\tif(!dataSetIterator.hasNext())\n\t\t\t\tthrow(new InterruptedException(\"Error: dataSet vacio\"));\n\n\t\t\t// Se sobreescribe convert para sustituir la etiqueta de la imagen por su \n\t\t\t//indice en la lista de etiquetas: frog -> 6\n\t\t\treturn dataSetIterator;\n\t\t\t\n\t\t} catch (IOException ioe) {\n\t\t\tLOG.error(\"Error al cargar los datos de entrenamiento: \"+ioe.getMessage());\n\t\t\tthrow ioe;\n\t\t} catch (InterruptedException ie) {\n\t\t\tLOG.error(\"Error interno al cargar con multihilos los datos: \"+ie.getMessage());\n\t\t\tthrow ie;\n\t\t}\n\t}", "@Parameters\n // Método public static que devuelve un elemento iterable de array de objetos\n public static Iterable<Object[]> getData() {\n return Arrays.asList(new Object[][] {\n // Indicamos todas las pruebas {a, b, esperado}\n { 3, 1, 4 }, { 2, 3, 5 }, { 3, 3, 6 } });\n }", "@Test\n public void testAnalisarDados() throws Exception {\n System.out.println(\"analisarDados\");\n int[][] dadosFicheiro = null;\n int linhas = 0;\n Integer[] expResult = null;\n String time = \"\";\n String tipoOrdenacao = \"\";\n Integer[] resultArray = null;\n \n int[] result = ProjetoV1.analisarDados(dadosFicheiro, linhas, time, tipoOrdenacao);\n if(result != null){\n resultArray= ArrayUtils.converterParaArrayInteger(result); \n }\n \n assertArrayEquals(expResult, resultArray);\n\n }", "public static String[][] leerPedidos() {\n int cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM pedido\");\n while (result.next()) {\n cont++;\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //matriz para guardar los registros\n String[][] reporte = new String[cont][11];\n cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM pedido\");\n while (result.next()) {\n //leo los registros y los guardo cada uno en un renglon de la matriz \n reporte[cont][0] = result.getString(1);\n reporte[cont][1] = result.getString(2);\n reporte[cont][2] = result.getString(3);\n reporte[cont][3] = result.getString(4);\n reporte[cont][4] = result.getString(5);\n reporte[cont][5] = result.getString(6);\n reporte[cont][6] = result.getString(7);\n reporte[cont][7] = result.getString(8);\n reporte[cont][8] = result.getString(9);\n reporte[cont][9] = result.getString(10);\n reporte[cont][10] = result.getString(11);\n cont++;\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //regreso reporte completo\n return reporte;\n }", "private void limpiarDatos() {\n\t\t\n\t}", "Iterator<TabularData> dataIterator();", "public String[][] medianaDeTres(String[][] arr, int primeiro, int ultimo, int requiredData) {\r\n\t\tif (requiredData != 4) {\r\n\t\t\tif (primeiro < ultimo) {\r\n\r\n\t\t\t\tint meio = ((primeiro + ultimo) / 2);\r\n\t\t\t\tint a = Integer.parseInt(arr[primeiro][requiredData]);\r\n\t\t\t\tint b = Integer.parseInt(arr[meio][requiredData]);\r\n\t\t\t\tint c = Integer.parseInt(arr[ultimo][requiredData]);\r\n\t\t\t\tint medianaIndice;\r\n\r\n\t\t\t\tif (a < b) {\r\n\t\t\t\t\tif (b < c) {\r\n\t\t\t\t\t\t// a < b && b < c\r\n\t\t\t\t\t\tmedianaIndice = meio;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (a < c) {\r\n\t\t\t\t\t\t\t// a < c && c <= b\r\n\t\t\t\t\t\t\tmedianaIndice = ultimo;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// c <= a && a < b\r\n\t\t\t\t\t\t\tmedianaIndice = primeiro;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (c < b) {\r\n\t\t\t\t\t\t// c < b && b <= a\r\n\t\t\t\t\t\tmedianaIndice = meio;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (c < a) {\r\n\t\t\t\t\t\t\t// b <= c && c < a\r\n\t\t\t\t\t\t\tmedianaIndice = ultimo;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// b <= a && a <= c\r\n\t\t\t\t\t\t\tmedianaIndice = primeiro;\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\tswap(arr, medianaIndice, ultimo);\r\n\r\n\t\t\t\tint pivo = Integer.parseInt(arr[ultimo][requiredData]);\r\n\r\n\t\t\t\tint i = (primeiro - 1);\r\n\t\t\t\tfor (int j = primeiro; j <= ultimo - 1; j++) {\r\n\r\n\t\t\t\t\tif (Integer.parseInt(arr[j][requiredData]) < pivo) {\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\tString[] aux = arr[i];\r\n\t\t\t\t\t\tarr[i] = arr[j];\r\n\t\t\t\t\t\tarr[j] = aux;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString[] aux = arr[i + 1];\r\n\t\t\t\tarr[i + 1] = arr[ultimo];\r\n\t\t\t\tarr[ultimo] = aux;\r\n\t\t\t\tint piAux = i + 1;\r\n\r\n\t\t\t\tmedianaDeTres(arr, primeiro, piAux - 1, requiredData);\r\n\t\t\t\tmedianaDeTres(arr, piAux + 1, ultimo, requiredData);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (primeiro < ultimo) {\r\n\t\t\t\tCollator collator = Collator.getInstance();\r\n\t\t\t\tcollator.setStrength(Collator.NO_DECOMPOSITION);\r\n\t\t\t\tint meio = ((primeiro + ultimo) / 2);\r\n\t\t\t\tString a = (arr[primeiro][requiredData]);\r\n\t\t\t\tString b = (arr[meio][requiredData]);\r\n\t\t\t\tString c = (arr[ultimo][requiredData]);\r\n\t\t\t\tint medianaIndice;\r\n\r\n\t\t\t\tif (collator.compare(b, a) > 0) {\r\n\t\t\t\t\tif (collator.compare(c, b) > 0) {\r\n\t\t\t\t\t\t// a < b && b < c\r\n\t\t\t\t\t\tmedianaIndice = meio;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (collator.compare(c, a) > 0) {\r\n\t\t\t\t\t\t\t// a < c && c <= b\r\n\t\t\t\t\t\t\tmedianaIndice = ultimo;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// c <= a && a < b\r\n\t\t\t\t\t\t\tmedianaIndice = primeiro;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (collator.compare(b, c) > 0) {\r\n\t\t\t\t\t\t// c < b && b <= a\r\n\t\t\t\t\t\tmedianaIndice = meio;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (collator.compare(a, c) > 0) {\r\n\t\t\t\t\t\t\t// b <= c && c < a\r\n\t\t\t\t\t\t\tmedianaIndice = ultimo;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// b <= a && a <= c\r\n\t\t\t\t\t\t\tmedianaIndice = primeiro;\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\tswap(arr, medianaIndice, ultimo);\r\n\r\n\t\t\t\tString pivo = (arr[ultimo][requiredData]);\r\n\r\n\t\t\t\tint i = (primeiro - 1);\r\n\t\t\t\tfor (int j = primeiro; j <= ultimo - 1; j++) {\r\n\r\n\t\t\t\t\tif (collator.compare(pivo, arr[j][requiredData]) > 0) {\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\tString[] aux = arr[i];\r\n\t\t\t\t\t\tarr[i] = arr[j];\r\n\t\t\t\t\t\tarr[j] = aux;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString[] aux = arr[i + 1];\r\n\t\t\t\tarr[i + 1] = arr[ultimo];\r\n\t\t\t\tarr[ultimo] = aux;\r\n\t\t\t\tint piAux = i + 1;\r\n\r\n\t\t\t\tmedianaDeTres(arr, primeiro, piAux - 1, requiredData);\r\n\t\t\t\tmedianaDeTres(arr, piAux + 1, ultimo, requiredData);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "@Override\n public Iterator<Piedra> iterator() {\n return piedras.iterator();\n \n //crear un iterator propio\n// return new Iterator<Piedra>(){\n// int index=0;\n// @Override\n// public boolean hasNext() {\n// return piedras.size()>index;\n// }\n//\n// @Override\n// public Piedra next() {\n// return piedras.get(index++);\n// }\n// \n// };\n }", "public void resolver() {\r\n\t\tfor(int i = 0; i<casillas.length; i++) {\r\n\t\t\tfor(int j = 0; j<casillas[0].length; j ++) {\r\n\t\t\t\tif(casillas[i][j].darSeleccionada() == false) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tcasillas[i][j].modificarValor(cantidadMinasAlrededor(i, j));\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static double[] allarga(double[] a)\r\n\t{\r\n\t\t// in alternativa a copyOf:\r\n\t\t\t\t\t/*\r\n\t\t\t\t\tdouble[] nuovoStorico = new double[storico.length+1];\r\n\t\t\t\t\tfor (int k = 0; k < storico.length; k++) nuovoStorico[k] = storico[k];\r\n\t\t\t\t\tnuovoStorico[storico.length-1] = energia;\r\n\t\t\t\t\tstorico = nuovoStorico;\r\n\t\t\t\t\t */\r\n\t\t\r\n\t\treturn Arrays.copyOf(a, a.length+1);\r\n\t}", "public static int[]reparacion(int[] hijo,int ttablero){\n int []hijor=new int[ttablero];\n int falta;\n int cont=0;\n int aux;\n int repite;\n ArrayList<Integer> repetidos = new ArrayList<>();\n ArrayList<Integer> faltantes = new ArrayList<>();\n for(int i=0;i<=ttablero;i++){\n aux=hijo[i];\n for(int j=0;j<=ttablero;j++){\n if(aux==hijo[j]){\n cont=cont+1;\n // System.out.println(\"contador \"+cont+\" se repite el hijo \" +hijo[j]);\n }\n if (cont>=2) {\n repite=hijo[j];\n repetidos.add(repite);\n // System.out.println(\"se repite el numero \"+repite );\n cont=0; \n } \n \n }\n cont=0; \n }\n \n //limpiar de repetidos el array repetidos\n for (int i = 0; i<repetidos.size(); i++) {\n int auxi=repetidos.get(i);\n //System.out.println(\"aux \"+ auxi );\n for (int j = i+1;j<repetidos.size() ; j++) {\n if (auxi==repetidos.get(j)) {\n //System.out.println(\"repetidos \"+ repetidos.get(i) );\n repetidos.remove(j);\n \n }\n \n }\n \n }\n \n for (int i = 0; i <repetidos.size(); i++) {\n // System.out.println(\"repetidos finalmente \"+ repetidos.get(i) );\n }\n int a=0;\n for (int i = 0; i <=ttablero; i++) {\n int auxx=i;\n for (int j = 0; j<=ttablero; j++) {\n \n }\n }\n int [] auscio=new int [ttablero];\n for (int i = 0; i <ttablero; i++) {\n auscio[i]=0;\n // System.out.println(\"auscio \"+auscio[i]);\n }\n \n for (int i = 0; i <ttablero; i++) {\n // int amp=i;\n for (int j = 0; j<ttablero; j++) {\n if (i==hijo[j]) {\n auscio[i]=1;\n }\n }\n }\n \n for (int i = 0; i <ttablero; i++) {\n // System.out.print(\"\"+auscio[i]);\n }\n for (int i = 0; i <ttablero; i++) {\n if (auscio[i]==0) {\n // System.out.println(\"falta el numero \"+(i));\n faltantes.add(i);\n }\n }\n \n return hijor;\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 }", "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 }", "private void MontarTabela(String where) {\n \n int linha = 0;\n int coluna = 0;\n \n String offset = String.valueOf(getPaginacao());\n \n while(linha < 10){\n while(coluna < 7){\n tbConFin.getModel().setValueAt(\"\", linha, coluna);\n coluna++;\n }\n linha++;\n coluna = 0;\n }\n \n linha = 0;\n \n String rd_id\n ,rd_codico\n ,rd_nome\n ,rd_receita_despesa\n ,rd_grupo\n ,rd_fixa\n ,rd_ativo;\n \n \n \n try{\n ResultSet rsConFin = cc.stm.executeQuery(\"select * from v_receitadespesa \"+where+\" order by rd_codico limit 10 offset \"+offset);\n \n while ( rsConFin.next() ) {\n rd_id = rsConFin.getString(\"RD_ID\");\n rd_codico = rsConFin.getString(\"rd_codico\");\n rd_nome = rsConFin.getString(\"rd_nome\");\n rd_receita_despesa = getRecDesp(rsConFin.getString(\"rd_receita_despesa\"));\n rd_grupo = getSimNao(rsConFin.getString(\"rd_grupo\"));\n rd_fixa = getSimNao(rsConFin.getString(\"rd_fixa\"));\n rd_ativo = getSimNao(rsConFin.getString(\"rd_ativo\"));\n \n tbConFin.getModel().setValueAt(rd_id, linha, 0);\n tbConFin.getModel().setValueAt(rd_codico, linha, 1);\n tbConFin.getModel().setValueAt(rd_nome, linha, 2);\n tbConFin.getModel().setValueAt(rd_receita_despesa, linha, 3);\n tbConFin.getModel().setValueAt(rd_grupo, linha, 4);\n tbConFin.getModel().setValueAt(rd_fixa, linha, 5);\n tbConFin.getModel().setValueAt(rd_ativo, linha, 6);\n \n linha++;\n }\n \n \n if(linha <= 10){\n setMensagem(\"A Busca retornou \"+linha+\" registros!\");\n }\n \n if(linha < 10){\n setFimConsulta(true);\n }else{\n setFimConsulta(false);\n }\n \n }catch(SQLException e){\n JOptionPane.showMessageDialog(this, \"Erro ao Carregar informações de contas financeiras!\\n\"+e.getMessage());\n }\n \n }", "public void OrdenarIndividuos(int izq, int der) {\n Individuo pivote = (Individuo) individuos.get(izq); // tomamos primer elemento como pivote\r\n int i = izq; // i realiza la búsqueda de izquierda a derecha\r\n int j = der; // j realiza la búsqueda de derecha a izquierda\r\n Individuo ind;\r\n int aux;\r\n\r\n while (i < j) { // mientras no se crucen las búsquedas\r\n while (individuos.get(i).getEvaluacion() <= pivote.getEvaluacion() && i < j) {\r\n i++; // busca elemento mayor que pivote\r\n }\r\n while (individuos.get(j).getEvaluacion() > pivote.getEvaluacion()) {\r\n j--; // busca elemento menor que pivote\r\n }\r\n if (i < j) {\r\n ind = (Individuo) individuos.get(i); // si no se han cruzado \r\n //aux= A[i]; // los intercambia\r\n individuos.set(i, individuos.get(j));\r\n //A[i]=A[j];\r\n individuos.set(j, ind);\r\n //A[j]=aux;\r\n }\r\n }\r\n individuos.set(izq, individuos.get(j));\r\n //A[izq]=A[j]; // se coloca el pivote en su lugar de forma que tendremos\r\n individuos.set(j, pivote);\r\n //A[j]=pivote; // los menores a su izquierda y los mayores a su derecha\r\n if (izq < j - 1) {\r\n OrdenarIndividuos(izq, j - 1); // ordenamos subarray izquierdo\r\n }\r\n if (j + 1 < der) {\r\n OrdenarIndividuos(j + 1, der); // ordenamos subarray derecho\r\n } \r\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 cargaDatosInicialesSoloParaAdicionDeCuenta() throws Exception {\n GestionContableWrapper gestionContableWrapper = parParametricasService.factoryGestionContable();\n gestionContableWrapper.getNormaContable3();\n parAjustesList = parParametricasService.listaTiposDeAjuste(obtieneEnumTipoAjuste(gestionContableWrapper.getNormaContable3()));\n //Obtien Ajuste Fin\n //Activa formulario para automatico modifica \n if (selectedEntidad.getNivel() >= 3) {\n numeroEspaciadorAdicionar = 260;\n }\n\n if (selectedEntidad.getNivel() == 3) {\n swParAutomatico = false;\n numeroEspaciadorAdicionar = 230;\n }\n if (selectedEntidad.getNivel() == 2) {\n swParAutomatico = true;\n swActivaBoton = true;\n numeroEspaciadorAdicionar = 200;\n }\n if (selectedEntidad.getNivel() == 1) {\n swParAutomatico = true;\n numeroEspaciadorAdicionar = 130;\n cntParametroAutomaticoDeNivel2 = cntParametroAutomaticoService.obtieneObjetoDeParametroAutomatico(selectedEntidad);\n }\n\n mascaraNuevoOpcion = \"N\";\n cntEntidad = (CntEntidad) getCntEntidadesService().find(CntEntidad.class, selectedEntidad.getIdEntidad());\n mascaraNivel = getCntEntidadesService().generaCodigoNivelesSubAndPadre(selectedEntidad, \"N\");\n mascaraSubNivel = getCntEntidadesService().generaCodigoNivelesSubAndPadre(selectedEntidad, \"S\");\n longitudNivel = getCntEntidadesService().controlaLongitudNumero(selectedEntidad, \"N\");\n longitudSubNivel = getCntEntidadesService().controlaLongitudNumero(selectedEntidad, \"S\");\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 setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }", "public void tempoDeDescoberta(){\r\n \tfor(int i=0; i<d.length; i++){\r\n \t\tSystem.out.println(\"d[\"+i+\"] :: \"+d[i]);\r\n \t}\r\n }", "public ListaConPI<Adyacente> adyacentesDe(int i) { \n return elArray[i]; \n }", "@Parameters\n public static Iterable<Object[]> getData() {\n List<Object[]> obj = new ArrayList<>();\n obj.add(new Object[] {3, 12});\n obj.add(new Object[] {2, 8});\n obj.add(new Object[] {1, 4});\n \n return obj;\n }", "public void cargarDatos() {\n \n if(drogasIncautadoList==null){\n return;\n }\n \n \n \n List<Droga> datos = drogasIncautadoList;\n\n Object[][] matriz = new Object[datos.size()][4];\n \n for (int i = 0; i < datos.size(); i++) {\n \n \n //System.out.println(s[0]);\n \n matriz[i][0] = datos.get(i).getTipoDroga();\n matriz[i][1] = datos.get(i).getKgDroga();\n matriz[i][2] = datos.get(i).getQuetesDroga();\n matriz[i][3] = datos.get(i).getDescripcion();\n \n }\n Object[][] data = matriz;\n String[] cabecera = {\"Tipo Droga\",\"KG\", \"Quetes\", \"Descripción\"};\n dtm = new DefaultTableModel(data, cabecera);\n tableDatos.setModel(dtm);\n }", "public datosTaller() {\n this.cedulaCliente = new int[100]; //Atributo de la clase\n this.nombreCliente = new String[100]; //Atributo de la clase\n this.compraRealizada = new String[100]; //Atributo de la clase\n this.valorCompra = new float[100]; //Atributo de la clase\n this.posicionActual = 0; //Inicializacion de la posicion en la que se almacenan datos\n }", "private void fillCalimiteiten()\n\t{\n\n\t\t_Calimiteiten[0] = new Calimiteit(new Brand(false), 80, 108, new actBlussen(true));\n\t\t_Calimiteiten[1] = new Calimiteit(new Brand(false), 557, 284, new actBlussen(true));\n\t\t_Calimiteiten[2] = new Calimiteit(new Brand(false), 557, 284, new actBlussen(true));\n\t\t_Calimiteiten[3] = new Calimiteit(new Brand(false), 557, 284, new actBlussen(true));\n\t\t_Calimiteiten[4] = new Calimiteit(new Brand(false), 415, 86, new actBlussen(true));\n\t\t_Calimiteiten[5] = new Calimiteit(new Evacuatie(false), 201, 590, new actZorg(true));\n\t\t_Calimiteiten[6] = new Calimiteit(new Evacuatie(false), 47, 669, new actZorg(true));\n\t\t_Calimiteiten[7] = new Calimiteit(new Evacuatie(false), 128, 666, new actZorg(true));\n\t\t_Calimiteiten[8] = new Calimiteit(new Evacuatie(false), 145, 601, new actZorg(true));\n\t\t_Calimiteiten[9] = new Calimiteit(new Evacuatie(false), 507, 540, new actZorg(true));\n\t\t_Calimiteiten[10] = new Calimiteit(new Autoongeluk(false), 280, 140, new actEhbo(true));\n\t\t_Calimiteiten[11] = new Calimiteit(new Autoongeluk(false), 395, 375, new actEhbo(true));\n\t\t_Calimiteiten[12] = new Calimiteit(new Autoongeluk(false), 305, 615, new actEhbo(true));\n\t\t_Calimiteiten[13] = new Calimiteit(new Elek_Brand(false), 275, 185, new actElectraBrand(true));\n\t\t_Calimiteiten[14] = new Calimiteit(new Elek_Brand(false), 460, 390, new actElectraBrand(true));\n\t\t_Calimiteiten[15] = new Calimiteit(new Elek_Brand(false), 155, 530, new actElectraBrand(true));\n\t\t_Calimiteiten[16] = new Calimiteit(new Overstroming(false), 240, 465, new actWaterpomp(true));\n\t\t_Calimiteiten[17] = new Calimiteit(new Overstroming(false), 425, 575, new actWaterpomp(true));\n\t\t_Calimiteiten[18] = new Calimiteit(new Overstroming(false), 415, 415, new actWaterpomp(true));\n\t\t_Calimiteiten[19] = new Calimiteit(new Rellen(false), 300, 115, new actStuurME(true));\n\t\t_Calimiteiten[20] = new Calimiteit(new Rellen(false), 265, 420, new actStuurME(true));\n\t\t_Calimiteiten[21] = new Calimiteit(new Rellen(false), 420, 635, new actStuurME(true));\n\t\t_Calimiteiten[22] = new Calimiteit(new Overval(false), 300, 350, new actArrest(true));\n\t\t_Calimiteiten[23] = new Calimiteit(new Overval(false), 450, 230, new actArrest(true));\n\t\t_Calimiteiten[24] = new Calimiteit(new Overval(false), 210, 200, new actArrest(true));\n\n\t\t/*\n\t\t * Hier zorgt hij ervoor dat er in de Actor class ook de gemaakte\n\t\t * calimiteit mee geeft.\n\t\t */\n\t\tfor (Calimiteit calimiteit : _Calimiteiten) {\n\t\t\tString actorStr = calimiteit.getActor().toString();\n\t\t\tactorStr = actorStr.substring(0, actorStr.indexOf(\"@\"));\n\n\t\t\tif (actorStr.equals(\"Brand\")) {\n\t\t\t\tBrand actor = (Brand) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Evacuatie\")) {\n\t\t\t\tEvacuatie actor = (Evacuatie) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Autoongeluk\")) {\n\t\t\t\tAutoongeluk actor = (Autoongeluk) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Elek_Brand\")) {\n\t\t\t\tElek_Brand actor = (Elek_Brand) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Overstroming\")) {\n\t\t\t\tOverstroming actor = (Overstroming) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Rellen\")) {\n\t\t\t\tRellen actor = (Rellen) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t\telse if (actorStr.equals(\"Overval\")) {\n\t\t\t\tOverval actor = (Overval) calimiteit.getActor();\n\t\t\t\tactor.setCalimiteit(calimiteit);\n\t\t\t}\n\t\t}\n\t}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "private void fillObservationsDataFast() {\n\n Integer studyId = this.workbookStudy.getStudy().getStudyid();\n// int variateCount = this.workbookStudy.getVariates().size();\n \n List<String> factorsReturn = getFactoresReturnList();\n \n fillFactorLabelDataOptimized(studyId, 0, getFactoresKeyList(), factorsReturn, factorTrial.getFname());\n \n// List<Measurement> measurementList = workbookStudy.getMeasurements();\n \n// log.info(\"Getting Data Trial ...\");\n// List<Object> dataList;\n// if(! workbookStudy.getVariates().isEmpty()){\n// dataList = this.servicioApp.getObservationsDataMeasurementEffect(studyId, effectid);\n// }else{\n// dataList = new ArrayList<Object>();\n// }\n// log.info(\"Getting Data Trial Done...\");\n// \n// \n// log.info(\"Getting List of Obsunit ...\");\n// List<Obsunit> obsunits = this.servicioApp.getObsunitListByEffectid(studyId, effectid);\n// log.info(\"Getting List of Obsunit...\");\n// int rowIndex = 0;\n// for (Obsunit obsUnit : obsunits) {\n// Measurement measurement = measurementList.get(rowIndex);\n// measurement.initMeasurementData(variateCount);\n//\n// assignMeasurementData(measurement, obsUnit, dataList);\n// rowIndex++;\n// }\n }", "public List<conteoTab> filtro() throws Exception {\n iConteo iC = new iConteo(path, this);\n try {\n fecha = sp.getString(\"date\", \"\");\n iC.nombre = fecha;\n\n List<conteoTab> cl = iC.all();\n\n for (conteoTab c : cl) {\n boolean val = true;\n for (int i = 0; i <= clc.size(); i++) {\n if (c.getIdBloque() == sp.getInt(\"bloque\", 0) || c.getIdVariedad() == sp.getInt(\"idvariedad\", 0)) {\n val = true;\n } else {\n val = false;\n }\n }\n if (val) {\n clc.add(c);\n } else {\n }\n }\n } catch (Exception e) {\n Toast.makeText(this, \"No existen registros actuales que coincidan con la fecha\", Toast.LENGTH_LONG).show();\n clc.clear();\n }\n return clc;\n }", "public DatosIteracion mejorIteracionVisibles(ArrayList<DatosIteracion> datos) {\r\n\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getnNodos() < datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getnNodos()) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getnNodos() == datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getnNodos()) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getCapturados() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getCapturados()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "private List<PlanTrabajo> generarPlanesTrabajo( Date fecPrgn, \n\t\t\tList<Cuadrilla> cuadrillas,Map<Long, GrupoAtencion> mpGrupos, \n\t\t\tMap<Long, Long> asignaciones ){\n\t\t\n\t\t\tList<PlanTrabajo> planTrabajoList = new ArrayList<PlanTrabajo>();\n\t\t\tSet<Long> grupos = asignaciones.keySet();\t\n\t\t\tlong np = 1;\n\t\t\tfor (Long ngrupo : grupos) {\n\t\t\t\t Long ncuadrilla = asignaciones.get(ngrupo);\n\t\t\t\t GrupoAtencion grupoAtencion = mpGrupos.get(ngrupo);\n\t\t\t\t //GrupoAtencion grupoAtencion = asignar(cuadrilla, idx, mpGruposCached);\n\t\t\t\t PlanTrabajo planTrabajo = new PlanTrabajo(np);\n\t\t\t\t int nsp = 1;\n\t\t\t\t planTrabajo.setFechaProgramacion(new Timestamp(fecPrgn.getTime()));\n\t\t\t\t int i = cuadrillas.indexOf( new Cuadrilla(ncuadrilla));\n\t\t\t\t if(i!=-1){\n\t\t\t\t\t \n\t\t\t\t\t Cuadrilla cuadrilla = cuadrillas.get(i);\n\t\t\t\t\t planTrabajo.setCuadrilla(cuadrilla);\n\t\t\t\t\t planTrabajo.setGrupoAtencion(grupoAtencion);\n\t\t\t\t\t \n\t\t\t\t\t if(grupoAtencion!=null){\n\t\t\t\t\t\t for( GrupoAtencionDetalle d : grupoAtencion.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\t // añadiendo las solicitudes de servicio\t\n\t\t\t\t\t\t\t SolicitudServicio s = d.getSolicitudServicio();\n\t\t\t\t\t\t\t //System.out.println(\" #### añadiendo solicitud \"+s.getNumeroSolicitud());\n\t\t\t\t\t\t\t if(planTrabajo.getPlanTrabajoDetalles()==null){\n\t\t\t\t\t\t\t\t planTrabajo.setPlanTrabajoDetalles(new ArrayList<PlanTrabajoDetalle>());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t PlanTrabajoDetalle pd = new PlanTrabajoDetalle(np, nsp);\n\t\t\t\t\t\t\t pd.setSolicitudServicio(s);\n\t\t\t\t\t\t\t //planTrabajo.addPlanTrabajoDetalle( new PlanTrabajoDetalle(s));;\n\t\t\t\t\t\t\t planTrabajo.addPlanTrabajoDetalle(pd);\n\t\t\t\t\t\t\t nsp++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t planTrabajoList.add(planTrabajo);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t np++;\n\t\t\t}\n\t\t\t\n\t\treturn planTrabajoList;\n\t}", "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "private Double[] obtenerMovimientos(List<Categoria> listaCategorias) {\n\t\tSeries<Double> serie = new Series<>();\n\t\tDouble[] serieData = new Double[listaCategorias.size()];\n\t\tif(idUsuario != null){\n\t\t\tfor (int i = 0; i < listaCategorias.size(); i++) {\n\t\t\t\tCategoria categoriaActual = listaCategorias.get(i);\n\t\t\t\tserieData[i] = Utils.obtenerGastos(this.movimientoService.obtenerMovimientosUsuarioByCategoria(idUsuario,new MovimientoMesFilter(String.valueOf(LocalDate.now().getMonthValue()), categoriaActual.getId())));\n\t\t\t}\n\t\t}\n\t\tserie.setData(serieData);\n\t\treturn serieData;\n\t}", "public ArrayList<clsPago> consultaDataPagosCuotaInicial(int codigoCli)\n { \n ArrayList<clsPago> data = new ArrayList<clsPago>(); \n try{\n bd.conectarBaseDeDatos();\n sql = \" SELECT a.id_pagos_recibo idPago, a.id_usuario, b.name name_usuario, \"\n + \" a.referencia referencia, \"\n + \" a.fecha_pago fecha_pago, a.estado, \"\n + \" a.valor valor_pago, a.id_caja_operacion, e.name_completo nombre_cliente, \"\n + \" a.fecha_pago fecha_registro\"\n + \" FROM ck_pagos_recibo AS a\"\n + \" JOIN ck_usuario AS b ON a.id_usuario = b.id_usuario\"\n + \" JOIN ck_cliente AS e ON a.codigo = e.codigo\"\n + \" WHERE a.estado = 'A'\"\n + \" AND a.cuota_inicial = 'S'\"\n + \" AND a.estado_asignado = 'N'\"\n + \" AND a.codigo = \" + codigoCli; \n \n System.out.println(sql);\n bd.resultado = bd.sentencia.executeQuery(sql);\n \n if(bd.resultado.next())\n { \n do \n { \n clsPago oListaTemporal = new clsPago();\n \n oListaTemporal.setReferencia(bd.resultado.getString(\"referencia\"));\n oListaTemporal.setFechaPago(bd.resultado.getString(\"fecha_pago\"));\n oListaTemporal.setNombreUsuario(bd.resultado.getString(\"name_usuario\"));\n oListaTemporal.setNombreCliente(bd.resultado.getString(\"nombre_cliente\"));\n oListaTemporal.setValor(bd.resultado.getDouble(\"valor_pago\"));\n oListaTemporal.setFechaRegistro(bd.resultado.getString(\"fecha_registro\"));\n oListaTemporal.setIdPago(bd.resultado.getInt(\"idPago\"));\n data.add(oListaTemporal);\n }\n while(bd.resultado.next()); \n //return data;\n }\n else\n { \n data = null;\n } \n }\n catch(Exception ex)\n {\n System.out.print(ex);\n data = null;\n } \n bd.desconectarBaseDeDatos();\n return data;\n }", "public void cincoMasEntradas(int[][] entradas) throws Exception {\n ciclo: {\n for (int i = 0; i < entradas.length; i++) {\n if (entradas[i][1] > 0) {\n DefaultTableModel modelo = (DefaultTableModel) jTableMayorEntrada.getModel();\n Producto producto = buscarProducto(entradas[i][0]);\n Object[] filaNueva = { producto.getNombre(), entradas[i][1], entradas[i][2], entradas[i][3] };\n modelo.addRow(filaNueva); \n }\n if (i > 5) {\n break ciclo;\n }\n }\n }\n }", "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 }", "public void cargaDatasetEnMatrices() {\n int i, caux, row, column;\n String linea0 = null;\n String numero;\n char c;\n boolean notnumber; \n try {\n try (BufferedReader entrada = new BufferedReader(new FileReader(fich))) {\n //Recoge el numero de elementos del dataset\n linea0 = entrada.readLine();\n linea0 = entrada.readLine();\n linea0 = entrada.readLine();\n linea0 = entrada.readLine();\n i = 0;\n while (linea0.charAt(i) != ':') {\n i++;\n }\n notnumber = false;\n numero = \"\";\n i++;\n while (!notnumber) {\n if (i == linea0.length()) {\n notnumber = true;\n } else {\n c = linea0.charAt(i);\n if ((c != ' ') && (c != '\\n') && (c != '\\t')) {\n numero += c;\n }\n i++;\n }\n }\n if (i == linea0.length()) {\n n = Integer.parseInt(numero);\n } else {\n n = 0;\n }\n vx = new double[n];\n vy = new double[n];\n //Relleno los vectores vx y vy\n linea0 = entrada.readLine();\n linea0 = entrada.readLine();\n for (row = 0; row < n; row++) {\n for (column = 0; column <= 2; column++) {\n notnumber = false;\n numero = \"\";\n while (!notnumber) {\n caux = entrada.read();\n c = (char) caux;\n if ((c == ' ') || (c == '\\n') || (c == '\\t')) {\n if (numero.length() != 0) {\n if (column == 1) {\n vx[row] = Double.parseDouble(numero);\n } else if (column == 2) {\n vy[row] = Double.parseDouble(numero);\n }\n notnumber = true;\n }\n } else {\n numero += c;\n }\n }\n }\n }\n }\n } catch (IOException ex) {\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 }", "public String[][] obtenerConsultasBusqueda(String nombre){\n //VARIABLES PARA ALMACENAR LOS DATOS DE LA BASE DE DATOS\n String[][] datos = new String[obtenerRegistrosBusqueda(nombre)][5];\n int i = 0;\n //SE INTENTA HACE LA CONEXION Y OBTENER LOS RSULTDOS\n try {\n //METODOS DE CONEXION\n Connection connect = getConnection();\n PreparedStatement ps;\n ResultSet res;\n \n //QUERY PARA OBTENER LOS VALORES\n ps = connect.prepareStatement(\"SELECT nombre, apellidos, incentivo, descuentos, total FROM personal INNER JOIN nomina ON personal.id = nomina.id WHERE nombre = ?\");\n ps.setString(1, nombre);\n res = ps.executeQuery();\n \n while (res.next()) {\n //SE ALMACENANAN LOS DATOS DE LA BASE DE DATOS EN EL ARREGLO\n datos[i][0] = res.getString(\"nombre\");\n datos[i][1] = res.getString(\"apellidos\");\n datos[i][2] = res.getString(\"incentivo\");\n datos[i][3] = res.getString(\"descuentos\");\n datos[i][4] = res.getString(\"total\");\n i++; \n }\n //SE CIERRA LA CONEXION Y SE RETORNAN LOS DATOS OBTENIDOS\n connect.close();\n return datos;\n }\n //EN CASO DE ERROR SE MUESTRA EL MENSAJE \n catch (Exception e) {\n System.out.println(\"error en resultado: \"+e);\n JOptionPane.showMessageDialog(null, \"Hubo un error:\"+e);\n return datos;\n }\n }", "public void setValues(GenOutBean datos, int numFilas, int pagActual) throws java.sql.SQLException {\r\n\t\tclearRS();\r\n\t\tthis.elemVS = new java.util.Properties();\r\n\t\tthis.nextElem = 0;\r\n\t\tthis.cantidadColumnas = datos.getColumnCount();\r\n\t\tthis.nombreColumnas = new String[this.cantidadColumnas + 1];\r\n\t\tthis.tiposDatos = new String[this.cantidadColumnas];\r\n\t\t// Se copian los nombres de las columnas originales.\r\n\t\tfor (int i = 0; i < this.cantidadColumnas; i++){\r\n\t\t\tthis.nombreColumnas[i + 1] = datos.nombreColumnas[i + 1];\r\n\t\t\tthis.tiposDatos[i] = datos.getTiposDatos()[i];\r\n\t\t}\r\n\t\tint indiceInicial = pagActual * numFilas + 1;\r\n\t\t// Se copian los datos.\r\n\t\tint indice = numFilas * (pagActual + 1);\r\n\t\tif (indice > datos.size())\r\n\t\t\tnumFilas = datos.size() - (numFilas * pagActual);\r\n\t\tObject fila[];\r\n\t\tfor (int i = indiceInicial; i < indiceInicial + numFilas; i++) {\r\n\t\t\tfila = new Object[this.cantidadColumnas + 1];\r\n\t\t\tfor (int j = 0; j < this.cantidadColumnas; j++)\r\n\t\t\t\tfila[j + 1] = datos.getObject(i, j + 1);\r\n\t\t\tthis.addElem(fila);\r\n\t\t}\r\n\t\t//\tjdbcResultSet.close();\r\n\t\tthis.beforeFirst();\r\n\t}", "public void imprimir_etiquetas() {\n\n\t\tLinkedList l = new LinkedList();\n\t\tString q=\"select id,isnull(idarticulo,''),isnull(descripcion,''),isnull(cantidad,0),isnull(especial,0),isnull(especial_width,0),isnull(especial_height,0),isnull(quitarprefijo,0) from b_etiquetas where isnull(impresa,0)=0 order by id \";\n\t\tList<String> ids=new ArrayList<String>();\t\n\t\tObject[][] results=data.getResults(q);\n\t\tif (results!=null){\n\t\t\tif (results.length>0){\n\t\t\t\tif (_debug>0) System.out.println(\"Etiquetas para imprimir=\"+results.length);\n\t\t\t\tfor (int i = 0; i < results.length; i++) {\n\t\t\t\t\tString idarticulo = \"\";\n\t\t\t\t\tString id = \"\";\n\t\t\t\t\tString descripcion = \"\";\n\t\t\t\t\tString cant = \"\";\n\t\t\t\t\tString width = \"\";\n\t\t\t\t\tString height = \"\";\n\t\t\t\t\tString prefijo = \"\";\n\t\t\t\t\tint _width=40;\n\t\t\t\t\tint _height=40;\n\t\t\t\t\tdouble _cant = 0.0;\n\t\t\t\t\tboolean especial=false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tid = (String) results[i][0];\n\t\t\t\t\t\tidarticulo = (String) results[i][1];\n\t\t\t\t\t\tdescripcion = (String) results[i][2];\n\t\t\t\t\t\tcant = (String) results[i][3];\n\t\t\t\t\t\tespecial = ((String) results[i][4]).compareTo(\"1\")==0;\n\t\t\t\t\t\twidth = (String) results[i][5];\n\t\t\t\t\t\theight = (String) results[i][6];\n\t\t\t\t\t\tprefijo = (String) results[i][7];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t_width=new Integer(width);\n\t\t\t\t\t\t} catch (Exception 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\ttry {\n\t\t\t\t\t\t\t_height=new Integer(height);\n\t\t\t\t\t\t} catch (Exception 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\t_cant = new Double(cant);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tids.add(id);\n\t\t\t\t\tif (_cant >= 1) {\n\t\t\t\t\t\tif (idarticulo.compareTo(\"\")!=0){\n\t\t\t\t\t\t\tif (descripcion.compareTo(\"\")!=0){\n\t\t\t\t\t\t\t\tdescripcion.replaceAll(\"'\", \"\");\n\t\t\t\t\t\t\t\tStrEtiqueta str_etiqueta = new StrEtiqueta();\n\t\t\t\t\t\t\t\tstr_etiqueta.setCodigo(idarticulo);\n\t\t\t\t\t\t\t\tstr_etiqueta.setDescripcion(descripcion);\n\t\t\t\t\t\t\t\tstr_etiqueta.setCantidad(new Double(_cant).intValue());\n\t\t\t\t\t\t\t\tstr_etiqueta.setEspecial(especial);\n\t\t\t\t\t\t\t\tstr_etiqueta.setWidth(_width);\n\t\t\t\t\t\t\t\tstr_etiqueta.setHeight(_height);\n\t\t\t\t\t\t\t\tstr_etiqueta.setQuitar_prefijo(prefijo.compareTo(\"1\")==0);\n\t\t\t\t\t\t\t\tl.add(str_etiqueta);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\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\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (l.size() > 0) {\n\n\t\t\t\t\t// ImpresionCodigoDeBarras PI=new ImpresionCodigoDeBarras();\n\n\t\t\t\t\t\tprinting pi = this.getPrintingInterface();\n\t\t\t\t\t\tpi.setPrintList(l);\n\t\t\t\t\t\tpi.setDebug(false);\n\t\t\t\t\t\tboolean ok = pi.print_job();\n\t\t\t\t\t\tif (ok){\n\t\t\t\t\t\t\tif (_printer_error>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Se Enviaron las Etiquetas Pendientes a la Impresora\");\n\t\t\t\t\t\t\t\tthis.trayIcon.displayMessage(\"Beta Servidor de Impresion\", \"Se Enviaron las Etiquetas Pendientes a la Impresora\", TrayIcon.MessageType.INFO);\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tthis.trayIcon.displayMessage(\"Beta Servidor de Impresion\", \"Se Enviaron las Etiquetas a la Impresora\", TrayIcon.MessageType.INFO);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_printer_error=0;\n\t\t\t\t\t\t\tdata.beginTransaction();\n\t\t\t\t\t\t\tdata.clearBatch();\n\t\t\t\t\t\t\t\tfor (int i=0;i<ids.size();i++){\n\t\t\t\t\t\t\t\t\tq=\"update b_etiquetas set impresa=1 where id like '\"+ids.get(i)+\"'\";\n\t\t\t\t\t\t\t\t\tdata.addBatch(q);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.executeBatch();\n\t\t\t\t\t\t\t\tdata.commitTransaction();\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (_printer_error<=0){\n\t\t\t\t\t\t\t\tthis._clock_printer_error=this._clock_printer_error_reset;\n\t\t\t\t\t\t\t\tSystem.out.println(\"primer error\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_printer_error=1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t// PI.armar_secuencia();\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void collectValues\n (int[] i, int i0, int i1, long[] V) {\n for (int o=i0; o<i1; o++) // 1\n V[o] = read(i[o]); // 1\n }", "private void enviaCorreosElectronicos(){\r\n try{\r\n for(int i=0;i<arlDocGenDat.size();i++){\r\n strMsjCorEle=\"\";\r\n strMsjCorEle+=\"<HTML> La cotizacion Numero: \"+ objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_COD_COT) + \", \";\r\n strMsjCorEle+=\" del cliente: \"+objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_NOM_CLI);\r\n strMsjCorEle+=\" se ha Facturado con Numero: <b>\" + objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_NUM_FAC)+\"</b> \";\r\n strMsjCorEle+=\" </HTML> \";\r\n switch(objUti.getIntValueAt(arlDocGenDat, i,INT_ARL_COD_EMP_COT))\r\n {\r\n case 1: objCorEle.enviarCorreoMasivo(objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_COR_ELE_VEN),strTitCorEle + \" TUVAL \",strMsjCorEle ); break; \r\n case 2: objCorEle.enviarCorreoMasivo(objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_COR_ELE_VEN),strTitCorEle + \" CASTEK \",strMsjCorEle ); break;\r\n case 4: objCorEle.enviarCorreoMasivo(objUti.getStringValueAt(arlDocGenDat, i,INT_ARL_COR_ELE_VEN),strTitCorEle + \" DIMULTI \",strMsjCorEle ); break; \r\n }\r\n }\r\n }\r\n catch (Exception Evt) {\r\n System.err.println(\"ERROR \" + Evt.toString());\r\n objUti.mostrarMsgErr_F1(jifCnt, Evt);\r\n } \r\n \r\n }", "public String[][] obtenerConsultas(){\n //VARIABLES PARA ALMACENAR LOS DATOS DE LA BASE DE DATOS\n int i = 0;\n String[][] datos = new String[obtenerRegistros()][5];\n //SE INTENTA HACE LA CONEXION Y OBTENER LOS RSULTDOS\n try {\n //METODOS DE CONEXION\n Connection connect = getConnection();\n PreparedStatement ps;\n ResultSet res;\n\n //QUERY PARA OBTENER LOS VALORES\n ps = connect.prepareStatement(\"SELECT nombre, apellidos, incentivo, descuentos, total FROM personal INNER JOIN nomina ON personal.id = nomina.id;\");\n res = ps.executeQuery();\n \n while (res.next()) {\n //SE ALMACENANAN LOS DATOS DE LA BASE DE DATOS EN EL ARREGLO\n datos[i][0] = res.getString(\"nombre\");\n datos[i][1] = res.getString(\"apellidos\");\n datos[i][2] = res.getString(\"incentivo\");\n datos[i][3] = res.getString(\"descuentos\");\n datos[i][4] = res.getString(\"total\"); \n i++; \n }\n //SE CIERRA LA CONEXION Y SE RETORNAN LOS DATOS OBTENIDOS\n connect.close();\n return datos;\n }\n //EN CASO DE ERROR SE MUESTRA EL MENSAJE \n catch (Exception e) {\n System.out.println(\"error en resultado: \"+e);\n JOptionPane.showMessageDialog(null, \"Hubo un error:\"+e);\n return datos;\n }\n }", "public ArrayList<Elemento> getPosicionesAdyacentes(){\n ArrayList <Elemento> result = new ArrayList<>();\n int[] coordenada_i = {0,1,1,1,0,-1,-1,-1};\n int[] coordenada_j = {1,1,0,-1,-1,-1,0,1};\n int nueva_posicion_fila = 0;\n int nueva_posicion_columna = 0;\n for(int k=0; k<8; k++){\n nueva_posicion_fila = fila + coordenada_i[k];\n nueva_posicion_columna = columna + coordenada_j[k];\n \n if((0 <= nueva_posicion_fila) && (nueva_posicion_fila < automata.getAutomata().length) && \n (0<= nueva_posicion_columna) && (nueva_posicion_columna < automata.getAutomata()[0].length)){\n result.add(automata.getElemento(nueva_posicion_fila,nueva_posicion_columna));\n \n }\n \n }\n return result;\n }", "private List<Object[]> getReporteRecursivo(Reporteador reporteadorSeleccionado, DetalleReporteador detallePadre, Date fechaDesde, Date fechaHasta, int idSucursal, int nivel, Map<Integer, BigDecimal> mapaValorVariables)\r\n/* 289: */ throws AS2Exception, IllegalArgumentException, ArithmeticException\r\n/* 290: */ {\r\n/* 291:315 */ List<DetalleReporteador> listaDetalleReporteador = null;\r\n/* 292:316 */ if (detallePadre == null) {\r\n/* 293:317 */ listaDetalleReporteador = reporteadorSeleccionado.getListaDetalleReporteador();\r\n/* 294: */ } else {\r\n/* 295:319 */ listaDetalleReporteador = detallePadre.getListaDetalleReporteadorHijo();\r\n/* 296: */ }\r\n/* 297:321 */ nivel++;\r\n/* 298: */ \r\n/* 299:323 */ List<Object[]> resultado = new ArrayList();\r\n/* 300:326 */ for (DetalleReporteador detalle : listaDetalleReporteador) {\r\n/* 301:327 */ if (detalle.isActivo())\r\n/* 302: */ {\r\n/* 303:328 */ DetalleReporteadorVariable detalleVariable = detalle.getDetalleReporteadorVariable();\r\n/* 304:329 */ Object[] fila = new Object[4];\r\n/* 305:330 */ fila[0] = Integer.valueOf(nivel);\r\n/* 306:331 */ fila[1] = detalle.getNombre();\r\n/* 307:332 */ fila[2] = detalle.getDescripcion();\r\n/* 308:334 */ if (detalle.getDetalleReporteadorVariable() != null)\r\n/* 309: */ {\r\n/* 310:335 */ BigDecimal valor = obtenerValorExpresion(detalleVariable, fechaDesde, fechaHasta, idSucursal, mapaValorVariables);\r\n/* 311:336 */ fila[3] = valor;\r\n/* 312: */ }\r\n/* 313:339 */ resultado.add(fila);\r\n/* 314: */ \r\n/* 315: */ \r\n/* 316:342 */ resultado\r\n/* 317:343 */ .addAll(getReporteRecursivo(reporteadorSeleccionado, detalle, fechaDesde, fechaHasta, idSucursal, nivel, mapaValorVariables));\r\n/* 318: */ }\r\n/* 319: */ }\r\n/* 320:347 */ return resultado;\r\n/* 321: */ }", "public void ingresarDatos(int cd) {\n int f, c;\n float d;\n boolean resp;\n for (int k = 1; k <= cd; k++) {\n f = Integer.parseInt(JOptionPane.showInputDialog(\"Ingrese fila\"));\n c = Integer.parseInt(JOptionPane.showInputDialog(\"Ingrese columna\"));\n if (f >= 0 && f <= Nfilas && c >= 0 && c <= Ncol) {\n d = Float.parseFloat(JOptionPane.showInputDialog(\"Ingrese dato\"));\n resp = this.almacenarTrip(f, c, d);\n if (resp == false) {\n k--;\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Los indices no corresponden a la matriz\");\n k--;\n }\n }\n }", "public List<Object[]> getReporte(Reporteador reporteadorSeleccionado, Date fechaDesde, Date fechaHasta, int idSucursal)\r\n/* 266: */ throws AS2Exception, IllegalArgumentException, ArithmeticException\r\n/* 267: */ {\r\n/* 268:291 */ reporteadorSeleccionado = cargarDetalle(reporteadorSeleccionado.getId());\r\n/* 269:292 */ Map<Integer, BigDecimal> mapaValorVariables = new HashMap();\r\n/* 270: */ \r\n/* 271:294 */ List<Object[]> resultado = new ArrayList();\r\n/* 272:297 */ for (Iterator localIterator1 = reporteadorSeleccionado.getListaDetalleReporteadorVariable().iterator(); localIterator1.hasNext();)\r\n/* 273: */ {\r\n/* 274:297 */ detalle1 = (DetalleReporteadorVariable)localIterator1.next();\r\n/* 275:298 */ for (DetalleReporteadorVariable detalle2 : reporteadorSeleccionado.getListaDetalleReporteadorVariable()) {\r\n/* 276:299 */ if ((detalle2.isIndicadorFormula()) && \r\n/* 277:300 */ (detalle2.getExpresion().contains(detalle1.getCodigo()))) {\r\n/* 278:301 */ detalle2.getListaDetalleVariablesExpresion().add(detalle1);\r\n/* 279: */ }\r\n/* 280: */ }\r\n/* 281: */ }\r\n/* 282: */ DetalleReporteadorVariable detalle1;\r\n/* 283:307 */ resultado.addAll(getReporteRecursivo(reporteadorSeleccionado, null, fechaDesde, fechaHasta, idSucursal, 0, mapaValorVariables));\r\n/* 284: */ \r\n/* 285:309 */ return resultado;\r\n/* 286: */ }", "public GenerarInformePlanificacion(Curso[] cursos, Apoderado[] apoderados) {\n this.apoderados = new PlanificacionApoderado[apoderados.length];\n for (int i = 0; i < apoderados.length; i++) {\n this.apoderados[i] = new PlanificacionApoderado();\n }\n\n int cantidadCurso = 0;\n\n for (int apTotal = 0; apTotal < this.apoderados.length; apTotal++) {\n this.apoderados[apTotal].nombre = apoderados[apTotal].getNombre();\n this.apoderados[apTotal].apellido = apoderados[apTotal].getApellido();\n this.apoderados[apTotal].run = apoderados[apTotal].getRun();\n for (int cantPupilos = 0; cantPupilos < apoderados[apTotal].getPupilos().size(); cantPupilos++) {\n\n PlanificacionAlumno alumnoAgregar = new PlanificacionAlumno();\n alumnoAgregar.nombre = apoderados[apTotal].getPupilos().get(cantPupilos).getNombre();\n alumnoAgregar.apellido = apoderados[apTotal].getPupilos().get(cantPupilos).getApellido();\n alumnoAgregar.run = apoderados[apTotal].getPupilos().get(cantPupilos).getRun();\n for (int j = 0; j < 16; j++) {\n for (int alum = 0; alum < 30; alum++) {\n if (cursos[j].getAlumnos()[alum].getRun().equals(apoderados[apTotal].getPupilos().get(cantPupilos).getRun())) {\n cantidadCurso = j;\n break;\n }\n }\n }\n for (int i = 0; i < 50; i++) {\n alumnoAgregar.plan[i] = cursos[cantidadCurso].getAsignaturas()[(int) i / 10].getPlan()[i % 10];\n }\n this.apoderados[apTotal].pupilos.add(alumnoAgregar);\n\n }\n }\n\n }", "public void cargaDatosInicialesSoloParaModificacionDeCuenta() throws Exception {\n GestionContableWrapper gestionContableWrapper = parParametricasService.factoryGestionContable();\n gestionContableWrapper.getNormaContable3();\n parAjustesList = parParametricasService.listaTiposDeAjuste(obtieneEnumTipoAjuste(gestionContableWrapper.getNormaContable3()));\n selectAuxiliarParaAsignacionModificacion = cntEntidadesService.listaDeAuxiliaresPorEntidad(selectedEntidad);\n //Obtien Ajuste Fin\n\n //Activa formulario para automatico modifica \n switch (selectedEntidad.getNivel()) {\n case 1:\n swParAutomatico = true;\n numeroEspaciador = 200;\n break;\n case 2:\n swParAutomatico = true;\n swActivaBoton = true;\n numeroEspaciador = 200;\n break;\n case 3:\n swParAutomatico = false;\n numeroEspaciador = 1;\n break;\n default:\n break;\n }\n\n cntEntidad = (CntEntidad) getCntEntidadesService().find(CntEntidad.class, selectedEntidad.getIdEntidad());\n }", "public void setIteraciones(int iteraciones) {\r\n this.iteraciones = iteraciones;\r\n }", "public String[][] datosActividades(String where)\n {\n ResultSet sql; \n try {\n Connection con = conexion.abrirConexion();\n Statement s = con.createStatement();\n sql = s.executeQuery(\"SELECT actividad.idActividad, actividad.nombre, tiene.foto FROM actividad \" +\n \"INNER JOIN tiene ON actividad.idActividad = tiene.Actividad_idActividad \" +\n \"INNER JOIN posee ON posee.tiene_idTiene = tiene.idTiene \" +\n where);\n //número de registros obrenidos\n int count = 0;\n while (sql.next()) {\n ++count;\n }\n //declaración del array\n String [][] a = new String [count][4];\n //se regresa al primero\n sql.beforeFirst();\n //contador para copiar del resultset al array\n int i = 0;\n //copiar del resultset al array\n while (sql.next())\n {\n a[i][0] = sql.getString(1);\n a[i][1] = sql.getString(2);\n a[i][2] = sql.getString(3);\n i++;\n } \n conexion.cerrarConexion(con);\n return a;\n }\n catch (SQLException ex)\n {\n return null;\n }\n catch(NullPointerException e){\n JOptionPane.showMessageDialog(null, \"Error al intentar conectar con el servidor.\");\n return null;\n }\n }", "public static String[][] leerPedidosUsuario(String matricula) {\n int cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM totales where matricula = '\" + matricula + \"'\");\n \n while (result.next()) {\n cont++;\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //matriz para guardar los registros\n String[][] reporte = new String[cont][11];\n cont = 0;\n try {\n Statement statement = connection.createStatement();\n ResultSet result = statement.executeQuery(\"SELECT * FROM totales where matricula = '\" + matricula + \"'\");\n while (result.next()) {\n //leo los registros y los guardo cada uno en un renglon de la matriz \n reporte[cont][0] = result.getString(1);\n reporte[cont][1] = result.getString(2);\n reporte[cont][2] = result.getString(3);\n reporte[cont][3] = result.getString(4);\n reporte[cont][4] = result.getString(5);\n reporte[cont][5] = result.getString(6);\n reporte[cont][6] = result.getString(7);\n reporte[cont][7] = result.getString(8);\n reporte[cont][8] = result.getString(9);\n reporte[cont][9] = result.getString(10);\n reporte[cont][10] = result.getString(11);\n cont++;\n }\n } catch (SQLException ex) {\n Logger.getLogger(ManejoBasesDatos.class.getName()).log(Level.SEVERE, null, ex);\n }\n //regreso reporte completo\n return reporte;\n }", "public double[][] LerConjuntoTreinamento() throws FileNotFoundException {\n File treinamento = new File(\"mamografiaSemIdade.csv\");\n\n String linha = new String();\n\n Scanner leitor = new Scanner(treinamento);\n\n double[][] padroes = new double[5][800];\n int qntd = 0;\n while (leitor.hasNext()) {\n linha = leitor.nextLine();\n String[] valoresEntreVirgulas = linha.split(\";\");\n double[] valoresDouble = Arrays.stream(valoresEntreVirgulas).mapToDouble(Double::parseDouble).toArray();\n padroes[qntd] = valoresDouble;\n qntd++;\n //System.out.println(valoresEntreVirgulas[0] + valoresEntreVirgulas[1] + valoresEntreVirgulas[2] + valoresEntreVirgulas[3] + valoresEntreVirgulas[4]);\n }\n\n return padroes;\n }", "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 }", "public void linearize() {\r\n Object[] temp = new Object[size];\r\n int k = start;\r\n for (int i = 0; i < size; i++) {\r\n temp[i] = cir[k];\r\n k = (k + 1) % cir.length;\r\n }\r\n cir = temp;\r\n }", "public Collection cargarDeObjetivo(int codigoCiclo, int codigoPlan, int objetivo, int periodo, String estado) {\n/* 121 */ Collection resultados = new ArrayList();\n/* */ try {\n/* 123 */ String s = \"select m.Codigo_Ciclo, m.Codigo_Plan, m.Codigo_Meta, m.Codigo_Objetivo, m.Descripcion, m.Valor_Meta, m.Tipo_Medicion, m.Frecuencia_Medicion, m.Justificacion, m.Estado, m.Fecha_Insercion, m.Usuario_Insercion, m.Fecha_Modificacion, m.Usuario_Modificacion, m.Mes01, m.Mes02, m.Mes03, m.Mes04, m.Mes05, m.Mes06, m.Mes07, m.Mes08, m.Mes09, m.Mes10, m.Mes11, m.Mes12, m.Fuente_Dato, m.Aplica_En, m.Unidad_Medida, m.Valor_Minimo, m.Valor_Maximo, m.Tipo_Grafica, Tm.Descripcion as Nombretipomedicion, Est.Descripcion as Nombreestado, Um.Descripcion as Nombre_Unidad_Medida, SUM(CASE WHEN ac.NUMERO IS NOT NULL THEN 1 ELSE 0 END) acciones from Cal_Plan_Metas m left join Am_Acciones Ac on( m.Codigo_Ciclo = Ac.Codigo_Ciclo and m.Codigo_Plan = Ac.Codigo_Plan and m.Codigo_Meta = Ac.Codigo_Meta and Ac.Asociado = 'P'), \\t\\t Sis_Multivalores Tm, \\t\\t Sis_Multivalores Est, \\t\\t Sis_Multivalores Um where m.Tipo_Medicion = Tm.Valor and Tm.Tabla = 'CAL_TIPO_MEDICION' and m.Estado = Est.Valor and Est.Tabla = 'CAL_ESTADO_META' and m.Unidad_Medida = Um.Valor and Um.Tabla = 'CAL_UNIDAD_MEDIDA_META' and m.codigo_ciclo=\" + codigoCiclo + \" and m.codigo_plan=\" + codigoPlan + \" and m.codigo_objetivo=\" + objetivo;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 180 */ if (estado.length() > 0) {\n/* 181 */ s = s + \" and m.estado='A'\";\n/* */ }\n/* */ \n/* 184 */ if (periodo == 1) {\n/* 185 */ s = s + \" and m.mes01='S'\";\n/* */ }\n/* 187 */ else if (periodo == 2) {\n/* 188 */ s = s + \" and m.mes02='S'\";\n/* */ }\n/* 190 */ else if (periodo == 3) {\n/* 191 */ s = s + \" and m.mes03='S'\";\n/* */ }\n/* 193 */ else if (periodo == 4) {\n/* 194 */ s = s + \" and m.mes04='S'\";\n/* */ }\n/* 196 */ else if (periodo == 5) {\n/* 197 */ s = s + \" and m.mes05='S'\";\n/* */ }\n/* 199 */ else if (periodo == 6) {\n/* 200 */ s = s + \" and m.mes06='S'\";\n/* */ }\n/* 202 */ else if (periodo == 7) {\n/* 203 */ s = s + \" and m.mes07='S'\";\n/* */ }\n/* 205 */ else if (periodo == 8) {\n/* 206 */ s = s + \" and m.mes08='S'\";\n/* */ }\n/* 208 */ else if (periodo == 9) {\n/* 209 */ s = s + \" and m.mes09='S'\";\n/* */ }\n/* 211 */ else if (periodo == 10) {\n/* 212 */ s = s + \" and m.mes10='S'\";\n/* */ }\n/* 214 */ else if (periodo == 11) {\n/* 215 */ s = s + \" and m.mes11='S'\";\n/* */ }\n/* 217 */ else if (periodo == 12) {\n/* 218 */ s = s + \" and m.mes12='S'\";\n/* */ } \n/* */ \n/* 221 */ s = s + \" GROUP BY m.Codigo_Ciclo, m.Codigo_Plan, m.Codigo_Meta, m.Codigo_Objetivo, m.Descripcion, m.Valor_Meta, m.Tipo_Medicion, m.Frecuencia_Medicion, m.Justificacion, m.Estado, m.Fecha_Insercion, m.Usuario_Insercion, m.Fecha_Modificacion, m.Usuario_Modificacion, m.Mes01, m.Mes02, m.Mes03, m.Mes04, m.Mes05, m.Mes06, m.Mes07, m.Mes08, m.Mes09, m.Mes10, m.Mes11, m.Mes12, m.Fuente_Dato, m.Aplica_En, m.Unidad_Medida, m.Valor_Minimo, m.Valor_Maximo, m.Tipo_Grafica, Tm.Descripcion, Est.Descripcion, Um.Descripcion order by m.descripcion\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 259 */ boolean rtaDB = this.dat.parseSql(s);\n/* 260 */ if (!rtaDB) {\n/* 261 */ return resultados;\n/* */ }\n/* */ \n/* 264 */ this.rs = this.dat.getResultSet();\n/* 265 */ while (this.rs.next()) {\n/* 266 */ resultados.add(leerRegistro());\n/* */ }\n/* */ }\n/* 269 */ catch (Exception e) {\n/* 270 */ e.printStackTrace();\n/* 271 */ Utilidades.writeError(\"CalPlanMetasFactory:cargarTodos \", e);\n/* */ } \n/* 273 */ return resultados;\n/* */ }", "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 }", "private void evaluateData () {\n long rows = DatabaseUtils.longForQuery(sqliteDBHelper.openSqlDatabaseReadable(), \"SELECT COUNT(*) FROM \" + SqliteDBStructure.DATA_AGGREGATE\r\n + \" JOIN \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \" ON \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \" = \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \".\" + SqliteDBStructure.ACCESS_TIME, null);\r\n // calculate the amount of tasks (thread) depending on the MaxBatchSize\r\n tasks = rows >= MaxBatchSize? (int)(rows/MaxBatchSize + 1):1;\r\n // set the amount of finished tasks to 0\r\n finished = 0;\r\n // send the amount of task to the main activity so it can be displayed in the progress dialog\r\n sendTaskAmount(tasks + 1);\r\n // create a thread pool with tasks amount of threads\r\n final ExecutorService executorService = Executors.newFixedThreadPool(tasks);\r\n // create a list which holds all the tasks to be executed\r\n final List<ProcessingDataHandler> taskList = new LinkedList<>();\r\n // for each task create a batch of MaxBatchSize rows to evaluate\r\n for (int i = 0; i < tasks; i++) {\r\n // pass the offset (where to start) and the limit (how many rows)\r\n taskList.add(new ProcessingDataHandler(i*MaxBatchSize, MaxBatchSize));\r\n }\r\n // invoke all the task at once\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n try {\r\n executorService.invokeAll(taskList);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }).start();\r\n\r\n updateProgressDialog();\r\n }", "@SuppressWarnings(\"unchecked\")\n public void consultarCoactivosXLS() throws CirculemosNegocioException {\n\n // consulta la tabla temporal de los 6000 coactivos\n StringBuilder sql = new StringBuilder();\n\n sql.append(\"select [TIPO DOC], [NUMERO DE IDENTIFICACIÓN], [valor multas], [titulo valor], proceso \");\n sql.append(\"from coactivos_xls \");\n sql.append(\"where id_tramite is null and numero_axis is null AND archivo is not null \");\n sql.append(\"AND [titulo valor] IN ('2186721','2187250','2187580','2186845')\");\n\n Query query = em.createNativeQuery(sql.toString());\n\n List<Object[]> listaResultados = Utilidades.safeList(query.getResultList());\n\n Date fechaCoactivo = UtilFecha.buildCalendar().getTime();\n CoactivoDTO coactivoDTOs;\n TipoIdentificacionPersonaDTO tipoIdentificacion;\n List<ObligacionCoactivoDTO> obligacionesCoactivoDTO;\n PersonaDTO personaDTO;\n ProcesoDTO proceso;\n // persiste los resultados en coactivoDTO\n for (Object[] coactivo : listaResultados) {\n coactivoDTOs = new CoactivoDTO();\n // persiste el tipo de indetificacion en TipoIdentificacionPersonaDTO\n personaDTO = new PersonaDTO();\n proceso = new ProcesoDTO();\n tipoIdentificacion = new TipoIdentificacionPersonaDTO();\n obligacionesCoactivoDTO = new ArrayList<>();\n\n tipoIdentificacion.setCodigo((String) coactivo[0]);\n personaDTO.setTipoIdentificacion(tipoIdentificacion);\n coactivoDTOs.setPersona(personaDTO);\n coactivoDTOs.getPersona().setNumeroIdentificacion((String) coactivo[1]);\n\n proceso.setFechaInicio(fechaCoactivo);\n coactivoDTOs.setProceso(proceso);\n coactivoDTOs.setValorTotalObligaciones(BigDecimal\n .valueOf(Double.valueOf(coactivo[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n coactivoDTOs.setValorTotalCostasProcesales(\n coactivoDTOs.getValorTotalObligaciones().multiply(BigDecimal.valueOf(0.05)));\n coactivoDTOs.getProceso().setObservacion(\"COACTIVO\");\n String[] numeroFactura = coactivo[3].toString().split(\",\");\n // separa los numeros de factura cuando viene mas de uno.\n for (String nFactura : numeroFactura) {\n // consulta por numero de factura el el saldo a capital por cada factura\n sql = new StringBuilder();\n sql.append(\"select nombre, saldo_capital, saldo_interes \");\n sql.append(\"from cartera_coactivos_xls \");\n sql.append(\"where nombre = :nFactura\");\n\n Query quer = em.createNativeQuery(sql.toString());\n\n quer.setParameter(\"nFactura\", nFactura);\n\n List<Object[]> result = Utilidades.safeList(quer.getResultList());\n // persiste las obligaciones consultadas y las inserta en ObligacionCoactivoDTO\n ObligacionCoactivoDTO obligaciones;\n for (Object[] obligacion : result) {\n obligaciones = new ObligacionCoactivoDTO();\n obligaciones.setNumeroObligacion((String) obligacion[0]);\n obligaciones.setValorObligacion(BigDecimal.valueOf(\n Double.valueOf(obligacion[1].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n obligaciones.setValorInteresMoratorios(BigDecimal.valueOf(\n Double.valueOf(obligacion[2].toString().replaceAll(\"\\\\.\", \"\").replaceAll(\",\", \".\"))));\n // Adiciona las obligaciones a una lista\n obligacionesCoactivoDTO.add(obligaciones);\n }\n\n }\n coactivoDTOs.setObligacionCoactivos(obligacionesCoactivoDTO);\n try {\n iLCoactivo.registrarCoactivoAxis(coactivoDTOs, coactivo[4].toString());\n } catch (Exception e) {\n logger.error(\"Error al registrar coactivo 6000 :\", e);\n }\n }\n }", "public void buscarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tString codigo_empresa = empresa.getCodigo_empresa();\r\n\t\t\tString codigo_sucursal = sucursal.getCodigo_sucursal();\r\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\r\n\t\t\t\t\t.toString();\r\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n\t\t\tMap<String, Object> parameters = new HashMap();\r\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\t\tparameters.put(\"parameter\", parameter);\r\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n\t\t\tgetServiceLocator().getHis_partoService().setLimit(\r\n\t\t\t\t\t\"limit 25 offset 0\");\r\n\r\n\t\t\tList<His_parto> lista_datos = getServiceLocator()\r\n\t\t\t\t\t.getHis_partoService().listar(parameters);\r\n\t\t\trowsResultado.getChildren().clear();\r\n\r\n\t\t\tfor (His_parto his_parto : lista_datos) {\r\n\t\t\t\trowsResultado.appendChild(crearFilas(his_parto, this));\r\n\t\t\t}\r\n\r\n\t\t\tgridResultado.setVisible(true);\r\n\t\t\tgridResultado.setMold(\"paging\");\r\n\t\t\tgridResultado.setPageSize(20);\r\n\r\n\t\t\tgridResultado.applyProperties();\r\n\t\t\tgridResultado.invalidate();\r\n\t\t\tgridResultado.setVisible(true);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "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 }", "private void cargarDatos() {\r\n txtRucDni.setText(objVentas.getObjCliente().getStr_rucdni());\r\n txtCliente.setText(objVentas.getObjCliente().getStr_razonSocial());\r\n txtDocumento.setText(objVentas.getStr_numeroDocumento());\r\n txtMonto.setText(String.valueOf(Util.redondeo(objVentas.getDbTotal(), 2) ));\r\n txtPaga.requestFocus();\r\n setLocationRelativeTo(null);\r\n\r\n String arr[] = objVentas.getStr_numeroDocumento().split(\"-\");\r\n \r\n \r\n \r\n \r\n List<Ventas> listaVentaDetalle = new ArrayList<>();\r\n listaVentaDetalle = PaqueteBusinessDelegate.getFlujoCajaService().\r\n listarVenta(String.valueOf(gui.getLocal().getInt_idLocal()), Util.SINPAGO, objVentas.getStr_numeroDocumento(), 2);\r\n cargarTabla(listaVentaDetalle);\r\n \r\n int cantidadDocumentos;\r\n if (!this.gui.getListaConfig().get(0).getTipoImpresion().equals(Config.TICKETERA)){\r\n //Determinar la cantidad de productos por documentos\r\n cantidadDocumentos=(listaVentaDetalle.size()/10);\r\n log.info(\"Cantidad: \"+cantidadDocumentos);\r\n\r\n if(listaVentaDetalle.size()%10!=0)\r\n cantidadDocumentos++;\r\n }else{\r\n cantidadDocumentos = 1;\r\n }\r\n \r\n \r\n log.info(\"Cantidad: \"+cantidadDocumentos);\r\n \r\n// System.out.println(\"local : \"+objVentas.getObjLocal().getInt_idLocal()+\" tD :\"+arr[2].trim());\r\n txtNroDocumento.setText(PaqueteBusinessDelegate.getVentasService().\r\n consultaSiguinteCorrelativo(objVentas.getObjLocal().getInt_idLocal(), arr[2].trim()));\r\n \r\n// System.out.println(\"consulta : \"+PaqueteBusinessDelegate.getVentasService().\r\n// consultaSiguinteCorrelativo(objVentas.getObjLocal().getInt_idLocal(), arr[2].trim()));\r\n String documento=txtNroDocumento.getText();\r\n String statico=txtNroDocumento.getText().split(\"/\")[0];\r\n// System.out.println(\"estatico : \"+statico);\r\n statico=statico.split(\"-\")[0].concat(\"-\").concat(statico.split(\"-\")[1]).concat(\"-\");\r\n \r\n\r\n if (cantidadDocumentos>1){\r\n for (int i=1;i<cantidadDocumentos;i++){\r\n \r\n if (i<cantidadDocumentos)\r\n documento+=\";\";\r\n \r\n documento+=statico.concat(String.valueOf( Util.stringTOint(\r\n txtNroDocumento.getText().split(\"/\")[0].split(\"-\")[2])+i)).\r\n concat(\"/\").concat(txtNroDocumento.getText().split(\"/\")[1]);\r\n\r\n \r\n log.info(\"NRO: \"+documento);\r\n }\r\n txtNroDocumento.setText(documento);\r\n }\r\n \r\n \r\n \r\n \r\n }", "public DatosIteracion mejorIteracionVisibles() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionVisibles(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionVisibles(array);\r\n\t}", "public static void main(String[] args) {\n \n empleado[] misEmpleados=new empleado[3];\n //String miArray[]=new String[3];\n \n misEmpleados[0]=new empleado(\"paco gomez\",123321,1998,12,12);\n misEmpleados[1]=new empleado(\"Johana\",28500,1998,12,17);\n misEmpleados[2]=new empleado(\"sebastian\",98500,1898,12,17);\n \n /*for (int i = 0; i < misEmpleados.length; i++) {\n misEmpleados[i].aumentoSueldo(10);\n \n }\n for (int i = 0; i < misEmpleados.length; i++) {\n System.out.println(\"nombre :\" + misEmpleados[i].dameNombre() + \" sueldo \" + misEmpleados[i].dameSueldo()+ \" fecha de alta \"\n + misEmpleados[i].dameContrato());\n }*/\n \n for (empleado e:misEmpleados) {\n e.aumentoSueldo(10);\n \n }\n for (empleado e:misEmpleados) {\n System.out.println(\"nombre :\" + e.dameNombre() + \" sueldo \" + e.dameSueldo()+ \" fecha de alta \"\n + e.dameContrato());\n \n }\n \n }", "public void ordenarRanking(){\n for(int i = 0; i < clasificacion.length; i++) {\n boolean flag = false;\n for(int j = 0; j < clasificacion.length-1; j++) {\n\n /*Si el elemento de la posicion j+1 es mayor que el anterior se intercambian\n los valores de esas posiciones*/\n if((clasificacion[j].getMediana())<(clasificacion[j+1].getMediana())) {\n Ranking k = new Ranking();\n k=clasificacion[j];\n clasificacion[j] = clasificacion[i];\n clasificacion[i] = k;\n flag=true; //Se pone a true para indicar que se ha hecho un cambio\n }//END_IF\n }//END_FOR\n\n if(!flag) break; //Si flag es igual a falso quiere decir que en la ultima iteracion\n //no hubo ningun intercambio y por lo tanto el metodo puede terminar\n //ya que el vector esta ordenado\n }//END_FOR\n\n }", "public static void changeArrayRows() {\r\n\t\tchar[][] data = initializeArray();\r\n\t\tThread t[] = new Thread[4];\r\n\t\tlong time1 = System.nanoTime();\r\n\t\t\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tt[i] = new ThreadRow(data, (i * data.length/4), (i+1) * data.length/4);\r\n\t\t\tt[i].start();\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (Thread threads : t)\r\n\t\t\t\tthreads.join();\r\n\t\t}\r\n\t\tcatch (Exception e) { \r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tlong time2 = System.nanoTime();\r\n\t\t\r\n\t\tSystem.out.println((time2 - time1) + \" ns\");\r\n\t}", "@Test\n public void testAnalisarDia() throws Exception {\n System.out.println(\"analisarDia\");\n int[][] dadosFicheiro = null;\n int linhas = 0;\n int[] expResult = null;\n int[] result = ProjetoV1.analisarDia(dadosFicheiro, linhas);\n assertArrayEquals(expResult, result);\n\n }", "private Filtro getFiltroFissiGiornoConto(Date data, int codConto) {\n /* variabili e costanti locali di lavoro */\n Filtro filtro = null;\n Filtro filtroDate = null;\n Filtro filtroInizio = null;\n Filtro filtroSincro;\n Filtro filtroVuota;\n Filtro filtroIntervallo;\n Filtro filtroFine;\n Filtro filtroConto = null;\n Modulo modConto;\n Date dataVuota;\n\n try { // prova ad eseguire il codice\n\n modConto = Progetto.getModulo(Conto.NOME_MODULO);\n\n filtroDate = new Filtro();\n\n filtroInizio = FiltroFactory.crea(Cam.dataInizioValidita.get(),\n Filtro.Op.MINORE_UGUALE,\n data);\n filtroSincro = FiltroFactory.crea(Cam.dataSincro.get(), Filtro.Op.MINORE, data);\n dataVuota = Lib.Data.getVuota();\n filtroVuota = FiltroFactory.crea(Cam.dataSincro.get(), dataVuota);\n\n filtroFine = FiltroFactory.crea(Cam.dataFineValidita.get(),\n Filtro.Op.MAGGIORE_UGUALE,\n data);\n filtroIntervallo = new Filtro();\n filtroIntervallo.add(filtroSincro);\n filtroIntervallo.add(filtroFine);\n\n filtroDate.add(filtroIntervallo);\n filtroDate.add(Filtro.Op.OR, filtroVuota);\n\n /* filtro per il conto */\n filtroConto = FiltroFactory.codice(modConto, codConto);\n\n filtro = new Filtro();\n filtro.add(filtroInizio);\n filtro.add(filtroDate);\n filtro.add(filtroConto);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n /* valore di ritorno */\n return filtro;\n }", "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 rozmiarTablicy()\n {\n iloscWierszy = tabelaDanych.getRowCount();\n iloscKolumn = tabelaDanych.getColumnCount();\n tablica = new int[iloscWierszy][iloscKolumn];\n // wypelnienie tablicy pomocniczej z wartościami tabeli\n for (int i = 0; i < iloscWierszy ; i++)\n {\n for (int j = 0; j < iloscKolumn; j++)\n {\n tablica [i][j] = (int) tabelaDanych.getValueAt(i,j);\n }\n }\n }", "public List<Object[]> getRetencionesAnuladas(int mes, int anio, int idOrganizacion, Sucursal sucursalFP, Sucursal sucursalRetencion, PuntoDeVenta puntoVentaRetencion, String orden, TipoComprobanteSRI tipoComprobante)\r\n/* 125: */ {\r\n/* 126:175 */ StringBuilder sql = new StringBuilder();\r\n/* 127: */ \r\n/* 128:177 */ sql.append(\" SELECT a.fechaEmisionDocumento, f.fechaRegistro, f.fechaEmision, CONCAT(f.establecimiento,'-',f.puntoEmision,'-',f.numero), f.identificacionProveedor, \");\r\n/* 129: */ \r\n/* 130:179 */ sql.append(\" \\t'', f.montoIva*0, f.montoIva*0, f.montoIva*0, '', '', \");\r\n/* 131: */ \r\n/* 132:181 */ sql.append(\" \\tCONCAT(a.establecimiento,'-',a.puntoEmision,'-',a.numeroDesde), f.montoIva*0, f.montoIva*0, f.montoIva*0, f.nombreProveedor, \");\r\n/* 133: */ \r\n/* 134:183 */ sql.append(\"\\tf.montoIva*0, f.montoIva*0, '', a.autorizacion, f.fechaRegistro, f.autorizacion, '', 'ANULADO', f.idFacturaProveedorSRI,'' \");\r\n/* 135:184 */ sql.append(\" FROM AnuladoSRI a, FacturaProveedorSRI f \");\r\n/* 136:185 */ sql.append(\" WHERE a.documentoRelacionado = f.idFacturaProveedorSRI \");\r\n/* 137:186 */ sql.append(\" AND a.tipoComprobanteSRI = :tipoComprobante \");\r\n/* 138:187 */ sql.append(\" AND a.anio = :anio AND a.mes = :mes \");\r\n/* 139:188 */ sql.append(\" AND a.idOrganizacion = :idOrganizacion \");\r\n/* 140:189 */ if (sucursalFP != null) {\r\n/* 141:190 */ sql.append(\" AND f.idSucursal = :idSucursal \");\r\n/* 142: */ }\r\n/* 143:192 */ if (sucursalRetencion != null) {\r\n/* 144:193 */ sql.append(\" AND a.establecimiento = :sucursalRetencion \");\r\n/* 145: */ }\r\n/* 146:195 */ if (puntoVentaRetencion != null) {\r\n/* 147:196 */ sql.append(\" AND a.puntoEmision = :puntoVentaRetencion \");\r\n/* 148: */ }\r\n/* 149:198 */ Query query = this.em.createQuery(sql.toString());\r\n/* 150:199 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 151:200 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 152:201 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 153:202 */ query.setParameter(\"tipoComprobante\", tipoComprobante);\r\n/* 154:203 */ if (sucursalFP != null) {\r\n/* 155:204 */ query.setParameter(\"idSucursal\", Integer.valueOf(sucursalFP.getId()));\r\n/* 156: */ }\r\n/* 157:206 */ if (sucursalRetencion != null) {\r\n/* 158:207 */ query.setParameter(\"sucursalRetencion\", sucursalRetencion.getCodigo());\r\n/* 159: */ }\r\n/* 160:209 */ if (puntoVentaRetencion != null) {\r\n/* 161:210 */ query.setParameter(\"puntoVentaRetencion\", puntoVentaRetencion.getCodigo());\r\n/* 162: */ }\r\n/* 163:213 */ return query.getResultList();\r\n/* 164: */ }", "public void linearize(){\n Object []lin=new Object[size];\n int k=start;\n for(int i=0;i<size;i++){\n lin[i]=cir[k];\n k=(k+1)%cir.length;\n }\n cir=new Object[size];\n for(int i=0;i<size;i++){\n cir[i]=lin[i];\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 }", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "public void buscarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tString codigo_empresa = empresa.getCodigo_empresa();\r\n\t\t\tString codigo_sucursal = sucursal.getCodigo_sucursal();\r\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\r\n\t\t\t\t\t.toString();\r\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\r\n\r\n\t\t\tMap<String, Object> parameters = new HashMap();\r\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\t\tparameters.put(\"parameter\", parameter);\r\n\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\r\n\r\n\t\t\tgetServiceLocator().getHis_atencion_embarazadaService().setLimit(\r\n\t\t\t\t\t\"limit 25 offset 0\");\r\n\r\n\t\t\tList<His_atencion_embarazada> lista_datos = getServiceLocator()\r\n\t\t\t\t\t.getHis_atencion_embarazadaService().listar(parameters);\r\n\t\t\trowsResultado.getChildren().clear();\r\n\r\n\t\t\tfor (His_atencion_embarazada his_atencion_embarazada : lista_datos) {\r\n\t\t\t\trowsResultado.appendChild(crearFilas(his_atencion_embarazada,\r\n\t\t\t\t\t\tthis));\r\n\t\t\t}\r\n\r\n\t\t\tgridResultado.setVisible(true);\r\n\t\t\tgridResultado.setMold(\"paging\");\r\n\t\t\tgridResultado.setPageSize(20);\r\n\r\n\t\t\tgridResultado.applyProperties();\r\n\t\t\tgridResultado.invalidate();\r\n\t\t\tgridResultado.setVisible(true);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "protected void readAllData() {\n \n String query = buildDataQuery();\n \n try {\n ResultSet rs = executeQuery(query);\n ResultSetMetaData md = rs.getMetaData();\n \n //Construct the internal data containers\n _dataMap = new LinkedHashMap<String,double[]>();\n _textDataMap = new LinkedHashMap<String,String[]>();\n \n //Make containers to collect data as we get it from the ResultSet\n int ncol = md.getColumnCount();\n ResizableDoubleArray[] dataArrays = new ResizableDoubleArray[ncol]; //tmp holder for numeric data\n List<String>[] textDataLists = new List[ncol]; //tmp holder for text data\n for (int i=0; i<ncol; i++) {\n dataArrays[i] = new ResizableDoubleArray();\n textDataLists[i] = new ArrayList<String>();\n }\n\n //Define a Calendar so we get our times in the GMT time zone.\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n \n //Read data from the result set into the ResizableDoubleArray-s which are already in the _dataArrayMap.\n while (rs.next()) { \n for (int i=0; i<ncol; i++) {\n double d = Double.NaN;\n //Check type and read as appropriate\n //TODO: check for other variation of time and text types\n int typeID = md.getColumnType(i+1); \n \n if (typeID == java.sql.Types.TIMESTAMP) { //TODO: test for DATE and TIME types?\n //We need to convert timestamps to numerical values.\n Timestamp ts = rs.getTimestamp(i+1, cal);\n d = ts.getTime();\n } else if (typeID == java.sql.Types.VARCHAR || typeID == java.sql.Types.CHAR) {\n //Text column. Save strings apart from other data.\n //They will appear as NaNs in the numeric data values.\n String s = rs.getString(i+1);\n textDataLists[i].add(s);\n } else d = rs.getDouble(i+1);\n \n dataArrays[i].addElement(d);\n }\n }\n \n //Extract the primitive arrays from the ResizableDoubleArray-s and put in data map.\n //Segregate the text data. Don't bother to save \"data\" (NaNs) for String types.\n for (int i=0; i<ncol; i++) {\n String name = md.getColumnName(i+1);\n int typeID = md.getColumnType(i+1);\n if (typeID == java.sql.Types.VARCHAR || typeID == java.sql.Types.CHAR) { \n String[] text = new String[1];\n text = (String[]) textDataLists[i].toArray(text);\n _textDataMap.put(name, text);\n } else {\n double[] data = dataArrays[i].getElements();\n _dataMap.put(name, data);\n }\n }\n \n } catch (SQLException e) {\n String msg = \"Unable to process database query: \" + query;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n }", "public void cadastrarOfertasQuad1(){\n \n String[] palavras;\n \n //Primeiro quadrimestre\n try {\n try (BufferedReader lerArq = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/charles/alocacao/Arquivos Alocação/Arquivos CSV/Planejamento2017_q1.csv\"), \"UTF-8\"))) {\n String linha = lerArq.readLine(); //cabeçalho\n \n linha = lerArq.readLine();\n\n// linha = linha.replaceAll(\"\\\"\", \"\");\n while (linha != null) {\n\n linha = linha.replaceAll(\"\\\"\", \"\");\n\n palavras = linha.split(\";\", -1);\n\n oferta = new OfertaDisciplina();\n\n oferta.setCurso(palavras[0]);//2\n\n String nome = palavras[2];//4\n \n String codigo = palavras[1];//3\n \n Disciplina d = disciplinaFacade.findByCodOrName(codigo, nome);\n\n if (d != null) {\n// Disciplina d = disciplinaFacade.findByName(nome).get(0);\n oferta.setDisciplina(d);\n }\n oferta.setT(Integer.parseInt(palavras[3]));//5\n oferta.setP(Integer.parseInt(palavras[4]));//6\n oferta.setTurno(palavras[6]);//11\n oferta.setCampus(palavras[7]);//12\n if (!palavras[8].equals(\"\")) {\n oferta.setNumTurmas(Integer.parseInt(palavras[8]));//13\n }\n if (!palavras[9].equals(\"\")) {\n oferta.setPeriodicidade(palavras[9]);//19\n } else{\n oferta.setPeriodicidade(\"semanal\");\n }\n oferta.setQuadrimestre(1);\n\n salvarNoBanco();\n\n linha = lerArq.readLine();\n// linha = linha.replaceAll(\"\\\"\", \"\");\n }\n } //cabeçalho\n ofertas1LazyModel = null;\n } catch (IOException e) {\n System.err.printf(\"Erro na abertura do arquivo: %s.\\n\", e.getMessage());\n } \n }", "public int[][] iterate()\n {\n Random r = new Random();\n for (int i = 0; i < buffersize; i++) {\n if (unprocessed.isEmpty()) \n {\n finished = true;\n break;\n }\n int randomIndex = r.nextInt(unprocessed.size());\n nodemap.changeColor(unprocessed.get(randomIndex), 1);\n unprocessed.remove(randomIndex);\n }\n return nodemap.getIntMap();\n }", "public String[] getPreguntasNivelCategoria(String idCategoria, String idNivel, String IndicePreg){\n //Creamos el conector de bases de datos\n AdmiSQLiteOpenHelper admin = new AdmiSQLiteOpenHelper(this, \"administracion\", null, 1 );\n // Abre la base de datos en modo lectura y escritura\n SQLiteDatabase BasesDeDatos = admin.getWritableDatabase();\n Cursor consultaId = BasesDeDatos.rawQuery(\"SELECT id, co_respuesta, co_categoria, co_nivel, pregunta, respuesta FROM t_preguntas WHERE co_categoria = \"+idCategoria+\" AND co_nivel = \" + idNivel , null);\n\n String contTotalPreg = getPreguntasTotal( idCategoria, idNivel );\n\n\n //Declaro arreglos. todo aqui debo definir el total de indices\n Integer[ ] iPregunta = new Integer[ Integer.parseInt(contTotalPreg) ];\n String[ ] sPreguntas = new String[ Integer.parseInt(contTotalPreg) ];\n String[ ] sRespuesta = new String[ Integer.parseInt(contTotalPreg) ];\n String[ ] sComplemento = new String[2];\n\n try {\n\n if (consultaId != null) {\n consultaId.moveToFirst();\n int indice = 0;\n\n do {\n // todo Asignamos el valor en nuestras variables para usarlos en lo que necesitemos\n iPregunta[indice] = consultaId.getInt(consultaId.getColumnIndex(\"id\"));\n sPreguntas[indice] = consultaId.getString(consultaId.getColumnIndex(\"pregunta\"));\n sRespuesta[indice] = consultaId.getString(consultaId.getColumnIndex(\"respuesta\"));\n indice++;\n\n\n } while ( consultaId.moveToNext() );\n\n //Todo -> Aqui PRegunta // Establecer Pregunta y Respuestas Dinamico todo\n labelPregunta.setText( sPreguntas[ Integer.parseInt( IndicePreg ) ] );\n\n int numero = (int)( Math.random()*4+1 );\n\n //todo aqui las preguntas complementarias Mosca aqui idea algo crazy\n sComplemento = getComplementoPreguntas( Integer.toString( iPregunta[Integer.parseInt( IndicePreg )] ) );\n\n if ( numero == 1 ){\n btnOpcion1.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion1.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion2.setText( sComplemento[0] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[1] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n if ( numero == 2 ){\n btnOpcion2.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion2.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[1] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n if ( numero == 3 ){\n btnOpcion3.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion3.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion2.setText( sComplemento[1] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion4.setText( sComplemento[2] );\n btnOpcion4.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n }\n\n if ( numero == 4 ){\n btnOpcion4.setText( sRespuesta[ Integer.parseInt( IndicePreg ) ] );\n btnOpcion4.setId( iPregunta[Integer.parseInt( IndicePreg )] );\n\n btnOpcion1.setText( sComplemento[0] );\n btnOpcion1.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion2.setText( sComplemento[1] );\n btnOpcion2.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n btnOpcion3.setText( sComplemento[2] );\n btnOpcion3.setId( - iPregunta[Integer.parseInt( IndicePreg )] );\n\n }\n\n }else{\n System.out.println( \" ------------- No hay datos ------------------\" );\n System.out.println();\n }\n\n } catch ( Exception e ) {\n System.err.println( e.getClass().getName() + \": \" + e.getMessage() );\n System.exit(0);\n }\n\n //Cerramos el cursor y la conexion con la base de datos\n consultaId.close();\n BasesDeDatos.close();\n\n return sPreguntas;\n }", "public Collection getEntradaTrasladosEntreDiasoTemporadas(Long temporadaId, Date dataInici, Date dataFin) throws InfrastructureException {\r\n\t\tCollection col;\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\ttry {\r\n\t\t\tlogger.debug(\"getEntradaTrasladosEntreDiasoTemporadas ini\");\r\n\t\t\tString q = \"from Trasllat tdi where tdi.retornatEstablimentOrigen = true \";\r\n\r\n\t\t\tif(dataInici!= null || dataFin != null){\r\n\t\t\t\tLong campanyaActualId = (Long)getHibernateTemplate().find(\"select max(cam.id) from Campanya cam\").get(0);\r\n\t\t\t\tif(dataInici != null){\r\n\t\t\t\t\tString fi = df.format(dataInici);\r\n\t\t\t\t\tq = q+ \" and tdi.data >= '\"+fi+\"' \";\r\n\t\t\t\t}\r\n\t\t\t\tif(dataFin != null){\r\n\t\t\t\t\tString ff = df.format(dataFin);\r\n\t\t\t\t\tq = q+ \" and tdi.data <= '\"+ff+\"' \";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tq = q+\" and tdi.establimentByTdiCodede.campanya.id=\"+campanyaActualId;\r\n\r\n\t\t\t}else{\r\n\t\t\t\tq = q+ \" and tdi.establimentByTdiCodede.campanya.id=\"+temporadaId;\r\n\t\t\t}\r\n\r\n\t\t\tcol = getHibernateTemplate().find(q);\t\t\t\r\n\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tlogger.error(\"getEntradaTrasladosEntreDiasoTemporadas failed\", ex);\r\n\t\t\tthrow new InfrastructureException(ex);\r\n\t\t}\r\n\t\tlogger.debug(\"getEntradaTrasladosEntreDiasoTemporadas fin\");\r\n\t\treturn col;\r\n\t}", "public static ArrayList IngresarInfoLista(int posarray){\n\n // Definir objeto de la clase constanste para mensajes\n Constantes constantes = new Constantes();\n\n // Definir Array del objeto de la clase BeneficiosCovid\n ArrayList <BeneficiosCovid19> arrayBeneficios = new ArrayList <BeneficiosCovid19>();\n\n System.out.println(\"Por favor ingresar Subsidios para la lista Nro: \" + posarray);\n\n // Variables de trabajo\n String tipoDato = \"\";\n String info = \"\";\n String idrandom;\n String continuar = constantes.TXT_SI;\n //iniciar Ciclo para cargar informacion\n //while (continuar.equals(\"SI\")){\n\n //Definir Objeto de la clase BeneficiosCovid\n BeneficiosCovid19 beneficios_Covid = new BeneficiosCovid19();\n\n //Ingresar Nombre Tipo Alfa\n tipoDato = \"A\";\n info = validarinfo(constantes.TXT_Inp_Nombre,tipoDato);\n beneficios_Covid.setNombre(info);\n\n //Ingresar Valor Subsidio Tipo Numerico\n tipoDato = \"N\";\n info = validarinfo(constantes.TXT_Inp_Subsidio,tipoDato);\n beneficios_Covid.setValorSubsidio(Float.parseFloat(info));\n\n //Obtener el ID de manera aleatoria\n idrandom = getIdBeneficio();\n beneficios_Covid.setId(idrandom);\n\n arrayBeneficios.add(beneficios_Covid);\n\n /**\n * Validacion para continuar o finalizar el ciclo\n * principaly finalizar Main de manera controlada\n * por consola\n **/\n\n /* tipoDato = \"A\";\n continuar = validarinfo(constantes.TXT_Msg_Continuar,tipoDato);\n // Validar valor ingrsado para continuar o finalizar aplicación\n while ( !continuar.equals(\"SI\") && !continuar.equals(\"NO\")) {\n continuar = validarinfo(constantes.TXT_Msg_Continuar, tipoDato);\n }\n\n }\n */\n return arrayBeneficios;\n }", "public String[][] datosEstiloViaje()\n {\n ResultSet sql; \n try {\n Connection con = conexion.abrirConexion();\n Statement s = con.createStatement();\n sql = s.executeQuery(\"SELECT `idEstiloViaje`, `tipo` FROM `estiloviaje` ;\");\n //número de registros obrenidos\n int count = 0;\n while (sql.next()) {\n ++count;\n }\n //declaración del array\n String [][] a = new String [count][2];\n //se regresa al primero\n sql.beforeFirst();\n //contador para copiar del resultset al array\n int i = 0;\n //copiar del resultset al array\n while (sql.next())\n {\n a[i][0] = sql.getString(1);\n a[i][1] = sql.getString(2);\n i++;\n } \n conexion.cerrarConexion(con);\n return a;\n }\n catch (SQLException ex)\n {\n return null;\n }\n catch(NullPointerException e){\n JOptionPane.showMessageDialog(null, \"Error al intentar conectar con el servidor.\");\n return null;\n }\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 }", "private void iterativeDataPropertyMetrics() {\n\t}", "private void calcularOtrosIngresos(Ingreso ingreso)throws Exception{\n\t\tfor(IngresoDetalle ingresoDetalle : ingreso.getListaIngresoDetalle()){\r\n\t\t\tif(ingresoDetalle.getIntPersPersonaGirado().equals(ingreso.getBancoFondo().getIntPersonabancoPk())\r\n\t\t\t&& ingresoDetalle.getBdAjusteDeposito()==null){\r\n\t\t\t\tbdOtrosIngresos = ingresoDetalle.getBdMontoAbono();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void cargarDocumentos(CategoriaBE objCategoria,UsuarioBE objUsuario){\n this.pgbCargaDocumentos.setMaximum(100);\n int paso= 100/this.nomArch.size();\n String resultado = \"\";\n int valorActual = 0;\n for (int i = 0; i < nomArch.size(); ++i){\n DocumentoBE doc = null;\n try {\n int idDoc = Utilitario.generaCodigo(\"Documento\");\n doc = new DocumentoBE(idDoc, \"activo\" , nomArch.get(i).getName() , objUsuario, null);\n doc.setContenido(DocumentoBL.obtenerContenido(nomArch.get(i)));\n doc.setCategoria(objCategoria);\n\n try {\n ConexionJDBC.abrirConexion();\n if (DocumentoBL.registrar(doc)){\n resultado = \"El archivo \" + nomArch.get(i).getName() + \" fue registrado con exito\";\n String descripcion = GestorTiposOperacion.getTipoOperacion(\"registra\") + \"\\n\";\n descripcion += \"Registro nuevo:\\n\" + doc.getNombre() + \"\\n\";\n descripcion += \"Estado: \" + doc.getEstado();\n JFBase.setOperacion(this.getName(), GestorTiposOperacion.getTipoOperacion(\"registra\"), descripcion);\n JFBase.registrarOperacion();\n ConexionJDBC.cerrarConexion();\n }\n else {\n resultado = \"Error al registrar \" + nomArch.get(i).getName() + \" el archivo no fue registrado\";\n }\n } catch (Exception ex) {\n Logger.getLogger(JDRegistrarDocumento.class.getName()).log(Level.SEVERE, null, ex);\n }\n this.taDatosProgreso.setText(this.taDatosProgreso.getText() + \"\\n\" + resultado);\n valorActual += paso;\n this.pgbCargaDocumentos.setValue(valorActual);\n Rectangle rect = this.pgbCargaDocumentos.getBounds();\n\t\trect.x = 0;\n\t\trect.y = 0;\n\t\tthis.pgbCargaDocumentos.paintImmediately( rect );\n rect = this.pnlDatosProgreso.getBounds();\n rect.x = 0;\n rect.y = 0;\n this.pnlDatosProgreso.paintImmediately(rect);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(JDRegistrarDocumento.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(JDRegistrarDocumento.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n //PanelDocumento.fin=true;\n this.pgbCargaDocumentos.setValue(100);\n this.btnAceptar.setEnabled(true);\n }", "public void cadastrarOfertasQuad2(){\n \n String[] palavras;\n \n //Primeiro quadrimestre\n try {\n try (BufferedReader lerArq = new BufferedReader(new InputStreamReader(new FileInputStream(\"/home/charles/alocacao/Arquivos Alocação/Arquivos CSV/Planejamento2017_q2.csv\"), \"UTF-8\"))) {\n String linha = lerArq.readLine(); //cabeçalho\n \n linha = lerArq.readLine(); \n\n// linha = linha.replaceAll(\"\\\"\", \"\");\n while (linha != null) {\n\n linha = linha.replaceAll(\"\\\"\", \"\");\n\n palavras = linha.split(\";\", -1);\n\n oferta = new OfertaDisciplina();\n\n oferta.setCurso(palavras[0]);//2\n\n String nome = palavras[2];//4\n \n String codigo = palavras[1];//3\n \n Disciplina d = disciplinaFacade.findByCodOrName(codigo, nome);\n\n if (d != null) {\n// Disciplina d = disciplinaFacade.findByName(nome).get(0);\n oferta.setDisciplina(d);\n }\n oferta.setT(Integer.parseInt(palavras[3]));//5\n oferta.setP(Integer.parseInt(palavras[4]));//6\n oferta.setTurno(palavras[6]);//11\n oferta.setCampus(palavras[7]);//12\n if (!palavras[8].equals(\"\")) {\n oferta.setNumTurmas(Integer.parseInt(palavras[8]));//13\n }\n if (!palavras[9].equals(\"\")) {\n oferta.setPeriodicidade(palavras[9]);//19\n } else{\n oferta.setPeriodicidade(\"semanal\");\n }\n oferta.setQuadrimestre(2);\n\n salvarNoBanco();\n\n linha = lerArq.readLine();\n// linha = linha.replaceAll(\"\\\"\", \"\");\n }\n } //cabeçalho\n ofertas2LazyModel = null;\n\n } catch (IOException e) {\n System.err.printf(\"Erro na abertura do arquivo: %s.\\n\", e.getMessage());\n }\n }", "public void setAtores(Iterator<IPessoa> atores);", "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 }", "public void buscarDatos() throws Exception {\n\t\ttry {\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\n\t\t\t\t\t.toString();\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\n\n\t\t\tMap<String, Object> parameters = new HashMap<String, Object>();\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\n\n\t\t\tif (parameter.equalsIgnoreCase(\"fecha_inicial\")) {\n\t\t\t\tparameters.put(\"fecha_string\", value);\n\t\t\t} else {\n\t\t\t\tparameters.put(\"parameter\", parameter);\n\t\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\n\t\t\t}\n\t\t\tif (admision != null) {\n\t\t\t\tparameters.put(\"identificacion\",\n\t\t\t\t\t\tadmision.getNro_identificacion());\n\t\t\t}\n\n\t\t\tgetServiceLocator().getFicha_epidemiologia_nnService().setLimit(\n\t\t\t\t\t\"limit 25 offset 0\");\n\n\t\t\tList<Ficha_epidemiologia_n3> lista_datos = getServiceLocator()\n\t\t\t\t\t.getFicha_epidemiologia_nnService().listar(\n\t\t\t\t\t\t\tFicha_epidemiologia_n3.class, parameters);\n\t\t\trowsResultado.getChildren().clear();\n\n\t\t\tfor (Ficha_epidemiologia_n3 ficha_epidemiologia_n3 : lista_datos) {\n\t\t\t\trowsResultado.appendChild(crearFilas(\n\t\t\t\t\t\tficha_epidemiologia_n3, this));\n\t\t\t}\n\n\t\t\tgridResultado.setVisible(true);\n\t\t\tgridResultado.setMold(\"paging\");\n\t\t\tgridResultado.setPageSize(20);\n\n\t\t\tgridResultado.applyProperties();\n\t\t\tgridResultado.invalidate();\n\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}", "public Cromosoma[] generarSegmentos(Cromosoma[] poblacion, Evaluador evaluador, boolean mejora) {\r\n\t\tdouble puntAcumulada = 0.0; //puntuacion acumulada\r\n\t\tdouble sumaAptitud = 0.0; //suma de la aptitud\r\n\t\tint tamañoPoblacion = poblacion.length;\r\n\t\t\r\n\t\t//ordenamos la poblacion de peor a mejor aptitud.\r\n\t\tpoblacion = Ordenacion.sortSelectionIndividuals(poblacion, evaluador);\r\n\t\t\t\t\r\n\t\tdouble[] aptitudesEscaladas = new double[poblacion.length];\r\n\t\tdouble a = (C-1)*Poblacion.mediaPoblacionInstantanea(poblacion)/(Poblacion.mejorPoblacionInstantanea(poblacion, evaluador).getAptitud()-Poblacion.mediaPoblacionInstantanea(poblacion));\r\n\t\tdouble b = Poblacion.mediaPoblacionInstantanea(poblacion)*(1-a);\r\n\t\t\r\n\t\tfor(int i = 0; i<tamañoPoblacion; i++){\r\n\t\t\taptitudesEscaladas[i] = a*poblacion[i].getAptitud()+b;\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t\tdouble[] aptitudesPositivas = new double[tamañoPoblacion];\r\n\t\tfor (int i = 0; i< tamañoPoblacion; i++){\r\n\t\t\t\tdouble aptitudPositivaI = poblacion[i].getAptitud();\r\n\t\t\t\taptitudesPositivas[i] = aptitudPositivaI;\r\n\t\t}\r\n\t\t\r\n\t\t//si el problema es de minimizacion, debemos asignar mejores puntuaciones a los individuos con\r\n\t\t//menor aptitud luego transformamos el problema de minimizacion en un problema de maximizacion\r\n\t\tdouble[] aptitudesMaximizadas = new double[aptitudesPositivas.length];\r\n\t\tif(mejora)\r\n\t\t\taptitudesMaximizadas = evaluador.transformarAptitudesAMaximizacion(aptitudesEscaladas);\r\n\t\telse \r\n\t\t\taptitudesMaximizadas = evaluador.transformarAptitudesAMaximizacion(aptitudesPositivas);\r\n\t\taptitudesPositivas = aptitudesMaximizadas;\r\n\t\t\r\n\t\t//calculamos la suma de las aptitudes\r\n\t\tfor (int i = 0; i< aptitudesPositivas.length; i++){\r\n\t\t\tsumaAptitud += aptitudesPositivas[i];\r\n\t\t}\r\n\t\t//calculo de puntuaciones y puntuaciones acumuladas\r\n\t\tfor (int i = 0; i< tamañoPoblacion; i++){\r\n\t\t\t\r\n\t\t\tdouble aptitudI = aptitudesPositivas[i];\r\n\t\t\t\r\n\t\t\tpoblacion[i].setPuntuacion(aptitudI/sumaAptitud);\r\n\t\t\tdouble acumulacion = poblacion[i].getPuntuacion() + puntAcumulada;\r\n\t\t\tpoblacion[i].setPuntuacionAcumulada(acumulacion);\r\n\t\t\tpuntAcumulada = acumulacion;\r\n\t\t}\r\n\t\treturn poblacion;\r\n\t}", "public static String[][] acomodamiento(char direccion, String[][] cuadricula) {\n int numeroA;\n int espacios;\n for (int fila = 0; fila < 4; fila++) {\n\n for (int columna = 0; columna < 4; columna++) {\n\n switch (direccion) {\n case 'w':\n /*Creamos una condicion que empezara a mover los numeros si la posicion en esa parte\n de la matriz no esta vacia, cuando la encuentra mueve desde esa posicion hacia arriba\n del cuadro y si se encuentra alguna parte igual la suma , si esta vacia la remplaza y si no se queda igual\n */\n if (cuadricula[columna][fila].equals(\" \") == false) {\n for (int vecesMovimiento = columna; vecesMovimiento > 0; vecesMovimiento--) {\n //Verigica si hay un numero igual arriba suyo para sumarse\n if (cuadricula[vecesMovimiento][fila].equals(cuadricula[vecesMovimiento - 1][fila])) {\n /* Como los numeros son iguales se toma uno, se convierte el string de esa parte de la cuadricula a\n numeroA la duplica y se la agrega a la posicion de arriba\n */\n numeroA = Integer.parseInt(cuadricula[vecesMovimiento][fila].replaceAll(\" \", \"\"));\n numeroA += numeroA;\n cuadricula[vecesMovimiento - 1][fila] = Integer.toString(numeroA);\n /* desde la parte de espacios = 4 - cuadricula[vecesMovimiento-1]... hasta el for solo es el numero de espacios agregados al numero que dara\n para que se mantenga posicionado junto con la cuadricula\n */\n espacios = 4 - cuadricula[vecesMovimiento - 1][fila].length();\n for (int barras = espacios; barras > 0; barras--) {\n cuadricula[vecesMovimiento - 1][fila] += \" \";\n }\n cuadricula[vecesMovimiento][fila] = \" \";\n } //Condicion que indica si hay un espacio vacio en una posicion arriba la sustituye la de abajo\n else if (cuadricula[vecesMovimiento - 1][fila].equals(\" \")) {\n cuadricula[vecesMovimiento - 1][fila] = cuadricula[vecesMovimiento][fila];\n cuadricula[vecesMovimiento][fila] = \" \";\n }\n }\n }\n break;\n\n case 's':\n /*Creamos una condicion que empezara a mover los numeros si la posicion en esa parte\n de la matriz no esta vacia,tomando en cuenta que inicia a contar de abajo para arriba, cuando la encuentra mueve\n desde esa posicion hacia abajo del cuadro y si se encuentra alguna parte igual la suma , si esta vacia la remplaza y si no se queda igual\n */\n if (cuadricula[3 - columna][fila].equals(\" \") == false) {\n //Empezamos el ciclo en una posicion de abajo de la matriz\n // llegaremos hasta 2 ya que sigue comparando con una posicion abajo extra gracias al +1\n for (int vecesMovimiento = 3 - columna; vecesMovimiento < 3; vecesMovimiento++) {\n /* Como los numeros son iguales se toma uno, se convierte el string de esa parte de la cuadricula a\n numeroA la duplica y se la agrega a la posicion de abajo\n */\n if (cuadricula[vecesMovimiento][fila].equals(cuadricula[vecesMovimiento + 1][fila])) {\n numeroA = Integer.parseInt(cuadricula[vecesMovimiento][fila].replaceAll(\" \", \"\"));\n numeroA += numeroA;\n cuadricula[vecesMovimiento + 1][fila] = Integer.toString(numeroA);\n /* desde la parte de espacios = 4 - cuadricula[vecesMovimiento-1]... hasta el for solo es el numero de espacios agregados al numero que dara\n para que se mantenga posicionado junto con la cuadricula\n */\n espacios = 4 - cuadricula[vecesMovimiento + 1][fila].length();\n for (int barras = espacios; barras > 0; barras--) {\n cuadricula[vecesMovimiento + 1][fila] += \" \";\n }\n cuadricula[vecesMovimiento][fila] = \" \";\n } //Condicion que indica si hay un espacio vacio en una posicion abajo la sustituye la de arriba\n else if (cuadricula[vecesMovimiento + 1][fila].equals(\" \")) {\n cuadricula[vecesMovimiento + 1][fila] = cuadricula[vecesMovimiento][fila];\n cuadricula[vecesMovimiento][fila] = \" \";\n }\n }\n }\n break;\n\n case 'a':\n /*Creamos una condicion que empezara a mover los numeros si la posicion en esa parte\n de la matriz no esta vacia,tomando en cuenta que inicia a contar de izquierda a derecha, cuando la encuentra mueve\n desde esa posicion hacia la izquierda del cuadro y si se encuentra alguna parte igual la suma , si esta vacia la remplaza y si no se queda igual\n */\n if (cuadricula[fila][columna].equals(\" \") == false) {\n //Empezamos el ciclo en una posicion de la izquierda de la matriz, es decir inicializada en 0\n for (int vecesMovimiento = columna; vecesMovimiento > 0; vecesMovimiento--) {\n /* Como los numeros son iguales se toma uno, se convierte el string de esa parte de la cuadricula a\n numeroA la duplica y se la agrega a la posicion de izquierda\n */\n if (cuadricula[fila][vecesMovimiento].equals(cuadricula[fila][vecesMovimiento - 1])) {\n numeroA = Integer.parseInt(cuadricula[fila][vecesMovimiento].replaceAll(\" \", \"\"));\n numeroA += numeroA;\n cuadricula[fila][vecesMovimiento - 1] = Integer.toString(numeroA);\n espacios = 4 - cuadricula[fila][vecesMovimiento - 1].length();\n for (int barras = espacios; barras > 0; barras--) {\n cuadricula[fila][vecesMovimiento - 1] += \" \";\n }\n cuadricula[fila][vecesMovimiento] = \" \";\n } //Condicion que indica si hay un espacio vacio en una posicion izquierda la sustituye la de derecha\n else if (cuadricula[fila][vecesMovimiento - 1].equals(\" \")) {\n cuadricula[fila][vecesMovimiento - 1] = cuadricula[fila][vecesMovimiento];\n cuadricula[fila][vecesMovimiento] = \" \";\n }\n }\n }\n break;\n\n //Lo mismo establecido pero orientado a la derecha, y en lugar del -1 de los vectores lo pasamos como +1 siguiendo la estructura\n //de la opcion 's'\n case 'd':\n if (cuadricula[fila][3 - columna].equals(\" \") == false) {\n for (int vecesMovimiento = 3 - columna; vecesMovimiento < 3; vecesMovimiento++) {\n if (cuadricula[fila][vecesMovimiento].equals(cuadricula[fila][vecesMovimiento + 1])) {\n numeroA = Integer.parseInt(cuadricula[fila][vecesMovimiento].replaceAll(\" \", \"\"));\n numeroA += numeroA;\n cuadricula[fila][vecesMovimiento + 1] = Integer.toString(numeroA);\n espacios = 4 - cuadricula[fila][vecesMovimiento + 1].length();\n for (int barras = espacios; barras > 0; barras--) {\n cuadricula[fila][vecesMovimiento + 1] += \" \";\n }\n cuadricula[fila][vecesMovimiento] = \" \";\n } else if (cuadricula[fila][vecesMovimiento + 1].equals(\" \")) {\n cuadricula[fila][vecesMovimiento + 1] = cuadricula[fila][vecesMovimiento];\n cuadricula[fila][vecesMovimiento] = \" \";\n }\n }\n }\n break;\n\n }\n\n }\n }\n return cuadricula;\n }", "private void init() {\n visitado = new boolean[N+2][N+2];\n for (int x = 0; x < N+2; x++) visitado[x][0] = visitado[x][N+1] = true;\n for (int y = 0; y < N+2; y++) visitado[0][y] = visitado[N+1][y] = true;\n\n\n // todas las paredes levantadas\n norte = new boolean[N+2][N+2];\n este = new boolean[N+2][N+2];\n sur = new boolean[N+2][N+2];\n oeste = new boolean[N+2][N+2];\n for (int x = 0; x < N+2; x++)\n for (int y = 0; y < N+2; y++)\n norte[x][y] = este[x][y] = sur[x][y] = oeste[x][y] = true;\n }" ]
[ "0.67143005", "0.60407317", "0.5886557", "0.5718467", "0.56986296", "0.5669791", "0.56517977", "0.5622954", "0.56116724", "0.56077385", "0.56067336", "0.55338246", "0.55188966", "0.5502012", "0.54959536", "0.5482101", "0.54814273", "0.5440586", "0.54398036", "0.54155916", "0.5410147", "0.5408932", "0.54082674", "0.5389198", "0.5385496", "0.53837305", "0.53712904", "0.5356339", "0.53522867", "0.53521574", "0.53505707", "0.5348684", "0.53485036", "0.5347873", "0.53449434", "0.5339522", "0.533229", "0.5329213", "0.5323822", "0.5322017", "0.53174245", "0.5306809", "0.53067875", "0.5303882", "0.5297433", "0.5287374", "0.52805233", "0.5279796", "0.52797854", "0.52746814", "0.52737045", "0.5271061", "0.52649844", "0.5263802", "0.52585953", "0.52509207", "0.52456975", "0.5242217", "0.52370816", "0.5214801", "0.5208903", "0.5204703", "0.52009356", "0.52002865", "0.51992875", "0.5198527", "0.51980764", "0.5197117", "0.51877135", "0.518331", "0.51790226", "0.51766735", "0.51747346", "0.51677746", "0.51655895", "0.5164271", "0.51610947", "0.5157185", "0.51565313", "0.5153416", "0.5153305", "0.5151991", "0.5148911", "0.5143385", "0.51333255", "0.51319736", "0.5131743", "0.51302266", "0.5121732", "0.5119956", "0.51148957", "0.5109258", "0.5105465", "0.5102983", "0.5096987", "0.5095898", "0.5095648", "0.5095173", "0.5084473", "0.5083681" ]
0.7110382
0
iteracion mas optimizada de una estrategia
public DatosIteracion mejorIteracionVisibles() { ArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>(); for (DatosEstrategia e : this.getValoresEstrategias()) { array.add(this.mejorIteracionVisibles(e.getValoresIteraciones())); } return this.mejorIteracionVisibles(array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public DatosIteracion mejorIteracionOptimizada(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "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 }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\n\t}", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\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 static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byCoseno(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudCoseno(it1, it2, test);\r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "public ChampionnatComplexe (int [] Eq12,Matrice mat,Options o ) {\n\t\topt = o;\n\t\tint equilibrea = 0;\n\t\tint equilibreb = 0;\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3]; \n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibrea = grpA1[z] + grpA2[z] ;\n\t\t\tequilibreb = grpB1[z] + grpB2[z] ;\n\t\t}\n\t\tequilibreDesPoule = Integer.max(equilibrea, equilibreb) - Integer.min(equilibreb, equilibreb);\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\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}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public void determinarEstadoSalud(){\n \n for (int i = 0; i < listaEmpleados.size(); i++) {\n //Este for chequea si tiene alguna enfermedad preexistente -> asigna puntajes de acuerdo\n for (int j = 0; j < factoresRiesgo.length; j++) {\n \n if(listaEmpleados.get(i).getFactoresRiesgo().contains(factoresRiesgo[j])){ \n listaEmpleados.get(i).setEstadoSalud(30);\n }\n }\n //Verifica el rango de edad de la persona -> asigna puntajes de acuerdo\n if(listaEmpleados.get(i).getEdad() >= 70){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+50);\n }\n if(listaEmpleados.get(i).getEdad() >= 40 && listaEmpleados.get(i).getEdad() < 70 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+30);\n }\n if(listaEmpleados.get(i).getEdad() >= 20 && listaEmpleados.get(i).getEdad() < 40 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+10);\n }\n //Los hombre tienen mas probabilidades de morir por la mayoria de enfermedad, incluyendo el covid-19\n if(listaEmpleados.get(i).getSexo().equals(\"hombre\")){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+15);\n \n }\n //Verifica los diferentes puntajes y almacena los empleados en diferentes arraylist dependiendo su prioridad\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 80){\n EmpleadosPrioridadAlta.add(listaEmpleados.get(i)); \n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 60 && listaEmpleados.get(i).getEstadoSalud() < 80){\n EmpleadosPrioridadMediaAlta.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 35 && listaEmpleados.get(i).getEstadoSalud() < 60){\n EmpleadosPrioridadMedia.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 0 && listaEmpleados.get(i).getEstadoSalud() < 35){\n EmpleadosPrioridadBaja.add(listaEmpleados.get(i));\n }\n \n } \n \n }", "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\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//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "private void gerarConjuntosFuzzy(){\n\t\tthis.conjuntosFuzzy = new ArrayList<ConjuntoFuzzy>();\n\t\tdouble tamanhoDominio = this.valorMaximo - this.valorMinimo;\n\t\t//System.out.println(\"Extensão do domínio: \" + tamanhoDominio + \"[\" + this.limiteInferior + \", \" + this.limiteSuperior + \"]\");\n\t\tdouble range = tamanhoDominio/(this.quantRegioesFuzzy - 1);\n\t\tdouble inf = this.valorMinimo;\n\t\tdouble sup = this.valorMinimo + range;\n\t\t\n\t\t//Definição dos limites das regiões de pertinencia triangular\n\t\tfor(int i = 0; i < this.quantRegioesFuzzy; i++){\n\t\t\tString idConjunto = new String(this.nome + \"_\" + i);\n\t\t\tConjuntoFuzzy conjunto = new ConjuntoFuzzy(this.nome, idConjunto, inf, sup, i);\n\t\t\tthis.conjuntosFuzzy.add(conjunto);\n\t\t\t//System.out.println(\"Conjunto: \" + i + \" [\" + inf + \", \" + sup + \"]\");\n\t\t\tinf += range/2;\n\t\t\tsup += range/2;\n\t\t}\n\t\t\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byPearson(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudPearson(it1, it2, test);\r\n \r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\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 }", "public void resolver() {\r\n\t\tfor(int i = 0; i<casillas.length; i++) {\r\n\t\t\tfor(int j = 0; j<casillas[0].length; j ++) {\r\n\t\t\t\tif(casillas[i][j].darSeleccionada() == false) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tcasillas[i][j].modificarValor(cantidadMinasAlrededor(i, j));\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\n\t}", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "public void solucion() {\r\n System.out.println(\"Intervalo : [\" + a + \", \" + b + \"]\");\r\n System.out.println(\"Error : \" + porce);\r\n System.out.println(\"decimales : \"+ deci);\r\n System.out.println(\"Iteraciones : \" + iteraciones);\r\n System.out\r\n .println(\"------------------------------------------------ \\n\");\r\n \r\n double c = 0;\r\n double fa = 0;\r\n double fb = 0;\r\n double fc = 0;\r\n int iteracion = 1;\r\n \r\n do {\r\n // Aqui esta la magia\r\n c = (a + b) / 2; \r\n System.out.println(\"Iteracion (\" + iteracion + \") : \" + c);\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n fc = funcion(c);\r\n if (fa * fc == 0) {\r\n if (fa == 0) {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+a);\r\n System.out.println(a);\r\n System.exit(0);\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+c);\r\n System.out.println(c);\r\n System.exit(0);\r\n }}\r\n \r\n if (fc * fa < 0) {\r\n b = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n } else {\r\n a = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n }\r\n iteracion++;\r\n // Itera mientras se cumpla la cantidad de iteraciones establecidas\r\n // y la funcion se mantenga dentro del margen de error\r\n \r\n er = Math.abs(((c - x) / c)* 100);\r\n BigDecimal bd = new BigDecimal(aux1);\r\n bd = bd.setScale(deci, RoundingMode.HALF_UP);\r\n BigDecimal bdpm = new BigDecimal(pm);\r\n bdpm = bdpm.setScale(deci, RoundingMode.HALF_UP);\r\n cont++;\r\n fc=c ;\r\n JOptionPane.showMessageDialog(null, \"conteos: \" + cont + \" Pm: \" + bd.doubleValue() + \" Funcion: \" + bdpm.doubleValue() + \" Error: \" + er +\"%\"+ \"\\n\");\r\n } while (er <=porce);\r\n \r\n \r\n }", "public void getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<String> ExcutarCalculo(ArrayList<String> linha, String tipo){\n ArrayList<String> cod = new ArrayList();\n String reg, rv1, rv2;\n \n /*Verifica se a variavel tem registrador*/\n reg = r.getRegistrador(linha.get(0));\n if(linha.size() == 3){//x = n\n rv1 = r.getRegistrador(linha.get(2));//Verifica se é variavel\n \n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n } \n \n if(rv1 == null)\n cod.add(\"load \"+reg+\", \"+linha.get(2));\n else\n cod.add(\"load \"+reg+\", \"+rv1);\n }else{\n ArrayList<String> aux = new ArrayList();\n String[] ordem = new String[100];\n String [][]operador = {{\"(\",\"\"},{\"*\",\"mult\"},{\"/\",\"div\"},{\"+\",\"add\"},{\"-\",\"sub\"}};\n String []temp = {\"ra\",\"rb\",\"rc\",\"rd\",\"re\",\"rf\"};\n Boolean ctr = false;\n int i, j, k, tl, ctrTemp, r1, r2, pos;\n \n for(i = 0; i < 100; i++){\n ordem[i] = \"\";\n } \n \n tl = ctrTemp = 0;\n for(i = 0; i < 5; i++){\n for(j = 0; j < linha.size(); j++){\n if(linha.get(j).contains(operador[i][0])){\n if(i == 0){\n /* min = verificaRegistradores(linha.get(j+1),linha.get(j+3),temp);\n \n if(min == -1){\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t1\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+3);//Carrega val no registrador t2\n }\n \n \n for(k = 0; k < 5; k++){\n if(linha.get(j+2).contains(operador[k][0])){ \n if(operador[k][1].equals(\"add\")){\n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n }\n \n k = 5;\n }\n }\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3 por conta de reuso\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n \n for(k = 0; k < 5; k++)//( ate )\n linha.remove(j);\n linha.add(j,temp[ctrTemp-2]);\n \n if(min == -1)\n ctrTemp -= 1;\n else\n ctrTemp = 0;*/\n }else{\n rv1 = r.getRegistrador(linha.get(j-1));\n rv2 = r.getRegistrador(linha.get(j+1));\n \n r1 = verificaRegistradores(linha.get(j-1),temp);\n if(r1 == -1){//Nenhum registrador\n if(rv1 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j-1);//Carrega val no registrador t1\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv1;\n }\n r2 = verificaRegistradores(linha.get(j+1),temp);\n if(r2 == -1){//Nenhum registrador\n if(rv2 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t2\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv2;//Carrega val no registrador t2\n } \n \n pos = ctrTemp;//como posso entrar no mult ou no add\n if(operador[i][1].equals(\"mult\") || operador[i][1].equals(\"div\")){\n ctrTemp -= 2;\n \n if(operador[i][1].equals(\"mult\")){\n aux = mult(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }else\n if(operador[i][1].equals(\"div\")){\n aux = div(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }\n \n tl -= 2;\n for(k = 0; k < aux.size(); k++){\n ordem[tl++] = aux.get(k);\n }\n pos = ctrTemp-1;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n /*else\n ctrTemp -= 1;*/\n }else\n if(operador[i][1].equals(\"add\") || operador[i][1].equals(\"sub\")){\n if(operador[i][1].equals(\"sub\")){\n ordem[tl-1] = \"load \"+temp[ctrTemp-1]+\", -\"+linha.get(j+1);\n }\n \n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n pos = ctrTemp-2;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n else\n ctrTemp -= 1;\n }\n \n for(k = 0; k < 3; k++)\n linha.remove(j-1);\n linha.add(j-1,temp[pos]);\n }\n ctr = true;//Faz repetir denovo caso adicione;\n }\n }\n if(ctr){\n i--;//Controla pra só sair quando tiver excluido todas operacoes desse tipo\n ctr = false;\n }\n }\n for(k = 0; k < tl; k++){\n cod.add(ordem[k]);\n }\n\n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n }\n cod.add(\"move \"+reg+\", \"+temp[ctrTemp-1]);\n ctrTemp = 0;\n }\n \n return cod;\n }", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\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 static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public void joueDeuxHumains()\n\t{\n\t\tboolean fin = false;\n\t\tboolean result = false;\n\t\tint etoiles;\n\t\tint choix;\n\t\tint i = 0;\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint x2 = 0;\n\t\tint y2 = 0;\n\t\tString couleur;\n\t\tetoiles = initialiser();\n\t\twhile (!fin)\n\t\t{\n\t\t\tif (i % 2 == 0)\n\t\t\t{\n\t\t\t\tcouleur = \"bleu\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcouleur = \"rouge\";\n\t\t\t}\n\t\t\tSystem.out.println(\"1-Jouer\");\n\t\t\tSystem.out.println(\"2-Afficher une composante\");\n\t\t\tSystem.out.println(\"3-Vérifier si une case relie une composante\");\n\t\t\tSystem.out.println(\"4-Regarder s'il existe un chemin entre deux cases d'une couleur donnée\");\n\t\t\tSystem.out.println(\"5-Afficher le nombre minimum de cases entre deux cases données (x,y) et (z,t)\");\n\t\t\tSystem.out.println(\"6-Quitter\");\n\t\t\tchoix = clavier.nextInt();\n\t\t\tafficher(i);\n\t\t\tswitch (choix)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"### Ajout d'une case pour jouer ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tresult = tableauPeres_[x][y].colorerCase(couleur);\n\t\t\t\t\t//System.out.println(existeCheminCases(getLesVoisins(x, y, couleur), tableauPeres_[x][y], couleur));\n\t\t\t\t\tif (getNbEtoiles(x, y, couleur) < getNbEtoiles(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), x, y);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(x, y, getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY());\n\t\t\t\t\t}\n\t\t\t\t\tpreparerScore(x, y, couleur);\n\t\t\t\t\tafficheScores(couleur);\n\t\t\t\t\tnombresEtoiles(x, y, couleur);\n\t\t\t\t\t++i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"### Afficher une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tafficheComposante(x, y, couleur);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"### Tester si une case relie une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tif(!relieComposantes(x, y, couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case ne relie aucune composante.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case relie une ou plusieurs composante(s).\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"### Tester s'il existe un chemin entre deux cases données ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tif (existeCheminCases(tableauPeres_[x][y], tableauPeres_[x2][y2], couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il existe un chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il n'existe pas de chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"### Afficher nombre minimum de cases qui relie deux cases ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tSystem.out.println(relierCasesMin(x, y, x2, y2, couleur));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tfin = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (scoreJ2_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur bleu a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\t\t\telse if (scoreJ1_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur rouge a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\n\t\t}\n\t}", "public Ruteo setCovering(){\n\t\tRuteo resultado=null;\n\t\t double time1= System.currentTimeMillis();\n\t\t Integer [][]a=new Integer[Auxiliar.OBRAS.size()][listaSetCovering.size()];\n\t\t List<Double>c=new ArrayList<Double>();\n\t\t List<Double>t=new ArrayList<Double>();\n\t\t List<Obra>listObras=Auxiliar.OBRAS;\n\t\t for(int i=0;i<listaSetCovering.size();i++){\n\t\t\t c.add(listaSetCovering.get(i).costosTotales);\n\t\t\t t.add(listaSetCovering.get(i).tiempoTotal);\n\t\t }\n\t\t for(int i=0;i<Auxiliar.OBRAS.size();i++){\n\t\t\t for(int j=0;j<listaSetCovering.size();j++){\n\t\t\t\t if(listaSetCovering.get(j).estaObraEnRuta(listObras.get(i))){\n\t\t\t\t\t a[i][j]=1;\n\t\t\t\t }else{\n\t\t\t\t\t a[i][j]=0;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t List<Integer>respuesta=new ArrayList<Integer>();\n\t\tif(fo==FO1){\n\t\t\tSetCovering sc=new SetCovering();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\t\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tobjval=sc.fo;\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO2){\n\t\t\tSetCovering2 sc=new SetCovering2();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO3){\n\t\t\tSetCovering3 sc=new SetCovering3();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO4){\n\t\t\tSetCovering4 sc=new SetCovering4();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalSetCovering=(time2-time1)/1000.0;\n\t\t return resultado;\n\t}", "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 }", "public static void main(String[] args) {\n ArrayList<Integer> taszkok = new ArrayList<>();\r\n String text = null;\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\r\n try {\r\n text = reader.readLine();\r\n\r\n String[] taszkfeltolt = text.split(\",\");\r\n for(int i = 0; i<taszkfeltolt.length ;i++){\r\n taszkok.add(Integer.parseInt(taszkfeltolt[i])) ;\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n\r\n }\r\n\r\n int laphibak=0;\r\n ArrayList<String> abc = new ArrayList<>();\r\n ArrayList<Integer> fagyi = new ArrayList<>();\r\n ArrayList<Integer> szam = new ArrayList<>();\r\n for(int i = 0; i<taszkok.size();i++){\r\n boolean csillag=false;\r\n boolean nemvoltlaphiba=false;\r\n int fagyilesz=-1;\r\n //System.out.print(taszkok.get(i));\r\n\r\n if(0>taszkok.get(i)){\r\n //valami történik\r\n taszkok.set(i, taszkok.get(i)*(-1));\r\n fagyilesz=0;\r\n }\r\n if(abc.size()<3){\r\n\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){\r\n if (abc.size()==2){\r\n abc.add(\"C\");\r\n System.out.print(\"C\");\r\n }\r\n else if (abc.size()==1){\r\n abc.add(\"B\");\r\n System.out.print(\"B\");\r\n }\r\n else if (abc.size()==0){\r\n abc.add(\"A\");\r\n System.out.print(\"A\");\r\n }\r\n szam.add(taszkok.get(i));\r\n if(fagyilesz!=0){\r\n fagyi.add(4); // a kör végén ugy is csökkentem 1el elsőre is\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n //System.out.print(abc);\r\n int tempfagyi=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n if(fagyilesz!=0){\r\n fagyi.add(tempfagyi);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n //System.out.print(temp+\"e,\");\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n }\r\n else if(abc.size()==3){\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){ //ha ez egy uj szam\r\n int hanyadikbet=vanszabad(fagyi);\r\n if(hanyadikbet!=-1){\r\n String temp=abc.get(hanyadikbet);\r\n szam.remove(hanyadikbet);\r\n szam.add(taszkok.get(i));\r\n abc.remove(hanyadikbet); //a tömb végére rakom és 4 ra allitom a fagyasztast\r\n abc.add(temp);\r\n\r\n fagyi.remove(hanyadikbet);\r\n if(fagyilesz!=0){\r\n fagyi.add(4);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n\r\n System.out.print(temp);\r\n }\r\n else{\r\n csillag=true;\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n int fagyitemp=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n fagyi.add(fagyitemp);\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n\r\n }\r\n\r\n if (csillag==true){\r\n System.out.print(\"*\");\r\n }\r\n if(nemvoltlaphiba==true){\r\n System.out.print(\"-\");\r\n }\r\n else{\r\n laphibak++;\r\n }\r\n for(int j = 0; j<fagyi.size();j++){\r\n if(fagyi.get(j)!=0){\r\n fagyi.set(j,fagyi.get(j)-1); //csokkentem a fagyasztast\r\n }\r\n }\r\n }\r\n\r\n\r\n System.out.println();\r\n System.out.print(laphibak);\r\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public GenerarInformePlanificacion(Curso[] cursos, Apoderado[] apoderados) {\n this.apoderados = new PlanificacionApoderado[apoderados.length];\n for (int i = 0; i < apoderados.length; i++) {\n this.apoderados[i] = new PlanificacionApoderado();\n }\n\n int cantidadCurso = 0;\n\n for (int apTotal = 0; apTotal < this.apoderados.length; apTotal++) {\n this.apoderados[apTotal].nombre = apoderados[apTotal].getNombre();\n this.apoderados[apTotal].apellido = apoderados[apTotal].getApellido();\n this.apoderados[apTotal].run = apoderados[apTotal].getRun();\n for (int cantPupilos = 0; cantPupilos < apoderados[apTotal].getPupilos().size(); cantPupilos++) {\n\n PlanificacionAlumno alumnoAgregar = new PlanificacionAlumno();\n alumnoAgregar.nombre = apoderados[apTotal].getPupilos().get(cantPupilos).getNombre();\n alumnoAgregar.apellido = apoderados[apTotal].getPupilos().get(cantPupilos).getApellido();\n alumnoAgregar.run = apoderados[apTotal].getPupilos().get(cantPupilos).getRun();\n for (int j = 0; j < 16; j++) {\n for (int alum = 0; alum < 30; alum++) {\n if (cursos[j].getAlumnos()[alum].getRun().equals(apoderados[apTotal].getPupilos().get(cantPupilos).getRun())) {\n cantidadCurso = j;\n break;\n }\n }\n }\n for (int i = 0; i < 50; i++) {\n alumnoAgregar.plan[i] = cursos[cantidadCurso].getAsignaturas()[(int) i / 10].getPlan()[i % 10];\n }\n this.apoderados[apTotal].pupilos.add(alumnoAgregar);\n\n }\n }\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 DatosIteracion mejorIteracionVisibles(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public static void main(String[] args) {\n\t\t\tScanner tastiera=new Scanner(System.in);\r\n\t\t\tint k=0, j=0;\r\n\t\t\tint conta=0;\r\n\t\t\tString risposta=\"\";\r\n\t\t\tRandom r=new Random();\r\n\t\t\tArrayList<Giocatore> partecipantiOrdinati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> partecipantiMescolati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> perdenti=new ArrayList<Giocatore>();\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tpartecipantiOrdinati.add(new Giocatore(GIOCATORI[i]));\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tint indice=Math.abs(r.nextInt()%partecipantiOrdinati.size());\r\n\t\t\t\tpartecipantiMescolati.add(partecipantiOrdinati.get(indice));\r\n\t\t\t\tpartecipantiOrdinati.remove(indice);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"INIZIA IL TORNEO DI BRISCOLA!\");\r\n\t\t\twhile(partecipantiMescolati.size()!=1) {\r\n\t\t\t\tSystem.out.println(\"Fase \"+(j+1));\r\n\t\t\twhile(conta<partecipantiMescolati.size()) {\r\n\t\t\t\tMazzo m=new Mazzo();\r\n\t\t\t\tm.ordinaMazzo();\r\n\t\t\t\tm.mescolaMazzo();\r\n\t\t\t\tGiocatore g1=partecipantiMescolati.get(conta);\r\n\t\t\t\tGiocatore g2=partecipantiMescolati.get(conta+1);\r\n\t\t\t\tPartita p=new Partita(g1,g2,m);\r\n\t\t\t\tSystem.out.println(\"Inizia la partita tra \"+g1.getNickName()+\" e \"+g2.getNickName());\r\n\t\t\t\tSystem.out.println(\"La briscola è: \"+p.getBriscola().getCarta());\r\n\t\t\t\tSystem.out.println(\"Vuoi skippare la partita? \"); risposta=tastiera.next();\r\n\t\t\t\tif(risposta.equalsIgnoreCase(\"si\")) {\r\n\t\t\t\t\tg1.setPunteggio(p.skippa());\r\n\t\t\t\t\tg2.setPunteggio(PUNTI_MASSIMI-g1.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g1.getNickName());//vince g1\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g2.getNickName());// vince g2\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g1);\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\tp.daiLePrimeCarte();\r\n\t\t\t\t\tCarta c1=new Carta(g1.gioca().getCarta());\r\n\t\t\t\t\tCarta c2=new Carta(g2.gioca().getCarta());\r\n\t\t\t\t\tg1.eliminaDaMano(c1); g2.eliminaDaMano(c2);\r\n\t\t\t\t\tint tracciatore=1; //parte dal giocatore 1\r\n\t\t\t\t\twhile(!m.mazzoMescolato.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g1); p.pesca(g2);\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g2); p.pesca(g1);\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2); \r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{tracciatore = 1; k--;}\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Manche Finale\");\r\n\t\t\t\t\twhile(!g1.carteInMano.isEmpty() || !g2.carteInMano.isEmpty()) {\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttracciatore = 1;\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Situazione: \"+g1.getNickName()+\": \"+g1.getPunteggio());\r\n\t\t\t\t\tSystem.out.println(g2.getNickName()+\": \"+g2.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g1.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g2.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tconta+=2;\r\n\t\t\t\tSystem.out.println(\"Premi una lettera per continuare: \"); risposta=tastiera.next();\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\tconta=0;\r\n\t\t\tfor(int i=0;i<perdenti.size();i++)\r\n\t\t\t\tpartecipantiMescolati.remove(perdenti.get(i));\r\n\t\t\tSystem.out.println(\"Restano i seguenti partecipanti: \");\r\n\t\t\tfor(int i=0;i<partecipantiMescolati.size();i++) {\r\n\t\t\t\tSystem.out.println(partecipantiMescolati.get(i).getNickName());\r\n\t\t\t\tpartecipantiMescolati.get(i).setPunteggio(0);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Il vincitore del torneo è: \"+partecipantiMescolati.get(0).getNickName());\r\n\t\t\t\t\r\n\t}", "public int[] choisir(int[] coord)\r\n {\r\n int[] res = new int[3]; //tableau a rendre\r\n int x = coord[0];\r\n int y = coord[1]; //récupération des coordonnées\r\n int[] voisinage= new int[4]; //tableau qui regardera les cases adjacentes à la case cherchée\r\n voisinage[0] = getValHaut(x,y);\r\n voisinage[1] = getValDroite(x,y);\r\n voisinage[2] = getValBas(x,y);\r\n voisinage[3] = getValGauche(x,y);\r\n System.out.println(\"je choisis la case \"+x+\" \"+y+\"\");\r\n for(int i = 0; i<voisinage.length; i++ ) //parcours des possibilités si on joue sans créer d'opportunités adverses\r\n {\r\n if (Vision[x][y][i+1] == 0) //si il n'y a pas de trait déja tracé\r\n {\r\n if (voisinage[i] != 2) //si la case adjacente n'a pas déja deux traits dessinés\r\n {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n //fin du si la case adjacente a déja 2 traits dessinés\r\n }\r\n //si il n'y a pas de trait déja tracé\r\n }\r\n //fin du for de parcours des possibilités de jouers sans créer d'opportunités adverses\r\n\r\n for(int i=0; i<voisinage.length ; i++ ) //Parcours des possibilités sans recherche d'opportunités\r\n {\r\n if (Vision[x][y][i+1] == 0) {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n }\r\n //fin du parcours de possibilité sans recherche\r\n return tabVide;\r\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 static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "@Override\n public Combinacion comprobarColores(Combinacion filaIntroducida) {\n Combinacion respuesta;\n\n\n ArrayList<Ficha> combinacionRespuesta = new ArrayList<>();\n ArrayList<Integer> fichasNegrasUtilizadas = new ArrayList<>();\n ArrayList<Integer> fichasTotalesUtilizadas = new ArrayList<>();\n boolean comprobado = false;\n Colores color = Colores.SC;\n\n // COMPROBAMOS LAS NEGRAS\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[i])) {\n combinacionRespuesta.add(new Ficha(Colores.NEGRO));\n fichasNegrasUtilizadas.add(i);\n }\n }\n\n fichasTotalesUtilizadas.addAll(fichasNegrasUtilizadas);\n // SEPARAMOS NEGRAS DE BLANCAS\n\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (!fichasNegrasUtilizadas.contains(i)) {\n for (int j = 0; j < filaIntroducida.getCodigo().length && !comprobado; j++) {\n if (!fichasTotalesUtilizadas.contains(j)) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[j])) {\n color = Colores.BLANCO;\n fichasTotalesUtilizadas.add(j);\n comprobado = true;\n } else {\n color = Colores.SC;\n }\n }\n }\n combinacionRespuesta.add(new Ficha(color));\n comprobado = false;\n }\n }\n\n combinacionRespuesta.sort(new Comparator<Ficha>() {\n @Override\n public int compare(Ficha o1, Ficha o2) {\n return o1.getColor().compareTo(o2.getColor());\n }\n });\n\n respuesta = new Combinacion(combinacionRespuesta.toArray(new Ficha[combinacionRespuesta.size()]));\n\n // MODO MEDIO Y FACIL\n\n return respuesta;\n }", "private List<PlanTrabajo> generarPlanesTrabajo( Date fecPrgn, \n\t\t\tList<Cuadrilla> cuadrillas,Map<Long, GrupoAtencion> mpGrupos, \n\t\t\tMap<Long, Long> asignaciones ){\n\t\t\n\t\t\tList<PlanTrabajo> planTrabajoList = new ArrayList<PlanTrabajo>();\n\t\t\tSet<Long> grupos = asignaciones.keySet();\t\n\t\t\tlong np = 1;\n\t\t\tfor (Long ngrupo : grupos) {\n\t\t\t\t Long ncuadrilla = asignaciones.get(ngrupo);\n\t\t\t\t GrupoAtencion grupoAtencion = mpGrupos.get(ngrupo);\n\t\t\t\t //GrupoAtencion grupoAtencion = asignar(cuadrilla, idx, mpGruposCached);\n\t\t\t\t PlanTrabajo planTrabajo = new PlanTrabajo(np);\n\t\t\t\t int nsp = 1;\n\t\t\t\t planTrabajo.setFechaProgramacion(new Timestamp(fecPrgn.getTime()));\n\t\t\t\t int i = cuadrillas.indexOf( new Cuadrilla(ncuadrilla));\n\t\t\t\t if(i!=-1){\n\t\t\t\t\t \n\t\t\t\t\t Cuadrilla cuadrilla = cuadrillas.get(i);\n\t\t\t\t\t planTrabajo.setCuadrilla(cuadrilla);\n\t\t\t\t\t planTrabajo.setGrupoAtencion(grupoAtencion);\n\t\t\t\t\t \n\t\t\t\t\t if(grupoAtencion!=null){\n\t\t\t\t\t\t for( GrupoAtencionDetalle d : grupoAtencion.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\t // añadiendo las solicitudes de servicio\t\n\t\t\t\t\t\t\t SolicitudServicio s = d.getSolicitudServicio();\n\t\t\t\t\t\t\t //System.out.println(\" #### añadiendo solicitud \"+s.getNumeroSolicitud());\n\t\t\t\t\t\t\t if(planTrabajo.getPlanTrabajoDetalles()==null){\n\t\t\t\t\t\t\t\t planTrabajo.setPlanTrabajoDetalles(new ArrayList<PlanTrabajoDetalle>());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t PlanTrabajoDetalle pd = new PlanTrabajoDetalle(np, nsp);\n\t\t\t\t\t\t\t pd.setSolicitudServicio(s);\n\t\t\t\t\t\t\t //planTrabajo.addPlanTrabajoDetalle( new PlanTrabajoDetalle(s));;\n\t\t\t\t\t\t\t planTrabajo.addPlanTrabajoDetalle(pd);\n\t\t\t\t\t\t\t nsp++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t planTrabajoList.add(planTrabajo);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t np++;\n\t\t\t}\n\t\t\t\n\t\treturn planTrabajoList;\n\t}", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public OptimismPessimismCalculator() {\n mostPositive = 0;\n mostPositiveDoc = null;\n mostNegative = 0;\n mostNegativeDoc = null;\n biggestDifference = 0;\n biggestDifferenceDoc = null;\n \n publisherOptimism = new HashMap<>();\n publisherPessimism = new HashMap<>();\n regionOptimism = new HashMap<>();\n regionPessimism = new HashMap<>();\n dayOptimism = new HashMap<>();\n dayPessimism = new HashMap<>();\n weekdayOptimism = new HashMap<>();\n weekdayPessimism = new HashMap<>();\n }", "public DatosIteracion mejorIteracionCapturados(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masCapturadas();\r\n\t}", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "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 }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public Tournee chercheSolution(int tpsLimite, ContraintesTournee contraintes, Map<String, Map<String, Chemin>> plusCourtsChemins){\n\t\t//HashMap avec l'id et le point pour pouvoir recuperer le point a partir de l'id\n\t\tHashMap<String, Intersection> intersections = new HashMap<String, Intersection>();\n\t\tIterator<PointEnlevement> itEnlev = (Iterator<PointEnlevement>)contraintes.getPointsEnlevement().iterator();\n\t\tIterator<PointLivraison> itLiv = (Iterator<PointLivraison>)contraintes.getPointsLivraison().iterator();\n\t\t\n\t\t//Remplissage HashMap des intersections \n\t\tintersections.put(contraintes.getDepot().getId(), contraintes.getDepot());\n\t\tint nbSommets = 1;\n\t\twhile(itEnlev.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itEnlev.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\twhile(itLiv.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itLiv.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\t\n\t\t//Initialisation de la HashMap vuDispo - contenant les attributs boolean vu et dispo\n\t\tHashMap<String, Paire> vuDispo = initVuDispo(contraintes, intersections);\n\t\t\n\t\tTournee tournee = new Tournee(contraintes);\n\t\t//Sequentiel et MinFirst\n//\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\t\n\t\t//MinFirst + 2-Opt\n\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\ttwoOpt(tpsLimite, System.currentTimeMillis(), tournee, plusCourtsChemins, intersections);\n\t\t\n\t\treturn tournee;\n\t}", "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 static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "public void ordenarRanking(){\n for(int i = 0; i < clasificacion.length; i++) {\n boolean flag = false;\n for(int j = 0; j < clasificacion.length-1; j++) {\n\n /*Si el elemento de la posicion j+1 es mayor que el anterior se intercambian\n los valores de esas posiciones*/\n if((clasificacion[j].getMediana())<(clasificacion[j+1].getMediana())) {\n Ranking k = new Ranking();\n k=clasificacion[j];\n clasificacion[j] = clasificacion[i];\n clasificacion[i] = k;\n flag=true; //Se pone a true para indicar que se ha hecho un cambio\n }//END_IF\n }//END_FOR\n\n if(!flag) break; //Si flag es igual a falso quiere decir que en la ultima iteracion\n //no hubo ningun intercambio y por lo tanto el metodo puede terminar\n //ya que el vector esta ordenado\n }//END_FOR\n\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public void fusion(Monceau autre) throws DifferentOrderTrees {\r\n // à compléter\r\n \tArrayList<Node> temp = new ArrayList<Node>();\r\n\t\tboolean fini = false;\r\n \t\r\n \tif (arbres.isEmpty())\r\n \t\tarbres = autre.arbres;\r\n \t\r\n \telse if (!arbres.isEmpty() || !autre.arbres.isEmpty()) {\r\n \t\t//remplir la arraylist (ou arbre temp)\r\n \t\tfor (int i = 0; i < arbres.size(); i++)\r\n \t\t\ttemp.add(arbres.get(i));\r\n \t\t\r\n \t\tfor (int i = 0; i < autre.arbres.size(); i++)\r\n \t\t\ttemp.add(autre.arbres.get(i));\r\n \t\t\r\n \t\t//trier la arraylist qui contient l'arbre temp\r\n \t\tCollections.sort(temp, new Comparator<Node>() {\r\n \t\t\t@Override\r\n \t\t\tpublic int compare(Node objet1, Node objet2) {\r\n \t\t\t\tInteger noeud1 = new Integer(objet1.ordre);\r\n \t\t\t\tInteger noeud2 = new Integer(objet2.ordre);\r\n \t\t\t\treturn noeud1.compareTo(noeud2);}\r\n \t\t});\r\n \t\t\r\n \t\twhile (!fini) { \t\t\t\r\n \t\t\tfini = true;\r\n \t\t\tfor (int j = 0; j < temp.size(); j++) {\r\n \t\t\t\tfor (int k = j+1; k < temp.size(); k++) {\r\n \t\t\t\t\tif (temp.get(j).ordre == temp.get(k).ordre)\r\n \t\t\t\t\t\tfini = false; //faut pas avoir le meme ordre\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tfor (int j = 0; j < temp.size()-1; j++) {\r\n \t\t\t\tif (temp.get(j).ordre == temp.get(j + 1).ordre) {\r\n \t\t\t\t\t//les elements doivent conserver leur ordre\r\n \t\t\t\t\ttemp.set(j, temp.get(j).fusion(temp.get(j+1)));\r\n \t\t\t\t\ttemp.remove(j+1);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tarbres = temp;\r\n \t}\r\n \t\r\n \treturn;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "private List<Estado> estadosHijos(Estado estado){\r\n EstadoMancala estadom=(EstadoMancala)estado;\r\n Jugador jugadorEstado=estadom.jugadores()[estadom.jugadoractual];\r\n Movimiento[] movimientos=estadom.movimientos(jugadorEstado);\r\n List<Estado> estados=new ArrayList<Estado>();\r\n int cantmovs=0;\r\n if(movimientos!=null)\r\n cantmovs=movimientos.length;\r\n for (int i=0; i<cantmovs;i++){\r\n estados.add(estadom.clone().siguiente(movimientos[i]));\r\n }\r\n return estados;\r\n }", "public void getGerarEscala(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<Voluntario> listaVoluntario = repository.buscarVoluntarioCor(cor);\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t\t//Date agora = new Date();\r\n\t\t\r\n\t\tlong tempoIncial = System.currentTimeMillis();\r\n\t\tif(cor!=null) {\t\r\n//\t\t\tFor de verificação para não repetição dos campos sorteados\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\t//População inicial\t\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\r\n\t\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\r\n\r\n\t\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\t\r\n\r\n\t\t\t\tlistPopulacaoI.add(listaVoluntario.get(conteudoSorteado));\r\n\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Gera os pais\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\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//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Cruzamento\r\n\t\t\tint tamanhoA = equipeA.size();\r\n\t\t\tint tamanhoB = equipeB.size();\r\n\t\t\tint metadeA = (int) tamanhoA/2;\r\n\t\t\tint metadeB = (int) tamanhoB/2;\r\n\t\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//grava dados na base\r\n\t\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\r\n\t\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Tempo Total %.3f ms%n: \"+(System.currentTimeMillis()-tempoIncial));\r\n\t\tSystem.out.println(listPopulacaoI);\r\n//\t\tlong tempoFinal = System.currentTimeMillis();\r\n//\t\tlong tempoExecucao = tempoFinal-tempoIncial;\r\n\r\n\t\t\r\n\t\t/*System.out.println(\"tempo inicial:\"+tempoIncial);\r\n\t\tSystem.out.println(\"tempo inicial:\"+tempoFinal);\r\n\t\tSystem.out.println(\"Tempo execução do Metodo de gera escala equipe: \"+(tempoFinal-tempoIncial)/1000d);*/\r\n\t}", "private void calculateFitness() {\n\t\tint day1=this.getNumberOfHours()*this.getNumberOfClasses();\n\t\tint day2=2*day1;\n\t\tint day3=3*day1;\n\t\tint day4=4*day1;\n\t\tint day5=5*day1;\n\t\tTeacher_lesson temp=null;\n\t\t//day 1//\n\t\tHashSet<Integer> closedSet=new HashSet<Integer>();\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<day1;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day1;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\t\n\t\t\n\t\t//day2//\n\t\tclosedSet.clear();;\n\t\t\n\t\tfor(int i=day1;i<day2;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day2;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day3//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day2;i<day3;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day3;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//day4//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day3;i<day4;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day4;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\t\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day5//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day4;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t\t\t\n\t\t}\n\t\t\t/*if(temp.get_td_hour()<0){this.fitness=this.fitness-100;}//adunato na ginei giati o ka8igitis exei parapanw wres apo oti mporei na kanei//\n\t\t\t\telse if (temp.get_td_hour()==0){this.fitness=this.fitness-2;}//meiwnoume giati o ka8igitis 8a epivarin8ei oles tou tis wres thn idia mera//\n\t\t\t\telse{++this.fitness;}//kalh prosegisi*/\n\t\t}\n\t\t//*********************END OF DAILY EVALUATION*****************************//\n\t\t\n\t\t//**********************START OF WEEKLY EVALUATION************************//\n\t\t\n\t\tclosedSet.clear();\n\t\t\n\t int \t_weeklyhours = 1;\n\t \n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tif(!closedSet.contains(this.genes[i])){\n\t\t\t\t\n\t\t\t\n\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\t\t++_weeklyhours; }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t/*if(_weeklyhours>temp.get_tw_hour()){\n\t\t\t\tthis.fitness=this.fitness-100 ; //adunato na kanei parapanw wres ma8hma//\n\t\t\t}else\n\t\t\t\t{++this.fitness;}*/\n\t\t\tif(_weeklyhours<temp.get_tw_hour()){++this.fitness;}\n\t\t\tclosedSet.add(this.genes[i]);}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//*************END OF WEEKLY EVALUATION**********//\n\t\n\t\t//**START OF LESSON EVALUATION***//\n\t\tArraylistLesson set=new ArraylistLesson();\n\t\tclass_lid templ=null;\n\t\tTeacher_lesson tempj=null;\n\t\tint lid=0;\n\t\tString _class;\n\t\tint _classhours=1;\n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tlid=temp.get_lid();\n\t\t\t_class=temp.get_class();\n\t\t\ttempl=new class_lid(lid,_class);\n\t\t\tif(!set.contains(templ)){\n\t\t\t\t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\t\ttempj=getdata(this.genes[j]);{\n\t\t\t\t\t\tif(tempj!=null){\n\t\t\t\t\t\t\tif(temp.get_tid()==tempj.get_tid()){\n\t\t\t\t\t\t\t\tif(temp.get_lid()==tempj.get_lid()&&temp.get_class().equalsIgnoreCase(tempj.get_class())){\n\t\t\t\t\t\t\t\t\t++_classhours;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tint hours;\n\t\t\t\thours=temp.get_lhours();\n\t\t\t\n\t\tif(_classhours==hours){\n\t\t\t++this.fitness;\n\t\t}\n\t\tset.add(templ);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "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 }", "private Karta kartaErabaki(ArrayList<ArrayList<Karta>> pMatrizea) \r\n\t{\r\n\t\tKarta karta = (Karta) new KartaNormala(ElementuMota.ELURRA,0,KoloreMota.BERDEA);\r\n\t\tfor(int i=0;i<pMatrizea.size();i++) \r\n\t\t{\r\n\t\t\tfor(int x=0;x<5;x++) \r\n\t\t\t{\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()!=pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()==pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = this.lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn karta;\r\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\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\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void enemigosCatacumba(){\n esq81 = new Esqueleto(1, 8, 400, 160, 30);\n esq82 = new Esqueleto(2, 8, 400, 160, 30);\n esq111 = new Esqueleto(1, 11, 800, 255, 50);\n esq112 = new Esqueleto(2, 11, 800, 255, 50);\n esq141 = new Esqueleto(1, 14, 1000, 265, 60);\n esq142 = new Esqueleto(2, 14, 1000, 265, 60);\n //\n zom81 = new Zombie(1, 8, 1000, 170, 40);\n zom82 = new Zombie(2, 8, 1000, 170, 40);\n zom111 = new Zombie(1, 11, 1300, 250, 50);\n zom112 = new Zombie(2, 11, 1300, 250, 50);\n zom141 = new Zombie(1, 14, 1700, 260, 60);\n zom142 = new Zombie(2, 14, 1700, 260, 60);\n //\n fana81 = new Fanatico(1, 8, 400, 190, 40);\n fana82 = new Fanatico(2, 8, 400, 190, 40);\n fana111 = new Fanatico(1, 11, 700, 250, 50);\n fana112 = new Fanatico(2, 11, 700, 250, 50);\n fana141 = new Fanatico(1, 14, 900, 260, 60);\n fana142 = new Fanatico(2, 14, 900, 260, 60);\n //\n mi81 = new Mimico(1, 8, 3, 1, 3000);\n mi111 = new Mimico(1, 11, 4, 1, 3000);\n mi141 = new Mimico(1, 14, 5, 1, 3200);\n }", "private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "public void effetDeCarte(int idEffet, Joueur joueurQuiJoueLaCarte, Plateau plateau) {\n switch (idEffet) {\n case 0:\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 1:\n joueurQuiJoueLaCarte.deck.piocher(2);\n break;\n case 2:\n joueurQuiJoueLaCarte.deck.piocher(3);\n break;\n case 3:\n joueurQuiJoueLaCarte.gagnerDegats(1);\n break;\n case 4:\n joueurQuiJoueLaCarte.gagnerDegats(2);\n break;\n case 5:\n joueurQuiJoueLaCarte.gagnerDegats(3);\n\n break;\n case 6:\n joueurQuiJoueLaCarte.gagnerDegats(4);\n break;\n case 7:\n joueurQuiJoueLaCarte.gagnerRunes(1);\n break;\n case 8:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n break;\n case 9:\n gagnerDesRunes(joueurQuiJoueLaCarte,3);\n break;\n case 11:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n break;\n case 12:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n break;\n case 14:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n joueurQuiJoueLaCarte.piocher(1);\n break;\n case 15:\n joueurQuiJoueLaCarte.tuerUneCarteAvecDeLattaqueGratuitement(plateau);\n System.out.println(\"DEfeat a monster that has 4 D or less without paying it cost\");\n break;\n case 16:\n System.out.println(\"DEfeat a monster that has 6 D or less without paying it cost\");\n break;\n case 17:\n //joueurQuiJoueLaCarte.deck.piocher(1);\n System.out.println(\" You may banish a card in the center row\");\n break;\n case 18:\n System.out.println(\"Discard a card, if you do, draw two cards\");\n break;\n case 19:\n System.out.println(\"Copy l'effet d'un Héros joué ce tour-ci\");\n break;\n case 20:\n System.out.println(\"Once per turn you may draw a card\");\n break;\n case 21:\n System.out.println(\"You may banish this Construct to take an additional turn after this one.\");\n break;\n case 22:\n System.out.println(\"Acquire a Hero without paying its cost. Place in on top of your deck.\");\n break;\n case 23:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n break;\n case 24:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n verifLifebound(joueurQuiJoueLaCarte);\n break;\n case 25:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 26:\n System.out.println(\"Once per turn, gain 1 runes, the first time you play a lifebound hero, each turn gain 1 recompense\");\n break;\n case 27:\n System.out.println(\"Once per turn , gain 1d\" +\n \"Once per turn, you may spend 4r to gain 3 recompense\");\n break;\n case 28:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n plusDeDeuxConstructeur(joueurQuiJoueLaCarte);\n System.out.println(\"Draw a card if you control 2 or moreConstrcut\");\n break;\n case 29:\n System.out.println(\"Gain 1d or 1r\");\n break;\n case 30:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Gain 2r You pay 1R less the next time you acquire a Construc this turn\");\n break;\n case 31:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, when you put a Mechana Construc into play (including this one) , draw a card\");\n break;\n case 32:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, gain 2d.You may spend it only to acquire Mechana Construct\");\n break;\n case 33:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\" Once per turn\");\n gagner1DParTourPourChaqueMechaConstruct(joueurQuiJoueLaCarte);\n\n break;\n case 34:\n System.out.println(\"You may treat all Construcs as Mechana Construcs\");\n break;\n case 35:\n System.out.println(\"Once per turn, when you acquire another Mechana Construc, you may put it directly into play\");\n break;\n case 36:\n System.out.println(\"Once per turn ,gain 1 r . you may spend it only to acquire Mechana Construc\");\n break;\n case 37:\n joueurQuiJoueLaCarte.deck.piocher(2);\n System.out.println(\"Banish a card in you hand\");\n break;\n case 38:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 39:\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 40:\n System.out.println(\"Once per turn, gain 3d\");\n break;\n case 41:\n System.out.println(\"Once per turn, gain 1d\");\n break;\n case 42:\n System.out.println(\"Once per turn gain 1 The first time you deafeat a monster in the center row each turn, gain 1 R\");\n break;\n case 43:\n System.out.println(\"Unbanishable You may acquire or defeat any car in the center row without paying its cost\");\n break;\n case 44:\n System.out.println(\"Each opponent must destryo a Construc he controls\");\n break;\n case 45:\n System.out.println(\"Banish a card un the center row and/or in you discard pile\");\n break;\n case 46:\n System.out.println(\"Banish a card un the center row\");\n break;\n case 47:\n System.out.println(\"If an opponent has more than one construct, that player must destroy all but one Construct he controls\");\n break;\n case 48:\n System.out.println(\"Take a card at random from each oppenent's hand and add that card to your hands\");\n break;\n }\n\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void preenchePosicoes(List<Par<Integer,Integer>> posicoes, \n\t\t\tEstadoAmbiente estado) {\n\t\tfor (Par<Integer,Integer> p : posicoes) {\n\t\t\tthis.quadricula[p.primeiro()][p.segundo()] = estado;\n\t\t}\n\t}", "private ArrayList<Estado> generar_sucesores(Estado actual) {\r\n\t\tArrayList<Estado> sucesores = new ArrayList<>();\r\n\t\tsucesores.add(actual.derecha().addHeuristica(estado_final)); //Añado los puntos hijos del estado actual\r\n\t\tsucesores.add(actual.izquierda().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.arriba().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.abajo().addHeuristica(estado_final));\r\n\r\n\t\tif (sucesores.contains(estado_inicial)) { //Limpio posible estado inicial\r\n\t\t\tsucesores.remove(estado_inicial);\r\n\t\t}\r\n\t\tArrayList<Estado> aux = new ArrayList<>(); // Para evitar error de concurrencia creo una lista auxiliar con los sucesores\r\n\t\tfor (int i = 0; i < sucesores.size(); i++) {\r\n\t\t\taux.add(sucesores.get(i));\r\n\t\t}\r\n\t\tfor (Estado p : aux) { //Limpio muros\r\n\t\t\tif (matriz[p.getX() - 1][p.getY() - 1] == muro) {\r\n\t\t\t\tsucesores.remove(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sucesores;\r\n\t}", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "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}", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public String execute() {\n\t\ttry {\n\t\t\tHashMap<Integer, RigaVenditeCommercianti> map = new HashMap<Integer, RigaVenditeCommercianti>();\n\t\t\tlistaTotali = new LinkedList<RigaVenditeCommercianti>();\n\t\t\t\n\t\t\tFatture fatture = new Fatture();\n\t\t\tfatture.setOrderByCliente();\n\t\t\tCollection colFatture = fatture.getFatture(dataDal, dataAl);\n\t\t\tIterator itr = colFatture.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tFattura fattura = (Fattura) itr.next();\t\n\t\t\t\tfattura.calcolaTotali();\n\t\t\t\tif (map.containsKey(fattura.getIdCliente().intValue())) {\n\t\t\t\t\t//Aggiungi totali alla riga attuale\n\t\t\t\t\tRigaVenditeCommercianti riga = map.get(fattura.getIdCliente().intValue());\n\t\t\t\t\triga.setTotaleFattura(riga.getTotaleFattura().add(fattura.getTotaleFattura()));\n\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tfattura.calcolaTotali();\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 4\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva1())) { //IVA AL 4\n\t\t\t\t\t\triga.setImponibile1(riga.getImponibile1().add(imponibili.get(riga.getIva1())[0]));\n\t\t\t\t\t\triga.setImposta1(riga.getImposta1().add(imponibili.get(riga.getIva1())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 10\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile2(riga.getImponibile2().add(imponibili.get(riga.getIva2())[0]));\n\t\t\t\t\t\triga.setImposta2(riga.getImposta2().add(imponibili.get(riga.getIva2())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 20\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile3(riga.getImponibile3().add(imponibili.get(riga.getIva3())[0]));\n\t\t\t\t\t\triga.setImposta3(riga.getImposta3().add(imponibili.get(riga.getIva3())[1]));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//Crea riga per cliente\n\t\t\t\t\tRigaVenditeCommercianti riga = new RigaVenditeCommercianti();\n\t\t\t\t\triga.setCliente(fattura.getCliente());\n\t\t\t\t\triga.setTotaleFattura(fattura.getTotaleFattura());\n\t\t\t\t\t\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\tIvas dao = new Ivas();\n\t\t\t\t\tdao.setOrderByDescrizione(DataAccessObject.ORDER_ASC);\n\t\t\t\t\tCollection aliquote = dao.getElements();\n\t\t\t\t\t\n\t\t\t\t\tint index = 1;\n\t\t\t\t\tfor(Object obj : aliquote)\n\t\t\t\t\t{\n\t\t\t\t\t\tIva iva = (Iva)obj;\n\t\t\t\t\t\tif(iva.getValore().floatValue() < 4) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tBigDecimal imponibile = new BigDecimal(0);\n\t\t\t\t\t\tBigDecimal imposta = new BigDecimal(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(imponibili.containsKey(iva.getValore()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timponibile = imponibili.get(iva.getValore())[0];\n\t\t\t\t\t\t\timposta = imponibili.get(iva.getValore())[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva1(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile1(imponibile);\n\t\t\t\t\t\t\triga.setImposta1(imposta);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva2(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile2(imponibile);\n\t\t\t\t\t\t\triga.setImposta2(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva3(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile3(imponibile);\n\t\t\t\t\t\t\triga.setImposta3(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 3) break;\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tmap.put(fattura.getIdCliente().intValue(), riga);\n\t\t\t\t\tlistaTotali.add(riga);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tstampaErrore(\"PrintVendite.execute()\", e);\n\t\t\treturn ERROR;\n\t\t}\n\t\treturn SUCCESS;\n\t}", "private int getResult() {\n ArrayList<Character> operanzi = new ArrayList<Character>();\n ArrayList<Character> operatori = new ArrayList<Character>();\n for(int i = 1; i <= n; i++){\n // System.out.println(i);\n if ((expr[i] == 'T' ) || (expr[i] == 'F'))\n operanzi.add(expr[i]);\n else \n operatori.add(expr[i]);\n }\n System.out.println(operanzi.get(0));\n int n1 = operanzi.size();\n System.out.println(n1);\n long [][] T = new long[n1][n1];\n long [][] F = new long[n1][n1];\n\n for (int i = 0; i < operanzi.size(); i++) {\n \n if (operanzi.get(i) == 'T') {\n T[i][i] = 1;\n F[i][i] = 0;\n } else if (operanzi.get(i) == 'F') {\n T[i][i] = 0;\n F[i][i] = 1;\n }\n }\n long aux=0;\n for (int l=1; l<n1; ++l) \n { \n for (int i=0, j=l; j<n1; ++i, ++j) \n { \n T[i][j] = F[i][j] = 0; \n for (int g=0; g<l; g++) \n { \n int k = i + g; \n long total_i_k = evaluate(T[i][k],F[i][k],'+'); \n long total_k_j = evaluate(T[k+1][j] , F[k+1][j],'+'); \n long total = evaluate(total_i_k,total_k_j,'*');\n if (operatori.get(k) == '&') \n { \n aux = evaluate(T[i][k],T[k+1][j],'*');\n T[i][j] = evaluate(T[i][j],aux,'+'); \n \n\n F[i][j] = evaluate( F[i][j],evaluate(total,aux,'-'),'+'); \n } \n if (operatori.get(k) == '|') \n { \n aux = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate(F[i][j],aux,'+'); \n \n T[i][j] =evaluate( T[i][j],evaluate(total, aux,'-'),'+'); \n } \n if (operatori.get(k) == '^') \n { \n aux = evaluate(F[i][k],T[k+1][j],'*');\n long aux1= evaluate(T[i][k],F[k+1][j],'*');\n T[i][j] = evaluate( T[i][j],evaluate( aux , aux1,'+'),'+'); \n aux = evaluate(T[i][k],T[k+1][j],'*');\n aux1 = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate( F[i][j],evaluate(aux,aux1,'+'),'+');\n } \n } \n } \n } \n return (int)T[0][n1-1]; \n }", "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 }", "private List<ObligacionCoactivoDTO> calcularCostasProcesales(List<ObligacionCoactivoDTO> obligaciones,\n BigDecimal valorAbsoluto, BigDecimal porcentaje) throws CirculemosNegocioException {\n // No aplica costas\n if (valorAbsoluto == null && porcentaje == null) {\n return obligaciones;\n } else if (valorAbsoluto != null) {\n // Aplica valor absoluto\n if (obligaciones.size() == 1) {\n obligaciones.get(0).setValorCostasProcesales(valorAbsoluto);\n return obligaciones;\n } else {\n BigDecimal porcentajeDeuda;\n BigDecimal totalDeuda = new BigDecimal(0);\n\n // Calculo de deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n totalDeuda = totalDeuda\n .add(obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()));\n\n }\n\n // Calculo de porcentaje y valor\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n porcentajeDeuda = ((obligacion.getValorCostasProcesales()\n .add(obligacion.getValorInteresMoratorios())).multiply(new BigDecimal(100)))\n .divide(totalDeuda);\n\n obligacion\n .setValorCostasProcesales(totalDeuda.multiply(porcentajeDeuda).divide(new BigDecimal(100)));\n\n }\n return obligaciones;\n\n }\n } else if (porcentaje != null) {\n // Aplica porcentaje de la deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n obligacion.setValorCostasProcesales(\n (obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()))\n .multiply(porcentaje).divide(new BigDecimal(100)).setScale(2,\n BigDecimal.ROUND_HALF_UP));\n\n }\n return obligaciones;\n } else {\n throw new CirculemosNegocioException(ErrorCoactivo.GenerarCoactivo.COAC_002005);\n }\n }", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "public static Resultado PCF(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n //*Definicion de variables las variables\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n \n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n double slotsDemanda = demanda.getNroFS();\n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n \n \n \n // double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n //FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n FcmtAux = ((saltos*slotsDemanda) + corte + desalineamiento)/capacidadLibre;\n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public static Resultado KSP_FF_Algorithm_MBBR(GrafoMatriz G, GrafoMatriz Gaux, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n /*Definicion de variables las variables*/\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n \n /*Probamos para cada camino, si exite espectro para ubicar la damanda*/\n int k=0;\n while(k<ksp.length && ksp[k]!=null && demandaColocada==0){\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n /*Calcular la ocupacion del espectro para cada camino k*/\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ||\n Gaux.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ){\n OE[i]=0;\n break;\n }\n }\n }\n /*Teniendo la ocupacion del espectro del camino k, buscamos un bloque continuo de FS\n * que satisfazca la demanda.\n */\n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n demandaColocada=1;\n break;\n }\n }\n }\n if(demandaColocada==1){\n break;\n }\n }\n k++;\n }\n \n if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }\n /*Bloque contiguoo encontrado, asignamos los indices del espectro a utilizar \n * y retornamos el resultado\n */\n Resultado r= new Resultado();\n r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);\n return r;\n }" ]
[ "0.6659077", "0.6369091", "0.6290835", "0.62273735", "0.61889815", "0.59769803", "0.5968935", "0.59103996", "0.5896852", "0.5879993", "0.58483267", "0.57968515", "0.574093", "0.5701246", "0.5688302", "0.564915", "0.5641294", "0.56298786", "0.56267923", "0.5623532", "0.5619576", "0.5593624", "0.55916077", "0.5588625", "0.55830806", "0.557453", "0.5571601", "0.55687743", "0.5566994", "0.55655783", "0.5550565", "0.5546241", "0.55159426", "0.55027574", "0.55021155", "0.5493501", "0.548865", "0.5466397", "0.5460493", "0.5460261", "0.5456445", "0.5451198", "0.54412407", "0.5440667", "0.54325503", "0.54207826", "0.54179674", "0.54168737", "0.5416588", "0.5402674", "0.53988373", "0.5392815", "0.5390069", "0.53816295", "0.5371171", "0.53703547", "0.5362547", "0.5354948", "0.5354428", "0.53523725", "0.5351815", "0.5349358", "0.534028", "0.5336789", "0.53294593", "0.5324443", "0.5322742", "0.5320947", "0.5313928", "0.529563", "0.5293606", "0.5292493", "0.5279235", "0.5276801", "0.5273606", "0.5272331", "0.52674794", "0.5262569", "0.5260719", "0.5255163", "0.5250809", "0.52483845", "0.524259", "0.5236238", "0.5230499", "0.52254945", "0.5225043", "0.5224143", "0.52219313", "0.52191454", "0.5218492", "0.52074766", "0.51949996", "0.51944727", "0.5191369", "0.5189786", "0.518541", "0.5180373", "0.5175139", "0.5171705", "0.51698005" ]
0.0
-1
iteracion mas optimizada de una estrategia
public DatosIteracion mejorIteracionVisibles(String estrategia) { int i; for (i = 0; i < this.getValoresEstrategias().size(); i++) { if (this.getValoresEstrategias(i).getNombreEstrategia() .equals(estrategia)) break; } return this.getValoresEstrategias(i).masEficiente(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DatosIteracion mejorIteracionOptimizada() {\r\n\r\n\t\tArrayList<DatosIteracion> array = new ArrayList<DatosIteracion>();\r\n\r\n\t\tfor (DatosEstrategia e : this.getValoresEstrategias()) {\r\n\t\t\tarray.add(this.mejorIteracionOptimizada(e.getValoresIteraciones()));\r\n\t\t}\r\n\t\treturn this.mejorIteracionOptimizada(array);\r\n\t}", "public DatosIteracion mejorIteracionOptimizada(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masEficiente();\r\n\t}", "public void geneticoPSO(){ \n //leer archivos de texto\n nombreArchivos.stream().map((nombreArchivo) -> lam.leerArchivo(nombreArchivo)).forEach((Mochila moc) -> {\n mochilas.add(moc);\n }); \n \n int o = 0;\n for (Mochila mochila : mochilas) { \n \n Algorithm_PSO alg_pso = new Algorithm_PSO(0.1, 0.8, 0.7, 0.6, 1, tamanioPob, EFOs, mochila.getSolucion().length, mochila); \n Individuo_mochilaPSO res = (Individuo_mochilaPSO)alg_pso.correr();\n System.out.println(\"fitnes: \" + res.getFitness() + \". Solucion\" + Arrays.toString(res.getCromosoma()));\n if (o == 9){\n System.out.println(\"\");\n }\n o++;\n }\n \n }", "public static Nodo buscarSolucionPorAmplitud(Nodo inicio, int[][] solucion) {\n\t\tArrayList<Nodo> abiertos = new ArrayList<Nodo>();\n\t\tabiertos.add(inicio);\n\t\tint cont = 0;\n\t\tArrayList<Nodo> visitados = new ArrayList<Nodo>();\n\t\twhile(abiertos.size()!=0) {\n\t\t\tSystem.out.println(\"Visitados\");\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tfor(Nodo n : visitados) {\n\t\t\t\timprimirEstado(n.getEstado());\n\t\t\t\tSystem.out.println(\"Costo de este nodo: \" + n.getCosto());\n\t\t\t\tSystem.out.println(\"---------------\");\n\t\t\t}\n\t\t\tSystem.out.println(\"#################################\");\n\t\t\tNodo revisar = abiertos.remove(0);\n\t\t\trevisar.setCosto(calcularCosto(revisar.getEstado(), solucion));\n\t\t\timprimirEstado(revisar.getEstado());\n\t\t\tint[] pcero = ubicarPosicionCero(revisar.getEstado());\n\t\t\tSystem.out.println(\"Iteracion # \" + ++cont);\n\t\t\tif(Arrays.deepEquals(revisar.getEstado(), solucion)) {\n\t\t\t\tSystem.out.println(\"***** SOLUCION ENCONTRADA *****\");\n\t\t\t\treturn revisar;\n\n\t\t\t}\n\n\t\t\tArrayList<Nodo> hijos = new ArrayList<Nodo>();\n\t\t\tvisitados.add(revisar);\n\t\t\tif(pcero[0]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint arriba = hijo.getEstado()[pcero[0]-1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = arriba;\n\t\t\t\thijo.getEstado()[pcero[0]-1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[0]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint abajo = hijo.getEstado()[pcero[0]+1][pcero[1]];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = abajo;\n\t\t\t\thijo.getEstado()[pcero[0]+1][pcero[1]] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=0) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint izq = hijo.getEstado()[pcero[0]][pcero[1]-1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = izq;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]-1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\tif(pcero[1]!=2) {\n\t\t\t\tNodo hijo = new Nodo(clonar(revisar.getEstado()));\n\t\t\t\thijo.setCosto(calcularCosto(hijo.getEstado(), solucion));\n\t\t\t\tint der = hijo.getEstado()[pcero[0]][pcero[1]+1];\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]] = der;\n\t\t\t\thijo.getEstado()[pcero[0]][pcero[1]+1] = 0;\n\t\t\t\tif(!estaEnVisitados(visitados, hijo))\n\t\t\t\t\tabiertos.add(hijo); //Esta linea es para hacer recorrido em amplitud\n\t\t\t\thijos.add(hijo);\n\t\t\t}\n\t\t\trevisar.setHijos(hijos);\n\t\t}\n\t\treturn null;\n\n\t}", "public DatosIteracion mejorIteracionOptimizada(\r\n\t\t\tArrayList<DatosIteracion> datos) {\r\n\t\tDatosIteracion d = new DatosIteracion(\"auxiliar\");\r\n\t\tLectura l = new Lectura(999999, 0, 0);\r\n\t\td.getValoresLecturas().add(l);\r\n\r\n\t\tfor (int i = 0; i < datos.size(); i++) {\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) < (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\td = datos.get(i);\r\n\t\t\t}\r\n\r\n\t\t\tif ((d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (d.getValoresLecturas(\r\n\t\t\t\t\td.getValoresLecturas().size() - 1).getTiempo() + 1)) == (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getCapturados() / (datos\r\n\t\t\t\t\t.get(i)\r\n\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t.getTiempo() + 1))) {\r\n\r\n\t\t\t\tif (d.getValoresLecturas(d.getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo() > datos\r\n\t\t\t\t\t\t.get(i)\r\n\t\t\t\t\t\t.getValoresLecturas(\r\n\t\t\t\t\t\t\t\tdatos.get(i).getValoresLecturas().size() - 1)\r\n\t\t\t\t\t\t.getTiempo()) {\r\n\r\n\t\t\t\t\td = datos.get(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "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 }", "@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\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 Ruteo procedimientoIterativoGrasp(Auxiliar a){\n\t\t double time1= System.currentTimeMillis();\n\t\t\n\t\tDouble mejorCosto=9999999999999999.9;\n\t\tRuteo mejorRuteo=null;\n\t\tlistaSetCovering=new ArrayList<Ruta>();\n\t\tfor(int i=0;i<k;i++){\n\t\t\tHeuristicasTSPManagger h=new HeuristicasTSPManagger();\n\t\t\tList<Obra>tsp=h.CWJPC();\n\n\t\t\tList<Obra>tsp1=a.busquedaLocal(tsp);\n\t\t\n\t\t\tRuteo r2=a.split(tsp1);\n\t\t\tSystem.out.println(r2.rutas);\n\t\t\tlistaSetCovering.addAll(r2.rutas);\n\t\t\tif(mejorCosto>r2.costoTotal){\n\t\t\t\tmejorCosto=r2.costoTotal;\n\t\t\t\tmejorRuteo=r2;\n\t\t\t}\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalIterGrasp=(time2-time1)/(1000.0*k);\n\t\t tiempoComputacionalGrasp=(time2-time1)/(1000.0);\n\t\treturn mejorRuteo;\n\t}", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "public static ArrayList<Integer> estadisticageneral() {\n\n\t\tArrayList<Integer> mensaje = new ArrayList<>();\n\n\t\tArrayList<Res> resesAntes = ResCRUD.select();\n\t\tArrayList<Res> resess = new ArrayList<>();\n\n\t\t\n\t\tfor (int i = 0; i < resesAntes.size(); i++) {\n\t\t\t\n\t\t\tif (resesAntes.get(i).getVivo()==1) {\n\t\t\t\t\n\t\t\t\tresess.add(resesAntes.get(i));\n\t\t\t}\n\t\t}\t\t\n\n\t\tArrayList<Potrero> potrero = PotreroCRUD.select();\n\n\t\tRes res = null;\n\n\t\tint potreros = potrero.size();\n\t\tint reses = resess.size();\n\t\tint hembras = 0;\n\t\tint machos = 0;\n\t\tint ch = 0;\n\t\tint hl = 0;\n\t\tint nv = 0;\n\t\tint vh = 0;\n\t\tint vp = 0;\n\t\tint cm = 0;\n\t\tint ml = 0;\n\t\tint mc = 0;\n\t\tint tp = 0;\n\n\t\tfor (int i = 0; i < resess.size(); i++) {\n\n\t\t\tres = resess.get(i);\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"H\")) {\n\t\t\t\thembras++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CH\":\n\n\t\t\t\t\tch++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"HL\":\n\n\t\t\t\t\thl++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"NV\":\n\n\t\t\t\t\tnv++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VH\":\n\n\t\t\t\t\tvh++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"VP\":\n\n\t\t\t\t\tvp++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (res.getGenero().equalsIgnoreCase(\"M\")) {\n\t\t\t\tmachos++;\n\n\t\t\t\tswitch (res.getTipo()) {\n\n\t\t\t\tcase \"CM\":\n\n\t\t\t\t\tcm++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ML\":\n\n\t\t\t\t\tml++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MC\":\n\n\t\t\t\t\tmc++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"TP\":\n\n\t\t\t\t\ttp++;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tmensaje.add(potreros);\n\t\tmensaje.add(reses);\n\t\tmensaje.add(hembras);\n\t\tmensaje.add(machos);\n\t\tmensaje.add(ch);\n\t\tmensaje.add(hl);\n\t\tmensaje.add(nv);\n\t\tmensaje.add(vh);\n\t\tmensaje.add(vp);\n\t\tmensaje.add(cm);\n\t\tmensaje.add(ml);\n\t\tmensaje.add(mc);\n\t\tmensaje.add(tp);\n\n\t\treturn mensaje;\n\t}", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\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 static Resultado Def_FA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada=0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n \n \n int caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public ChampionnatComplexe (Matrice mat,Options o) {\n\t\topt = o;\n\t\tint [] Eq12 = FonctionsTransverses.tirage(12);\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3];\n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibreDesPoule = equilibreDesPoule + ( Integer.max(grpA1[z], grpB1[z]) - Integer.min(grpA1[z], grpB1[z]) ) + ( Integer.max(grpA2[z], grpB2[z]) - Integer.min(grpA2[z], grpB2[z]) );\n\t\t}\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byCoseno(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudCoseno(it1, it2, test);\r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "BasicSet NextClosure(BasicSet M,BasicSet A){\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\t\tMap <String,Integer> repbin=this.RepresentationBinaire(M);\r\n\t\tVector<BasicSet> fermes=new Vector<BasicSet>();\r\n\t\tSet<String> key=repbin.keySet();\r\n\t\tObject[] items= key.toArray();\r\n\r\n\t\t/* on recupere la position i qui correspond a la derniere position de M*/\r\n\t\tint i=M.size()-1;\r\n\t\tboolean success=false;\r\n\t\tBasicSet plein=new BasicSet();\r\n\t\tVector <String> vv=context.getAttributes();\r\n\t\tplein.addAll(vv);\r\n\r\n\r\n\t\twhile(success==false ){\t\t\r\n\r\n\t\t\tString item=items[i].toString();\r\n\r\n\t\t\tif(!A.contains(item)){\t\r\n\r\n\t\t\t\t/* Ensemble contenant item associe a i*/\r\n\t\t\t\tBasicSet I=new BasicSet();\r\n\t\t\t\tI.add(item);\r\n\r\n\t\t\t\t/*A union I*/\t\r\n\t\t\t\tA=A.union(I);\r\n\t\t\t\tBasicSet union=(BasicSet) A.clone();\r\n\t\t\t\t//System.out.println(\" union \"+union);\r\n\r\n\t\t\t\t//fermes.add(union);\r\n\r\n\t\t\t\tfermes.add(union);\r\n\t\t\t\t//System.out.println(\"ll11 \"+fermes);\r\n\r\n\t\t\t\t/* Calcul du ferme de A*/\r\n\t\t\t\tBasicSet b=ap.CalculYseconde(A,context);\r\n\r\n\t\t\t\t//BasicSet b=this.LpClosure(A);\r\n\t\t\t\t//System.out.println(\"b procchain \"+b);\r\n\r\n\t\t\t\t//System.out.println(\"b sec \"+b);\r\n\t\t\t\tBasicSet diff=new BasicSet();\r\n\t\t\t\tdiff=b.difference(A);\r\n\t\t\t\tMap <String,Integer> repB=this.RepresentationBinaire(diff);\r\n\t\t\t\tBasicSet test=new BasicSet();\r\n\t\t\t\tMap <String,Integer> testt=RepresentationBinaire(test);\r\n\t\t\t\ttestt.put(item, 1);\r\n\r\n\t\t\t\t/* on teste si l ensemble B\\A est plus petit que l ensemble contenant i\r\n\t\t\t\t * Si B\\A est plus petit alors on affecte B à A.\r\n\t\t\t\t **/\r\n\r\n\t\t\t\tif(item.equals(b.first())||LecticOrder(repB,testt)){\r\n\t\t\t\t\t//System.out.println(\"A succes=true \"+ A);\r\n\t\t\t\t\tA=b;\r\n\t\t\t\t\tsuccess=true;\t \r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tA.remove(item);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tA.remove(item);\r\n\t\t\t}\t\t\t\r\n\t\t\ti--;\r\n\t\t}\t\t\r\n\t\treturn A;\r\n\t}", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "private Map<Integer, Map<String,Object>> getCombinaciones( List<GrupoAtencion> grupos, List<Cuadrilla> cuadrillas){\n\t\t\n\n\t\tMap<Long, Map<String, Double>> mpgrupos = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t// aplicando todos contra todos\n\t\t\n\t\tfor (GrupoAtencion g : grupos) {\n\t\t\t\n\t\t\tMap<String, Double>mpcants = getCantidadPorTipoSolicitudes(g);\n\t\t\t// añdiendo \n\t\t\tmpgrupos.put(g.getNumeroGrupoAtencion(), mpcants); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMap<Long, Map<String, Double>> mpcuadrillas = new LinkedHashMap<Long, Map<String, Double>>();\n\t\t\n\t\tfor(Cuadrilla c : cuadrillas){\n\t\t\tMap<String, Double> mpproms = getPromedioHabilidades(c);\n\t\t\tmpcuadrillas.put(c.getNumeroCuadrilla(),mpproms );\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// todos contra todos;\n\t\t\n\t\tIterator<Long> it = mpgrupos.keySet().iterator();\n\t\t\n\t\t// combinaciones\n\t\tMap<Integer, Map<String,Object>> mpcomb = new LinkedHashMap<Integer, Map<String,Object>>();\n\t\tint idxcomb = 1; // indice de combinacion\n\t\twhile(it.hasNext()){\n\t\t\t\n\t\t\tLong ng = it.next();// número de grupos\n\t\t\tMap<String, Double> mpcants = mpgrupos.get(ng); // cantidades\n\t\t\t\n\t\t\tIterator<Long> itp = mpcuadrillas.keySet().iterator();\n\t\t\twhile(itp.hasNext()){\n\t\t\t\tLong nc = itp.next();// número de cuadrilla\n\t\t\t\tMap<String, Double> mpproms = mpcuadrillas.get(nc); // promedios\n\t\t\t\tMap<String,Object> mp = new LinkedHashMap<>();\n\t\t\t\t//System.out.println(mpproms.toString());\n\t\t\t\t\n\t\t\t\tmp.put(\"ng\",ng);// numero grupo\n\t\t\t\tmp.put(\"nc\",nc); // numero cuadrilla\n\t\t\t\t// añadiendo cantidades de tipos de solicitudes\n\t\t\t\tmp = addMap(mp, mpcants);\n\t\t\t\t// añadiendo promedio de habilidades\n\t\t\t\tmp = addMap(mp, mpproms);\n\t\t\t\t\n\t\t\t\tmpcomb.put(idxcomb, mp);\n\t\t\t\t//System.out.println(mp.toString());\n\t\t\t\tidxcomb++;\n\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn mpcomb ;\n\t}", "private static void BicingsimulatedAnnealingSearch(int num, int n_est, int nbicis, int nfurgo, int d1, int cas, String Cas, String H, String D, int s) {\n\n\n try {\n\n double MedT = 0;\n //double MedN = 0;\n //double MedB = 0;\n int iteraciones = 100;\n Estado Bicing = new Estado(n_est,nbicis,nfurgo,d1,s,1);\n Bicing.setList_cdesp(iteraciones);\n long StartTime = System.nanoTime();\n Problem problem = new Problem(Bicing, new sucesoresA(), new isGoal(), new Heuristic_Function());\n SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(iteraciones, 1000, 125, 0.00001D);\n SearchAgent agent = new SearchAgent(problem, search);\n List L = search.getPathStates();\n Properties properties = agent.getInstrumentation();\n long EndTime = System.nanoTime();\n Estado E = (Estado) search.getGoalState();\n long time = ((EndTime - StartTime) / 1000000);\n MedT += time;\n //MedB += E.getganancia();\n // MedN += Integer.parseInt(properties.getProperty((String)properties.keySet().iterator().next()));\n // MedB /= num;\n // MedN /= num;\n // MedT /= num;\n //MedB = (Math.round(MedB*100.0)/100.0);\n Writer output;\n output = new BufferedWriter(new FileWriter(\"Estadisticas_\" + Cas + \"_D\" + D + \"_H\" + H + \"S.txt\", true));\n double [] vec = E.getearnings();\n for (int i = 0 ; i < iteraciones; ++i) {\n String S = \"\" + vec[i];\n S = S + '\\n';\n output.append(S);\n }\n output.close();\n\n /*for (int i = 0; i < E.getN_furgo(); ++i) {\n System.out.println(\"Recorrido por furgoneta \" + i + \" \" + E.getIFurgo(i).getLong_t());\n }*/\n //printEstado(E);\n //System.out.println();\n //System.out.println(E.getganancia());\n //printActions(agent.getActions());\n //printInstrumentation(agent.getInstrumentation());\n } catch (Exception var4) {\n var4.printStackTrace();\n }\n\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "public ChampionnatComplexe (int [] Eq12,Matrice mat,Options o ) {\n\t\topt = o;\n\t\tint equilibrea = 0;\n\t\tint equilibreb = 0;\n\t\tgrpA1 = new int [3]; \n\t\tgrpA2 = new int [3]; \n\t\tgrpB1 = new int [3]; \n\t\tgrpB2 = new int [3]; \n\t\tfor (int i = 0 ; i < 3 ; i++ ) {\n\t\t\tgrpA1 [i] = Eq12 [i]; \n\t\t\tgrpA2 [i] = Eq12 [i+3]; \n\t\t\tgrpB1 [i] = Eq12 [i+6]; \n\t\t\tgrpB2 [i] = Eq12 [i+9]; \n\t\t}\n\t\tArrays.sort(grpA1);\n\t\tArrays.sort(grpA2);\n\t\tArrays.sort(grpB1);\n\t\tArrays.sort(grpB2);\n\t\tint a=0;\n\t\tfor ( int i = 0 ; i < 3 ; i ++ ) {\n\t\t\tfor ( int j = 0 ; j < 3 ; j ++ ) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB1[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB2[j]-1)*2;\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpA2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpA1[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpB2[j]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpB1[j]-1);\n\t\t\t}\n\n\t\t\ta = (int) Math.random();\n\t\t\tif (a==0) {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA1[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA1[i]-1);\n\t\t\t} else {\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA1[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpA2[i]-1,grpB2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB1[i]-1,grpA2[i]-1);\n\t\t\t\tdistanceTotale += mat.getDistanceBetween(grpB2[i]-1,grpA2[i]-1);\n\t\t\t}\n\t\t}\n\t\tint z;\n\t\tfor ( z= 0; z < 3 ; z++) {\n\t\t\tequilibrea = grpA1[z] + grpA2[z] ;\n\t\t\tequilibreb = grpB1[z] + grpB2[z] ;\n\t\t}\n\t\tequilibreDesPoule = Integer.max(equilibrea, equilibreb) - Integer.min(equilibreb, equilibreb);\n\t\tnoteDistance = getDistanceTotale() * 100 / 52000 ;\n\t\tnoteEquilibre = getEquilibreDesPoules() * 100 / 36 ;\n\t\tnoteMoyennePondereeEqDist = ( (noteDistance * opt.getPourcentageDistance()) + (noteEquilibre * (100 - opt.getPourcentageDistance()) ))/100;\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}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public MyPacMan optimise(List<double[]> dimensionList){\n for(int i = 0; i < POPULATION_SIZE; i++){\r\n MyPacMan individual = new MyPacMan(dimensionList);\r\n population.add(individual);\r\n \r\n } \r\n \r\n // try more than one iteration \r\n for(int iterationCount = 0; iterationCount < ITERATION_NO; iterationCount++){\r\n \r\n System.out.println(\"Iterazione n°: \" + Integer.toString(iterationCount));\r\n \r\n if(iterationCount%10 == 0 || iterationCount == ITERATION_NO-1){\r\n try {\r\n pw = new PrintWriter(new File(\"data/popoluation_\" + Integer.toString(iterationCount) +\".csv\"));\r\n } catch (FileNotFoundException ex) {\r\n \r\n } \r\n \r\n \r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n pw.write(\"v\" + Integer.toString(n));\r\n pw.write(\",\");\r\n }\r\n \r\n pw.write(\"fValue\");\r\n\r\n pw.write(\"\\n\");\r\n \r\n for (MyPacMan individual : population) {\r\n pw.write(individual.toString());\r\n pw.write(\",\");\r\n pw.write(Double.toString(fitFunction(individual)));\r\n pw.write(\"\\n\");\r\n }\r\n \r\n pw.flush();\r\n }\r\n \r\n int loop = 0;\r\n \r\n // main loop for evolution\r\n while(loop < population.size()){ \r\n\r\n MyPacMan original = null;\r\n MyPacMan candidate = null;\r\n boolean boundsHappy;\r\n\r\n do{\r\n boundsHappy = true;\r\n // pick an agent from the the population\r\n int x = loop;\r\n int a,b,c = -1;\r\n\r\n // pick three random agents from the population\r\n // make sure that they are not identical to selected agent from\r\n // the population \r\n\r\n do{\r\n a = random.nextInt(population.size());\r\n }while(x == a);\r\n do{\r\n b = random.nextInt(population.size());\r\n }while(b==x || b==a);\r\n do{\r\n c = random.nextInt(population.size());\r\n }while(c == x || c == a || c == b);\r\n\r\n // create three agent individuals\r\n MyPacMan individual1 = population.get(a);\r\n MyPacMan individual2 = population.get(b);\r\n MyPacMan individual3 = population.get(c);\r\n\r\n // create a noisy random candidate\r\n MyPacMan noisyRandomCandicate = new MyPacMan(dimensionList);\r\n\r\n // mutation process\r\n // if an element of the trial parameter vector is\r\n // found to violate the bounds after mutation and crossover, it is reset in such a way that the bounds\r\n // are respected (with the specific protocol depending on the implementation)\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n noisyRandomCandicate.dataValue[n] = (individual1.dataValue[n] + DIFFERENTIAL_WEIGHT * (individual2.dataValue[n] - individual3.dataValue[n])); \r\n } \r\n\r\n // Create a trial candicate \r\n original = population.get(x);\r\n candidate = new MyPacMan(dimensionList);\r\n\r\n // copy values from original agent to the candidate agent\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n candidate.dataValue[n] = original.dataValue[n];\r\n } \r\n\r\n // crossver process with the selected individual\r\n // pick a random dimension, which defintely takes the value from the noisy random candidate\r\n int R = random.nextInt(dimensionList.size());\r\n\r\n for(int n = 0; n < dimensionList.size(); n++){\r\n\r\n double crossoverProbability = random.nextDouble();\r\n\r\n if(crossoverProbability < CROSSOVER_PROBABILITY || n == R){\r\n candidate.dataValue[n] = noisyRandomCandicate.dataValue[n];\r\n }\r\n\r\n }\r\n\r\n // check here if the trial candiate satisfies bounds for each value\r\n for(int n = 0; n < dimensionList.size(); n++){ \r\n if(candidate.dataValue[n] < dimensionList.get(n)[0] || candidate.dataValue[n] > dimensionList.get(n)[1]){\r\n boundsHappy = false;\r\n }\r\n }\r\n\r\n }while(boundsHappy == false);\r\n\r\n //see if the candidate is better than original, if so replace it\r\n if(fitFunction(original) < fitFunction(candidate)){\r\n population.remove(original);\r\n population.add(candidate); \r\n }\r\n loop++;\r\n } \r\n }\r\n \r\n MyPacMan bestFitness = new MyPacMan(dimensionList);\r\n \r\n // selecting the final best agent from the the population\r\n for(int i = 0; i < population.size(); i++){\r\n MyPacMan individual = population.get(i);\r\n \r\n if(fitFunction(bestFitness) < fitFunction(individual)){\r\n \r\n try {\r\n bestFitness = (MyPacMan) individual.clone();\r\n } catch (CloneNotSupportedException ex) {\r\n \r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Fitness migliore: \" + fitFunction(bestFitness));\r\n return bestFitness;\r\n }", "public void determinarEstadoSalud(){\n \n for (int i = 0; i < listaEmpleados.size(); i++) {\n //Este for chequea si tiene alguna enfermedad preexistente -> asigna puntajes de acuerdo\n for (int j = 0; j < factoresRiesgo.length; j++) {\n \n if(listaEmpleados.get(i).getFactoresRiesgo().contains(factoresRiesgo[j])){ \n listaEmpleados.get(i).setEstadoSalud(30);\n }\n }\n //Verifica el rango de edad de la persona -> asigna puntajes de acuerdo\n if(listaEmpleados.get(i).getEdad() >= 70){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+50);\n }\n if(listaEmpleados.get(i).getEdad() >= 40 && listaEmpleados.get(i).getEdad() < 70 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+30);\n }\n if(listaEmpleados.get(i).getEdad() >= 20 && listaEmpleados.get(i).getEdad() < 40 ){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+10);\n }\n //Los hombre tienen mas probabilidades de morir por la mayoria de enfermedad, incluyendo el covid-19\n if(listaEmpleados.get(i).getSexo().equals(\"hombre\")){\n listaEmpleados.get(i).setEstadoSalud(listaEmpleados.get(i).getEstadoSalud()+15);\n \n }\n //Verifica los diferentes puntajes y almacena los empleados en diferentes arraylist dependiendo su prioridad\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 80){\n EmpleadosPrioridadAlta.add(listaEmpleados.get(i)); \n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 60 && listaEmpleados.get(i).getEstadoSalud() < 80){\n EmpleadosPrioridadMediaAlta.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 35 && listaEmpleados.get(i).getEstadoSalud() < 60){\n EmpleadosPrioridadMedia.add(listaEmpleados.get(i));\n }\n \n if(listaEmpleados.get(i).getEstadoSalud() >= 0 && listaEmpleados.get(i).getEstadoSalud() < 35){\n EmpleadosPrioridadBaja.add(listaEmpleados.get(i));\n }\n \n } \n \n }", "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.ACCION_NUEVA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos temporales \");\n\t\t\t\t\n\t\t\t\tmpGrupos.putAll(mpGruposCached);\n\t\t\t\t\n\t\t\t}else if(accion!=null && accion.equals(ConstantBusiness.ACCION_EDITA_PROGRAMACION)){\n\t\t\t\tmpGrupos = new LinkedHashMap<Long, GrupoAtencion>();\n\t\t\t\tlogger.info(\" mostrando mostrando grupos bd \");\n\t\t\t\tList<GrupoAtencion> grupoAtencionLíst = grupoAtencionDao.getGruposAtencionPorProgramacion(numeroProgramacion);\n\t\t\t\tList<GrupoAtencion> _grupoAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\tList<GrupoAtencionDetalle> _grupoDetalleAtencionLíst = new ArrayList<>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor (GrupoAtencion g : grupoAtencionLíst) {\n\t\t\t\t\tlogger.info(\" grupo generado :\"+g.getDescripcion());\n\t\t\t\t\t//clonando grupos \n\t\t\t\t\tlogger.info(\" ### clonando grupo : \"+g.getNumeroGrupoAtencion());\n\t\t\t\t\tGrupoAtencion grupoAtencion = (GrupoAtencion) g.clone();\n\t\t\t\t\tfor(GrupoAtencionDetalle d: g.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"### numero de solicitud :\"+d.getSolicitudServicio().getNumeroSolicitud());\n\t\t\t\t\t\t\n\t\t\t\t\t\t_grupoDetalleAtencionLíst.add((GrupoAtencionDetalle)d.clone());\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t_grupoAtencionLíst.add(grupoAtencion);\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\" mapeando objetos clonados \");\n\t\t\t\tfor (GrupoAtencion g : _grupoAtencionLíst) {\n\t\t\t\t\tg.setGrupoAtencionDetalles(new ArrayList<GrupoAtencionDetalle>());\n\t\t\t\t\tfor (GrupoAtencionDetalle d : _grupoDetalleAtencionLíst) {\n\t\t\t\t\t\tif( d.getGrupoAtencion()!=null && \n\t\t\t\t\t\t\t\td.getGrupoAtencion().getNumeroGrupoAtencion()==g.getNumeroGrupoAtencion()){\n\t\t\t\t\t\t\tg.getGrupoAtencionDetalles().add(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmpGrupos.put(g.getNumeroGrupoAtencion(), g);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tthis.mpGruposCached = mpGrupos;\n\t\t\t\t\n\t\t\t\tmostrarGrupos(mpGrupos);\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn mpGrupos;\n\t}", "public void affichageSolution() {\n\t\t//On commence par retirer toutes les traces pré-existantes du labyrinthe\n\t\tfor (int i = 0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Trace) {\n\t\t\t\t\tthis.laby.getLabyrinthe()[i][j] = new Case();\n\t\t\t\t\t((JLabel)grille.getComponents()[i*this.laby.getLargeur()+j]).setIcon(this.laby.getLabyrinthe()[i][j].imageCase(themeJeu));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//On parcourt toutes les cases du labyrinthe. Si on trouve un filon non extrait dont le chemin qui le sépare au mineur est plus petit que shortestPath, on enregistre la longueur du chemin ainsi que les coordonnees de ledit filon\n\t\tint shortestPath = Integer.MAX_VALUE;\n\t\tint[] coordsNearestFilon = {-1,-1};\n\t\tfor (int i=0 ; i < this.laby.getHauteur() ; i++) {\n\t\t\tfor (int j=0 ; j < this.laby.getLargeur() ; j++) {\n\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Filon && ((Filon)this.laby.getLabyrinthe()[i][j]).getExtrait() == false) {\n\t\t\t\t\tif (this.laby.solve(j,i) != null) {\n\t\t\t\t\t\tint pathSize = this.laby.solve(j,i).size();\n\t\t\t\t\t\tif (pathSize < shortestPath) {\n\t\t\t\t\t\t\tshortestPath = pathSize;\n\t\t\t\t\t\t\tcoordsNearestFilon[0] = j;\n\t\t\t\t\t\t\tcoordsNearestFilon[1] = i;\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//Si il n'y a plus de filon non extrait atteignable, on cherche les coordonnes de la clef\n\t\tif (coordsNearestFilon[0] == -1) {\n\t\t\tcoordsNearestFilon = this.laby.getCoordsClef();\n\t\t\t//Si il n'y a plus de filon non extrait atteignable et que la clef a deja ouvert la porte, on cherche les coordonnes de la sortie\n\t\t\tif (coordsNearestFilon == null)\tcoordsNearestFilon = this.laby.getCoordsSortie();\n\t\t}\n\n\t\t//On cree une pile qui contient des couples de coordonnees qui correspondent a la solution, puis on depile car le dernier element est l'objectif vise\n\t\tStack<Integer[]> solution = this.laby.solve(coordsNearestFilon[0], coordsNearestFilon[1]);\n\t\tsolution.pop();\n\n\t\t//Tant que l'on n'arrive pas au premier element de la pile (cad la case ou se trouve le mineur), on depile tout en gardant l'element depile, qui contient les coordonnees d'une trace que l'on dessine en suivant dans la fenetre\n\t\twhile (solution.size() != 1) {\n\t\t\tInteger[] coordsTmp = solution.pop();\n\t\t\tTrace traceTmp = new Trace();\n\t\t\tthis.laby.getLabyrinthe()[coordsTmp[1]][coordsTmp[0]] = new Trace();\n\t\t\t((JLabel)grille.getComponents()[coordsTmp[1]*this.laby.getLargeur()+coordsTmp[0]]).setIcon(traceTmp.imageCase());\n\t\t}\n\t\tSystem.out.println(\"\\n========================================== SOLUTION =====================================\\n\");\n\t\tthis.affichageLabyrinthe();\n\t}", "private void gerarConjuntosFuzzy(){\n\t\tthis.conjuntosFuzzy = new ArrayList<ConjuntoFuzzy>();\n\t\tdouble tamanhoDominio = this.valorMaximo - this.valorMinimo;\n\t\t//System.out.println(\"Extensão do domínio: \" + tamanhoDominio + \"[\" + this.limiteInferior + \", \" + this.limiteSuperior + \"]\");\n\t\tdouble range = tamanhoDominio/(this.quantRegioesFuzzy - 1);\n\t\tdouble inf = this.valorMinimo;\n\t\tdouble sup = this.valorMinimo + range;\n\t\t\n\t\t//Definição dos limites das regiões de pertinencia triangular\n\t\tfor(int i = 0; i < this.quantRegioesFuzzy; i++){\n\t\t\tString idConjunto = new String(this.nome + \"_\" + i);\n\t\t\tConjuntoFuzzy conjunto = new ConjuntoFuzzy(this.nome, idConjunto, inf, sup, i);\n\t\t\tthis.conjuntosFuzzy.add(conjunto);\n\t\t\t//System.out.println(\"Conjunto: \" + i + \" [\" + inf + \", \" + sup + \"]\");\n\t\t\tinf += range/2;\n\t\t\tsup += range/2;\n\t\t}\n\t\t\n\t}", "public HashMap<Long, TreeSet<ItemSim>> getModeloSimilitud_byPearson(int k, ArrayList<Long> test, ArrayList<Pelicula> peliculas) {\n HashMap<Long, TreeSet<ItemSim>> modelo_similitud = new HashMap<>();\r\n // Variables auxiliares:\r\n TreeSet<ItemSim> fila1;\r\n TreeSet<ItemSim> fila2;\r\n long id1;\r\n long id2;\r\n double similitud;\r\n long numPeliculas = peliculas.size();\r\n \r\n \r\n for (long i=0; i<numPeliculas; ++i){\r\n //System.out.println(\" pelicula \"+i+\" de \"+numPeliculas);\r\n //###// 1.1: Sacar la película numero i. Nota: estudiar si se pueden sacar todas de golpe.\r\n //Pelicula it1 = getPeliculaBD_byPos(instancia, i);\r\n Pelicula it1 = peliculas.get((int)i);\r\n id1 = it1.getIdPelicula();\r\n \r\n for (long j=i+1; j<numPeliculas; ++j){\r\n //###// 1.2: Sacar la película numero j.\r\n //Pelicula it2 = getPeliculaBD_byPos(instancia, j);\r\n Pelicula it2 = peliculas.get((int)j);\r\n id2 = it2.getIdPelicula();\r\n \r\n // 1.2: Calculo de la similitud entre it1 e it2.\r\n similitud = similitudPearson(it1, it2, test);\r\n \r\n // 1.3: Guardar la similitud en una estructura.\r\n //### 1.3: En el modelo definitivo, la similitud se guardará en la base de datos.\r\n //###//Similitud s1 = new Similitud(it1.id,it2.id,similitud);\r\n // NOTA: Hay que guardar, a la vez, tanto la similitud sim(id1,id2) como sim (id2,id1)\r\n if (modelo_similitud.containsKey(id1)){\r\n fila1 = modelo_similitud.get(id1);\r\n fila1.add(new ItemSim(id2,similitud));\r\n if (fila1.size() > k){\r\n fila1.remove(fila1.last());\r\n }\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }else{\r\n modelo_similitud.put(id1, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id1).add(new ItemSim(id2,similitud));\r\n \r\n if (modelo_similitud.containsKey(id2)){\r\n fila2 = modelo_similitud.get(id2);\r\n fila2.add(new ItemSim(id1,similitud));\r\n if (fila2.size() > k){\r\n fila2.remove(fila2.last());\r\n }\r\n }else{\r\n modelo_similitud.put(id2, new TreeSet<ItemSim>());\r\n modelo_similitud.get(id2).add(new ItemSim(id1,similitud));\r\n }\r\n }\r\n }\r\n }\r\n \r\n return modelo_similitud;\r\n }", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\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 }", "public void resolver() {\r\n\t\tfor(int i = 0; i<casillas.length; i++) {\r\n\t\t\tfor(int j = 0; j<casillas[0].length; j ++) {\r\n\t\t\t\tif(casillas[i][j].darSeleccionada() == false) {\r\n\t\t\t\t\tcasillas[i][j].destapar();\r\n\t\t\t\t\tcasillas[i][j].modificarValor(cantidadMinasAlrededor(i, j));\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 static void main(String[] args) {\n\t\tArrayList<Piloto> lst = new ArrayList <Piloto>();\r\n\t\tEvaluador evaluador = new Evaluador(lst);\r\n\t\t\r\n\t\tlst.add(new Piloto(\"Jorge\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Nicolas\", \"Perez\", true, 10 ));\r\n\t\tlst.add(new Piloto(\"Santiago\", \"Freire\", false, 0 ));\r\n\t\tlst.add(new Piloto(\"Ana\", \"Gutierrez\", false, 1 ));\r\n\t\tlst.add(new Piloto(\"Victoria\", \"Gutierrez\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Julia\", \"Freire\", true, 0 ));\r\n\t\tlst.add(new Piloto(\"Carlos\", \"Gutierrez\", true, 1 ));\r\n\t\t\r\n /*\r\n\t\t//le gusta volar y no tiene choques \r\n\t\tfor (Piloto p : evaluador.leGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n */\r\n \r\n\t\t//le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.leGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(true, true)) {\r\n System.out.println(p);\r\n }\r\n \r\n for (Piloto p : evaluador.obtenerTodosPeroParametrizar(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))) {\r\n System.out.println(p);\r\n }\r\n \r\n lst.stream()\r\n .filter(p -> (p.leGustaVolar && p.cantidadDeChoques > 0))\r\n .filter(p -> p.cantidadDeChoques == 10)\r\n .forEach(x -> System.out.println(x));\r\n \r\n\t\t\r\n /*\r\n\t\t//no le gusta volar y no tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarNoTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t\r\n\t\t//no le gusta volar y tiene choques\r\n\t\tfor (Piloto p : evaluador.noLeGustaVolarTieneChoques()) {\r\n System.out.println(p);\r\n }\r\n\t\t*/\r\n\t\t\r\n\t}", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected abstract Iterator<String> iterator(int restants, HashMap<String, Intersection> intersections, HashMap<String, Paire> vuDispo, Map<String, Map<String, Chemin>> plusCourtsChemins);", "public void solucion() {\r\n System.out.println(\"Intervalo : [\" + a + \", \" + b + \"]\");\r\n System.out.println(\"Error : \" + porce);\r\n System.out.println(\"decimales : \"+ deci);\r\n System.out.println(\"Iteraciones : \" + iteraciones);\r\n System.out\r\n .println(\"------------------------------------------------ \\n\");\r\n \r\n double c = 0;\r\n double fa = 0;\r\n double fb = 0;\r\n double fc = 0;\r\n int iteracion = 1;\r\n \r\n do {\r\n // Aqui esta la magia\r\n c = (a + b) / 2; \r\n System.out.println(\"Iteracion (\" + iteracion + \") : \" + c);\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n fc = funcion(c);\r\n if (fa * fc == 0) {\r\n if (fa == 0) {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+a);\r\n System.out.println(a);\r\n System.exit(0);\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+c);\r\n System.out.println(c);\r\n System.exit(0);\r\n }}\r\n \r\n if (fc * fa < 0) {\r\n b = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n } else {\r\n a = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n }\r\n iteracion++;\r\n // Itera mientras se cumpla la cantidad de iteraciones establecidas\r\n // y la funcion se mantenga dentro del margen de error\r\n \r\n er = Math.abs(((c - x) / c)* 100);\r\n BigDecimal bd = new BigDecimal(aux1);\r\n bd = bd.setScale(deci, RoundingMode.HALF_UP);\r\n BigDecimal bdpm = new BigDecimal(pm);\r\n bdpm = bdpm.setScale(deci, RoundingMode.HALF_UP);\r\n cont++;\r\n fc=c ;\r\n JOptionPane.showMessageDialog(null, \"conteos: \" + cont + \" Pm: \" + bd.doubleValue() + \" Funcion: \" + bdpm.doubleValue() + \" Error: \" + er +\"%\"+ \"\\n\");\r\n } while (er <=porce);\r\n \r\n \r\n }", "public void getGerarEscalaGeral(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<CorEquipes> listaCorGeral = repository.buscarCorGeral();\r\n\t\tList<Voluntario> listaVoluntarioGeral = repository.buscarVoluntarioGeral();\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t//\tFor de verificação para não repetição dos campos sorteados\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\t//População inicial\t\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t\r\n\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\r\n\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\r\n\t\t\tlistPopulacaoI.add(listaVoluntarioGeral.get(conteudoSorteado));\r\n\t\r\n\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\tintervaloSorteio.remove(j);\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//Gera os pais\r\n\t\tfor (int i=0; i<listaVoluntarioGeral.size(); i++) {\r\n\t\t\tintervaloSorteio.add(i);\r\n\t\t}\r\n\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\tbreak;\r\n\t\t\t}else {\r\n\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Cruzamento\r\n\t\tint tamanhoA = equipeA.size();\r\n\t\tint tamanhoB = equipeB.size();\r\n\t\tint metadeA = (int) tamanhoA/2;\r\n\t\tint metadeB = (int) tamanhoB/2;\r\n\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t}\r\n\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t}\r\n\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//grava dados na base\r\n\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\t\r\n\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\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}else {\r\n\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n//\t\t\t\t\tgetEntity().setCorE(listaCorGeral.get(i));\r\n\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public ArrayList<String> ExcutarCalculo(ArrayList<String> linha, String tipo){\n ArrayList<String> cod = new ArrayList();\n String reg, rv1, rv2;\n \n /*Verifica se a variavel tem registrador*/\n reg = r.getRegistrador(linha.get(0));\n if(linha.size() == 3){//x = n\n rv1 = r.getRegistrador(linha.get(2));//Verifica se é variavel\n \n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n } \n \n if(rv1 == null)\n cod.add(\"load \"+reg+\", \"+linha.get(2));\n else\n cod.add(\"load \"+reg+\", \"+rv1);\n }else{\n ArrayList<String> aux = new ArrayList();\n String[] ordem = new String[100];\n String [][]operador = {{\"(\",\"\"},{\"*\",\"mult\"},{\"/\",\"div\"},{\"+\",\"add\"},{\"-\",\"sub\"}};\n String []temp = {\"ra\",\"rb\",\"rc\",\"rd\",\"re\",\"rf\"};\n Boolean ctr = false;\n int i, j, k, tl, ctrTemp, r1, r2, pos;\n \n for(i = 0; i < 100; i++){\n ordem[i] = \"\";\n } \n \n tl = ctrTemp = 0;\n for(i = 0; i < 5; i++){\n for(j = 0; j < linha.size(); j++){\n if(linha.get(j).contains(operador[i][0])){\n if(i == 0){\n /* min = verificaRegistradores(linha.get(j+1),linha.get(j+3),temp);\n \n if(min == -1){\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t1\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+3);//Carrega val no registrador t2\n }\n \n \n for(k = 0; k < 5; k++){\n if(linha.get(j+2).contains(operador[k][0])){ \n if(operador[k][1].equals(\"add\")){\n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n }\n \n k = 5;\n }\n }\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3 por conta de reuso\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n \n for(k = 0; k < 5; k++)//( ate )\n linha.remove(j);\n linha.add(j,temp[ctrTemp-2]);\n \n if(min == -1)\n ctrTemp -= 1;\n else\n ctrTemp = 0;*/\n }else{\n rv1 = r.getRegistrador(linha.get(j-1));\n rv2 = r.getRegistrador(linha.get(j+1));\n \n r1 = verificaRegistradores(linha.get(j-1),temp);\n if(r1 == -1){//Nenhum registrador\n if(rv1 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j-1);//Carrega val no registrador t1\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv1;\n }\n r2 = verificaRegistradores(linha.get(j+1),temp);\n if(r2 == -1){//Nenhum registrador\n if(rv2 == null)\n ordem[tl++] = \"load \"+temp[ctrTemp++]+\", \"+linha.get(j+1);//Carrega val no registrador t2\n else\n ordem[tl++] = \"move \"+temp[ctrTemp++]+\", \"+rv2;//Carrega val no registrador t2\n } \n \n pos = ctrTemp;//como posso entrar no mult ou no add\n if(operador[i][1].equals(\"mult\") || operador[i][1].equals(\"div\")){\n ctrTemp -= 2;\n \n if(operador[i][1].equals(\"mult\")){\n aux = mult(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }else\n if(operador[i][1].equals(\"div\")){\n aux = div(linha.get(j-1), linha.get(j+1), tipo, temp[ctrTemp++]);\n }\n \n tl -= 2;\n for(k = 0; k < aux.size(); k++){\n ordem[tl++] = aux.get(k);\n }\n pos = ctrTemp-1;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n /*else\n ctrTemp -= 1;*/\n }else\n if(operador[i][1].equals(\"add\") || operador[i][1].equals(\"sub\")){\n if(operador[i][1].equals(\"sub\")){\n ordem[tl-1] = \"load \"+temp[ctrTemp-1]+\", -\"+linha.get(j+1);\n }\n \n if(tipo.equals(\"int\"))\n ordem[tl] += \"addi\";\n else\n ordem[tl] += \"addf\";\n \n ordem[tl] += \" \"+temp[ctrTemp-2];//temp3\n ordem[tl] += \", \"+temp[ctrTemp-1];//temp2\n ordem[tl] += \", \"+temp[ctrTemp-2];//temp1\n tl++;\n pos = ctrTemp-2;\n \n if(r1!= -1 && r2 != -1)\n ctrTemp -= 2;\n else\n ctrTemp -= 1;\n }\n \n for(k = 0; k < 3; k++)\n linha.remove(j-1);\n linha.add(j-1,temp[pos]);\n }\n ctr = true;//Faz repetir denovo caso adicione;\n }\n }\n if(ctr){\n i--;//Controla pra só sair quando tiver excluido todas operacoes desse tipo\n ctr = false;\n }\n }\n for(k = 0; k < tl; k++){\n cod.add(ordem[k]);\n }\n\n if(reg == null){\n reg = \"r\"+(r.getMax()+1);\n r.Add(linha.get(0), reg);\n }\n cod.add(\"move \"+reg+\", \"+temp[ctrTemp-1]);\n ctrTemp = 0;\n }\n \n return cod;\n }", "public void partieEnCour(int niveau){\n\t\t\t\n\t\t\tif(niveau<=0){\n\t\t\t\tSystem.out.println(\"Quel niveau ?\");\n\t\t\t\tniveau=lire.nextInt();\n\t\t\t}\n\t\t\tthis.niveau=niveau;\n\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau-1);\n\t\t\tSystem.out.println(terrainDeLaPartie.getCave().toString());\n\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\tboolean heroEnVie=true;\n\t\t\twhile(sortieNonAtteint()&& tempsNonEcoule() && heroEnVie==true){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(ObjetVivant eleViv:terrainDeLaPartie.getPersonnageSurLeTerrain()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(eleViv.estEnVie()){\n\t\t\t\t\t\t\teleViv.seDeplacer(terrainDeLaPartie);\n\t\t\t\t\t\t}\n\t\t\t\t\t}catch(DeplacementInvalideException e){\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\tfor(ObjetNonVivant eleNonViv:terrainDeLaPartie.getObjetSurLeTerrain()){\n\t\t\t\t\teleNonViv.tomber(terrainDeLaPartie);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tquiEstMort();\n\t\t\t\tquiEstDetruit();\n\t\t\t\tthis.terrainDeLaPartie.getObjetSurLeTerrain().addAll(this.terrainDeLaPartie.reinitialisationObjet());\n\t\t\t\tthis.terrainDeLaPartie.afficherMap();\n\t\t\t\tCave a=this.terrainDeLaPartie.getCave();\n\t\t\t\ta.setCaveTime(a.getCaveTime()-1);\t\t\t\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getPersonnageSurLeTerrain().size()-1+\" enemie\");\n\t\t\t\tSystem.out.println(this.terrainDeLaPartie.getObjetSurLeTerrain().size()-1+\" objet\");\n\t\t\t\t\n\t\t\t\theroEnVie=heroEncoreDansListe(this.terrainDeLaPartie.getPersonnageSurLeTerrain());\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(heroEnVie && !sortieNonAtteint()){\n\t\t\t\tthis.terrainDeLaPartie=this.EnsembleNiveau.listeMap.get(niveau);\n\t\t\t\tpartieEnCour(niveau+1);\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Vous avez perdu ! Voulez vous rejouer ?\");\n\t\t\t\tSystem.out.println(\"1:rejouer\");\n\t\t\t\tSystem.out.println(\"2:quitter \");\n\t\t\t\tint rep=lire.nextInt();\n\t\t\t\tif(rep==1){\n\t\t\t\t\tFile f=new File(\"BD01plus.bdcff\");\n\t\t\t\t\tEnsembleNiveau=new Univers();\n\t\t\t\t\tLireFichier.lire(f, EnsembleNiveau);\n\t\t\t\t\tthis.partieEnCour(niveau);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\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 static void llenarSoriana(){\r\n Producto naranja1 = new Producto (\"naranja\", \"el huertito\", 25, 0);\r\n Nodo<Producto> nTemp1 = new Nodo(naranja1);\r\n listaSoriana.agregarNodo(nTemp1);\r\n \r\n Producto naranja2 = new Producto (\"naranja\", \"el ranchito\", 34, 0);\r\n Nodo<Producto> nTemp2 = new Nodo (naranja2);\r\n listaSoriana.agregarNodo(nTemp2);\r\n \r\n Producto manzana3 = new Producto (\"manzana\", \"el rancho de don chuy\", 24, 0);\r\n Nodo<Producto> nTemp3 = new Nodo (manzana3);\r\n listaSoriana.agregarNodo(nTemp3);\r\n \r\n Producto manzana4 = new Producto (\"manzana\", \"la costeña\", 15, 0);\r\n Nodo<Producto> nTemp4 = new Nodo(manzana4);\r\n listaSoriana.agregarNodo(nTemp4);\r\n \r\n Producto platano5 = new Producto (\"platano\", \"el Huertito\", 26, 0);\r\n Nodo<Producto> nTemp5 = new Nodo (platano5);\r\n listaSoriana.agregarNodo(nTemp5);\r\n \r\n Producto platano6 = new Producto (\"platano\", \"granjita dorada\", 36, 0);\r\n Nodo<Producto> nTemp6 = new Nodo (platano6);\r\n listaSoriana.agregarNodo (nTemp6);\r\n \r\n Producto pera7 = new Producto (\"pera\", \"el rancho de don chuy\", 38, 0);\r\n Nodo<Producto> nTemp7 = new Nodo (pera7);\r\n listaSoriana.agregarNodo(nTemp7);\r\n \r\n Producto pera8 = new Producto (\"pera\", \"la costeña\", 8,0);\r\n Nodo<Producto> nTemp8 = new Nodo (pera8);\r\n listaSoriana.agregarNodo(nTemp8);\r\n \r\n Producto durazno9 = new Producto (\"durazno\", \"el huertito\", 12.50, 0);\r\n Nodo<Producto> nTemp9 = new Nodo (durazno9);\r\n listaSoriana.agregarNodo(nTemp9);\r\n \r\n Producto fresa10 = new Producto (\"fresa\", \"el rancho de don chuy\", 35.99,0);\r\n Nodo<Producto> nTemp10 = new Nodo (fresa10);\r\n listaSoriana.agregarNodo(nTemp10);\r\n \r\n Producto fresa11 = new Producto (\"fresa\", \"grajita dorada\", 29.99,0);\r\n Nodo<Producto> nTemp11 = new Nodo (fresa11);\r\n listaSoriana.agregarNodo(nTemp11);\r\n \r\n Producto melon12 = new Producto (\"melon\", \"la costeña\", 18.50, 0);\r\n Nodo<Producto> nTemp12 = new Nodo (melon12);\r\n listaSoriana.agregarNodo(nTemp12);\r\n \r\n Producto melon13 = new Producto (\"melon\", \"el huertito\", 8.50, 0);\r\n Nodo<Producto> nTemp13 = new Nodo (melon13);\r\n listaSoriana.agregarNodo(nTemp13);\r\n \r\n Producto elote14 = new Producto (\"elote\", \"el ranchito\", 6, 0);\r\n Nodo<Producto> nTemp14 = new Nodo (elote14);\r\n listaSoriana.agregarNodo(nTemp14);\r\n \r\n Producto elote15 = new Producto (\"elote\", \"moctezuma\", 12, 0);\r\n Nodo<Producto> nTemp15 = new Nodo (elote15);\r\n listaSoriana.agregarNodo(nTemp15);\r\n \r\n Producto aguacate16 = new Producto (\"aguacate\", \"la costeña\", 35, 0);\r\n Nodo<Producto> nTemp16 = new Nodo (aguacate16);\r\n listaSoriana.agregarNodo(nTemp16);\r\n \r\n Producto cebolla17 = new Producto (\"cebolla\", \"granjita dorada\", 8.99, 0);\r\n Nodo<Producto> nTemp17 = new Nodo (cebolla17);\r\n listaSoriana.agregarNodo(nTemp17);\r\n \r\n Producto tomate18 = new Producto (\"tomate\", \"el costeñito feliz\", 10.50, 0);\r\n Nodo<Producto> nTemp18 = new Nodo (tomate18);\r\n listaSoriana.agregarNodo(nTemp18);\r\n \r\n Producto tomate19 = new Producto (\"tomate\", \"el ranchito\", 8.99, 0);\r\n Nodo<Producto> nTemp19 = new Nodo (tomate19);\r\n listaSoriana.agregarNodo(nTemp19);\r\n \r\n Producto limon20 = new Producto (\"limon\", \"la costeña\", 3.50, 0);\r\n Nodo<Producto> nTemp20 = new Nodo (limon20);\r\n listaSoriana.agregarNodo(nTemp20);\r\n \r\n Producto limon21 = new Producto (\"limon\", \"el ranchito\", 10.99, 0);\r\n Nodo<Producto> nTemp21 = new Nodo (limon21);\r\n listaSoriana.agregarNodo(nTemp21);\r\n \r\n Producto papas22 = new Producto (\"papas\", \"la costeña\", 11, 0);\r\n Nodo<Producto> nTemp22 = new Nodo(papas22);\r\n listaSoriana.agregarNodo(nTemp22);\r\n \r\n Producto papas23 = new Producto (\"papas\", \"granjita dorada\", 4.99, 0);\r\n Nodo<Producto> nTemp23 = new Nodo(papas23);\r\n listaSoriana.agregarNodo(nTemp23);\r\n \r\n Producto chile24 = new Producto (\"chile\", \"el rancho de don chuy\", 2.99, 0);\r\n Nodo<Producto> nTemp24 = new Nodo (chile24);\r\n listaSoriana.agregarNodo(nTemp24);\r\n \r\n Producto chile25 = new Producto (\"chile\",\"la costeña\", 12, 0);\r\n Nodo<Producto> nTemp25 = new Nodo (chile25);\r\n listaSoriana.agregarNodo(nTemp25);\r\n \r\n Producto jamon26 = new Producto (\"jamon\",\"fud\", 25, 1);\r\n Nodo<Producto> nTemp26 = new Nodo(jamon26);\r\n listaSoriana.agregarNodo(nTemp26);\r\n \r\n Producto jamon27 = new Producto(\"jamon\", \"kir\", 13.99, 1);\r\n Nodo<Producto> nTemp27 = new Nodo(jamon27);\r\n listaSoriana.agregarNodo(nTemp27);\r\n \r\n Producto peperoni28 = new Producto (\"peperoni28\", \"fud\", 32, 1);\r\n Nodo<Producto> nTemp28 = new Nodo (peperoni28);\r\n listaSoriana.agregarNodo(nTemp28);\r\n \r\n Producto salchicha29 = new Producto (\"salchicha\", \" san rafael\", 23.99, 1);\r\n Nodo<Producto> nTemp29 = new Nodo (salchicha29);\r\n listaSoriana.agregarNodo(nTemp29); \r\n \r\n Producto huevos30 = new Producto (\"huevos\", \"san rafael\", 30.99, 1);\r\n Nodo<Producto> nTemp30 = new Nodo (huevos30);\r\n listaSoriana.agregarNodo(nTemp30);\r\n \r\n Producto chuletas31 = new Producto (\"chuletas\", \"la res dorada\", 55, 1);\r\n Nodo<Producto> nTemp31 = new Nodo (chuletas31);\r\n listaSoriana.agregarNodo(nTemp31);\r\n \r\n Producto carnemolida32 = new Producto (\"carne molida\", \"san rafael\", 34, 1);\r\n Nodo<Producto> nTemp32 = new Nodo (carnemolida32);\r\n listaSoriana.agregarNodo(nTemp32);\r\n \r\n Producto carnemolida33 = new Producto (\"carne molida\", \"la res dorada\", 32.99, 1);\r\n Nodo<Producto> nTemp33 = new Nodo (carnemolida33);\r\n listaSoriana.agregarNodo(nTemp33);\r\n \r\n Producto pollo34 = new Producto (\"pollo\", \"pollito feliz\", 38, 1);\r\n Nodo<Producto> nTemp34 = new Nodo (pollo34);\r\n listaSoriana.agregarNodo(nTemp34);\r\n \r\n Producto pescado35 = new Producto (\"pescado\", \"pescadito\", 32.99, 1);\r\n Nodo<Producto> nTemp35 = new Nodo (pescado35);\r\n listaSoriana.agregarNodo(nTemp35);\r\n \r\n Producto quesolaurel36 = new Producto (\"queso\", \"laurel\", 23.50, 1);\r\n Nodo<Producto> nTemp36 = new Nodo (quesolaurel36);\r\n listaSoriana.agregarNodo(nTemp36);\r\n \r\n Producto leche37 = new Producto (\"leche\", \"nutrileche\", 12.99, 1);\r\n Nodo<Producto> nTemp37 = new Nodo (leche37);\r\n listaSoriana.agregarNodo(nTemp37);\r\n \r\n Producto lechedeslactosada38 = new Producto (\"leche deslactosada\", \"lala\", 17.50, 1);\r\n Nodo<Producto> nTemp38 = new Nodo (lechedeslactosada38);\r\n listaSoriana.agregarNodo(nTemp38);\r\n \r\n Producto panblanco39 = new Producto (\"pan blanco\", \"bombo\", 23.99, 2);\r\n Nodo<Producto> nTemp39 = new Nodo (panblanco39);\r\n listaSoriana.agregarNodo(nTemp39);\r\n \r\n Producto atun40 = new Producto (\"atun\", \"la aleta feliz\", 12, 2);\r\n Nodo<Producto> nTemp40 = new Nodo (atun40);\r\n listaSoriana.agregarNodo(nTemp40);\r\n \r\n Producto atun41 = new Producto (\"atun\", \"el barco\", 10.99, 2);\r\n Nodo<Producto> nTemp41 = new Nodo (atun41);\r\n listaSoriana.agregarNodo(nTemp41);\r\n \r\n Producto arroz42 = new Producto (\"arroz\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp42 = new Nodo (arroz42);\r\n listaSoriana.agregarNodo(nTemp42);\r\n \r\n Producto arroz43 = new Producto (\"arroz\", \"soriana\", 9.99, 2);\r\n Nodo<Producto> nTemp43 = new Nodo (arroz43);\r\n listaSoriana.agregarNodo(nTemp43);\r\n \r\n Producto frijol44 = new Producto (\"frijol\", \"mi marca\", 10.99, 2);\r\n Nodo<Producto> nTemp44 = new Nodo (frijol44);\r\n listaSoriana.agregarNodo(nTemp44);\r\n \r\n Producto frijol45 = new Producto (\"frijol\", \"soriana\", 15.99, 2);\r\n Nodo<Producto> nTemp45 = new Nodo (frijol45);\r\n listaSoriana.agregarNodo(nTemp45);\r\n \r\n Producto azucar46 = new Producto (\"azucar\", \"mi marca\", 12.50, 2);\r\n Nodo<Producto> nTemp46 = new Nodo (azucar46);\r\n listaSoriana.agregarNodo(nTemp46);\r\n \r\n Producto azucar47 = new Producto (\"azucar\", \"zulka\", 15.99, 2);\r\n Nodo<Producto> nTemp47 = new Nodo (azucar47);\r\n listaSoriana.agregarNodo(nTemp47);\r\n \r\n Producto servilletas48 = new Producto (\"servilletas\", \"esponjosas\",10.50, 2);\r\n Nodo<Producto> nTemp48 = new Nodo (servilletas48);\r\n listaSoriana.agregarNodo(nTemp48);\r\n \r\n Producto sal49 = new Producto (\"sal\", \"mar azul\", 3.99, 2);\r\n Nodo<Producto> nTemp49 = new Nodo (sal49);\r\n listaSoriana.agregarNodo(nTemp49);\r\n \r\n Producto aceitedecocina50 = new Producto (\"aceite de cocina\", \"123\", 15.99, 2);\r\n Nodo<Producto> nTemp50 = new Nodo (aceitedecocina50);\r\n listaSoriana.agregarNodo(nTemp50);\r\n \r\n Producto caffe51 = new Producto (\"caffe\", \"nescafe\", 23, 2);\r\n Nodo<Producto> nTemp51 = new Nodo (caffe51);\r\n listaSoriana.agregarNodo(nTemp51);\r\n \r\n Producto puredetomate52 = new Producto (\"pure de tomate\", \" la costeña\", 12.99, 2);\r\n Nodo<Producto> nTemp52 = new Nodo (puredetomate52);\r\n listaSoriana.agregarNodo(nTemp52);\r\n \r\n Producto lentejas53 = new Producto (\"lentejas\", \"la granjita\", 8.99, 2);\r\n Nodo<Producto> nTemp53 = new Nodo (lentejas53);\r\n listaSoriana.agregarNodo(nTemp53);\r\n \r\n Producto zuko54 = new Producto (\"zuko\", \"zuko\", 2.99, 2);\r\n Nodo<Producto> nTemp54 = new Nodo (zuko54);\r\n listaSoriana.agregarNodo(nTemp54);\r\n \r\n Producto champu55 = new Producto (\"champu\", \"loreal\", 32, 3);\r\n Nodo<Producto> nTemp55 = new Nodo (champu55);\r\n listaSoriana.agregarNodo(nTemp55);\r\n \r\n Producto champu56 = new Producto (\"champu\", \"el risueño\", 29.99, 3);\r\n Nodo<Producto> nTemp56 = new Nodo (champu56);\r\n listaSoriana.agregarNodo(nTemp56);\r\n \r\n Producto desodorante57 = new Producto (\"desodorante\", \"nivea\", 23.50, 3);\r\n Nodo<Producto> nTemp57 = new Nodo (desodorante57);\r\n listaSoriana.agregarNodo(nTemp57);\r\n \r\n Producto pastadedientes58 = new Producto(\"pasta de dientes\", \"colgate\", 17.50, 3);\r\n Nodo<Producto> nTemp58 = new Nodo (pastadedientes58);\r\n listaSoriana.agregarNodo(nTemp58);\r\n \r\n Producto pastadedientes59 = new Producto (\"pasta de dientes\", \"el diente blanco\", 29, 3);\r\n Nodo<Producto> nTemp59 = new Nodo (pastadedientes59);\r\n listaSoriana.agregarNodo(nTemp59);\r\n \r\n Producto rastrillos60 = new Producto (\"rastrillos\", \"el filosito\", 33.99, 3);\r\n Nodo<Producto> nTemp60 = new Nodo (rastrillos60);\r\n listaSoriana.agregarNodo(nTemp60);\r\n \r\n Producto rastrillos61 = new Producto (\"rastrillos\", \"barba de oro\", 23.99, 3);\r\n Nodo<Producto> nTemp61 = new Nodo (rastrillos61);\r\n listaSoriana.agregarNodo(nTemp61);\r\n \r\n Producto hilodental62 = new Producto (\"hilo dental\", \"el diente blanco\", 32.99, 3);\r\n Nodo<Producto> nTemp62 = new Nodo (hilodental62);\r\n listaSoriana.agregarNodo(nTemp62);\r\n \r\n Producto cepillodedientes63 = new Producto (\"cepillo de dientes\", \"OBBM\", 17.99, 3);\r\n Nodo<Producto> nTemp63 = new Nodo (cepillodedientes63);\r\n listaSoriana.agregarNodo(nTemp63);\r\n \r\n Producto cloro64 = new Producto (\"cloro\", \"cloralex\", 23.50, 3);\r\n Nodo<Producto> nTemp64 = new Nodo (cloro64);\r\n listaSoriana.agregarNodo(nTemp64);\r\n \r\n Producto acondicionador65 = new Producto (\"acondicionador\", \"sedal\", 28.99, 3);\r\n Nodo<Producto> nTemp65 = new Nodo (acondicionador65);\r\n listaSoriana.agregarNodo(nTemp65);\r\n \r\n Producto acondicionador66 = new Producto (\"acondicionador\", \"pantene\", 23.99, 3);\r\n Nodo<Producto> nTemp66 = new Nodo (acondicionador66);\r\n listaSoriana.agregarNodo(nTemp66);\r\n \r\n Producto pinol67 = new Producto(\"pinol\", \"mi piso limpio\", 15, 3);\r\n Nodo<Producto> nTemp67 = new Nodo (pinol67);\r\n listaSoriana.agregarNodo(nTemp67);\r\n \r\n Producto pinol68 = new Producto (\"pinol\", \"eficaz\", 18.99, 3);\r\n Nodo<Producto> nTemp68 = new Nodo (pinol68);\r\n listaSoriana.agregarNodo(nTemp68);\r\n \r\n Producto tortillas69 = new Producto (\"tortillas\", \"maizena\", 8.99, 2);\r\n Nodo<Producto> nTemp69 = new Nodo (tortillas69);\r\n listaSoriana.agregarNodo(nTemp69);\r\n \r\n Producto cremaparacuerpo70 = new Producto (\"crema para cuerpo\", \"dove\", 13.50, 3);\r\n Nodo<Producto> nTemp70 = new Nodo (cremaparacuerpo70);\r\n listaSoriana.agregarNodo(nTemp70);\r\n \r\n Producto maizoro71 = new Producto (\"maizoro\", \"special k\", 35.99, 2);\r\n Nodo<Producto> nTemp71 = new Nodo (maizoro71);\r\n listaSoriana.agregarNodo(nTemp71);\r\n \r\n Producto maizoro72 = new Producto (\"maizoro\",\"azucaradas\", 43, 2);\r\n Nodo<Producto> nTemp72 = new Nodo (maizoro72);\r\n listaSoriana.agregarNodo(nTemp72);\r\n \r\n Producto zanahoria73 = new Producto (\"zanahoria\", \"el huertito\", 12.99, 0);\r\n Nodo<Producto> nTemp73 = new Nodo (zanahoria73);\r\n listaSoriana.agregarNodo(nTemp73);\r\n \r\n Producto maizoro74 = new Producto (\"maizoro\", \"cherrios\", 45, 2);\r\n Nodo<Producto> nTemp74 = new Nodo (maizoro74);\r\n listaSoriana.agregarNodo(nTemp74);\r\n \r\n Producto mayonesa75 = new Producto (\"mayonesa\", \"helmans\", 23, 2);\r\n Nodo<Producto> nTemp75 = new Nodo (mayonesa75);\r\n listaSoriana.agregarNodo(nTemp75);\r\n }", "public void joueDeuxHumains()\n\t{\n\t\tboolean fin = false;\n\t\tboolean result = false;\n\t\tint etoiles;\n\t\tint choix;\n\t\tint i = 0;\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint x2 = 0;\n\t\tint y2 = 0;\n\t\tString couleur;\n\t\tetoiles = initialiser();\n\t\twhile (!fin)\n\t\t{\n\t\t\tif (i % 2 == 0)\n\t\t\t{\n\t\t\t\tcouleur = \"bleu\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcouleur = \"rouge\";\n\t\t\t}\n\t\t\tSystem.out.println(\"1-Jouer\");\n\t\t\tSystem.out.println(\"2-Afficher une composante\");\n\t\t\tSystem.out.println(\"3-Vérifier si une case relie une composante\");\n\t\t\tSystem.out.println(\"4-Regarder s'il existe un chemin entre deux cases d'une couleur donnée\");\n\t\t\tSystem.out.println(\"5-Afficher le nombre minimum de cases entre deux cases données (x,y) et (z,t)\");\n\t\t\tSystem.out.println(\"6-Quitter\");\n\t\t\tchoix = clavier.nextInt();\n\t\t\tafficher(i);\n\t\t\tswitch (choix)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"### Ajout d'une case pour jouer ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tresult = tableauPeres_[x][y].colorerCase(couleur);\n\t\t\t\t\t//System.out.println(existeCheminCases(getLesVoisins(x, y, couleur), tableauPeres_[x][y], couleur));\n\t\t\t\t\tif (getNbEtoiles(x, y, couleur) < getNbEtoiles(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY(), x, y);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunion(x, y, getLesVoisins(x, y, couleur).getX(), getLesVoisins(x, y, couleur).getY());\n\t\t\t\t\t}\n\t\t\t\t\tpreparerScore(x, y, couleur);\n\t\t\t\t\tafficheScores(couleur);\n\t\t\t\t\tnombresEtoiles(x, y, couleur);\n\t\t\t\t\t++i;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tSystem.out.println(\"### Afficher une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tafficheComposante(x, y, couleur);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tSystem.out.println(\"### Tester si une case relie une composante ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tif(!relieComposantes(x, y, couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case ne relie aucune composante.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Cette case relie une ou plusieurs composante(s).\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"### Tester s'il existe un chemin entre deux cases données ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tif (existeCheminCases(tableauPeres_[x][y], tableauPeres_[x2][y2], couleur))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il existe un chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Il n'existe pas de chemin entre les deux cases.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tSystem.out.println(\"### Afficher nombre minimum de cases qui relie deux cases ###\");\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la première case ?\");\n\t\t\t\t\tx = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la première case ?\");\n\t\t\t\t\ty = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de x de la deuxième case ?\");\n\t\t\t\t\tx2 = clavier.nextInt();\n\t\t\t\t\tSystem.out.println(\"Quel est la valeur de y de la deuxième case ?\");\n\t\t\t\t\ty2 = clavier.nextInt();\n\t\t\t\t\tcompressionChemin(x, y);\n\t\t\t\t\tcompressionChemin(x2, y2);\n\t\t\t\t\tSystem.out.println(relierCasesMin(x, y, x2, y2, couleur));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tfin = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (scoreJ2_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur bleu a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\t\t\telse if (scoreJ1_ == etoiles)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Joueur rouge a gagné !\");\n\t\t\t\tfin = true;\n\t\t\t}\n\n\t\t}\n\t}", "public Ruteo setCovering(){\n\t\tRuteo resultado=null;\n\t\t double time1= System.currentTimeMillis();\n\t\t Integer [][]a=new Integer[Auxiliar.OBRAS.size()][listaSetCovering.size()];\n\t\t List<Double>c=new ArrayList<Double>();\n\t\t List<Double>t=new ArrayList<Double>();\n\t\t List<Obra>listObras=Auxiliar.OBRAS;\n\t\t for(int i=0;i<listaSetCovering.size();i++){\n\t\t\t c.add(listaSetCovering.get(i).costosTotales);\n\t\t\t t.add(listaSetCovering.get(i).tiempoTotal);\n\t\t }\n\t\t for(int i=0;i<Auxiliar.OBRAS.size();i++){\n\t\t\t for(int j=0;j<listaSetCovering.size();j++){\n\t\t\t\t if(listaSetCovering.get(j).estaObraEnRuta(listObras.get(i))){\n\t\t\t\t\t a[i][j]=1;\n\t\t\t\t }else{\n\t\t\t\t\t a[i][j]=0;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t List<Integer>respuesta=new ArrayList<Integer>();\n\t\tif(fo==FO1){\n\t\t\tSetCovering sc=new SetCovering();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\t\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tobjval=sc.fo;\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO2){\n\t\t\tSetCovering2 sc=new SetCovering2();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO3){\n\t\t\tSetCovering3 sc=new SetCovering3();\n\t\t\trespuesta=sc.generateModel(c, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}else if(fo==FO4){\n\t\t\tSetCovering4 sc=new SetCovering4();\n\t\t\trespuesta=sc.generateModel(c,t, a);\n\t\t\tobjval=sc.fo;\n\t\t\tList<Ruta>rutasRuteo=new ArrayList<Ruta>();\n\t\t\tfor(int i=0;i<respuesta.size();i++){\n\t\t\t\tRuta ruta=listaSetCovering.get(respuesta.get(i));\n\t\t\t\trutasRuteo.add(ruta);\n\t\t\t}\n\t\t\tDouble costosRuteo=darCostoRuteo(rutasRuteo);\n\t\t\tRuteo ruteo=new Ruteo(costosRuteo,rutasRuteo);\n\t\t\tresultado=ruteo;\n\t\t}\n\t\t double time2= System.currentTimeMillis();\n\t\t tiempoComputacionalSetCovering=(time2-time1)/1000.0;\n\t\t return resultado;\n\t}", "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 }", "public static void main(String[] args) {\n ArrayList<Integer> taszkok = new ArrayList<>();\r\n String text = null;\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\r\n try {\r\n text = reader.readLine();\r\n\r\n String[] taszkfeltolt = text.split(\",\");\r\n for(int i = 0; i<taszkfeltolt.length ;i++){\r\n taszkok.add(Integer.parseInt(taszkfeltolt[i])) ;\r\n }\r\n\r\n }\r\n catch(Exception e){\r\n\r\n }\r\n\r\n int laphibak=0;\r\n ArrayList<String> abc = new ArrayList<>();\r\n ArrayList<Integer> fagyi = new ArrayList<>();\r\n ArrayList<Integer> szam = new ArrayList<>();\r\n for(int i = 0; i<taszkok.size();i++){\r\n boolean csillag=false;\r\n boolean nemvoltlaphiba=false;\r\n int fagyilesz=-1;\r\n //System.out.print(taszkok.get(i));\r\n\r\n if(0>taszkok.get(i)){\r\n //valami történik\r\n taszkok.set(i, taszkok.get(i)*(-1));\r\n fagyilesz=0;\r\n }\r\n if(abc.size()<3){\r\n\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){\r\n if (abc.size()==2){\r\n abc.add(\"C\");\r\n System.out.print(\"C\");\r\n }\r\n else if (abc.size()==1){\r\n abc.add(\"B\");\r\n System.out.print(\"B\");\r\n }\r\n else if (abc.size()==0){\r\n abc.add(\"A\");\r\n System.out.print(\"A\");\r\n }\r\n szam.add(taszkok.get(i));\r\n if(fagyilesz!=0){\r\n fagyi.add(4); // a kör végén ugy is csökkentem 1el elsőre is\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n //System.out.print(abc);\r\n int tempfagyi=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n if(fagyilesz!=0){\r\n fagyi.add(tempfagyi);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n //System.out.print(temp+\"e,\");\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n }\r\n else if(abc.size()==3){\r\n int vanilyen = vanilyen(taszkok.get(i),szam);\r\n if(vanilyen==-1){ //ha ez egy uj szam\r\n int hanyadikbet=vanszabad(fagyi);\r\n if(hanyadikbet!=-1){\r\n String temp=abc.get(hanyadikbet);\r\n szam.remove(hanyadikbet);\r\n szam.add(taszkok.get(i));\r\n abc.remove(hanyadikbet); //a tömb végére rakom és 4 ra allitom a fagyasztast\r\n abc.add(temp);\r\n\r\n fagyi.remove(hanyadikbet);\r\n if(fagyilesz!=0){\r\n fagyi.add(4);\r\n }\r\n else{\r\n fagyi.add(0);\r\n }\r\n\r\n System.out.print(temp);\r\n }\r\n else{\r\n csillag=true;\r\n }\r\n }\r\n else{\r\n String temp=abc.get(vanilyen);\r\n abc.remove(vanilyen); //a tömb végére rakom és 0 ra allitom a fagyasztast\r\n abc.add(temp);\r\n szam.remove(vanilyen);\r\n szam.add(taszkok.get(i));\r\n int fagyitemp=fagyi.get(vanilyen);\r\n fagyi.remove(vanilyen);\r\n fagyi.add(fagyitemp);\r\n nemvoltlaphiba=true;\r\n }\r\n\r\n\r\n }\r\n\r\n if (csillag==true){\r\n System.out.print(\"*\");\r\n }\r\n if(nemvoltlaphiba==true){\r\n System.out.print(\"-\");\r\n }\r\n else{\r\n laphibak++;\r\n }\r\n for(int j = 0; j<fagyi.size();j++){\r\n if(fagyi.get(j)!=0){\r\n fagyi.set(j,fagyi.get(j)-1); //csokkentem a fagyasztast\r\n }\r\n }\r\n }\r\n\r\n\r\n System.out.println();\r\n System.out.print(laphibak);\r\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public GenerarInformePlanificacion(Curso[] cursos, Apoderado[] apoderados) {\n this.apoderados = new PlanificacionApoderado[apoderados.length];\n for (int i = 0; i < apoderados.length; i++) {\n this.apoderados[i] = new PlanificacionApoderado();\n }\n\n int cantidadCurso = 0;\n\n for (int apTotal = 0; apTotal < this.apoderados.length; apTotal++) {\n this.apoderados[apTotal].nombre = apoderados[apTotal].getNombre();\n this.apoderados[apTotal].apellido = apoderados[apTotal].getApellido();\n this.apoderados[apTotal].run = apoderados[apTotal].getRun();\n for (int cantPupilos = 0; cantPupilos < apoderados[apTotal].getPupilos().size(); cantPupilos++) {\n\n PlanificacionAlumno alumnoAgregar = new PlanificacionAlumno();\n alumnoAgregar.nombre = apoderados[apTotal].getPupilos().get(cantPupilos).getNombre();\n alumnoAgregar.apellido = apoderados[apTotal].getPupilos().get(cantPupilos).getApellido();\n alumnoAgregar.run = apoderados[apTotal].getPupilos().get(cantPupilos).getRun();\n for (int j = 0; j < 16; j++) {\n for (int alum = 0; alum < 30; alum++) {\n if (cursos[j].getAlumnos()[alum].getRun().equals(apoderados[apTotal].getPupilos().get(cantPupilos).getRun())) {\n cantidadCurso = j;\n break;\n }\n }\n }\n for (int i = 0; i < 50; i++) {\n alumnoAgregar.plan[i] = cursos[cantidadCurso].getAsignaturas()[(int) i / 10].getPlan()[i % 10];\n }\n this.apoderados[apTotal].pupilos.add(alumnoAgregar);\n\n }\n }\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 static void main(String[] args) {\n\t\t\tScanner tastiera=new Scanner(System.in);\r\n\t\t\tint k=0, j=0;\r\n\t\t\tint conta=0;\r\n\t\t\tString risposta=\"\";\r\n\t\t\tRandom r=new Random();\r\n\t\t\tArrayList<Giocatore> partecipantiOrdinati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> partecipantiMescolati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> perdenti=new ArrayList<Giocatore>();\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tpartecipantiOrdinati.add(new Giocatore(GIOCATORI[i]));\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tint indice=Math.abs(r.nextInt()%partecipantiOrdinati.size());\r\n\t\t\t\tpartecipantiMescolati.add(partecipantiOrdinati.get(indice));\r\n\t\t\t\tpartecipantiOrdinati.remove(indice);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"INIZIA IL TORNEO DI BRISCOLA!\");\r\n\t\t\twhile(partecipantiMescolati.size()!=1) {\r\n\t\t\t\tSystem.out.println(\"Fase \"+(j+1));\r\n\t\t\twhile(conta<partecipantiMescolati.size()) {\r\n\t\t\t\tMazzo m=new Mazzo();\r\n\t\t\t\tm.ordinaMazzo();\r\n\t\t\t\tm.mescolaMazzo();\r\n\t\t\t\tGiocatore g1=partecipantiMescolati.get(conta);\r\n\t\t\t\tGiocatore g2=partecipantiMescolati.get(conta+1);\r\n\t\t\t\tPartita p=new Partita(g1,g2,m);\r\n\t\t\t\tSystem.out.println(\"Inizia la partita tra \"+g1.getNickName()+\" e \"+g2.getNickName());\r\n\t\t\t\tSystem.out.println(\"La briscola è: \"+p.getBriscola().getCarta());\r\n\t\t\t\tSystem.out.println(\"Vuoi skippare la partita? \"); risposta=tastiera.next();\r\n\t\t\t\tif(risposta.equalsIgnoreCase(\"si\")) {\r\n\t\t\t\t\tg1.setPunteggio(p.skippa());\r\n\t\t\t\t\tg2.setPunteggio(PUNTI_MASSIMI-g1.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g1.getNickName());//vince g1\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g2.getNickName());// vince g2\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g1);\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\tp.daiLePrimeCarte();\r\n\t\t\t\t\tCarta c1=new Carta(g1.gioca().getCarta());\r\n\t\t\t\t\tCarta c2=new Carta(g2.gioca().getCarta());\r\n\t\t\t\t\tg1.eliminaDaMano(c1); g2.eliminaDaMano(c2);\r\n\t\t\t\t\tint tracciatore=1; //parte dal giocatore 1\r\n\t\t\t\t\twhile(!m.mazzoMescolato.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g1); p.pesca(g2);\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g2); p.pesca(g1);\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2); \r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{tracciatore = 1; k--;}\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Manche Finale\");\r\n\t\t\t\t\twhile(!g1.carteInMano.isEmpty() || !g2.carteInMano.isEmpty()) {\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttracciatore = 1;\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Situazione: \"+g1.getNickName()+\": \"+g1.getPunteggio());\r\n\t\t\t\t\tSystem.out.println(g2.getNickName()+\": \"+g2.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g1.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g2.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tconta+=2;\r\n\t\t\t\tSystem.out.println(\"Premi una lettera per continuare: \"); risposta=tastiera.next();\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\tconta=0;\r\n\t\t\tfor(int i=0;i<perdenti.size();i++)\r\n\t\t\t\tpartecipantiMescolati.remove(perdenti.get(i));\r\n\t\t\tSystem.out.println(\"Restano i seguenti partecipanti: \");\r\n\t\t\tfor(int i=0;i<partecipantiMescolati.size();i++) {\r\n\t\t\t\tSystem.out.println(partecipantiMescolati.get(i).getNickName());\r\n\t\t\t\tpartecipantiMescolati.get(i).setPunteggio(0);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Il vincitore del torneo è: \"+partecipantiMescolati.get(0).getNickName());\r\n\t\t\t\t\r\n\t}", "public int[] choisir(int[] coord)\r\n {\r\n int[] res = new int[3]; //tableau a rendre\r\n int x = coord[0];\r\n int y = coord[1]; //récupération des coordonnées\r\n int[] voisinage= new int[4]; //tableau qui regardera les cases adjacentes à la case cherchée\r\n voisinage[0] = getValHaut(x,y);\r\n voisinage[1] = getValDroite(x,y);\r\n voisinage[2] = getValBas(x,y);\r\n voisinage[3] = getValGauche(x,y);\r\n System.out.println(\"je choisis la case \"+x+\" \"+y+\"\");\r\n for(int i = 0; i<voisinage.length; i++ ) //parcours des possibilités si on joue sans créer d'opportunités adverses\r\n {\r\n if (Vision[x][y][i+1] == 0) //si il n'y a pas de trait déja tracé\r\n {\r\n if (voisinage[i] != 2) //si la case adjacente n'a pas déja deux traits dessinés\r\n {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n //fin du si la case adjacente a déja 2 traits dessinés\r\n }\r\n //si il n'y a pas de trait déja tracé\r\n }\r\n //fin du for de parcours des possibilités de jouers sans créer d'opportunités adverses\r\n\r\n for(int i=0; i<voisinage.length ; i++ ) //Parcours des possibilités sans recherche d'opportunités\r\n {\r\n if (Vision[x][y][i+1] == 0) {\r\n switch (i) //switch pour réagir selon la case a jouer\r\n {\r\n case 0:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n\r\n case 1:\r\n res[0]=x+1;\r\n res[1]=y;\r\n break;\r\n\r\n case 2:\r\n res[0]=x;\r\n res[1]=y+1;\r\n break;\r\n\r\n case 3:\r\n res[0]=x;\r\n res[1]=y;\r\n break;\r\n }\r\n //fin du switch sur i\r\n\r\n res[2]=i%2;\r\n return res;\r\n }\r\n }\r\n //fin du parcours de possibilité sans recherche\r\n return tabVide;\r\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 static Resultado Def_FACA(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n \n double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "@Override\n public Combinacion comprobarColores(Combinacion filaIntroducida) {\n Combinacion respuesta;\n\n\n ArrayList<Ficha> combinacionRespuesta = new ArrayList<>();\n ArrayList<Integer> fichasNegrasUtilizadas = new ArrayList<>();\n ArrayList<Integer> fichasTotalesUtilizadas = new ArrayList<>();\n boolean comprobado = false;\n Colores color = Colores.SC;\n\n // COMPROBAMOS LAS NEGRAS\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[i])) {\n combinacionRespuesta.add(new Ficha(Colores.NEGRO));\n fichasNegrasUtilizadas.add(i);\n }\n }\n\n fichasTotalesUtilizadas.addAll(fichasNegrasUtilizadas);\n // SEPARAMOS NEGRAS DE BLANCAS\n\n for (int i = 0; i < filaIntroducida.getCodigo().length; i++) {\n if (!fichasNegrasUtilizadas.contains(i)) {\n for (int j = 0; j < filaIntroducida.getCodigo().length && !comprobado; j++) {\n if (!fichasTotalesUtilizadas.contains(j)) {\n if (filaIntroducida.getCodigo()[i].equals(tablero.getCombinacionOculta().getCodigo()[j])) {\n color = Colores.BLANCO;\n fichasTotalesUtilizadas.add(j);\n comprobado = true;\n } else {\n color = Colores.SC;\n }\n }\n }\n combinacionRespuesta.add(new Ficha(color));\n comprobado = false;\n }\n }\n\n combinacionRespuesta.sort(new Comparator<Ficha>() {\n @Override\n public int compare(Ficha o1, Ficha o2) {\n return o1.getColor().compareTo(o2.getColor());\n }\n });\n\n respuesta = new Combinacion(combinacionRespuesta.toArray(new Ficha[combinacionRespuesta.size()]));\n\n // MODO MEDIO Y FACIL\n\n return respuesta;\n }", "private List<PlanTrabajo> generarPlanesTrabajo( Date fecPrgn, \n\t\t\tList<Cuadrilla> cuadrillas,Map<Long, GrupoAtencion> mpGrupos, \n\t\t\tMap<Long, Long> asignaciones ){\n\t\t\n\t\t\tList<PlanTrabajo> planTrabajoList = new ArrayList<PlanTrabajo>();\n\t\t\tSet<Long> grupos = asignaciones.keySet();\t\n\t\t\tlong np = 1;\n\t\t\tfor (Long ngrupo : grupos) {\n\t\t\t\t Long ncuadrilla = asignaciones.get(ngrupo);\n\t\t\t\t GrupoAtencion grupoAtencion = mpGrupos.get(ngrupo);\n\t\t\t\t //GrupoAtencion grupoAtencion = asignar(cuadrilla, idx, mpGruposCached);\n\t\t\t\t PlanTrabajo planTrabajo = new PlanTrabajo(np);\n\t\t\t\t int nsp = 1;\n\t\t\t\t planTrabajo.setFechaProgramacion(new Timestamp(fecPrgn.getTime()));\n\t\t\t\t int i = cuadrillas.indexOf( new Cuadrilla(ncuadrilla));\n\t\t\t\t if(i!=-1){\n\t\t\t\t\t \n\t\t\t\t\t Cuadrilla cuadrilla = cuadrillas.get(i);\n\t\t\t\t\t planTrabajo.setCuadrilla(cuadrilla);\n\t\t\t\t\t planTrabajo.setGrupoAtencion(grupoAtencion);\n\t\t\t\t\t \n\t\t\t\t\t if(grupoAtencion!=null){\n\t\t\t\t\t\t for( GrupoAtencionDetalle d : grupoAtencion.getGrupoAtencionDetalles()){\n\t\t\t\t\t\t\t // añadiendo las solicitudes de servicio\t\n\t\t\t\t\t\t\t SolicitudServicio s = d.getSolicitudServicio();\n\t\t\t\t\t\t\t //System.out.println(\" #### añadiendo solicitud \"+s.getNumeroSolicitud());\n\t\t\t\t\t\t\t if(planTrabajo.getPlanTrabajoDetalles()==null){\n\t\t\t\t\t\t\t\t planTrabajo.setPlanTrabajoDetalles(new ArrayList<PlanTrabajoDetalle>());\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t PlanTrabajoDetalle pd = new PlanTrabajoDetalle(np, nsp);\n\t\t\t\t\t\t\t pd.setSolicitudServicio(s);\n\t\t\t\t\t\t\t //planTrabajo.addPlanTrabajoDetalle( new PlanTrabajoDetalle(s));;\n\t\t\t\t\t\t\t planTrabajo.addPlanTrabajoDetalle(pd);\n\t\t\t\t\t\t\t nsp++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t planTrabajoList.add(planTrabajo);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t np++;\n\t\t\t}\n\t\t\t\n\t\treturn planTrabajoList;\n\t}", "public void RunAlgo(int i,Set<Session> s, ArrayList<Set<Session>> courses){\n System.out.println(i);\n if(i==courses.size()) {\n Set<Session> temp= copySet(s);\n if(allCombinations.size()>maxSize) flag=false;\n allCombinations.add(temp);\n System.out.println(allCombinations.size());\n return;\n }\n Set<Session> current = courses.get(i);\n for (Session x : current) {\n if (isGoodMatch(x, s)) {\n s.add(x);\n if(flag)\n RunAlgo(i + 1, s, courses);\n s.remove(x);\n }\n }\n\n }", "public OptimismPessimismCalculator() {\n mostPositive = 0;\n mostPositiveDoc = null;\n mostNegative = 0;\n mostNegativeDoc = null;\n biggestDifference = 0;\n biggestDifferenceDoc = null;\n \n publisherOptimism = new HashMap<>();\n publisherPessimism = new HashMap<>();\n regionOptimism = new HashMap<>();\n regionPessimism = new HashMap<>();\n dayOptimism = new HashMap<>();\n dayPessimism = new HashMap<>();\n weekdayOptimism = new HashMap<>();\n weekdayPessimism = new HashMap<>();\n }", "public DatosIteracion mejorIteracionCapturados(String estrategia) {\r\n\r\n\t\tint i;\r\n\t\tfor (i = 0; i < this.getValoresEstrategias().size(); i++) {\r\n\t\t\tif (this.getValoresEstrategias(i).getNombreEstrategia()\r\n\t\t\t\t\t.equals(estrategia))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn this.getValoresEstrategias(i).masCapturadas();\r\n\t}", "public void ingresaVehiculo (){\r\n \r\n Vehicle skate = new Skateboard(\"vanz\", \"2009\", \"1 metro\");\r\n Vehicle carro = new Car(\"renault\", \"2009\", \"disel\",\"corriente\" );\r\n Vehicle jet = new Jet(\"jet\", \"2019\", \"premiun\", \"ocho motores\");\r\n Vehicle cicla = new Bicycle(\"shimano\", \"2010\",\"4 tiempos\" ) ; \r\n Vehuculo.add(skate);\r\n Vehuculo.add(carro);\r\n Vehuculo.add(jet);\r\n Vehuculo.add(cicla); \r\n \r\n /*\r\n for en el cual se hace el parceo y se instancia la clase Skateboard\r\n \r\n */\r\n for (Vehicle Vehuculo1 : Vehuculo) {\r\n if(Vehuculo1 instanceof Skateboard){\r\n Skateboard skatevehiculo = (Skateboard)Vehuculo1;\r\n skatevehiculo.imprimirPadre();\r\n skatevehiculo.imprimirSkate();\r\n skatevehiculo.imprimirInterfaz();\r\n }\r\n /*\r\n se intancia y se hace el parceo de la clase car\r\n \r\n */\r\n else if(Vehuculo1 instanceof Car){\r\n \r\n Car carvhiculo = (Car)Vehuculo1;\r\n carvhiculo.imprimirPadre();\r\n carvhiculo.imprimirCarro();\r\n carvhiculo.imprimirVehiculopotenciado();\r\n \r\n \r\n \r\n }\r\n /*se intancia y se hace el parceo de la clase\r\n \r\n */\r\n else if(Vehuculo1 instanceof Jet){\r\n \r\n Jet jethiculo = (Jet)Vehuculo1;\r\n jethiculo.imprimirPadre();\r\n jethiculo.imprimirJet();\r\n jethiculo.imprimirVehiculopotenciado();\r\n jethiculo.imprimirInterfaz();\r\n }\r\n else if(Vehuculo1 instanceof Bicycle){\r\n \r\n Bicycle ciclavehiculo = (Bicycle)Vehuculo1;\r\n ciclavehiculo.imprimirPadre();\r\n ciclavehiculo.imprimirBici();\r\n }\r\n }\r\n \r\n \r\n }", "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 }", "public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }", "public Tournee chercheSolution(int tpsLimite, ContraintesTournee contraintes, Map<String, Map<String, Chemin>> plusCourtsChemins){\n\t\t//HashMap avec l'id et le point pour pouvoir recuperer le point a partir de l'id\n\t\tHashMap<String, Intersection> intersections = new HashMap<String, Intersection>();\n\t\tIterator<PointEnlevement> itEnlev = (Iterator<PointEnlevement>)contraintes.getPointsEnlevement().iterator();\n\t\tIterator<PointLivraison> itLiv = (Iterator<PointLivraison>)contraintes.getPointsLivraison().iterator();\n\t\t\n\t\t//Remplissage HashMap des intersections \n\t\tintersections.put(contraintes.getDepot().getId(), contraintes.getDepot());\n\t\tint nbSommets = 1;\n\t\twhile(itEnlev.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itEnlev.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\twhile(itLiv.hasNext()) {\n\t\t\tIntersection intersec = (Intersection) itLiv.next();\n\t\t\tintersections.put(intersec.getId(), intersec);\n\t\t\tnbSommets++;\n\t\t}\n\t\t\n\t\t//Initialisation de la HashMap vuDispo - contenant les attributs boolean vu et dispo\n\t\tHashMap<String, Paire> vuDispo = initVuDispo(contraintes, intersections);\n\t\t\n\t\tTournee tournee = new Tournee(contraintes);\n\t\t//Sequentiel et MinFirst\n//\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\t\n\t\t//MinFirst + 2-Opt\n\t\tcalculerSimplementTournee(tournee, contraintes.getDepot().getId(), (nbSommets-1), intersections, vuDispo, plusCourtsChemins);\t\t\n\t\ttwoOpt(tpsLimite, System.currentTimeMillis(), tournee, plusCourtsChemins, intersections);\n\t\t\n\t\treturn tournee;\n\t}", "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 static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "public void ordenarRanking(){\n for(int i = 0; i < clasificacion.length; i++) {\n boolean flag = false;\n for(int j = 0; j < clasificacion.length-1; j++) {\n\n /*Si el elemento de la posicion j+1 es mayor que el anterior se intercambian\n los valores de esas posiciones*/\n if((clasificacion[j].getMediana())<(clasificacion[j+1].getMediana())) {\n Ranking k = new Ranking();\n k=clasificacion[j];\n clasificacion[j] = clasificacion[i];\n clasificacion[i] = k;\n flag=true; //Se pone a true para indicar que se ha hecho un cambio\n }//END_IF\n }//END_FOR\n\n if(!flag) break; //Si flag es igual a falso quiere decir que en la ultima iteracion\n //no hubo ningun intercambio y por lo tanto el metodo puede terminar\n //ya que el vector esta ordenado\n }//END_FOR\n\n }", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public void fusion(Monceau autre) throws DifferentOrderTrees {\r\n // à compléter\r\n \tArrayList<Node> temp = new ArrayList<Node>();\r\n\t\tboolean fini = false;\r\n \t\r\n \tif (arbres.isEmpty())\r\n \t\tarbres = autre.arbres;\r\n \t\r\n \telse if (!arbres.isEmpty() || !autre.arbres.isEmpty()) {\r\n \t\t//remplir la arraylist (ou arbre temp)\r\n \t\tfor (int i = 0; i < arbres.size(); i++)\r\n \t\t\ttemp.add(arbres.get(i));\r\n \t\t\r\n \t\tfor (int i = 0; i < autre.arbres.size(); i++)\r\n \t\t\ttemp.add(autre.arbres.get(i));\r\n \t\t\r\n \t\t//trier la arraylist qui contient l'arbre temp\r\n \t\tCollections.sort(temp, new Comparator<Node>() {\r\n \t\t\t@Override\r\n \t\t\tpublic int compare(Node objet1, Node objet2) {\r\n \t\t\t\tInteger noeud1 = new Integer(objet1.ordre);\r\n \t\t\t\tInteger noeud2 = new Integer(objet2.ordre);\r\n \t\t\t\treturn noeud1.compareTo(noeud2);}\r\n \t\t});\r\n \t\t\r\n \t\twhile (!fini) { \t\t\t\r\n \t\t\tfini = true;\r\n \t\t\tfor (int j = 0; j < temp.size(); j++) {\r\n \t\t\t\tfor (int k = j+1; k < temp.size(); k++) {\r\n \t\t\t\t\tif (temp.get(j).ordre == temp.get(k).ordre)\r\n \t\t\t\t\t\tfini = false; //faut pas avoir le meme ordre\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tfor (int j = 0; j < temp.size()-1; j++) {\r\n \t\t\t\tif (temp.get(j).ordre == temp.get(j + 1).ordre) {\r\n \t\t\t\t\t//les elements doivent conserver leur ordre\r\n \t\t\t\t\ttemp.set(j, temp.get(j).fusion(temp.get(j+1)));\r\n \t\t\t\t\ttemp.remove(j+1);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\tarbres = temp;\r\n \t}\r\n \t\r\n \treturn;\r\n }", "public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }", "private List<Estado> estadosHijos(Estado estado){\r\n EstadoMancala estadom=(EstadoMancala)estado;\r\n Jugador jugadorEstado=estadom.jugadores()[estadom.jugadoractual];\r\n Movimiento[] movimientos=estadom.movimientos(jugadorEstado);\r\n List<Estado> estados=new ArrayList<Estado>();\r\n int cantmovs=0;\r\n if(movimientos!=null)\r\n cantmovs=movimientos.length;\r\n for (int i=0; i<cantmovs;i++){\r\n estados.add(estadom.clone().siguiente(movimientos[i]));\r\n }\r\n return estados;\r\n }", "public void getGerarEscala(ActionEvent actionEvent) {\n\t\tEventoRepository eventoRep = new EventoRepository(JPAFactory.getEntityManager());\r\n\t\tlistaEvento = eventoRep.buscarEventos(inicio,fim);\r\n\t\t\r\n\t\t//CorEquipesController grupoCores = new CorEquipesController();\r\n\t\tTurmaVoluntarioRepository repository = new TurmaVoluntarioRepository(JPAFactory.getEntityManager());\r\n\t\tList<Voluntario> listaVoluntario = repository.buscarVoluntarioCor(cor);\r\n\t\tList<Voluntario> equipeA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> equipeB = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> listPopulacaoI = new ArrayList<Voluntario>();\t\t\t\r\n\t\tList<Voluntario> escalaA = new ArrayList<Voluntario>();\r\n\t\tList<Voluntario> escalaB = new ArrayList<Voluntario>();\r\n\t\tList<Integer> intervaloSorteio = new ArrayList<Integer>();\r\n\r\n\t\t//Date agora = new Date();\r\n\t\t\r\n\t\tlong tempoIncial = System.currentTimeMillis();\r\n\t\tif(cor!=null) {\t\r\n//\t\t\tFor de verificação para não repetição dos campos sorteados\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\t//População inicial\t\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\r\n\t\t\t\tint posicaoSorteada = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\r\n\r\n\t\t\t\tint conteudoSorteado = intervaloSorteio.get(posicaoSorteada);\r\n\t\t\t\t\r\n\r\n\t\t\t\tlistPopulacaoI.add(listaVoluntario.get(conteudoSorteado));\r\n\r\n\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\tif (conteudoSorteado==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Gera os pais\r\n\t\t\tfor (int i=0; i<listaVoluntario.size(); i++) {\r\n\t\t\t\tintervaloSorteio.add(i);\r\n\t\t\t}\r\n\t\t\tfor(int k = 0; k<listPopulacaoI.size();k++) {\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t//vrifica a lista para adicionar na equipe A (pai1)\r\n\t\t\t\tif (intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaA = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoA = intervaloSorteio.get(posicaoSorteadaA);\r\n\t\t\t\t\tequipeA.add(listPopulacaoI.get(conteudoSorteadoA));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoA==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\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//vrifica a lista para adicionar na equipe B (pai2)\r\n\t\t\t\tif(intervaloSorteio.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tint posicaoSorteadaB = rand.nextInt(intervaloSorteio.size());\r\n\t\t\t\t\tint conteudoSorteadoB = intervaloSorteio.get(posicaoSorteadaB);\r\n\t\t\t\t\tequipeB.add(listPopulacaoI.get(conteudoSorteadoB));\r\n\t\t\t\t\tfor (int j = 0; j<intervaloSorteio.size(); j++) {\r\n\t\t\t\t\t\tif (conteudoSorteadoB==intervaloSorteio.get(j)) {\r\n\t\t\t\t\t\t\tintervaloSorteio.remove(j);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Cruzamento\r\n\t\t\tint tamanhoA = equipeA.size();\r\n\t\t\tint tamanhoB = equipeB.size();\r\n\t\t\tint metadeA = (int) tamanhoA/2;\r\n\t\t\tint metadeB = (int) tamanhoB/2;\r\n\t\t\tfor (int i=0; i<metadeA; i++) {\r\n\t\t\t\tescalaA.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeA; i<tamanhoA; i++) {\r\n\t\t\t\tescalaB.add(equipeA.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=0; i<metadeB; i++) {\r\n\t\t\t\tescalaB.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\tfor (int i=metadeB; i<tamanhoB; i++) {\r\n\t\t\t\tescalaA.add(equipeB.get(i));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//grava dados na base\r\n\t\t\tint tamanhoEvanto = listaEvento.size();\r\n\t\t\tint metadeTamanhoEv = tamanhoEvanto/2;\r\n\t\t\tfor (int i = 0; i < listaEvento.size(); i ++) {\r\n\t\t\t\tif (listaEvento.get(i).getTipoEvento().getValor().equals(0)) {\r\n\t\t\t\t\tfor(int j = 0; j < equipeA.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeA.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tfor(int j = 0; j < equipeB.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(equipeB.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor(int j = 0; j < listPopulacaoI.size(); j++) {\r\n\t\t\t\t\t\tgetEntity().setCorE(cor);\r\n\t\t\t\t\t\tgetEntity().setEvento(listaEvento.get(i));\r\n\t\t\t\t\t\tgetEntity().setVoluntario(listPopulacaoI.get(j));\r\n\t\t\t\t\t\tinsert(actionEvent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Tempo Total %.3f ms%n: \"+(System.currentTimeMillis()-tempoIncial));\r\n\t\tSystem.out.println(listPopulacaoI);\r\n//\t\tlong tempoFinal = System.currentTimeMillis();\r\n//\t\tlong tempoExecucao = tempoFinal-tempoIncial;\r\n\r\n\t\t\r\n\t\t/*System.out.println(\"tempo inicial:\"+tempoIncial);\r\n\t\tSystem.out.println(\"tempo inicial:\"+tempoFinal);\r\n\t\tSystem.out.println(\"Tempo execução do Metodo de gera escala equipe: \"+(tempoFinal-tempoIncial)/1000d);*/\r\n\t}", "private void calculateFitness() {\n\t\tint day1=this.getNumberOfHours()*this.getNumberOfClasses();\n\t\tint day2=2*day1;\n\t\tint day3=3*day1;\n\t\tint day4=4*day1;\n\t\tint day5=5*day1;\n\t\tTeacher_lesson temp=null;\n\t\t//day 1//\n\t\tHashSet<Integer> closedSet=new HashSet<Integer>();\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<day1;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day1;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\t\n\t\t\n\t\t//day2//\n\t\tclosedSet.clear();;\n\t\t\n\t\tfor(int i=day1;i<day2;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day2;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day3//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day2;i<day3;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day3;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//day4//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day3;i<day4;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day4;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\t\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t}\n\t\t\t\n\t\t}\n\t\t//day5//\n\t\tclosedSet.clear();;\n\t\tfor(int i=day4;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp !=null){\n\t\t\t\tif(!(closedSet.contains(temp.get_tid()))){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\n\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\tclosedSet.add(temp.get_tid());\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\t//-1 giati den aferesame thn prwti wra otan to vriskei ston pinaka//\n\t\t\t\ttemp.set_d_hour(temp.get_td_hour()-1);\n\t\t\t\tif(temp.get_td_hour()>0){++this.fitness;}\n\t\t\t\t\n\t\t}\n\t\t\t/*if(temp.get_td_hour()<0){this.fitness=this.fitness-100;}//adunato na ginei giati o ka8igitis exei parapanw wres apo oti mporei na kanei//\n\t\t\t\telse if (temp.get_td_hour()==0){this.fitness=this.fitness-2;}//meiwnoume giati o ka8igitis 8a epivarin8ei oles tou tis wres thn idia mera//\n\t\t\t\telse{++this.fitness;}//kalh prosegisi*/\n\t\t}\n\t\t//*********************END OF DAILY EVALUATION*****************************//\n\t\t\n\t\t//**********************START OF WEEKLY EVALUATION************************//\n\t\t\n\t\tclosedSet.clear();\n\t\t\n\t int \t_weeklyhours = 1;\n\t \n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tif(!closedSet.contains(this.genes[i])){\n\t\t\t\t\n\t\t\t\n\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\tif(temp.get_tid()==this.genes[j]){\n\t\t\t\t\t++_weeklyhours; }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t/*if(_weeklyhours>temp.get_tw_hour()){\n\t\t\t\tthis.fitness=this.fitness-100 ; //adunato na kanei parapanw wres ma8hma//\n\t\t\t}else\n\t\t\t\t{++this.fitness;}*/\n\t\t\tif(_weeklyhours<temp.get_tw_hour()){++this.fitness;}\n\t\t\tclosedSet.add(this.genes[i]);}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//*************END OF WEEKLY EVALUATION**********//\n\t\n\t\t//**START OF LESSON EVALUATION***//\n\t\tArraylistLesson set=new ArraylistLesson();\n\t\tclass_lid templ=null;\n\t\tTeacher_lesson tempj=null;\n\t\tint lid=0;\n\t\tString _class;\n\t\tint _classhours=1;\n\t\tfor(int i=0;i<day5;i++){\n\t\t\ttemp=getdata(this.genes[i]);\n\t\t\tif(temp!=null){\n\t\t\tlid=temp.get_lid();\n\t\t\t_class=temp.get_class();\n\t\t\ttempl=new class_lid(lid,_class);\n\t\t\tif(!set.contains(templ)){\n\t\t\t\t\n\t\t\t\tfor(int j=i+1;j<day5;j++){\n\t\t\t\t\ttempj=getdata(this.genes[j]);{\n\t\t\t\t\t\tif(tempj!=null){\n\t\t\t\t\t\t\tif(temp.get_tid()==tempj.get_tid()){\n\t\t\t\t\t\t\t\tif(temp.get_lid()==tempj.get_lid()&&temp.get_class().equalsIgnoreCase(tempj.get_class())){\n\t\t\t\t\t\t\t\t\t++_classhours;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tint hours;\n\t\t\t\thours=temp.get_lhours();\n\t\t\t\n\t\tif(_classhours==hours){\n\t\t\t++this.fitness;\n\t\t}\n\t\tset.add(templ);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "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 }", "private Karta kartaErabaki(ArrayList<ArrayList<Karta>> pMatrizea) \r\n\t{\r\n\t\tKarta karta = (Karta) new KartaNormala(ElementuMota.ELURRA,0,KoloreMota.BERDEA);\r\n\t\tfor(int i=0;i<pMatrizea.size();i++) \r\n\t\t{\r\n\t\t\tfor(int x=0;x<5;x++) \r\n\t\t\t{\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()!=pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()!=this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t\tif(pMatrizea.get(i).get(0).getElementua()==pMatrizea.get(i).get(1).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getElementua()==this.lortuJolastekoKartaPosz(x).getElementua() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(0).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tpMatrizea.get(i).get(1).getKolorea()!=this.lortuJolastekoKartaPosz(x).getKolorea() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getBalioa()>karta.getBalioa() &&\r\n\t\t\t\t\t\tthis.lortuJolastekoKartaPosz(x).getErabilgarria()) \r\n\t\t\t\t{\r\n\t\t\t\t\tkarta = this.lortuJolastekoKartaPosz(x);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn karta;\r\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\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\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void enemigosCatacumba(){\n esq81 = new Esqueleto(1, 8, 400, 160, 30);\n esq82 = new Esqueleto(2, 8, 400, 160, 30);\n esq111 = new Esqueleto(1, 11, 800, 255, 50);\n esq112 = new Esqueleto(2, 11, 800, 255, 50);\n esq141 = new Esqueleto(1, 14, 1000, 265, 60);\n esq142 = new Esqueleto(2, 14, 1000, 265, 60);\n //\n zom81 = new Zombie(1, 8, 1000, 170, 40);\n zom82 = new Zombie(2, 8, 1000, 170, 40);\n zom111 = new Zombie(1, 11, 1300, 250, 50);\n zom112 = new Zombie(2, 11, 1300, 250, 50);\n zom141 = new Zombie(1, 14, 1700, 260, 60);\n zom142 = new Zombie(2, 14, 1700, 260, 60);\n //\n fana81 = new Fanatico(1, 8, 400, 190, 40);\n fana82 = new Fanatico(2, 8, 400, 190, 40);\n fana111 = new Fanatico(1, 11, 700, 250, 50);\n fana112 = new Fanatico(2, 11, 700, 250, 50);\n fana141 = new Fanatico(1, 14, 900, 260, 60);\n fana142 = new Fanatico(2, 14, 900, 260, 60);\n //\n mi81 = new Mimico(1, 8, 3, 1, 3000);\n mi111 = new Mimico(1, 11, 4, 1, 3000);\n mi141 = new Mimico(1, 14, 5, 1, 3200);\n }", "private void dijkstras() {\n LinkedList<Integer> openNodeList = new LinkedList<Integer>();\n openNodeList.add(grid.length - 1);\n Integer curGrid = -1;\n\n while ( openNodeList.size() > 0 ) {\n curGrid = getBestGrid(openNodeList,curGrid);\n\n for ( int i = 0; i < grid[curGrid].edges.size() - 1; i++ ) {\n Integer tmp = grid[curGrid].edges.get(i).arrayIndex;\n if ( !grid[tmp].bFinalized && !openNodeList.contains(tmp)) {\n //System.out.println(\"Adding:\\t\" + tmp + \":\\t\" + grid[tmp].cost);\n grid[tmp].setHead(curGrid);\n grid[tmp].cost = grid[curGrid].cost + grid[curGrid].edges.get(i).Exposure;\n openNodeList.add(tmp);\n }\n }\n\n grid[curGrid].bFinalized = true;\n openNodeList.removeFirstOccurrence(curGrid);\n }\n }", "private ArrayList<Pelicula> busquedaPorGenero(ArrayList<Pelicula> peliculas, String genero){\r\n\r\n ArrayList<Pelicula> peliculasPorGenero = new ArrayList<>();\r\n\r\n\r\n\r\n for(Pelicula unaPelicula:peliculas){\r\n\r\n if(unaPelicula.getGenre().contains(genero)){\r\n\r\n peliculasPorGenero.add(unaPelicula);\r\n }\r\n }\r\n\r\n return peliculasPorGenero;\r\n }", "public void effetDeCarte(int idEffet, Joueur joueurQuiJoueLaCarte, Plateau plateau) {\n switch (idEffet) {\n case 0:\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 1:\n joueurQuiJoueLaCarte.deck.piocher(2);\n break;\n case 2:\n joueurQuiJoueLaCarte.deck.piocher(3);\n break;\n case 3:\n joueurQuiJoueLaCarte.gagnerDegats(1);\n break;\n case 4:\n joueurQuiJoueLaCarte.gagnerDegats(2);\n break;\n case 5:\n joueurQuiJoueLaCarte.gagnerDegats(3);\n\n break;\n case 6:\n joueurQuiJoueLaCarte.gagnerDegats(4);\n break;\n case 7:\n joueurQuiJoueLaCarte.gagnerRunes(1);\n break;\n case 8:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n break;\n case 9:\n gagnerDesRunes(joueurQuiJoueLaCarte,3);\n break;\n case 11:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n break;\n case 12:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n break;\n case 14:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n joueurQuiJoueLaCarte.piocher(1);\n break;\n case 15:\n joueurQuiJoueLaCarte.tuerUneCarteAvecDeLattaqueGratuitement(plateau);\n System.out.println(\"DEfeat a monster that has 4 D or less without paying it cost\");\n break;\n case 16:\n System.out.println(\"DEfeat a monster that has 6 D or less without paying it cost\");\n break;\n case 17:\n //joueurQuiJoueLaCarte.deck.piocher(1);\n System.out.println(\" You may banish a card in the center row\");\n break;\n case 18:\n System.out.println(\"Discard a card, if you do, draw two cards\");\n break;\n case 19:\n System.out.println(\"Copy l'effet d'un Héros joué ce tour-ci\");\n break;\n case 20:\n System.out.println(\"Once per turn you may draw a card\");\n break;\n case 21:\n System.out.println(\"You may banish this Construct to take an additional turn after this one.\");\n break;\n case 22:\n System.out.println(\"Acquire a Hero without paying its cost. Place in on top of your deck.\");\n break;\n case 23:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(1);\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n break;\n case 24:\n gagnerDesRunes(joueurQuiJoueLaCarte,2);\n verifLifebound(joueurQuiJoueLaCarte);\n break;\n case 25:\n gagnerDesRunes(joueurQuiJoueLaCarte,1);\n joueurQuiJoueLaCarte.deck.piocher(1);\n break;\n case 26:\n System.out.println(\"Once per turn, gain 1 runes, the first time you play a lifebound hero, each turn gain 1 recompense\");\n break;\n case 27:\n System.out.println(\"Once per turn , gain 1d\" +\n \"Once per turn, you may spend 4r to gain 3 recompense\");\n break;\n case 28:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n plusDeDeuxConstructeur(joueurQuiJoueLaCarte);\n System.out.println(\"Draw a card if you control 2 or moreConstrcut\");\n break;\n case 29:\n System.out.println(\"Gain 1d or 1r\");\n break;\n case 30:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Gain 2r You pay 1R less the next time you acquire a Construc this turn\");\n break;\n case 31:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, when you put a Mechana Construc into play (including this one) , draw a card\");\n break;\n case 32:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\"Once per turn, gain 2d.You may spend it only to acquire Mechana Construct\");\n break;\n case 33:\n joueurQuiJoueLaCarte.gagnerPointsHonneur(2);\n System.out.println(\" Once per turn\");\n gagner1DParTourPourChaqueMechaConstruct(joueurQuiJoueLaCarte);\n\n break;\n case 34:\n System.out.println(\"You may treat all Construcs as Mechana Construcs\");\n break;\n case 35:\n System.out.println(\"Once per turn, when you acquire another Mechana Construc, you may put it directly into play\");\n break;\n case 36:\n System.out.println(\"Once per turn ,gain 1 r . you may spend it only to acquire Mechana Construc\");\n break;\n case 37:\n joueurQuiJoueLaCarte.deck.piocher(2);\n System.out.println(\"Banish a card in you hand\");\n break;\n case 38:\n gagnerDesDegats(joueurQuiJoueLaCarte,2);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 39:\n gagnerDesDegats(joueurQuiJoueLaCarte,1);\n System.out.println(\"Banish a card in you hand or discard pile\");\n break;\n case 40:\n System.out.println(\"Once per turn, gain 3d\");\n break;\n case 41:\n System.out.println(\"Once per turn, gain 1d\");\n break;\n case 42:\n System.out.println(\"Once per turn gain 1 The first time you deafeat a monster in the center row each turn, gain 1 R\");\n break;\n case 43:\n System.out.println(\"Unbanishable You may acquire or defeat any car in the center row without paying its cost\");\n break;\n case 44:\n System.out.println(\"Each opponent must destryo a Construc he controls\");\n break;\n case 45:\n System.out.println(\"Banish a card un the center row and/or in you discard pile\");\n break;\n case 46:\n System.out.println(\"Banish a card un the center row\");\n break;\n case 47:\n System.out.println(\"If an opponent has more than one construct, that player must destroy all but one Construct he controls\");\n break;\n case 48:\n System.out.println(\"Take a card at random from each oppenent's hand and add that card to your hands\");\n break;\n }\n\n }", "private void createOptimizationFunction() {\n \t\tobjective = \"min:\"; //$NON-NLS-1$\n \t\tSet s = slice.entrySet();\n \t\tfor (Iterator iterator = s.iterator(); iterator.hasNext();) {\n \t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n \t\t\tHashMap conflictingEntries = (HashMap) entry.getValue();\n \t\t\tif (conflictingEntries.size() <= 1) {\n \t\t\t\tobjective += \" 1 \" + getVariable((IInstallableUnit) conflictingEntries.values().iterator().next()); //$NON-NLS-1$\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tList toSort = new ArrayList(conflictingEntries.values());\n \t\t\tCollections.sort(toSort);\n \t\t\tint weight = toSort.size();\n \t\t\tfor (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {\n \t\t\t\tobjective += \" \" + weight-- + \" \" + getVariable((IInstallableUnit) iterator2.next()); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\t}\n \t\t}\n \t\tobjective += \" ;\"; //$NON-NLS-1$\n \t}", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void preenchePosicoes(List<Par<Integer,Integer>> posicoes, \n\t\t\tEstadoAmbiente estado) {\n\t\tfor (Par<Integer,Integer> p : posicoes) {\n\t\t\tthis.quadricula[p.primeiro()][p.segundo()] = estado;\n\t\t}\n\t}", "private ArrayList<Estado> generar_sucesores(Estado actual) {\r\n\t\tArrayList<Estado> sucesores = new ArrayList<>();\r\n\t\tsucesores.add(actual.derecha().addHeuristica(estado_final)); //Añado los puntos hijos del estado actual\r\n\t\tsucesores.add(actual.izquierda().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.arriba().addHeuristica(estado_final));\r\n\t\tsucesores.add(actual.abajo().addHeuristica(estado_final));\r\n\r\n\t\tif (sucesores.contains(estado_inicial)) { //Limpio posible estado inicial\r\n\t\t\tsucesores.remove(estado_inicial);\r\n\t\t}\r\n\t\tArrayList<Estado> aux = new ArrayList<>(); // Para evitar error de concurrencia creo una lista auxiliar con los sucesores\r\n\t\tfor (int i = 0; i < sucesores.size(); i++) {\r\n\t\t\taux.add(sucesores.get(i));\r\n\t\t}\r\n\t\tfor (Estado p : aux) { //Limpio muros\r\n\t\t\tif (matriz[p.getX() - 1][p.getY() - 1] == muro) {\r\n\t\t\t\tsucesores.remove(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sucesores;\r\n\t}", "protected void doorschuiven(Groepen wedstrijdGroepen, Groepen aanwezigheidsGroepen) {\r\n int aantal = bepaalAantalDoorschuiven(0, aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Aantal door te schuiven spelers \" + aantal);\r\n // Doorloop hoogste groep tot ��n na laagste groep. In de laagste groep\r\n // kunnen geen spelers inschuiven\r\n \t// Let op: iterator gaat op array index en NIET op groepID\r\n ArrayList<Groep> groepen = wedstrijdGroepen.getGroepen();\r\n// for (int i = 0; i < groepen.size() - 1; ++i) {\r\n for (int i = 0; i < wedstrijdGroepen.getAantalGroepen() - 1; ++i) {\r\n aantal = bepaalAantalDoorschuiven(groepen.get(i).getNiveau(), aanwezigheidsGroepen.getPeriode(), aanwezigheidsGroepen.getRonde());\r\n \tlogger.log(Level.INFO, \"Doorschuiven van groep \" + groepen.get(i+1).getNaam() + \" naar \" + groepen.get(i).getNaam() + \" n=\" + aantal);\r\n ArrayList<Speler> naarGroep = groepen.get(i).getSpelers();\r\n if (naarGroep == null) naarGroep = new ArrayList<>();\r\n ArrayList<Speler> vanGroep = groepen.get(i + 1).getSpelers();\r\n // Als laatste speler niet aanwezig, dan ��n minder doorschuiven\r\n Speler laatste = groepen.get(i + 1).getSpelerByID(aantal);\r\n if (aantal > 2 && laatste == null) aantal--;\r\n\r\n for (int j = 1; j <= aantal; ++j) {\r\n Speler s = groepen.get(i + 1).getSpelerByID(j);\r\n \tlogger.log(Level.FINE, \"Speler : \" + (s != null ? s.getNaam() : \"null\"));\r\n if ((s != null) && s.isAanwezig()) {\r\n if ((j == aantal) && (aantal == 1)) {\r\n // Alleen doorschuiven als speler 1 niet meer ingehaald kan worden\r\n Speler s2 = groepen.get(i + 1).getSpelerByID(2);\r\n\t\t\t\t\t\tif (!IJCController.c().laasteRondeDoorschuivenAltijd) {\r\n\t\t\t\t\t\t\tif ((s2 != null) && (s.getPunten() > (s2.getPunten() + 4))) {\r\n\t\t\t\t\t\t\t\tlogger.log(Level.FINE, \"Speler doorgeschoven, niet meer in te halen \");\r\n\t\t\t\t\t\t\t\tnaarGroep.add(new Speler(s));\r\n\t\t\t\t\t\t\t\tvanGroep.remove(s);\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n } else if (j == aantal) {\r\n if (naarGroep.size() % 2 != 0) {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, laatste doorschuiver maar door om even aantal \");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n }\r\n } else {\r\n \tlogger.log(Level.FINE, \"Speler doorgeschoven, niet laatste dus altijd\");\r\n naarGroep.add(new Speler(s));\r\n vanGroep.remove(s);\r\n\r\n }\r\n }\r\n\r\n }\r\n }\r\n }", "public Caldean datingScene(Caldean theBachelor){\n\n ArrayList<Double> compChart = new ArrayList();\n\n ArrayList<Caldean> theSuitors;\n if(theBachelor.isFemale())\n theSuitors = eligibleDuises;\n else\n theSuitors = eligibleDuas;\n\n if(theSuitors.size()!=0){\n\n System.out.print(\"courting\");\n\n Iterator<Caldean> paradise = theSuitors.iterator();\n\n rankWeightSum= 0;\n ageWeightSum = 0;\n\n while(paradise.hasNext())\n {\n howManyFishInThePond(theBachelor, paradise.next());\n }\n\n paradise = theSuitors.iterator();\n\n while(paradise.hasNext()){\n compChart.add(butAreYouAGemini(theBachelor, paradise.next()));\n }\n\n double myDesire = fate.nextDouble();\n double myDuty = 0;\n int andTheLuckyWinnerIs = 0;\n\n\n for(int i = 0; myDuty>myDesire; i++){\n myDuty = myDuty + compChart.get(i);\n andTheLuckyWinnerIs = i;\n }\n\n return theSuitors.get(andTheLuckyWinnerIs);\n}\nelse\n return null;\n}", "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}", "public static void main(String[] args) { \n /* Grafo grafo = new Grafo();\n \n No no;\n no = new No(\"1\");//0\n grafo.addNo(no);\n no = new No(\"2\");//1\n grafo.addNo(no);\n no = new No(\"3\");//2\n grafo.addNo(no);\n no = new No(\"4\");//3\n grafo.addNo(no);\n no = new No(\"5\");//4\n grafo.addNo(no);\n no = new No(\"6\");//5\n grafo.addNo(no);\n no = new No(\"7\");//6\n grafo.addNo(no);\n \n //Cria as arestas do nó\n \n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 2);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 5);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 4);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 2);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(4), 7);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 1);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(4), 4);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(5), 3);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 4);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(5), 1);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 5);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 7);\n \n No no;\n no = new No(\"SF\");//0\n grafo.addNo(no);\n no = new No(\"LA\");//1\n grafo.addNo(no);\n no = new No(\"D\");//2\n grafo.addNo(no);\n no = new No(\"C\");//3\n grafo.addNo(no);\n no = new No(\"A\");//4\n grafo.addNo(no);\n no = new No(\"B\");//5\n grafo.addNo(no);\n no = new No(\"NY\");//6\n grafo.addNo(no);\n no = new No(\"M\");//7\n grafo.addNo(no);\n \n \n //Cria as arestas do nó\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(1), 39);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(2), 89);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(3), 120);\n Aresta.inserirAresta(grafo.getNo(0), grafo.getNo(6), 210);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(2), 50);\n Aresta.inserirAresta(grafo.getNo(1), grafo.getNo(6), 170);\n Aresta.inserirAresta(grafo.getNo(2), grafo.getNo(3), 65);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(5), 79);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(6), 59);\n Aresta.inserirAresta(grafo.getNo(3), grafo.getNo(4), 99);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(6), 80);\n Aresta.inserirAresta(grafo.getNo(4), grafo.getNo(7), 70);\n Aresta.inserirAresta(grafo.getNo(5), grafo.getNo(6), 20);\n Aresta.inserirAresta(grafo.getNo(6), grafo.getNo(7), 66);*/\n \n Grafo grafo = GrafoAleatorioKruskal.gerar(1000, 10, 10, 100);\n //Gera a arvore geradora com custo minimo\n grafo.kruskal();\n \n //TESTE\n int teste = grafo.getNo(0).getConjunto();\n boolean answer = true;\n for(No n : grafo.getNos()){\n if (teste!= n.getConjunto()){\n answer = false;\n }\n }\n if(answer){\n System.out.println(\"Todos os nós pertecem ao mesmo conjunto\");\n }\n else{\n System.out.println(\"Deu erro\");\n }\n }", "public String execute() {\n\t\ttry {\n\t\t\tHashMap<Integer, RigaVenditeCommercianti> map = new HashMap<Integer, RigaVenditeCommercianti>();\n\t\t\tlistaTotali = new LinkedList<RigaVenditeCommercianti>();\n\t\t\t\n\t\t\tFatture fatture = new Fatture();\n\t\t\tfatture.setOrderByCliente();\n\t\t\tCollection colFatture = fatture.getFatture(dataDal, dataAl);\n\t\t\tIterator itr = colFatture.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tFattura fattura = (Fattura) itr.next();\t\n\t\t\t\tfattura.calcolaTotali();\n\t\t\t\tif (map.containsKey(fattura.getIdCliente().intValue())) {\n\t\t\t\t\t//Aggiungi totali alla riga attuale\n\t\t\t\t\tRigaVenditeCommercianti riga = map.get(fattura.getIdCliente().intValue());\n\t\t\t\t\triga.setTotaleFattura(riga.getTotaleFattura().add(fattura.getTotaleFattura()));\n\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tfattura.calcolaTotali();\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 4\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva1())) { //IVA AL 4\n\t\t\t\t\t\triga.setImponibile1(riga.getImponibile1().add(imponibili.get(riga.getIva1())[0]));\n\t\t\t\t\t\triga.setImposta1(riga.getImposta1().add(imponibili.get(riga.getIva1())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 10\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile2(riga.getImponibile2().add(imponibili.get(riga.getIva2())[0]));\n\t\t\t\t\t\triga.setImposta2(riga.getImposta2().add(imponibili.get(riga.getIva2())[1]));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//IVA AL 20\n\t\t\t\t\tif (imponibili.containsKey(riga.getIva2())) {\n\t\t\t\t\t\triga.setImponibile3(riga.getImponibile3().add(imponibili.get(riga.getIva3())[0]));\n\t\t\t\t\t\triga.setImposta3(riga.getImposta3().add(imponibili.get(riga.getIva3())[1]));\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//Crea riga per cliente\n\t\t\t\t\tRigaVenditeCommercianti riga = new RigaVenditeCommercianti();\n\t\t\t\t\triga.setCliente(fattura.getCliente());\n\t\t\t\t\triga.setTotaleFattura(fattura.getTotaleFattura());\n\t\t\t\t\t\n\t\t\t\t\t//CALCOLO IMPONIBILI\n\t\t\t\t\tHashMap<BigDecimal, BigDecimal[]> imponibili = fattura.getImponibili();\n\t\t\t\t\tIvas dao = new Ivas();\n\t\t\t\t\tdao.setOrderByDescrizione(DataAccessObject.ORDER_ASC);\n\t\t\t\t\tCollection aliquote = dao.getElements();\n\t\t\t\t\t\n\t\t\t\t\tint index = 1;\n\t\t\t\t\tfor(Object obj : aliquote)\n\t\t\t\t\t{\n\t\t\t\t\t\tIva iva = (Iva)obj;\n\t\t\t\t\t\tif(iva.getValore().floatValue() < 4) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tBigDecimal imponibile = new BigDecimal(0);\n\t\t\t\t\t\tBigDecimal imposta = new BigDecimal(0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(imponibili.containsKey(iva.getValore()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timponibile = imponibili.get(iva.getValore())[0];\n\t\t\t\t\t\t\timposta = imponibili.get(iva.getValore())[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva1(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile1(imponibile);\n\t\t\t\t\t\t\triga.setImposta1(imposta);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva2(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile2(imponibile);\n\t\t\t\t\t\t\triga.setImposta2(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(index == 3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\triga.setIva3(iva.getValore());\n\t\t\t\t\t\t\triga.setImponibile3(imponibile);\n\t\t\t\t\t\t\triga.setImposta3(imposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(index == 3) break;\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tmap.put(fattura.getIdCliente().intValue(), riga);\n\t\t\t\t\tlistaTotali.add(riga);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tstampaErrore(\"PrintVendite.execute()\", e);\n\t\t\treturn ERROR;\n\t\t}\n\t\treturn SUCCESS;\n\t}", "private int getResult() {\n ArrayList<Character> operanzi = new ArrayList<Character>();\n ArrayList<Character> operatori = new ArrayList<Character>();\n for(int i = 1; i <= n; i++){\n // System.out.println(i);\n if ((expr[i] == 'T' ) || (expr[i] == 'F'))\n operanzi.add(expr[i]);\n else \n operatori.add(expr[i]);\n }\n System.out.println(operanzi.get(0));\n int n1 = operanzi.size();\n System.out.println(n1);\n long [][] T = new long[n1][n1];\n long [][] F = new long[n1][n1];\n\n for (int i = 0; i < operanzi.size(); i++) {\n \n if (operanzi.get(i) == 'T') {\n T[i][i] = 1;\n F[i][i] = 0;\n } else if (operanzi.get(i) == 'F') {\n T[i][i] = 0;\n F[i][i] = 1;\n }\n }\n long aux=0;\n for (int l=1; l<n1; ++l) \n { \n for (int i=0, j=l; j<n1; ++i, ++j) \n { \n T[i][j] = F[i][j] = 0; \n for (int g=0; g<l; g++) \n { \n int k = i + g; \n long total_i_k = evaluate(T[i][k],F[i][k],'+'); \n long total_k_j = evaluate(T[k+1][j] , F[k+1][j],'+'); \n long total = evaluate(total_i_k,total_k_j,'*');\n if (operatori.get(k) == '&') \n { \n aux = evaluate(T[i][k],T[k+1][j],'*');\n T[i][j] = evaluate(T[i][j],aux,'+'); \n \n\n F[i][j] = evaluate( F[i][j],evaluate(total,aux,'-'),'+'); \n } \n if (operatori.get(k) == '|') \n { \n aux = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate(F[i][j],aux,'+'); \n \n T[i][j] =evaluate( T[i][j],evaluate(total, aux,'-'),'+'); \n } \n if (operatori.get(k) == '^') \n { \n aux = evaluate(F[i][k],T[k+1][j],'*');\n long aux1= evaluate(T[i][k],F[k+1][j],'*');\n T[i][j] = evaluate( T[i][j],evaluate( aux , aux1,'+'),'+'); \n aux = evaluate(T[i][k],T[k+1][j],'*');\n aux1 = evaluate(F[i][k],F[k+1][j],'*');\n F[i][j] = evaluate( F[i][j],evaluate(aux,aux1,'+'),'+');\n } \n } \n } \n } \n return (int)T[0][n1-1]; \n }", "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 }", "private List<ObligacionCoactivoDTO> calcularCostasProcesales(List<ObligacionCoactivoDTO> obligaciones,\n BigDecimal valorAbsoluto, BigDecimal porcentaje) throws CirculemosNegocioException {\n // No aplica costas\n if (valorAbsoluto == null && porcentaje == null) {\n return obligaciones;\n } else if (valorAbsoluto != null) {\n // Aplica valor absoluto\n if (obligaciones.size() == 1) {\n obligaciones.get(0).setValorCostasProcesales(valorAbsoluto);\n return obligaciones;\n } else {\n BigDecimal porcentajeDeuda;\n BigDecimal totalDeuda = new BigDecimal(0);\n\n // Calculo de deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n totalDeuda = totalDeuda\n .add(obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()));\n\n }\n\n // Calculo de porcentaje y valor\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n porcentajeDeuda = ((obligacion.getValorCostasProcesales()\n .add(obligacion.getValorInteresMoratorios())).multiply(new BigDecimal(100)))\n .divide(totalDeuda);\n\n obligacion\n .setValorCostasProcesales(totalDeuda.multiply(porcentajeDeuda).divide(new BigDecimal(100)));\n\n }\n return obligaciones;\n\n }\n } else if (porcentaje != null) {\n // Aplica porcentaje de la deuda\n for (ObligacionCoactivoDTO obligacion : obligaciones) {\n obligacion.setValorCostasProcesales(\n (obligacion.getValorObligacion().add(obligacion.getValorInteresMoratorios()))\n .multiply(porcentaje).divide(new BigDecimal(100)).setScale(2,\n BigDecimal.ROUND_HALF_UP));\n\n }\n return obligaciones;\n } else {\n throw new CirculemosNegocioException(ErrorCoactivo.GenerarCoactivo.COAC_002005);\n }\n }", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "public static Resultado PCF(GrafoMatriz G, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n //*Definicion de variables las variables\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n \n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n ArrayList<ListaEnlazada> kspUbicados = new ArrayList<ListaEnlazada>();\n ArrayList<Integer> inicios = new ArrayList<Integer>();\n ArrayList<Integer> fines = new ArrayList<Integer>();\n ArrayList<Integer> indiceKsp = new ArrayList<Integer>();\n\n //Probamos para cada camino, si existe espectro para ubicar la damanda\n int k=0;\n\n while(k<ksp.length && ksp[k]!=null){\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n //Calcular la ocupacion del espectro para cada camino k\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n //System.out.println(\"v1 \"+n.getDato()+\" v2 \"+n.getSiguiente().getDato()+\" cant vertices \"+G.getCantidadDeVertices()+\" i \"+i+\" FSs \"+G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS().length);\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0){\n OE[i]=0;\n break;\n }\n }\n }\n \n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n fines.add(fin);\n inicios.add(inicio);\n demandaColocada=1;\n kspUbicados.add(ksp[k]);\n indiceKsp.add(k);\n //inicio=fin=cont=0;\n break;\n }\n }\n }\n if(demandaColocada==1){\n demandaColocada = 0;\n break;\n }\n }\n k++;\n }\n \n /*if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }*/\n \n if (kspUbicados.isEmpty()){\n //System.out.println(\"Desubicado\");\n return null;\n }\n \n int [] cortesSlots = new int [2];\n double corte = -1;\n double Fcmt = 9999999;\n double FcmtAux = -1;\n \n int caminoElegido = -1;\n\n //controla que exista un resultado\n boolean nulo = true;\n\n ArrayList<Integer> indiceL = new ArrayList<Integer>();\n \n //contar los cortes de cada candidato\n for (int i=0; i<kspUbicados.size(); i++){\n cortesSlots = Utilitarios.nroCuts(kspUbicados.get(i), G, capacidad);\n if (cortesSlots != null){\n \n corte = (double)cortesSlots[0];\n \n indiceL = Utilitarios.buscarIndices(kspUbicados.get(i), G, capacidad);\n \n double saltos = (double)Utilitarios.calcularSaltos(kspUbicados.get(i));\n \n double slotsDemanda = demanda.getNroFS();\n \n //contar los desalineamientos\n double desalineamiento = (double)Utilitarios.contarDesalineamiento(kspUbicados.get(i), G, capacidad, cortesSlots[1]);\n \n double capacidadLibre = (double)Utilitarios.contarCapacidadLibre(kspUbicados.get(i),G,capacidad);\n \n \n \n \n // double vecinos = (double)Utilitarios.contarVecinos(kspUbicados.get(i),G,capacidad);\n \n\n \n //FcmtAux = corte + (desalineamiento/(demanda.getNroFS()*vecinos)) + (saltos *(demanda.getNroFS()/capacidadLibre)); \n \n FcmtAux = ((saltos*slotsDemanda) + corte + desalineamiento)/capacidadLibre;\n \n if (FcmtAux<Fcmt){\n Fcmt = FcmtAux;\n caminoElegido = i;\n }\n \n nulo = false;\n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n \n }\n }\n \n if (caminoElegido==-1){\n System.out.println(\"Camino Elegido = -1 ..................\");\n }\n //caminoElegido = Utilitarios.contarCuts(kspUbicados, G, capacidad);\n \n if (nulo || caminoElegido==-1){\n return null;\n }\n \n Resultado r= new Resultado();\n /*r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);*/\n \n r.setCamino(indiceKsp.get(caminoElegido));\n r.setFin(fines.get(caminoElegido));\n r.setInicio(inicios.get(caminoElegido));\n return r;\n }", "public static Resultado KSP_FF_Algorithm_MBBR(GrafoMatriz G, GrafoMatriz Gaux, Demanda demanda,ListaEnlazada [] ksp,int capacidad){\n \n /*Definicion de variables las variables*/\n int inicio=0, fin=0,cont; // posicion inicial y final dentro del espectro asi como el contador de FSs contiguos disponibles\n int demandaColocada=0; // bandera para controlar si ya se encontro espectro disponible para la demanda.\n int [] OE= new int[capacidad]; //Ocupacion de Espectro.\n //Inicializadomos el espectro, inicialmente todos los FSs estan libres\n \n /*Probamos para cada camino, si exite espectro para ubicar la damanda*/\n int k=0;\n while(k<ksp.length && ksp[k]!=null && demandaColocada==0){\n for(int i=0;i<capacidad;i++){\n OE[i]=1;\n }\n /*Calcular la ocupacion del espectro para cada camino k*/\n for(int i=0;i<capacidad;i++){\n for(Nodo n=ksp[k].getInicio();n.getSiguiente().getSiguiente()!=null;n=n.getSiguiente()){\n if(G.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ||\n Gaux.acceder(n.getDato(),n.getSiguiente().getDato()).getFS()[i].getEstado()==0 ){\n OE[i]=0;\n break;\n }\n }\n }\n /*Teniendo la ocupacion del espectro del camino k, buscamos un bloque continuo de FS\n * que satisfazca la demanda.\n */\n inicio=fin=cont=0;\n for(int i=0;i<capacidad;i++){\n if(OE[i]==1){\n inicio=i;\n for(int j=inicio;j<capacidad;j++){\n if(OE[j]==1){\n cont++;\n }\n else{\n cont=0;\n break;\n }\n //si se encontro un bloque valido, salimos de todos los bloques\n if(cont==demanda.getNroFS()){\n fin=j;\n demandaColocada=1;\n break;\n }\n }\n }\n if(demandaColocada==1){\n break;\n }\n }\n k++;\n }\n \n if(demandaColocada==0){\n return null; // Si no se encontro, en ningun camino un bloque contiguo de FSs, retorna null.\n }\n /*Bloque contiguoo encontrado, asignamos los indices del espectro a utilizar \n * y retornamos el resultado\n */\n Resultado r= new Resultado();\n r.setCamino(k-1);\n r.setFin(fin);\n r.setInicio(inicio);\n return r;\n }" ]
[ "0.6659077", "0.6369091", "0.6290835", "0.62273735", "0.61889815", "0.59769803", "0.5968935", "0.59103996", "0.5896852", "0.5879993", "0.58483267", "0.57968515", "0.574093", "0.5701246", "0.5688302", "0.564915", "0.5641294", "0.56298786", "0.56267923", "0.5623532", "0.5619576", "0.5593624", "0.55916077", "0.5588625", "0.55830806", "0.557453", "0.5571601", "0.55687743", "0.5566994", "0.55655783", "0.5550565", "0.5546241", "0.55159426", "0.55027574", "0.55021155", "0.5493501", "0.548865", "0.5466397", "0.5460493", "0.5460261", "0.5456445", "0.5451198", "0.54412407", "0.5440667", "0.54325503", "0.54207826", "0.54179674", "0.54168737", "0.5416588", "0.5402674", "0.53988373", "0.5392815", "0.5390069", "0.5371171", "0.53703547", "0.5362547", "0.5354948", "0.5354428", "0.53523725", "0.5351815", "0.5349358", "0.534028", "0.5336789", "0.53294593", "0.5324443", "0.5322742", "0.5320947", "0.5313928", "0.529563", "0.5293606", "0.5292493", "0.5279235", "0.5276801", "0.5273606", "0.5272331", "0.52674794", "0.5262569", "0.5260719", "0.5255163", "0.5250809", "0.52483845", "0.524259", "0.5236238", "0.5230499", "0.52254945", "0.5225043", "0.5224143", "0.52219313", "0.52191454", "0.5218492", "0.52074766", "0.51949996", "0.51944727", "0.5191369", "0.5189786", "0.518541", "0.5180373", "0.5175139", "0.5171705", "0.51698005" ]
0.53816295
53
iteracion que mas nodos ve
public DatosIteracion mejorIteracionVisibles(ArrayList<DatosIteracion> datos) { DatosIteracion d = new DatosIteracion("auxiliar"); Lectura l = new Lectura(999999, 0, 0); d.getValoresLecturas().add(l); for (int i = 0; i < datos.size(); i++) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getnNodos() < datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getnNodos()) { d = datos.get(i); } if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getnNodos() == datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getnNodos()) { if (d.getValoresLecturas(d.getValoresLecturas().size() - 1) .getCapturados() > datos .get(i) .getValoresLecturas( datos.get(i).getValoresLecturas().size() - 1) .getCapturados()) { d = datos.get(i); } } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic List<Nodo> obtenerNodos() {\n\t\treturn nodos;\n\t}", "protected abstract Node[] getAllNodes();", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "private List<Node<T>> auxiliarRecorridoIn(Node<T> nodo, List<Node<T>> lista, Node<T> raiz) {\r\n\t\t\r\n\t\tif (nodo.getChildren() != null) {\r\n\t\t\tList<Node<T>> hijos = nodo.getChildren();\r\n\t\t\tfor (int i = 1; i <= hijos.size(); i++) {\r\n\t\t\t\t\r\n\t\t\t\tauxiliarRecorridoIn(hijos.get(i), lista, raiz);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn lista;\r\n\t}", "public Iterator nodeIterator() { return nodes.keySet().iterator(); }", "@Override\n public Iterator<Node<E>> iterator() {\n return new ArrayList<Node<E>>(graphNodes.values()).iterator();\n }", "@Override\r\n\tpublic Iterable<Entity> getNodes()\r\n\t{\n\t\treturn null;\r\n\t}", "public Iterador() {\n pila = new Pila<Nodo>();\n if (raiz != null) {\n pila.push(raiz);\n Nodo<T> nodo = pila.peek();\n while(nodo != null){\n if (nodo.izquierdo != null) {\n pila.push(nodo.izquierdo);\n }\n nodo = nodo.izquierdo;\n }\n }\n\n }", "public void iterate() {\n\t\t// iterator\n\t\tQueue<NDLMapEntryNode<T>> nodes = new LinkedList<NDLMapEntryNode<T>>();\n\t\tnodes.add(rootNode);\n\t\twhile(!nodes.isEmpty()) {\n\t\t\t// iterate BFSwise\n\t\t\tNDLMapEntryNode<T> node = nodes.poll();\n\t\t\tif(node.end) {\n\t\t\t\t// end of entry, call processor\n\t\t\t\tif(keyProcessor != null) {\n\t\t\t\t\tkeyProcessor.process(node.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(node.keys != null) {\n\t\t\t\t// if available\n\t\t\t\tnodes.addAll(node.keys.values()); // next nodes to traverse\n\t\t\t}\n\t\t}\n\t}", "public Iterator<LayoutNode> nodeIterator() {\n\treturn nodeList.iterator();\n }", "public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllInterpretedBy_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), INTERPRETEDBY);\r\n\t}", "private List<Node> findBranchsMesh()\r\n\t{\t\r\n\t\t// Nos que fecham o laco\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t\r\n\t\tfor (Entry<String, Integer> value : cacheDestinationNodes.entrySet())\r\n\t\t{\r\n\t\t\t// No possui mais de um arco chegando (ANEL!)\r\n\t\t\tif (value.getValue() > 1)\r\n\t\t\t{\r\n\t\t\t\tString label = value.getKey();\r\n\t\t\t\tNode node = cacheNodes.get(label);\r\n\t\t\t\tnodes.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// nodes > 1 indica que esta rede possui anel\r\n\t\treturn nodes; \r\n\t}", "Iterable<T> followNodeAndSelef(T start) throws NullPointerException;", "private Collection<Node> getNodes()\r\n\t{\r\n\t return nodeMap.values();\r\n\t}", "public Vector<Node> GetAdditionalSubNodes();", "@Override\r\n\tpublic List<List<Node<T>>> getPathsFromRootToAnyLeaf() {\r\n\t\tList<Node<T>> listaHojas = new LinkedList<Node<T>>();// Lista con todas\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// las hojas\r\n\t\t// del arbol\r\n\t\tlistaHojas = listaHojas(raiz, listaHojas);// Hojas\r\n\t\tList<List<Node<T>>> listaFinal = new LinkedList<List<Node<T>>>();// Lista\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// con\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// todos\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// los\r\n\t\t// caminos de la\r\n\t\t// raiz a las hojas\r\n\t\tfor (int i = 1; i <= listaHojas.size(); i++) {\r\n\t\t\tList<Node<T>> lista = new LinkedList<Node<T>>();\r\n\t\t\tlistaFinal.add(completaCamino(listaHojas.get(i), lista));// Crea\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// los\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// caminos\r\n\t\t}\r\n\t\treturn listaFinal;\r\n\t}", "Collection<Node> allNodes();", "public Iterator<Node> getNodeIter() {\n\t\treturn nodes.iterator();\n\t}", "List<CyNode> getNodeList();", "private int getNumberOfNodesRec(int contador, Node<T> nodo) {\r\n\t\tcontador++;// Si este metodo entra es porque entro a un nodo por lo que\r\n\t\t\t\t\t// se suma 1\r\n\t\tif (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> lista = nodo.getChildren();// Hijos\r\n\t\t\tfor (int i = 1; i <= lista.size(); i++) {\r\n\t\t\t\tcontador = getNumberOfNodesRec(contador, lista.get(i));// Recursividad\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn contador;\r\n\t}", "public void printGraph()\n {\n Iterator<T> nodeIterator = nodeList.keySet().iterator();\n \n while (nodeIterator.hasNext())\n {\n GraphNode curr = nodeList.get(nodeIterator.next());\n \n while (curr != null)\n {\n System.out.print(curr.nodeId+\"(\"+curr.parentDist+\")\"+\"->\");\n curr = curr.next;\n }\n System.out.print(\"Null\");\n System.out.println();\n }\n }", "List<Node> getNodes();", "public Vector<Node> getChildren(){\n\t\t Vector<Node> children = new Vector<>(0);\n\t\t Iterator<Link> l= myLinks.iterator();\n\t\t\twhile(l.hasNext()){\n\t\t\t\tLink temp=l.next();\n\t\t\t\tif(temp.getM().equals(currNode))\n\t\t\t\t children.add(temp.getN());\n\t\t\t\tif(temp.getN().equals(currNode))\n\t\t\t\t children.add(temp.getM());\n\t\t\t}\n\t\treturn children;\n\t}", "List<Node> nodes();", "public ArrayList<GraphNode> getAroundNodes(GraphNode n1){\n ArrayList<GraphNode> temp1 = new ArrayList<GraphNode>();\n if(!n1.isValid())\n return temp1;\n EdgeList<GraphEdge> m1 = edgeListVector.get(n1.getIndex());\n\n\n for(GraphEdge e1:m1){\n temp1.add(nodeVector.get(e1.getTo()));\n }\n return temp1;\n }", "public int size(){\n return n_nodi;\n }", "public List<Node> getNodes();", "@Override\r\n\tpublic Iterator<T> iterator() {\n\t\treturn new Iterator<T>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic boolean hasNext() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnodo<T> sig = sentinel;\r\n\t\t\t\tsentinel = sentinel.getNext();\r\n\t\t\t\treturn (sentinel != null) ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic T next() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn sentinel.getValue();\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t}", "public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllPartOfSet_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), PARTOFSET);\r\n\t}", "SingelIterator() {\n neste = listehode;\n forrige = listehode;\n }", "private Node<T> finnNode(int indeks){\n Node<T> curr;\n // begin på hode\n if (indeks < antall/2){\n curr= hode;\n for ( int i=0; i<indeks; i++){\n curr= curr.neste;\n }// end for\n }// end if\n else {\n curr= hale;\n for (int i = antall-1; i>indeks; i--){\n curr= curr.forrige;\n }// end for\n }// end else\n return curr;\n }", "Iterable<T> followNode(T start) throws NullPointerException;", "public abstract List<AStarNode> getNeighbours();", "private void Clean(){\n \t NodeIterable nodeit = graphModel.getGraph().getNodes();\n \t\n \t for (Node node : nodeit) {\n\t\t\t\n \t\t \n \t\t \n\t\t}\n \t\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 }", "@Override\n\n public void leggInn(int indeks, T verdi) {\n\n if (verdi == null){\n throw new NullPointerException(); }\n if (indeks < 0){\n throw new IndexOutOfBoundsException(); }\n if (indeks > (antall - 1)){\n throw new IndexOutOfBoundsException(); }\n\n Node<T> newNode = new Node<T>(verdi);\n if (hode == null ){ // Hvis Listen er Tom\n hode = newNode;\n hale = newNode;\n }\n else if (indeks == 0){\n newNode.neste = hode;\n hode.forrige = newNode;\n hode = newNode;\n }\n else if (indeks == (antall - 1)){\n newNode.forrige = hale;\n hale.forrige = newNode;\n hale = newNode;\n }\n else {\n Node<T> nodeTemp = hode;\n for (int i = 1; i < indeks; i++){\n nodeTemp = nodeTemp.neste;\n newNode.neste = nodeTemp.neste;\n nodeTemp.neste = newNode;\n newNode.forrige = nodeTemp;\n newNode.neste.forrige = newNode;\n }\n }\n antall++;\n endringer++;\n }", "public List<INode> getAllNodes();", "@Override\npublic boolean fjern(T verdi) {\n Node<T> curr = hode;\n while (curr != null) {\n if (curr.verdi.equals(verdi)) {\n if (antall == 1) {\n hode = hale = null;\n } else if (curr == hode) {\n hode = hode.neste;\n hode.forrige = null;\n } else if (curr == hale) {\n hale = hale.forrige;\n hale.neste = null;\n } else {\n curr.forrige.neste = curr.neste;\n curr.neste.forrige = curr.forrige;\n }\n antall--;\n endringer++;\n return true;\n }\n curr = curr.neste;\n }\n return false;\n}", "public void assignAllSiblings(){\n \n List<Informacion> pasos=ejemplo.getListaPasos();\n for(Informacion info:pasos){\n if(info.getElemento().split(\" \").length>1){\n assignSiblings(info.getElemento().split(\" \"));\n } \n }\n }", "public List<NodoRuta> getElementos() { \n \n return new ArrayList<NodoRuta>(nodos);\n }", "public abstract List<Node> getChildNodes();", "public Object[] getStartNodes ();", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void loopingChildren(Node documento) throws IOException, SQLException, Exception {\r\n\r\n\t\tArrayList<ArmazenaErroOuAvisoAntigo> temp = new ArrayList<ArmazenaErroOuAvisoAntigo>();\r\n\r\n\t\tInteger aux = null;\r\n\r\n\t\tif (documento != null) {\r\n\r\n\t\t\t/**\r\n\t\t\t * teste\r\n\t\t\t */\r\n\t\t\tString nomeTag = documento.getNodeName();\r\n\r\n\t\t\t/*\r\n\t\t\t * Pesquisa se eh uma tag especial de parametro.\r\n\t\t\t */\r\n\t\t\tif (nomeTag != null && (TokenNucleo.LINHA.equals(nomeTag) || TokenNucleo.COLUNA.equals(nomeTag)\r\n\t\t\t\t\t|| TokenNucleo.MAE.equals(nomeTag))) {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Tag de linha que contem o numero da linha e a configuracao de\r\n\t\t\t\t * identacao.\r\n\t\t\t\t */\r\n\t\t\t\tif (TokenNucleo.LINHA.equals(nomeTag)) {\r\n\r\n\t\t\t\t\tlinhaTag = new Integer(documento.getAttributes().item(2).getNodeValue());\r\n\r\n\t\t\t\t\taux = new Integer(documento.getAttributes().item(1).getNodeValue());\r\n\r\n\t\t\t\t\tEspaco2Tag = new Espaco2(aux, new Integer(documento.getAttributes().item(0).getNodeValue()));\r\n\r\n\t\t\t\t\tdocumento = documento.getNextSibling();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Tag de coluna.\r\n\t\t\t\t */\r\n\t\t\t\tif (TokenNucleo.COLUNA.equals(nomeTag)) {\r\n\r\n\t\t\t\t\tcolunaTag = new Integer(documento.getAttributes().item(0).getNodeValue());\r\n\r\n\t\t\t\t\tdocumento = documento.getNextSibling();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * tag mae para todas as outras.\r\n\t\t\t\t */\r\n\t\t\t\tif (TokenNucleo.MAE.equals(nomeTag)) {\r\n\r\n\t\t\t\t\tNodeList children = documento.getChildNodes();\r\n\r\n\t\t\t\t\tfor (int i = 0; i < children.getLength(); i++) {\r\n\r\n\t\t\t\t\t\t// Comeca a fazer um loop para dentro do documento.\r\n\t\t\t\t\t\tloopingChildren(children.item(i));\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * Se a tag for Tag HTML do Conteudo do Link.\r\n\t\t\t */\r\n\t\t\telse {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Tipo de No.\r\n\t\t\t\t */\r\n\t\t\t\tshort type = documento.getNodeType();\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Se houver um doctype ele eh atribuido a lista de tags, para\r\n\t\t\t\t * que nao ocorra erros.\r\n\t\t\t\t */\r\n\t\t\t\tif (type == Node.DOCUMENT_TYPE_NODE) {\r\n\r\n\t\t\t\t\ttag.add(\"!DOCTYPE\");\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Reescreve o no para que se possa guardar ela montada.\r\n\t\t\t\t */\r\n\t\t\t\ttagCompleta = new ConversorTexto().reEscrever(documento);\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Verificacao HardCoded\r\n\t\t\t\t */\r\n\t\t\t\tif (!nomeTag.equals(\"#text\")) {\r\n\r\n\t\t\t\t\tif (nomeTag.toLowerCase().equals(\"input\")) {\r\n\r\n\t\t\t\t\t\tif (!regras.verificaTextoPredefinidoInput(tagCompleta)) {\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(132);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"Value\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\tif (nomeTag.toLowerCase().equals(\"input\") || nomeTag.toLowerCase().equals(\"textarea\")\r\n\t\t\t\t\t\t\t|| nomeTag.toLowerCase().equals(\"select\")) {\r\n\r\n\t\t\t\t\t\tboolean ishidden = false;\r\n\r\n\t\t\t\t\t\tboolean isbutton = false;\r\n\r\n\t\t\t\t\t\tboolean isimage = false;\r\n\r\n\t\t\t\t\t\tboolean comErro = true;\r\n\r\n\t\t\t\t\t\tNamedNodeMap nos = documento.getAttributes();\r\n\r\n\t\t\t\t\t\tfor (int k = 0; k < nos.getLength(); k++) {\r\n\r\n\t\t\t\t\t\t\tif (nos.item(k).getNodeName().toLowerCase().equals(\"type\")) {\r\n\r\n\t\t\t\t\t\t\t\tif (nos.item(k).getNodeValue().toLowerCase().equals(\"hidden\")) {\r\n\r\n\t\t\t\t\t\t\t\t\tishidden = true;\r\n\r\n\t\t\t\t\t\t\t\t} else if (nos.item(k).getNodeValue().toLowerCase().equals(\"button\")) {\r\n\r\n\t\t\t\t\t\t\t\t\tisbutton = true;\r\n\r\n\t\t\t\t\t\t\t\t} else if (nos.item(k).getNodeValue().toLowerCase().equals(\"submit\")) {\r\n\r\n\t\t\t\t\t\t\t\t\tisbutton = true;\r\n\r\n\t\t\t\t\t\t\t\t} else if (nos.item(k).getNodeValue().toLowerCase().equals(\"reset\")) {\r\n\r\n\t\t\t\t\t\t\t\t\tisbutton = true;\r\n\r\n\t\t\t\t\t\t\t\t} else if (nos.item(k).getNodeValue().toLowerCase().equals(\"image\")) {\r\n\r\n\t\t\t\t\t\t\t\t\tisimage = true;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (nos.item(k).getNodeName().equals(\"id\")) {\r\n\r\n\t\t\t\t\t\t\t\tif (regras.verificaLabel(strHtmlSource, nos.item(k).getNodeValue())) {\r\n\r\n\t\t\t\t\t\t\t\t\tcomErro = false;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (ishidden == false && isbutton == false && isimage == false && comErro == true) {\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(233);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"Label\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\tif (nomeTag.toLowerCase().equals(\"h1\") || nomeTag.toLowerCase().equals(\"h2\")\r\n\t\t\t\t\t\t\t|| nomeTag.toLowerCase().equals(\"h3\") || nomeTag.toLowerCase().equals(\"h4\")\r\n\t\t\t\t\t\t\t|| nomeTag.toLowerCase().equals(\"h5\") || nomeTag.toLowerCase().equals(\"h6\")) {\r\n\r\n\t\t\t\t\t\tif (regras.verificaH1aH6(strHtmlSource) != 0) {\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(217);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\tif (!regras.verificaTamFixoEmAtributoStyle(tagCompleta)) {\r\n\r\n\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\tv.setPv3(179);\r\n\r\n\t\t\t\t\t\tv.setProcurado(\"\");\r\n\r\n\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\ttemp.add(v);\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (nomeTag.toLowerCase().equals(\"textarea\")) {\r\n\r\n\t\t\t\t\t\tif (!regras.verificaTextoPredefinidoTextarea(strHtmlSource, tagCompleta)) {\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(134);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\tif (nomeTag.toLowerCase().equals(\"frame\")) {\r\n\r\n\t\t\t\t\t\tif (!regras.verificaLongDesc(tagCompleta)) {\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(212);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\tif (nomeTag.toLowerCase().equals(\"a\")) {\r\n\r\n\t\t\t\t\t\tif (!regras.verificaSeparadorEmLink(strHtmlSource)) {\r\n\r\n\t\t\t\t\t\t\t// System.out.println(\"oi\");\r\n\r\n\t\t\t\t\t\t\tArmazenaErroOuAvisoAntigo v = new ArmazenaErroOuAvisoAntigo();\r\n\r\n\t\t\t\t\t\t\tv.setPv3(259);\r\n\r\n\t\t\t\t\t\t\tv.setProcurado(\"\");\r\n\r\n\t\t\t\t\t\t\tv.setTag(true);\r\n\r\n\t\t\t\t\t\t\ttemp.add(v);\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\t\t\t/*\r\n\t\t\t\t * No de abertura, ele apenas prossegue a pesquisa com os seus\r\n\t\t\t\t * filhos.\r\n\t\t\t\t */\r\n\t\t\t\tif (type == Node.DOCUMENT_NODE) {\r\n\r\n\t\t\t\t\tloopingChildren(((Document) documento).getDocumentElement());\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * No normal, que deve ser avaliado.\r\n\t\t\t\t */\r\n\t\t\t\telse if (type == Node.ELEMENT_NODE) {\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Guarda o nome da tag para que depois ela possa ser feito\r\n\t\t\t\t\t * o teste se ha uma tag especifica no documento.\r\n\t\t\t\t\t */\r\n\t\t\t\t\ttag.add(documento.getNodeName().toUpperCase());\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Avalia a tag e recebe uma lista de erros.\r\n\t\t\t\t\t */\r\n\t\t\t\t\ttemp.addAll(this.validar.validar(documento));\r\n\r\n\t\t\t\t\tif (temp != null) {\r\n\r\n\t\t\t\t\t\t// informa qual � a tag corrente\r\n\t\t\t\t\t\tcurrentTagName = documento.getNodeName().toLowerCase();\r\n\r\n\t\t\t\t\t\t// Se houver erro guarde ele.\r\n\t\t\t\t\t\tavaliar(temp);\r\n\r\n\t\t\t\t\t\t// System.out.print(\"erro no \" + documento.getNodeName()\r\n\t\t\t\t\t\t// +\"\\n\");\r\n\r\n\t\t\t\t\t\tif (documento.getNodeName().toUpperCase().equals(\"IMG\")) {\r\n\r\n\t\t\t\t\t\t\t// Node\r\n\t\t\t\t\t\t\t// src=documento.getAttributes().getNamedItem(\"src\");\r\n\t\t\t\t\t\t\t// System.out.print(\"img \" + src.getNodeValue()\r\n\t\t\t\t\t\t\t// +\"\\n\");\r\n\r\n\t\t\t\t\t\t} else if (documento.getNodeName().toUpperCase().equals(\"OPTION\")) {\r\n\r\n\t\t\t\t\t\t\t// Node\r\n\t\t\t\t\t\t\t// src=documento.getAttributes().getNamedItem(\"value\");\r\n\t\t\t\t\t\t\t// System.out.print(\"option '\" + src.getNodeValue()\r\n\t\t\t\t\t\t\t// +\"'\\n\");\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\t/*\r\n\t\t\t\t\t * Se tiver filhos busque-os.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tNodeList children = documento.getChildNodes();\r\n\r\n\t\t\t\t\tif (children != null) {\r\n\r\n\t\t\t\t\t\tint len = children.getLength();\r\n\r\n\t\t\t\t\t\tfor (int pos = 0; pos < len; pos++) {\r\n\r\n\t\t\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\t * Para cada filho eh feito uma nova consulta.\r\n\t\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\t\tloopingChildren(children.item(pos));\r\n\r\n\t\t\t\t\t\t\t} catch (Error e) {\r\n\r\n\t\t\t\t\t\t\t\tthrow new Exception(\"Erro de overflow\");\r\n\r\n\t\t\t\t\t\t\t}\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\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public void leggInn(N n, V v) {\n Node nyNode = new Node(n, v);\n Node node = listehode.neste;\n\n if (inneholder(n)) {\n System.out.println(\"FEIL! OBJEKTET ER ALLEREDE I BEHOLDEREN \");\n return;\n }\n\n //Legger objektet forst i beholderen om listehode.nestepeker ikke peker paa noe\n //dvs om beholderen er tom\n if (listehode.neste == null) {\n listehode.neste = nyNode;\n antall++;\n return;\n }\n\n //Legger nyNode sin neste til listehode.neste sin nestepeker\n if (nyNode.compareTo(listehode.neste.nkl) < 0) {\n nyNode.neste = listehode.neste;\n listehode.neste = nyNode;\n antall++;\n return;\n\n //Sjekker om det nye objektet er mindre enn det gamle og om det\n //finnes en nestepeker hvis det nye objektet blir lagt til\n } else if ((nyNode.compareTo(node.nkl) < 0) && !listehode.neste.hasNext()) {\n listehode.neste = nyNode;\n nyNode = node.neste;\n antall++;\n return;\n }\n\n //Saa lenge det forste-objektet sin nestepeker ikke er null sa gaar\n //lokka. Da sjekkes det om det nye objektet er mindre enn det\n //neste objektet i lista, hvis det er det, sa legges det til foer\n //det neste objektet\n while (node.neste != null) {\n if(nyNode.compareTo(node.neste.nkl) < 0) {\n nyNode.neste = node.neste;\n node.neste = nyNode;\n antall++;\n return;\n }\n node = node.neste;\n }\n node.neste = nyNode;\n antall++;\n return;\n }", "public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }", "static void PrintRecorrido(int ini, int fin) {\n\n //System.out.println(\"Recorrido de nodos para llegar de nodo \" + ini + \" a \" + fin);\n List<Integer> path = new ArrayList<Integer>();\n int total=0;\n for (;;) { //infinite loop\n\n path.add(fin);\n if (prev[fin] == -1) {//si se llegó al inicio\n break;\n }\n total+=pesos[fin];//va sumando los pesos \n fin = prev[fin]; //\n }\n\n for (int i = path.size() - 1, k = 0; i >= 0; --i) {//se recorre de atrás para adelante printing los valores\n if (k != 0) {\n System.out.print(\" \");\n }\n System.out.print(path.get(i));//muestra el valor en posicion i (ultimo)\n k = 1;\n }\n System.out.print(\" Total:\"+total);\n System.out.println();\n }", "@Override\n public int getSize() {\n return nodos.size();\n }", "public void iterate(){//iterate over all the keys\n\t\tSystem.out.println(\"Keys are :\");\n\t\tSystem.out.println(\"-----------------------\");\n\t\titerate(this.root);\n\t\tSystem.out.println(\"-----------------------\");\n\t}", "@Override\n\tpublic Iterator<E> iterator() {\n\n\t\tNode tempRoot = root;\n\t\tinOrder(tempRoot);\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean traverse(INode startNode, INode destinationNode) {\n\t\tif (isNeighbors(startNode, destinationNode) == true) {\n\t\t\tint zähler = 0;\n\t\t\tString result = \"\";\n\t\t\tMatrixNode startListNode = (MatrixNode) startNode;\n\t\t\tQueue<MatrixNode> queue = new ArrayDeque<>();\n\t\t\tqueue.add(startListNode);\n\t\t\tstartListNode.mark();\n\t\t\twhile (!queue.isEmpty()) { // solange queue nicht leer ist\n\t\t\t\t// erstes Element von der queue nehmen\n\t\t\t\tMatrixNode node = (MatrixNode) queue.poll();\n\t\t\t\tif (node.equals(destinationNode)) {\n\t\t\t\t\tSystem.out.println(\"Zähler: \" + zähler);\n\t\t\t\t\treturn true; // testen, ob Ziel-Knoten gefunden\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < nodes.size(); i++) {\n\t\t\t\t\tif (isNeighbors(node, nodes.get(i))) {\n\t\t\t\t\t\tif (!((MatrixNode) nodes.get(i)).getMark()) {\n\t\t\t\t\t\t\tqueue.add((MatrixNode) nodes.get(i));\n\t\t\t\t\t\t\t((MatrixNode) nodes.get(i)).mark();\n\t\t\t\t\t\t\tresult += node.getName() + \"-\" + nodes.get(i).getName();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tzähler++;\n\t\t\t\tSystem.out.println(result + \"||\");\n\t\t\t}\n\t\t}\n\t\treturn false; // Knoten kann nicht erreicht werden\n\t}", "public void inOrderTraverseIterative();", "@Override\n public void nullstill() {\n Node<T> curr= hode;\n while (curr!=null){\n Node<T> p= curr.neste;\n curr.forrige=curr.neste= null;\n curr.verdi= null;\n curr= p;\n }\n hode= hale= null;\n endringer++;\n antall=0;\n }", "@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 }", "public Nodes getNodes()\n {\n return nodes;\n }", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "ArrayList<PathFindingNode> neighbours(PathFindingNode node);", "@Override\n public Iterator<T> iterator() {\n return new UsedNodesIterator<>(this);\n }", "public Nodes nodes() {\n return this.nodes;\n }", "@Override\n public int indeksTil(T verdi) {\n int indeks=0;\n Node<T> curr= hode;\n for (; curr!=null; curr= curr.neste, indeks++){\n if (curr.verdi.equals(verdi)){\n return indeks;\n\n }// end if\n\n }// end for\n return -1;\n }", "public void findNNodes(BSTNode<T> root)\n\t{\n\t\tArrayList<T> valueArray = new ArrayList<T>();\n\t\tBSTNode<T> obj = new BSTNode<T>();\n\t\tobj.inOrder(root,valueArray);\n\t\tSystem.out.print(valueArray);\n\t}", "Iterable<? extends XomNode> elements();", "private void recoverINodes()\n {\n Map<String, DFSNode.SerializedDFSNode> serInodeMap = new HashMap<>();\n try (BufferedReader reader = new BufferedReader(new FileReader(dfsNodeFile)))\n {\n String line;\n while((line=reader.readLine())!=null)\n {\n DFSNode.SerializedDFSNode serializedINode = (DFSNode.SerializedDFSNode) JSONUtil.fromJSON(line, DFSNode.SerializedDFSNode.class);\n DFSNode inode = new DFSNode();\n inode.fqpn = serializedINode.fqpn;\n inode.dataBlockMetas = serializedINode.dataBlockMeta;\n inode.dirOrFile= serializedINode.dirOrFile;\n inodeMap.put(inode.fqpn,inode);\n\n\n serInodeMap.put(serializedINode.fqpn,serializedINode);\n if (NumberUtils.isCreatable(inode.fqpn))\n fileNodeCounter = Math.max(fileNodeCounter,Integer.valueOf(inode.fqpn));\n\n /* if (inode.dataBlockMetas!=null) {\n\n DFSDataBlockMeta meta = inode.dataBlockMetas.get(inode.dataBlockMetas.size()-1);\n\n meta.fileSystem = resolve(meta.fileSystemName);\n\n }*/\n\n\n }\n } catch (Exception ex) {\n ex.printStackTrace();}\n\n\n inodeMap.values().stream().forEach(inode->{\n\n DFSNode.SerializedDFSNode serializedINode = serInodeMap.get(inode.fqpn);\n\n // inode.next = inodeMap.get(serializedINode.nextNodeName);\n\n if (serializedINode.getNodeNames()!=null) {\n List<DFSNode> nodes = serializedINode.getNodeNames().stream().map(name -> {\n return inodeMap.get(name) ;\n }).collect(Collectors.toList());\n\n inode.setNodes(nodes);\n }\n });\n\n }", "@Override\n public boolean leggInn(T verdi) {\n Objects.requireNonNull(verdi,\" Null verdier er ikke tillat.\");\n // tilfelle 1- om listen var tom liste\n if (tom()) {\n // kan skrives også som if (hode==null && hale==null)\n hode = hale = new Node<T>(verdi, null, null);\n antall++;\n } else {\n hale.neste = new Node<T>(verdi, hale, null);\n hale = hale.neste;\n antall++;\n endringer++;\n }// end else\n return true;\n }", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "public Vector<Node> getNodes(){\n\t\treturn this.listOfNodes;\n\t}", "Iterable<Long> vertices() {\n return nodes.keySet();\n }", "@Override\n public Collection<? extends INode> getNodes() {\n\n return new LinkedList<>(Collections.unmodifiableCollection(this.nodeMap\n .values()));\n }", "public List<Node> node_list() throws HibernateException \r\n\t\t{ \r\n\t\t\tList <Node> Lista_nodos = null; \r\n\t\t \r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); //IMPORTANTE la query: se pide la clase realmnete Cliente! no la tabla que se ha creado\r\n\t\t Lista_nodos= sesion.createQuery(\"FROM Node\").list(); //creamos consulta de la tabla clientes (en plural)!\r\n\t\t }finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return Lista_nodos; \r\n\t\t}", "public Collection<Node> getNodeList(){\r\n return nodesMap.values();\r\n }", "private void colorNodes() {\n for (NodeImpl n : supervisedNodes) {\n colorNode(n);\n }\n }", "public List<OSMNode> nonRepeatingNodes() {\n if (isClosed()) {\n return nodes.subList(0, nodes.size() - 1);\n } else {\n return nodes;\n }\n }", "@Override\r\n public Iterator<NamedTreeNode<T>> iterator()\r\n {\r\n return new Iterator<NamedTreeNode<T>>()\r\n {\r\n NamedTreeNode<T> n = (NamedTreeNode<T>)getLeftNode();\r\n @Override\r\n public boolean hasNext()\r\n {\r\n return n != null;\r\n }\r\n @Override\r\n public NamedTreeNode<T> next()\r\n {\r\n if( n == null ) {\r\n throw new NoSuchElementException();\r\n }\r\n NamedTreeNode<T> r = n;\r\n n = (NamedTreeNode<T>)n.getRightNode();\r\n return r;\r\n }\r\n @Override\r\n public void remove()\r\n {\r\n throw new UnsupportedOperationException();\r\n }\r\n };\r\n }", "@Override\n public Collection<node_data> getV() {\n return this.nodes.values();\n }", "public void mezclarPorGrado() {\n\t\tint i = 0;\n\t\tint inicio = 0;\n\t\tint fin = 0;\n\t\tint grado = 0;\n\t\tNodo aux;\n\t\tRandom r = new Random();\n\t\tboolean[] mezclado = new boolean[cantNodos];\n\n\t\twhile (i < cantNodos) {\n\t\t\tinicio = i;\n\t\t\tgrado = nodos.get(i).getGrado();\n\t\t\twhile (i < cantNodos && nodos.get(i).getGrado() == grado)\n\t\t\t\ti++;\n\n\t\t\tfin = i;\n\n\t\t\tfor (int k = inicio; k < (fin - inicio); k++) {\n\t\t\t\tint res = r.nextInt(fin - inicio);\n\t\t\t\tif (mezclado[k])\n\t\t\t\t\tres = r.nextInt(fin - inicio);\n\t\t\t\taux = nodos.get(k);\n\t\t\t\tmezclado[k] = true;\n\t\t\t\tnodos.set(k, nodos.get(inicio + res));\n\t\t\t\tnodos.set(inicio + res, aux);\n\t\t\t}\n\t\t}\n\t\tvalidarMezcla();\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.contains(((Edge<?>)o).getFrom()))\n\t\t\t\t\t\toutput.add((Node<A>) ((Edge<?>)o).getFrom());\n\t\t\t\t\n\t\t\t}\n\n\t\t} \n\t\treturn output;\n\t\t\n\t}", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public Set<Node<E>> getNeighbors(Node<E> node){\n Set<Node<E>> result = new HashSet<>();\n result = nodes.get(node);\n return result;\n }", "@Override\n public void render(GraphicsContext gc){\n for(GraphNode node : nodeVector){\n NavNode n1 = (NavNode) node;\n if(n1.isValid()){\n gc.fillRoundRect(n1.getPosition().getX(),n1.getPosition().getY(),2,2,1,1);\n renderNode(gc,Color.BLACK,n1,1);\n for(GraphNode nn1: getAroundNodes(n1)){\n// if(nn1.isValid()&& getEdge(n1.Index(),nn1.Index()).Cost() >= Constants.GRAPH_GRAPH_OBSTACLE_EDGE_COST){\n if(nn1.isValid()&& getEdge(n1.getIndex(),nn1.getIndex()).getBehavior() == GraphEdge.shoot){\n renderNode(gc,Color.BLUE,(NavNode) nn1,2);\n renderline(gc,Color.BLUE,n1,(NavNode) nn1);\n }\n }\n }\n\n }\n\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 }", "private List<Node<T>> auxiliarRecorridoPost(Node<T> nodo, List<Node<T>> lista) {\r\n\t\tif (nodo.getChildren() != null) {// Si tiene hijos\r\n\t\t\tList<Node<T>> hijos = nodo.getChildren();// Hijos\r\n\t\t\tfor (int i = 1; i <= hijos.size(); i++) {\r\n\t\t\t\tauxiliarRecorridoPost(hijos.get(i), lista);// Recursividad\r\n\t\t\t}\r\n\t\t}\r\n\t\tlista.add(nodo);// Aņade a la lista\r\n\t\treturn lista;// Devuelve lista\r\n\t}", "@Override\n public abstract Collection<? extends GraphNode<N, E>> getNodes();", "@Override\r\n public void visit(NodeList n, Graph argu) {\r\n for (Enumeration<Node> e = n.elements(); e.hasMoreElements(); )\r\n e.nextElement().accept(this, argu);\r\n }", "@Override\n public Iterator<Node> iterator() {\n return this;\n }", "private List<Node<T>> auxiliarRecorridoPre(Node<T> nodo, List<Node<T>> lista) {\r\n\t\tlista.add(nodo);// Inserta en la lista\r\n\t\tif (nodo.getChildren() != null) {// Si tiene hijo\r\n\t\t\tList<Node<T>> hijos = nodo.getChildren();// Hijos\r\n\t\t\tfor (int i = 1; i <= hijos.size(); i++) {\r\n\t\t\t\tauxiliarRecorridoPre(hijos.get(i), lista);// Recursividad\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn lista;// Retorna lista\r\n\t}", "void printNodesWithEdges()\n {\n for ( int i = 0; i < this.numNodes; i++ )\n {\n Node currNode = this.nodeList.get(i);\n System.out.println(\"Node id: \" + currNode.id );\n \n int numEdges = currNode.connectedNodes.size();\n for ( int j = 0; j < numEdges; j++ )\n {\n Node currEdge = currNode.connectedNodes.get(j);\n System.out.print(currEdge.id + \",\");\n }\n\n System.out.println();\n } \n\n \n }", "public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllInvolvedPerson_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), INVOLVEDPERSON);\r\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public OctreeIterator iterator()\n {\n Stack<CelestialBody> stack = new Stack<>();\n stack = this.root.iterate(stack);\n\n OctreeIterator iterator = new OctreeIterator(stack);\n return iterator;\n }", "protected Iterator getNominationsSet() \n {\n return this.nominations.iterator();\n }", "@Override\n protected void iterChildren(TreeFunction f) {\n }", "@Override\n protected void iterChildren(TreeFunction f) {\n }", "@Override\n protected void iterChildren(TreeFunction f) {\n }", "private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }", "private List<AxiomTreeNode> getChildNodeList(AxiomTreeNode t) {\n\n List<AxiomTreeNode> list = new ArrayList<AxiomTreeNode>();\n\n for (int i = 0; i < t.getChildCount(); i++) {\n\n list.add((AxiomTreeNode) t.getChildAt(i));\n }\n\n return list;\n }", "@Override\r\n\tpublic int getNumberOfNodes() {\r\n\t\tint contador = 0;// Contador para el recursivo\r\n\t\treturn getNumberOfNodesRec(contador, raiz);\r\n\t}", "@Override\n public boolean hasNext()\n {\n Node testNode = getNth(idx);\n if(testNode.getElement() == null)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "io.netifi.proteus.admin.om.Node getNodes(int index);", "@Override\n\tpublic List<Node> chilren() {\n\t\treturn children;\n\t}", "Set getNi()\n {\n return neighbors.keySet();\n }", "public boolean GO ()\r\n\t{\r\n\t\t\r\n\t\t for (GenericTreeNode<String> node : ActualNode.getChildren()) {\r\n\t\t\t if (node.getData().equalsIgnoreCase(Navigation_WHERE)){\r\n\t\t\t\t Path.add(new GenericTreeNode<String>(ActualNode));\r\n\t\t\t\t ActualNode=new GenericTreeNode<String>(node);\r\n\t\t\t return true;\r\n\t\t\t }\r\n\t }\r\n\t\t return false;\r\n\t}" ]
[ "0.6379116", "0.63516146", "0.6231993", "0.61751956", "0.6151972", "0.6082038", "0.60528886", "0.60103273", "0.60056365", "0.60028917", "0.59776324", "0.59583646", "0.59565437", "0.59444785", "0.5939521", "0.5926289", "0.5895953", "0.58814853", "0.5867164", "0.5843562", "0.58379674", "0.5834839", "0.58190316", "0.58169955", "0.58119315", "0.5808291", "0.579817", "0.5797016", "0.57872605", "0.5778754", "0.57775515", "0.57752484", "0.57678664", "0.5743571", "0.5742763", "0.57328534", "0.5728232", "0.5718444", "0.5705278", "0.57035446", "0.5696835", "0.5694039", "0.5693783", "0.56800056", "0.56721646", "0.5669367", "0.566815", "0.5656485", "0.5654602", "0.56486297", "0.56443304", "0.564062", "0.56306815", "0.56286824", "0.5617548", "0.56109333", "0.5606011", "0.5601356", "0.55979776", "0.55948734", "0.55870324", "0.5574771", "0.5574751", "0.5574269", "0.55653495", "0.5561533", "0.5558993", "0.5552294", "0.55499285", "0.5549045", "0.5547825", "0.55430555", "0.5542261", "0.55400914", "0.55390745", "0.55386674", "0.5537421", "0.5528414", "0.5525562", "0.5522389", "0.5516227", "0.55096376", "0.5508557", "0.5507315", "0.55045545", "0.5500671", "0.55006117", "0.5498369", "0.5490415", "0.54901433", "0.5486886", "0.5486886", "0.5486886", "0.5485076", "0.5483488", "0.54645634", "0.5463885", "0.5463813", "0.5456202", "0.54552966", "0.545428" ]
0.0
-1
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); if(request.getParameter("tipus").equals("loginfail")) { //error en el login: username i/o password son incorrectes out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>Error: L'usuari o contrasenya introduits son incorrectes</h2>" + "<br>" + "<a href='login.jsp'>Tornar a login</a>" + "<br>" + "</body></html>"); } else if(request.getParameter("tipus").equals("tornamenu")) { //error general out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>Hi ha hagut un error!</h2>" + "<br>" + "<a href='menu.jsp'>Tornar al menu</a>" + "<br>" + "</body></html>"); } else if(request.getParameter("tipus").equals("Notrobat")) { //la cerca de imatges no obte cap resultat out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>La teva cerca no ha obtingut ningun resultat</h2>" + "<br>" + "<a href='buscarImagen.jsp'>Torna a fer una cerca</a>" + "<br>" + "<a href='menu.jsp'>Tornar al menu</a>" + "<br>" + "</body></html>"); } else if(request.getParameter("tipus").equals("userexists")) { //l'usuari ja existeix a la DB out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>L'usuari introduit ja existeix. Siusplau, introdueix un altre username</h2>" + "<br>" + "<a href='crearUser.jsp'>Tornar a crear usuari</a>" + "<br>" + "</body></html>"); } else if(request.getParameter("tipus").equals("imageexists")) { //la imatge que es vol registrar ja existeix out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>La imatge ja esta registrada. Siusplau, introdueix un altra imatge</h2>" + "<br>" + "<a href='registrarImagen.jsp'>Tornar a registrar imatge</a>" + "<br>" + "</body></html>"); } else if(request.getParameter("tipus").equals("formatmal")) { //el format de la imatge no es JPEG out.println("<html> <body>" + "<link rel='stylesheet' href='css/styles.css'>" + "<h2>El format de la imatge no es JPEG. Siusplau, introdueix un altra imatge</h2>" + "<br>" + "<a href='registrarImagen.jsp'>Tornar a registrar imatge</a>" + "<br>" + "</body></html>"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }" ]
[ "0.7004024", "0.66585696", "0.66031146", "0.6510023", "0.6447109", "0.64421695", "0.64405906", "0.64321136", "0.6428049", "0.6424289", "0.6424289", "0.6419742", "0.6419742", "0.6419742", "0.6418235", "0.64143145", "0.64143145", "0.6400266", "0.63939095", "0.63939095", "0.639271", "0.63919044", "0.63919044", "0.63903785", "0.63903785", "0.63903785", "0.63903785", "0.63887113", "0.63887113", "0.6380285", "0.63783026", "0.63781637", "0.637677", "0.63761306", "0.6370491", "0.63626", "0.63626", "0.63614637", "0.6355308", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896" ]
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197", "0.6515622", "0.6513045", "0.6512626", "0.6492367", "0.64817846", "0.6477479", "0.64725804", "0.6472099", "0.6469389", "0.6456206", "0.6452577", "0.6452577", "0.6452577", "0.6450273", "0.6450273", "0.6438126", "0.6437522", "0.64339423", "0.64253825", "0.6422238", "0.6420897", "0.6420897", "0.6420897", "0.6407662", "0.64041835", "0.64041835", "0.639631", "0.6395677", "0.6354875", "0.63334197", "0.6324263", "0.62959254", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6280875", "0.6272104", "0.6272104", "0.62711537", "0.62616795", "0.62544584", "0.6251865", "0.62274224", "0.6214439", "0.62137586", "0.621211", "0.620854", "0.62023044", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61638993", "0.61603814", "0.6148914", "0.61465937", "0.61465937", "0.614548", "0.6141879", "0.6136717", "0.61313903", "0.61300284", "0.6124381", "0.6118381", "0.6118128", "0.61063534", "0.60992104", "0.6098801", "0.6096766" ]
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }", "@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }" ]
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", "0.85282224", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8516995", "0.8512296", "0.8511239", "0.8510324", "0.84964365", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599", "0.8492599" ]
0.0
-1
The Type of Element the Block belongs to 0: I Cyan 1: J Blue 2: L Orange 3: O Yellow 4: S Green 5: T Purple 6: Z Red
public void generateElement(Block[][] panelField) { switch (type) { case 0: for (int col = 3; col < 7; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(0); list.add(panelField[1][col]); if (col == 5) { rotator = panelField[1][5]; } } break; case 1: for (int col = 3; col < 6; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(1); list.add(panelField[1][col]); if (col == 4) { rotator = panelField[1][4]; } } panelField[0][3] = new Block(0, 3); panelField[0][3].setType(1); list.add(panelField[0][3]); break; case 2: for (int col = 3; col < 6; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(2); list.add(panelField[1][col]); if (col == 4) { rotator = panelField[1][4]; } } panelField[0][5] = new Block(0, 5); panelField[0][5].setType(2); list.add(panelField[0][5]); break; case 3: for (int col = 4; col < 6; col++) { for (int row = 0; row < 2; row++) { panelField[row][col] = new Block(row, col); panelField[row][col].setType(3); list.add(panelField[row][col]); } } break; case 4: for (int col = 3; col < 5; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(4); list.add(panelField[1][col]); if (col == 4) { rotator = panelField[1][4]; } } for (int col = 4; col < 6; col++) { panelField[0][col] = new Block(0, col); panelField[0][col].setType(4); list.add(panelField[0][col]); } break; case 5: for (int col = 3; col < 6; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(5); list.add(panelField[1][col]); if (col == 4) { rotator = panelField[1][4]; } } panelField[0][4] = new Block(0, 4); panelField[0][4].setType(5); list.add(panelField[0][4]); break; case 6: for (int col = 4; col < 6; col++) { panelField[1][col] = new Block(1, col); panelField[1][col].setType(6); list.add(panelField[1][col]); if (col == 4) { rotator = panelField[1][4]; } } for (int col = 3; col < 5; col++) { panelField[0][col] = new Block(0, col); panelField[0][col].setType(6); list.add(panelField[0][col]); } break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Color getColor(BlockType type) {\n\t\tswitch (type) {\n\t\tcase Z : \n\t\t\treturn z;\n\t\tcase S :\n\t\t\treturn s;\n\t\tcase LEFT :\n\t\t\treturn left;\n\t\tcase RIGHT : \n\t\t\treturn right;\n\t\tcase LINE :\n\t\t\treturn line;\n\t\tcase TRIANGLE :\n\t\t\treturn tri;\n\t\tcase SQUARE :\n\t\t\treturn square;\n\t\tdefault :\n\t\t\treturn null;\n\t\t}\n\t}", "public BlockType getType()\n {\n return blockType;\n }", "public String giveType(){\n if(isFull==false){\n return \"notfilled\";\n }\n else if(type==TYPE.BLACK){\n return \"BLACK\";\n }else{\n return \"WHITE\";\n }\n }", "Type getElementType();", "TypeElement getTypeElement();", "ElementType getElementType();", "public static String getElementName(String type) {\n switch(type){\n case(\"1\"):\n return \"Kinetic\";\n case(\"2\"):\n return \"Arc\";\n case(\"3\"):\n return \"Solar\";\n case(\"4\"):\n return \"Void\";\n default:\n return \"Damage Type Not Found\";\n }\n }", "@Override\r\n\tpublic int getType() {\n\t\treturn getTag();\r\n\t}", "public String getType(int i) {\n/* 138 */ return \"CDATA\";\n/* */ }", "public int getType() { return type; }", "public int getType() { return type; }", "public String getElementType() {\n\t\treturn (element_type);\n\t}", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "int getType();", "int getType();", "int getType();", "int getType();", "int getType();", "int getType();", "int getType();", "int getType();", "@Override\n\tpublic EnumBlockRenderType getRenderType(IBlockState iBlockState) {\n\t\treturn EnumBlockRenderType.MODEL;\n\t}", "public int getType();", "public int getType();", "public int getType();", "public int getType();", "public int getType();", "public String getType() {return type;}", "public int getType() { \n return type; \n }", "public int getType() {\n\t\treturn 1;\r\n\t}", "public char getType() {\r\n return type.charAt(1);\r\n }", "public Material type()\n\t{\n\t\treturn type;\n\t}", "public char getType(){\n\t\treturn type;\n\t}", "@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}", "@Override\n\tpublic String getType() {\n\t\treturn getColor()+\"圆形\";\n\t}", "public int getType () {\r\n return type;\r\n }", "@Theme int getType();", "public String Type()\t{\r\n\t\treturn BrickFinder.getDefault().getType();\r\n\t}", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "private Color determineColorFromType(String type)\n\t{\n\t\tIterator<String> iterator = this.tileTypeColorMap.keySet().iterator();\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\tString key = iterator.next();\n\t\t\tif (key == type)\n\t\t\t{\n\t\t\t\treturn tileTypeColorMap.get(key);\n\t\t\t}\n\t\t}\n\t\treturn this.ERROR_COLOR;\n\t}", "public String getType() { return type; }", "public int getType(){\r\n\t\treturn type;\r\n\t}", "public int getType()\r\n\t{\r\n\t\treturn type;\r\n\t}", "public char getType() {\r\n return type;\r\n }", "public int getType() {\n return type;\n }", "public int getType()\r\n {\r\n return type;\r\n }", "public Class getType(Element element) {\r\n Class type = element.type();\r\n \r\n if(type == void.class) {\r\n return contact.getType();\r\n }\r\n return type;\r\n }", "public TypeElement getTypeElement() {\n return this.te;\n }", "public char getType() {\n\t\treturn type;\n\t}", "public int getType() {\n return type_;\n }", "public int getType(){\n return type;\n }", "private String getType(){\r\n return type;\r\n }", "public String getType() {\n\t\treturn String.valueOf(this.pieceType);\n\t}", "public LightType type()\n\t{\n\t\treturn _type;\n\t}", "public int getType(){\n\t\treturn type;\n\t}", "public void setColor(BlockType type, Color c) {\n\t\tswitch (type) {\n\t\tcase Z : \n\t\t\tz = c;\n\t\t\tbreak;\n\t\tcase S :\n\t\t\ts = c;\n\t\t\tbreak;\n\t\tcase LEFT :\n\t\t\tleft = c;\n\t\t\tbreak;\n\t\tcase RIGHT : \n\t\t\tright = c;\n\t\t\tbreak;\n\t\tcase LINE :\n\t\t\tline = c;\n\t\t\tbreak;\n\t\tcase TRIANGLE :\n\t\t\ttri = c;\n\t\t\tbreak;\n\t\tcase SQUARE :\n\t\t\tsquare = c;\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "MediaPackageElement.Type getElementType();", "public ItemType getType();", "public GraphElementType getElementType();", "public char getType() {\n return type;\n }", "public char getType() {\n return type;\n }", "public String getType() {\n /**\n * @return type of Ice Cream\n */\n return type;\n }", "public int getType()\n\t{\n\t\treturn type;\n\t}", "public int typeIndex();", "int getTypeValue();" ]
[ "0.6293028", "0.6095107", "0.58629465", "0.579542", "0.5772298", "0.5718014", "0.5686309", "0.56595385", "0.5601011", "0.5596749", "0.5596749", "0.55914825", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5472531", "0.5459836", "0.5459836", "0.5459836", "0.5459836", "0.5459836", "0.5459836", "0.5459836", "0.5459836", "0.5409669", "0.5400794", "0.5400794", "0.5400794", "0.5400794", "0.5400794", "0.53857315", "0.53824854", "0.537588", "0.53733486", "0.5369879", "0.53599125", "0.5353583", "0.5349093", "0.5343267", "0.5338869", "0.5337678", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.53276914", "0.5322298", "0.53219503", "0.5303374", "0.530106", "0.52945715", "0.52937436", "0.5290086", "0.528574", "0.52846754", "0.52839696", "0.5283829", "0.5277583", "0.5276118", "0.5270476", "0.5267071", "0.5260428", "0.5242727", "0.5235835", "0.5232951", "0.52313983", "0.5218172", "0.5218172", "0.52122873", "0.5210081", "0.5209173", "0.5200737" ]
0.0
-1
saves the location of the blocks in the panelfield (relative to the rotator) while we changee the rotategrid to hold future locations
public void rotateLeft(Block[][] panelField) { HashMap<Block, Point> locsaver = new HashMap<>(); Boolean rotationfinished = false; rotator.setMarked(true); Block[][] rotategrid = new Block[3][3]; rotategrid[1][1] = rotator; for (int r = 0; r < 3; r++) { for (int c = 0; c < 3; c++) { if (r == 1 && c == 1) { continue; } rotategrid[r][c] = panelField[rotator.getRow() - 1 + r][rotator.getCol() - 1 + c]; } } while (!rotationfinished) { for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { if (list.contains(rotategrid[row][col]) && !list.contains(rotategrid[2 - col][row]) && !rotategrid[row][col].isMarked()) { rotategrid[2 - col][row] = rotategrid[row][col]; rotategrid[row][col] = null; rotategrid[2 - col][row].setMarked(true); } } } rotationfinished = true; for (Block block : list) { if (block.isMarked() == false) { rotationfinished = false; break; } } } for (Block block : list) { block.setMarked(false); } // Fill the hashlist with the target coordinates of the blocks for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { if (list.contains(rotategrid[row][col])) { locsaver.put(rotategrid[row][col], new Point(rotator.getCol() - 1 + col, rotator.getRow() - 1 + row)); } } } boolean rotfinished = false; rotator.setMarked(true); while (!rotfinished) { for (Block block : list) { if (block.isMarked()) { continue; } int oldrow = block.getRow(); int oldcol = block.getCol(); Double newrow = locsaver.get(block).getY(); Double newcol = locsaver.get(block).getX(); if (panelField[newrow.intValue()][newcol.intValue()] == null) { panelField[newrow.intValue()][newcol.intValue()] = panelField[oldrow][oldcol]; panelField[oldrow][oldcol] = null; panelField[newrow.intValue()][newcol.intValue()].setMarked(true); panelField[newrow.intValue()][newcol.intValue()].setRow(newrow.intValue()); panelField[newrow.intValue()][newcol.intValue()].setCol(newcol.intValue()); } } rotfinished = true; for (Block block : list) { if (block.isMarked() == false) { rotfinished = false; break; } } } for (Block block : list) { block.setMarked(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rotateRight(Block[][] panelField) {\n\t\tHashMap<Block, Point> locsaver = new HashMap<>();\n\n\t\tBoolean rotationfinished = false;\n\t\trotator.setMarked(true);\n\n\t\tBlock[][] rotategrid = new Block[3][3];\n\t\trotategrid[1][1] = rotator;\n\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (r == 1 && c == 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\trotategrid[r][c] = panelField[rotator.getRow() - 1 + r][rotator.getCol() - 1 + c];\n\t\t\t}\n\t\t}\n\n\t\twhile (!rotationfinished) {\n\t\t\tfor (int row = 0; row < 3; row++) {\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t\tif (list.contains(rotategrid[row][col]) && !list.contains(rotategrid[col][2 - row])\n\t\t\t\t\t\t\t&& !rotategrid[row][col].isMarked()) {\n\t\t\t\t\t\trotategrid[col][2 - row] = rotategrid[row][col];\n\t\t\t\t\t\trotategrid[row][col] = null;\n\t\t\t\t\t\trotategrid[col][2 - row].setMarked(true);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trotationfinished = true;\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked() == false) {\n\t\t\t\t\trotationfinished = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tfor (Block block : list) {\n\t\t\tblock.setMarked(false);\n\t\t}\n\n\t\t// Fill the hashlist with the target coordinates of the blocks\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\tif (list.contains(rotategrid[row][col])) {\n\t\t\t\t\tlocsaver.put(rotategrid[row][col],\n\t\t\t\t\t\t\tnew Point(rotator.getCol() - 1 + col, rotator.getRow() - 1 + row));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tboolean rotfinished = false;\n\t\trotator.setMarked(true);\n\n\t\twhile (!rotfinished) {\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tint oldrow = block.getRow();\n\t\t\t\tint oldcol = block.getCol();\n\t\t\t\tDouble newrow = locsaver.get(block).getY();\n\t\t\t\tDouble newcol = locsaver.get(block).getX();\n\t\t\t\tif (panelField[newrow.intValue()][newcol.intValue()] == null) {\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()] = panelField[oldrow][oldcol];\n\t\t\t\t\tpanelField[oldrow][oldcol] = null;\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setMarked(true);\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setRow(newrow.intValue());\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setCol(newcol.intValue());\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trotfinished = true;\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked() == false) {\n\t\t\t\t\trotfinished = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (Block block : list) {\n\t\t\tblock.setMarked(false);\n\t\t}\n\n\t}", "private void save() {\n Tile[][] field = gameController.grid.field;\n Tile[][] undoField = gameController.grid.undoField;\n// SharedPreferenceUtil.put(this, SpConstant.WIDTH, field.length);\n// SharedPreferenceUtil.put(this, SpConstant.HEIGHT, field.length);\n for (int xx = 0; xx < field.length; xx++) {\n for (int yy = 0; yy < field[0].length; yy++) {\n if (field[xx][yy] != null) {\n SharedPreferenceUtil.put(this, xx + \"_\" + yy, field[xx][yy].getValue());\n } else {\n SharedPreferenceUtil.put(this, xx + \"_\" + yy, 0);\n }\n\n if (undoField[xx][yy] != null) {\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GRID + xx + \"_\" + yy, undoField[xx][yy].getValue());\n } else {\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GRID + xx + \"_\" + yy, 0);\n }\n }\n }\n SharedPreferenceUtil.put(this, SpConstant.SCORE, gameController.currentScore);\n SharedPreferenceUtil.put(this, SpConstant.HIGH_SCORE_TEMP, gameController.historyHighScore);\n SharedPreferenceUtil.put(this, SpConstant.UNDO_SCORE, gameController.lastScore);\n SharedPreferenceUtil.put(this, SpConstant.CAN_UNDO, gameController.canUndo);\n SharedPreferenceUtil.put(this, SpConstant.GAME_STATE, gameController.gameState);\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GAME_STATE, gameController.lastGameState);\n SharedPreferenceUtil.put(this, SpConstant.AUDIO_ENABLED, gameController.isAudioEnabled);\n }", "public ProtectedCuboidRegion saveRegion() {\n\t\t\n\t\tcom.sk89q.worldedit.BlockVector pos1 = \n\t\t\t\tnew com.sk89q.worldedit.BlockVector(position1.getBlockX(), position1.getBlockY(), position1.getBlockZ());\n\t\tcom.sk89q.worldedit.BlockVector pos2 =\n\t\t\t\tnew com.sk89q.worldedit.BlockVector(position2.getBlockX(), position2.getBlockY(), position2.getBlockZ());\n\t\t\n\t\tplayer.sendMessage(\"\" + name + position1.toString() + position2.toString());\n\t\t\n\t\tProtectedCuboidRegion newPlotRegion = new ProtectedCuboidRegion(name, pos1, pos2);\n\t\t\n\t\tRegionManager regionManager = Mcc.worldGuard.getRegionManager(player.getWorld());\n\t\tregionManager.addRegion(newPlotRegion);\n\t\tnewPlotRegion = (ProtectedCuboidRegion) regionManager.getRegion(name);\n\t\t\n\t\tnewPlotRegion.setPriority(2);\n\t\ttry {\n\t\t\tregionManager.save();\n\t\t} catch (ProtectionDatabaseException e) {\n\t\t\tplayer.sendMessage(ChatColor.RED + \"Critical World Guard error! Notify Funonly\");\n\t\t}\n\t\t\n\t\treturn newPlotRegion;\n\t}", "@Override\n\tpublic void setOffsetBackToFile() {\n\t\tString newXString;\n\t\tString newYString;\n\t\t newXString = String.valueOf(getX().getValueInSpecifiedUnits())+getX().getUserUnit();\n\t newYString = String.valueOf(getY().getValueInSpecifiedUnits())+getY().getUserUnit();\n\t\tjc.getElement().setAttribute(\"x\", newXString);\n\t\tjc.getElement().setAttribute(\"y\", newYString);\n\t\ttry {\n\t\t\tjc.getView().getFrame().writeFile();\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 recordLocation(){\n\t\tg2d.setColor(Color.blue);\n\t\n int x = (int)(sd.getLocationX() * scale) + width/2;\n int y = (int)(sd.getLocationY() * scale) + height/2;\n g2d.fillRect(x,y,8,8);\n\t\n\t}", "public int saveBlocks() {\n \t\tint noOfSavedBlocks = 0;\n \t\tint x = 0;\n \t\tint y = 0;\n \t\tint z = 0;\n \t\ttry {\n \t\t\tif(hasTwoCorners()) {\n \t\t\t\tthis.setBlockTypes(new int[getSizeX()][getSizeY()][getSizeZ()]);\n \t\t\t\tthis.setBlockDatas(new byte[getSizeX()][getSizeY()][getSizeZ()]);\n \t\t\t\tthis.getSignLines().clear();\n \t\t\t\tthis.getInvBlockContents().clear();\n \t\t\t\tx = getMinX();\n \t\t\t\tfor(int i = 0; i < getSizeX(); i++){\n \t\t\t\t\ty = getMinY();\n \t\t\t\t\tfor(int j = 0; j < getSizeY(); j++){\n \t\t\t\t\t\tz = getMinZ();\n \t\t\t\t\t\tfor(int k = 0;k < getSizeZ(); k++) {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tBlock block = getWorld().getBlockAt(x, y, z);\n \t\t\t\t\t\t\t\tthis.getBlockTypes()[i][j][k] = block.getTypeId();\n \t\t\t\t\t\t\t\tthis.getBlockDatas()[i][j][k] = block.getData();\n \t\t\t\t\t\t\t\tBlockState state = block.getState();\n \t\t\t\t\t\t\t\tif(state instanceof Sign) {\n \t\t\t\t\t\t\t\t\t// Signs\n \t\t\t\t\t\t\t\t\tSign sign = (Sign)state;\n \t\t\t\t\t\t\t\t\tif(sign.getLines() != null) {\n \t\t\t\t\t\t\t\t\t\tthis.getSignLines().put(\"sign-\" + i + \"-\" + j + \"-\" + k, sign.getLines());\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t} else if(state instanceof Chest) {\n \t\t\t\t\t\t\t\t\t// Chests\n \t\t\t\t\t\t\t\t\tChest chest = (Chest)state;\n \t\t\t\t\t\t\t\t\tInventory inv = chest.getInventory();\n \t\t\t\t\t\t\t\t\tint size = inv.getSize();\n \t\t\t\t\t\t\t\t\tList<ItemStack> items = new ArrayList<ItemStack>();\n \t\t\t\t\t\t\t\t\tfor(int invIndex = 0; invIndex < size; invIndex++){\n \t\t\t\t\t\t\t\t\t\tItemStack item = inv.getItem(invIndex);\n \t\t\t\t\t\t\t\t\t\tif(item != null && item.getType().getId() != Material.AIR.getId()) {\n \t\t\t\t\t\t\t\t\t\t\titems.add(item);\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\tthis.getInvBlockContents().put(\"chest-\" + i + \"-\" + j + \"-\" + k, items);\n \t\t\t\t\t\t\t\t} else if(state instanceof Dispenser) {\n \t\t\t\t\t\t\t\t\t// Dispensers\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\tDispenser dispenser = (Dispenser)state;\n \t\t\t\t\t\t\t\t\tInventory inv = dispenser.getInventory();\n \t\t\t\t\t\t\t\t\tint size = inv.getSize();\n \t\t\t\t\t\t\t\t\tList<ItemStack> items = new ArrayList<ItemStack>();\n \t\t\t\t\t\t\t\t\tfor(int invIndex = 0; invIndex < size; invIndex++){\n \t\t\t\t\t\t\t\t\t\tItemStack item = inv.getItem(invIndex);\n \t\t\t\t\t\t\t\t\t\tif(item != null && item.getType().getId() != Material.AIR.getId()) {\n \t\t\t\t\t\t\t\t\t\t\titems.add(item);\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\tthis.getInvBlockContents().put(\"dispenser-\" + i + \"-\" + j + \"-\" + k, items);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tnoOfSavedBlocks++;\n \t\t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\t\tthis.getWar().getLogger().warning(\"Failed to save block in volume \" + getName() + \". Saved blocks so far:\" + noOfSavedBlocks \n \t\t\t\t\t\t\t\t\t\t+ \". Error at x:\" + x + \" y:\" + y + \" z:\" + z + \". Exception:\" + e.getClass().toString() + e.getMessage());\n \t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t} finally {\n \t\t\t\t\t\t\t\tz++;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t\ty++;\n \t\t\t\t\t}\n \t\t\t\t\tx++;\n \t\t\t\t}\n \t\t\t}\t\t\n \t\t} catch (Exception e) {\n \t\t\tthis.getWar().getLogger().warning(\"Failed to save volume \" + getName() + \" blocks. Saved blocks:\" + noOfSavedBlocks \n \t\t\t\t\t+ \". Error at x:\" + x + \" y:\" + y + \" z:\" + z + \". Exception:\" + e.getClass().toString() + \" \"+ e.getMessage());\n \t\t\te.printStackTrace();\n \t\t}\n \t\treturn noOfSavedBlocks;\n \t}", "public void save() {\n\n\t\tint[][] rawData = new int[2][CHUNK_SIZE * CHUNK_SIZE];\n\n\t\tfor (int l = 0; l < 2; l++) {\n\t\t\tLayer layer = Layer.get(l);\n\t\t\tfor (int y = 0; y < CHUNK_SIZE; y++) {\n\t\t\t\tfor (int x = 0; x < CHUNK_SIZE; x++) {\n\t\t\t\t\trawData[l][x + y * CHUNK_SIZE] = getTileId(layer, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.saveData = new RawChunkData(rawData);\n\t}", "public void saveGridToESRI() {\n\t\tRectangle rect = grid.getBounds();\n\t\tMapProjection proj = grid.getProjection();\n\n\t\tdouble minLon = proj.getRefXY(rect.x, rect.y).getX();\n\t\tdouble minLat = proj.getRefXY(rect.x, rect.getMaxY()).getY();\n\n\t\tdouble maxLon = proj.getRefXY(rect.getMaxX(), rect.y).getX();\n\t\tdouble maxLat = proj.getRefXY(rect.x, rect.y).getY();\n\n\t\tdouble dLon = maxLon - minLon;\n\t\tdouble dLat = maxLat - minLat;\n\n\t\t// if second x is wrapped\n\t\tif ((int) Math.rint(proj.getMapXY(maxLon, 0).getX()) !=\n\t\t\t(int) Math.rint(rect.getMaxX()))\n\t\t\t// if first x is NOT wrapped\n\t\t\tif ((int) Math.rint(proj.getMapXY(minLon, 0).getX()) ==\n\t\t\t\t(int) Math.rint(rect.x))\n\t\t\t\tdLon += 360;\n\n\t\tint nCols = rect.width;\n\t\tint nRows = (int) (nCols * dLat / dLon);\n\n\t\tdouble cell_size = dLon / nCols;\n\n\t\tFile file = new File(\"untitled\" + MapTools.saveCount++);\n\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tJLabel label = new JLabel(\"Save \" + nCols + \" by \" + nRows + \" grid in ESRI format as?\");\n\t\tpanel.add( label , BorderLayout.NORTH);\n\n\t\tJPanel p2 = new JPanel(new GridLayout(0,1));\n\t\tButtonGroup bg = new ButtonGroup();\n\t\tJRadioButton b = new JRadioButton(\"ASCII\", true);\n\t\tbg.add(b);\n\t\tp2.add(b);\n\t\tfinal JRadioButton b2 = new JRadioButton(\"Binary\");\n\t\tbg.add(b2);\n\t\tp2.add(b2);\n\t\tpanel.add(p2);\n\n\t\tint s = JOptionPane.showConfirmDialog( map.getTopLevelAncestor(), panel, \"Save grid\", JOptionPane.OK_CANCEL_OPTION);\n\t\t// Close on cancel\n\t\tif(s == JOptionPane.CANCEL_OPTION) {\n\t\t\treturn;\n\t\t}\n\n\t\tJFileChooser chooser = MapApp.getFileChooser();\n\t\tchooser.setSelectedFile(file);\n\t\tchooser.setFileFilter(null);\n\t\tint confirm = JOptionPane.NO_OPTION;\n\n\t\twhile (confirm == JOptionPane.NO_OPTION) {\n\t\t\tint ok = chooser.showSaveDialog(map.getTopLevelAncestor());\n\t\t\tif (ok == chooser.CANCEL_OPTION)\n\t\t\t\treturn;\n\t\t\t// append .asc to file if save as ESRI ascii is choosen \n\t\t\tfile = chooser.getSelectedFile();\n\t\t\tif ( !file.getName().endsWith(\".asc\") && !b2.isSelected()) {\n\t\t\t\tfile = new File(file.getPath() + \".asc\");\n\t\t\t}\n\n\t\t\tif (file.exists()) {\n\t\t\t\tconfirm = JOptionPane.showConfirmDialog(map.getTopLevelAncestor(), \"File exists, Overwrite?\");\n\t\t\t\tif (confirm == JOptionPane.CANCEL_OPTION) return;\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfinal File saveTo = file;\n\t\tfinal int cols = nCols;\n\t\tfinal int rows = nRows;\n\t\tfinal double mLon = minLon;\n\t\tfinal double mLat = minLat;\n\t\tfinal double c_size = cell_size;\n\n\t\t((MapApp) map.getApp()).addProcessingTask(\"Saving Grid...\", new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tif (b2.isSelected())\n\t\t\t\t\t\tsaveGridToESRI_Bin(saveTo, cols, rows, mLon, mLat, c_size);\n\t\t\t\t\telse\n\t\t\t\t\t\tsaveGridToESRI_ASCII(saveTo, cols, rows, mLon, mLat, c_size);\n\t\t\t\t} catch(Exception ex) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(map.getTopLevelAncestor(),\n\t\t\t\t\t\t\t\t\"an error occurred during this operation:\\t\"\n\t\t\t\t\t\t\t\t+ \" \"+ ex.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void saveDividerLocations() {\n GuiDisplayUtil.saveCurrentBoundsToPrefs();\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_1, this.jSplitPane1.getDividerLocation());\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_2, this.jSplitPaneTables.getDividerLocation());\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_3, chatPanelMain.getSplitDividerLocation());\n }", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "private void setWorldCoordinatesFromFields() {\n if (trackerPanel == null) return;\n OffsetOriginStep step = (OffsetOriginStep) getStep(trackerPanel.getFrameNumber());\n boolean different = step.worldX != xField.getValue() || step.worldY != yField.getValue();\n if (different) {\n XMLControl trackControl = new XMLControlElement(this);\n XMLControl coordsControl = new XMLControlElement(trackerPanel.getCoords());\n step.setWorldXY(xField.getValue(), yField.getValue());\n step.getPosition().showCoordinates(trackerPanel);\n Undo.postTrackAndCoordsEdit(this, trackControl, coordsControl);\n }\n }", "void storeValues(int posx, int posy, int piece) {\n\t\tprevPosX = posx;\n\t\tprevPosY = posy;\n\t\tprevName = \"\" + prevPosX + \"\" + prevPosY;\n\t\tprevComp = (JLabel) curComp;\n\t\tprevPiece = piece;\n\t\tpiece = Logic.arr[posx][posy];\n\t}", "@Override\n\tpublic void saveBlocks() {\n\t\tint saved = 0;\n\t\ttry {\n\t\t\tsaved = ZoneVolumeMapper.saveZoneBlocksAndEntities(this, this.zone.getName());\n\t\t} catch (SQLException ex) {\n\t\t\tWar.war.log(\"Failed to save warzone \" + zone.getName() + \": \" + ex.getMessage(), Level.WARNING);\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tWar.war.log(\"Saved \" + saved + \" blocks in warzone \" + this.zone.getName() + \".\", java.util.logging.Level.INFO);\n\t\tthis.isSaved = true;\n\t}", "public void save() {\r\n IniReader.write(FILE_NAME, \"x\", x, \"y\", y, \"fullscreen\", fullscreen, \"controlType\", controlType, \"vol\", volMul,\r\n \"keyUpMouse\", getKeyUpMouseName(), \"keyDownMouse\", getKeyDownMouseName(), \"keyUp\", getKeyUpName(), \"keyDown\", keyDownName,\r\n \"keyLeft\", keyLeftName, \"keyRight\", keyRightName, \"keyShoot\", keyShootName, \"keyShoot2\", getKeyShoot2Name(),\r\n \"keyAbility\", getKeyAbilityName(), \"keyEscape\", getKeyEscapeName(), \"keyMap\", keyMapName, \"keyInventory\", keyInventoryName,\r\n \"keyTalk\", getKeyTalkName(), \"keyPause\", getKeyPauseName(), \"keyDrop\", getKeyDropName(), \"keySellMenu\", getKeySellMenuName(),\r\n \"keyBuyMenu\", getKeyBuyMenuName(), \"keyChangeShipMenu\", getKeyChangeShipMenuName(), \"keyHireShipMenu\", getKeyHireShipMenuName());\r\n }", "private void saveLocation()\n {\n willLocationBeSaved = !willLocationBeSaved;\n }", "public void saveState() {\n savedPen.setValues(pm.pen);\n }", "private void saveValues() {\r\n this.pl_expert.setParam(\"displayNodeDegree\", (String) this.nodeDegreeSpinner.getValue());\r\n this.pl_expert.setParam(\"displayEdges\", (String) this.displayEdgesSpinner.getValue());\r\n this.pl_expert.setParam(\"scale\", (String) this.scaleSpinner.getValue());\r\n this.pl_expert.setParam(\"minWeight\", (String) this.minweightSpinner.getValue());\r\n this.pl_expert.setParam(\"iterations\", (String) this.iterationsSpinner.getValue());\r\n this.pl_expert.setParam(\"mutationParameter\", this.mutationParameter.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"Update_param\", this.Update_param.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"vote_value\", (String) this.vote_value.getValue());\r\n this.pl_expert.setParam(\"keep_value\", (String) this.keep_value.getValue());\r\n this.pl_expert.setParam(\"mut_value\", (String) this.mut_value.getValue());\r\n this.pl_expert.setParam(\"only_sub\", new Boolean(this.only_sub.isSelected()).toString());\r\n\r\n this.is_alg_started = false;\r\n }", "@Override protected Parcelable onSaveInstanceState() {\n Parcelable superState = super.onSaveInstanceState();\n SavedState ss = new SavedState(superState);\n ss.rotated = rotated;\n ss.totalSpacingDegree = totalSpacingDegree;\n ss.satelliteDistance = satelliteDistance;\n ss.measureDiff = measureDiff;\n ss.expandDuration = expandDuration;\n ss.closeItemsOnClick = closeItemsOnClick;\n return ss;\n }", "private void buildPanelEast() {\n\r\n }", "protected void refresh() {\r\n // Toggle attached direction.\r\n org.bukkit.material.Sign material = new org.bukkit.material.Sign(this.getBlock().getType());\r\n material.setData(this.getSignMaterial().getData());\r\n \r\n material.setFacingDirection(material.getAttachedFace());\r\n this.getBlock().setData(material.getData());\r\n \r\n material.setFacingDirection(material.getAttachedFace());\r\n this.getBlock().setData(material.getData());\r\n }", "private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }", "private void saveMove(){\n\t\tpreviousTile=monster.currentTile;\r\n\t}", "public void actualiza(){\r\n //pregunto si se presiono una tecla de dirección\r\n if(bTecla) {\r\n int iX = basPrincipal.getX();\r\n int iY = basPrincipal.getY();\r\n if(iDir == 1) {\r\n iY -= getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 2) {\r\n iX += getWidth() / iMAXANCHO;\r\n }\r\n if(iDir == 3) {\r\n iY += getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 4) {\r\n iX -= getWidth() / iMAXANCHO;\r\n }\r\n //limpio la bandera\r\n bTecla = false;\r\n \r\n //asigno posiciones en caso de no salirme\r\n if(iX >= 0 && iY >= 0 && iX + basPrincipal.getAncho() <= getWidth()\r\n && iY + basPrincipal.getAlto() <= getHeight()) {\r\n basPrincipal.setX(iX);\r\n basPrincipal.setY(iY);\r\n } \r\n }\r\n \r\n //Muevo los chimpys\r\n for(Base basChimpy : lklChimpys) {\r\n basChimpy.setX(basChimpy.getX() - iAceleracion);\r\n }\r\n \r\n //Muevo los diddys\r\n for(Base basDiddy : lklDiddys) {\r\n basDiddy.setX(basDiddy.getX() + iAceleracion);\r\n }\r\n\r\n }", "private void drawNewDrawPanel(final Integer blkSize) {\n\t\tfrmNewBlock = new JFrame();\n\t\tfrmNewBlock.setPreferredSize(new Dimension(750, 700));\n\t\tfrmNewBlock.setTitle(\"New Block\");\n\t\tfrmNewBlock.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tfrmNewBlock.pack();\n\t\tfrmNewBlock.setVisible(true);\n\n\t\tcontrolPanel = new JPanel();\n\t\tcontrolPanel.setLayout(new MigLayout(\"\", \"[100][15][3][287][287][3]\",\n\t\t\t\t\"[][12.00][25][25][25][500][][]\"));\n\n\t\tRuler ruler = new Ruler(blkSize);\n\t\tcontrolPanel.add(ruler, \"cell 2 0 4 6\");\n\n\t\tbuttonGroup = new ButtonGroup();\n\n\t\tbtnNew = new JButton(\"Start New Block\");\n\t\tbuttonGroup.add(btnNew);\n\t\tbtnNew.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew NewBlockFrame();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnNew, \"cell 0 2\");\n\n\t\tbtnReset = new JButton(\"Reset Block\");\n\t\tbuttonGroup.add(btnReset);\n\t\tbtnReset.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcontrolPanel.repaint();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnReset, \"cell 0 3,growx\");\n\n\t/*\tbtnUndo = new JButton(\"Undo Last\");\n\t\tbuttonGroup.add(btnUndo);\n\t\tbtnUndo.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tblkLines = DrawPiece.getBlkLines();\n\t\t\t\tblkLines = DrawPiece.removeBlkLine(blkLines);\n\t\t\t\truler.repaint();\n\t\t\t\truler.add(new DrawBlock(blkLines));\n\t\t\t\truler.repaint();\n\t\t\t\t\n\t\t\t\t\t*/\t\t\t\t\t\t\n\n//\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t.getGraphics();\n//\n//\t\t\t\tThread myThread = new Thread() {\n//\n//\t\t\t\t\tpublic void run() {\n//\t\t\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t\t\t.getGraphics();\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tdrawPiece.redrawBlkLines(g2, blkLines);\t\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t}\n//\n//\t\t\t\t};\n//\t\t\t\tmyThread.start();\n//\n//\t\t\t\tg2.setColor(Color.RED);\n//\n//\t\t\t}\n//\t});\n//\t\tcontrolPanel.add(btnUndo, \"cell 3 6,alignx left\");\n\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbuttonGroup.add(btnSave);\n\t\tbtnSave.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tRandom rand = new Random();\n\t\t\t\tString blkName = JOptionPane.showInputDialog(\"Please enter \"\n\t\t\t\t\t\t+ \"a name for the block: \");\n\t\t\t\tint id = (int)QuiltPad.blockRepository.count() + 1;\n\t\t\t\tint uPieces = rand.nextInt(12) + 1;\n\t\t\t\tBlock block = new Block(id, blkName, blkSize, uPieces, blkLines);\n\t\t\t\tQuiltPad.blockRepository.save(block);\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew BlockFrame();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnSave, \"cell 4 6,alignx right\");\n\t\t\n\t\tfrmNewBlock.getContentPane().add(controlPanel);\n\n\t}", "public void saveState() {\n mementos = new ArrayList<>(mementos.subList(0, statePointer + 1));\n Notebook notebookToAdd = new Notebook(this.notebook);\n notebookToAdd.setCurrentClassroom(this.notebook.getCurrentClassroom());\n Memento mementoToAdd = new Memento(notebookToAdd);\n mementos.add(mementoToAdd);\n statePointer++;\n }", "public void writeback(){\r\n \tthis.settings.genChainLength = Integer.parseInt(genChainLengthField.getText());\r\n \tthis.settings.genChainLengthFlux = Integer.parseInt(genChainLengthFluxField.getText());\r\n \tthis.settings.stepGenDistance = Integer.parseInt(stepGenDistanceField.getText());\r\n \tthis.settings.rows = Integer.parseInt(rowsField.getText());\r\n \tthis.settings.cols = Integer.parseInt(colsField.getText());\r\n \tthis.settings.cellWidth = Integer.parseInt(cellWidthField.getText());\r\n \tthis.settings.startRow = Integer.parseInt(startRowField.getText());\r\n \tthis.settings.startCol = Integer.parseInt(startColField.getText());\r\n \tthis.settings.endRow = Integer.parseInt(endRowField.getText());\r\n \tthis.settings.endCol = Integer.parseInt(endColField.getText());\r\n \tthis.settings.progRevealRadius = Integer.parseInt(progRevealRadiusField.getText());\r\n \tthis.settings.progDraw = progDrawCB.isSelected();\r\n \tthis.settings.progDrawSpeed = Integer.parseInt(progDrawSpeedField.getText());\r\n }", "public void generateElement(Block[][] panelField) {\n\t\tswitch (type) {\n\n\t\tcase 0:\n\t\t\tfor (int col = 3; col < 7; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(0);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 5) {\n\t\t\t\t\trotator = panelField[1][5];\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(1);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][3] = new Block(0, 3);\n\t\t\tpanelField[0][3].setType(1);\n\t\t\tlist.add(panelField[0][3]);\n\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(2);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][5] = new Block(0, 5);\n\t\t\tpanelField[0][5].setType(2);\n\t\t\tlist.add(panelField[0][5]);\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tfor (int row = 0; row < 2; row++) {\n\t\t\t\t\tpanelField[row][col] = new Block(row, col);\n\t\t\t\t\tpanelField[row][col].setType(3);\n\t\t\t\t\tlist.add(panelField[row][col]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 4:\n\t\t\tfor (int col = 3; col < 5; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(4);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tpanelField[0][col] = new Block(0, col);\n\t\t\t\tpanelField[0][col].setType(4);\n\t\t\t\tlist.add(panelField[0][col]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(5);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][4] = new Block(0, 4);\n\t\t\tpanelField[0][4].setType(5);\n\t\t\tlist.add(panelField[0][4]);\n\t\t\tbreak;\n\n\t\tcase 6:\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(6);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int col = 3; col < 5; col++) {\n\t\t\t\tpanelField[0][col] = new Block(0, col);\n\t\t\t\tpanelField[0][col].setType(6);\n\t\t\t\tlist.add(panelField[0][col]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "@Override\n public void setDisplayedLocation(Location loc) {\n pane.setVvalue(loc.getyCoord());\n pane.setHvalue(loc.getxCoord());\n setCurrentFloor(loc.getLevel());\n displayedLocation = getDisplayedLocation();\n }", "public void saveSettings() {\n try {\n Settings.setDegausserPort((String) this.demagnetizerPort.getSelectedItem());\n Settings.setDegausserDelay(((Number) this.demagDelay.getSelectedItem()).intValue());\n Settings.setDegausserRamp(((Number) this.demagRamp.getSelectedItem()).intValue());\n Settings.setDegausserMaximumField(((Number) this.maximumField.getValue()).doubleValue());\n Settings.setHandlerPort((String) this.handlerPort.getSelectedItem());\n Settings.setHandlerAcceleration(((Number) this.acceleration.getValue()).intValue());\n Settings.setHandlerAxialAFPosition(((Number) this.axialAFPosition.getValue()).intValue());\n Settings.setHandlerBackgroundPosition(((Number) this.backgroundPosition.getValue()).intValue());\n Settings.setHandlerDeceleration(((Number) this.deceleration.getValue()).intValue());\n Settings.setHandlerMeasurementPosition(((Number) this.measurementPosition.getValue()).intValue());\n Settings.setHandlerMeasurementVelocity(((Number) this.measurementVelocity.getValue()).intValue());\n Settings.setHandlerRotation(((Number) this.rotation.getValue()).intValue());\n Settings.setHandlerSampleLoadPosition(((Number) this.sampleLoadPosition.getValue()).intValue());\n Settings.setHandlerTransverseYAFPosition(((Number) this.transverseYAFPosition.getValue()).intValue());\n Settings.setHandlerVelocity(((Number) this.velocity.getValue()).intValue());\n Settings.setHandlerRotationVelocity(((Number) this.rotationVelocity.getValue()).intValue());\n Settings.setHandlerRotationDeceleration(((Number) this.rotationDec.getValue()).intValue());\n Settings.setHandlerRotationAcceleration(((Number) this.rotationAcc.getValue()).intValue());\n\n Settings.setMagnetometerPort((String) this.magnetometerPort.getSelectedItem());\n Settings.setMagnetometerXAxisCalibration(((Number) this.xAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerYAxisCalibration(((Number) this.yAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerZAxisCalibration(((Number) this.zAxisCalibration.getValue()).doubleValue());\n creator.setVisible(false);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void createFinalLine() {\n //Up\n if (orOpActive.row > origin.row) {\n for (int i = origin.row + 1; i <= orOpActive.row; i++) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n\n //Down\n if (orOpActive.row < origin.row) {\n for (int i = origin.row - 1; i >= orOpActive.row; i--) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n //Right\n if (orOpActive.column > origin.column) {\n for (int i = origin.column + 1; i <= orOpActive.column; i++) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n //Left\n if (orOpActive.column < origin.column) {\n for (int i = origin.column - 1; i >= orOpActive.column; i--) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n }", "public MapEditor() throws LWJGLException {\n // TODO: Comment me\n setMinimumSize(new Dimension(1024, 800));\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setBounds(100, 100, 800, 796);\n contentPane = new JPanel();\n contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n setContentPane(contentPane);\n contentPane.setLayout(new MigLayout(\"\", \"[grow][grow]\",\n \"[][][603.00,grow,baseline]\"));\n \n // TODO: Comment me\n JToolBar toolBar = new JToolBar();\n toolBar.setBorder(UIManager.getBorder(\"ToolBar.border\"));\n contentPane.add(toolBar, \"flowx,cell 0 0 2 1,growx\");\n \n // TODO: Comment me\n JButton btnSave = new JButton(\"\");\n btnSave.setIcon(new ImageIcon(\"res/save.png\"));\n btnSave.setToolTipText(\"Save\");\n btnSave.setBorder(null);\n toolBar.add(btnSave);\n \n // TODO: Comment me\n Component horizontalStrut = Box.createHorizontalStrut(20);\n horizontalStrut.setMaximumSize(new Dimension(5, 32767));\n horizontalStrut.setPreferredSize(new Dimension(5, 0));\n horizontalStrut.setMinimumSize(new Dimension(5, 0));\n toolBar.add(horizontalStrut);\n \n // TODO: Comment me\n JButton btnLoad = new JButton(\"\");\n btnLoad.setBorder(null);\n btnLoad.setToolTipText(\"Load\");\n btnLoad.setIcon(new ImageIcon(\"res/load.png\"));\n toolBar.add(btnLoad);\n \n // TODO: Comment me\n Component horizontalStrut_1 = Box.createHorizontalStrut(20);\n toolBar.add(horizontalStrut_1);\n \n // TODO: Comment me\n JButton btnExport = new JButton(\"\");\n btnExport.setBorder(null);\n btnExport.setIcon(new ImageIcon(\"res/export.png\"));\n btnExport.setToolTipText(\"Export\");\n toolBar.add(btnExport);\n \n // TODO: Comment me\n Component horizontalStrut_2 = Box.createHorizontalStrut(20);\n toolBar.add(horizontalStrut_2);\n \n // TODO: Comment me\n JButton btnUndo = new JButton(\"\");\n btnUndo.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n currentTab.getEditorCanvas().undo();\n }\n });\n btnUndo.setBorder(null);\n btnUndo.setToolTipText(\"Undo\");\n btnUndo.setIcon(new ImageIcon(\"res/undo.png\"));\n toolBar.add(btnUndo);\n \n // TODO: Comment me\n Component horizontalStrut_3 = Box.createHorizontalStrut(20);\n horizontalStrut_3.setPreferredSize(new Dimension(5, 0));\n horizontalStrut_3.setMinimumSize(new Dimension(5, 0));\n horizontalStrut_3.setMaximumSize(new Dimension(5, 32767));\n toolBar.add(horizontalStrut_3);\n \n // TODO: Comment me\n JButton btnRedo = new JButton(\"\");\n btnRedo.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n currentTab.getEditorCanvas().redo();\n }\n });\n btnRedo.setBorder(null);\n btnRedo.setIcon(new ImageIcon(\"res/redo.png\"));\n btnRedo.setToolTipText(\"Redo\");\n toolBar.add(btnRedo);\n\n // TODO: Comment me\n JPanel toolboxPanel = new JPanel();\n toolboxPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n contentPane.add(toolboxPanel, \"cell 0 1 2 1,grow\");\n toolboxPanel.setLayout(new MigLayout(\"\", \"[666px,grow]\", \"[122px]\"));\n Toolbox toolbox = new Toolbox();\n toolboxPanel.add(toolbox, \"cell 0 0,growx,aligny top\");\n\n // TODO: Comment me\n JPanel map2dPanel = new JPanel();\n map2dPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\n map2dPanel.setBorder(new TitledBorder(null, \"2D Map\",\n TitledBorder.LEADING, TitledBorder.TOP, null,\n null));\n map2dPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n map2dPanel.setLayout(new MigLayout(\"\", \"[19px,grow,fill]\",\n \"[19px,grow,fill]\"));\n Map2D map2d = new Map2D();\n map2dPanel.add(map2d, \"cell 0 0,alignx left,aligny top\");\n contentPane.add(map2dPanel, \"cell 0 2,grow\");\n\n // TODO: Comment me.\n btnSave.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n map2d.save();\n }\n });\n \n // TODO: Comment me.\n btnLoad.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n map2d.load();\n }\n });\n\n // TODO: Comment me\n JPanel map3dPanel = new JPanel();\n map3dPanel.setBorder(new TitledBorder(null, \"3D Map\",\n TitledBorder.LEADING, TitledBorder.TOP, null,\n null));\n map3dPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n map3dPanel.setLayout(new MigLayout(\"\", \"[10px,grow]\", \"[10px,grow][]\"));\n map3dPanel.add(new Map3D(), \"cell 0 0,grow\");\n contentPane.add(map3dPanel, \"cell 1 2 1 2,grow\");\n }", "void save3(PrintWriter pw){\n\t\t\t pw.println(\" \");\n\t\t\t int YEG = 0;\n int XEG = 0;\n for(int i =0; i < this.position.length;i++){\n for(int p= 0; p < this.position.length; p++){\n if(this.position[i][p] == 1){\n YEG = i;\n XEG = p;\n }//end of if statement\n }//end of inner for loop\n }//end of outer for loop\n pw.println(YEG + \" \" + XEG);\n\t\t }", "public void saveCameraPosition() {\n \t\tCameraPosition camera = mMap.getCameraPosition();\n \t\tSharedPreferences settings = context.getSharedPreferences(\"MAP\", 0);\n \t\tSharedPreferences.Editor editor = settings.edit();\n \t\teditor.putFloat(\"lat\", (float) camera.target.latitude);\n \t\teditor.putFloat(\"lng\", (float) camera.target.longitude);\n \t\teditor.putFloat(\"bea\", camera.bearing);\n \t\teditor.putFloat(\"tilt\", camera.tilt);\n \t\teditor.putFloat(\"zoom\", camera.zoom);\n \t\teditor.commit();\n \t}", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "void saveSet() {\n if( file==null ) {\n int returnVal = fc.showSaveDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n }\n System.out.println(\"Saving to: \" + file.getName());\n try {\n int count = tabbedPane.getTabCount();\n ArrayList l = new ArrayList();\n for(int i=0; i< count; i++) {\n rrpanel= (RoombaRecorderPanel)tabbedPane.getComponentAt(i);\n l.add(rrpanel.copy());\n }\n FileOutputStream fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //oos.writeObject(loopButton);\n //oos.writeObject(\n oos.writeObject(l);\n oos.close();\n } catch( Exception e ) {\n System.out.println(\"Save error \"+e);\n }\n }", "public void saveBlocks() {\n\n if (blockCount == 0 || leftBlockIndex < 0)\n return;\n\n EditText blockTitleView1 = (EditText)block1ViewSet.get(BLOCK_TITLE);\n model.getBlocks().get(leftBlockIndex).setTitle( blockTitleView1.getText().toString());\n\n if (model.getBlocks().get(leftBlockIndex).getSubBlock1() != null) {\n if (model.getBlocks().get(leftBlockIndex).getSubBlock1().getType() == SubBlockType.TEXT) {\n\n EditText textView1 = (EditText) block1ViewSet.get(SB1_TEXT);\n model.getBlocks().get(leftBlockIndex).getSubBlock1().setText(textView1.getText().toString());\n\n } else {\n\n EditText subtitleView1 = (EditText) block1ViewSet.get(SB1_SUBTITLE);\n model.getBlocks().get(leftBlockIndex).getSubBlock1().setSubtitle(subtitleView1.getText().toString());\n\n }\n }\n\n if (model.getBlocks().get(leftBlockIndex).getSubBlock2() != null) {\n if (model.getBlocks().get(leftBlockIndex).getSubBlock2().getType() == SubBlockType.TEXT) {\n\n EditText textView2 = (EditText) block1ViewSet.get(SB2_TEXT);\n model.getBlocks().get(leftBlockIndex).getSubBlock2().setText(textView2.getText().toString());\n\n } else {\n\n EditText subtitleView2 = (EditText) block1ViewSet.get(SB2_SUBTITLE);\n model.getBlocks().get(leftBlockIndex).getSubBlock2().setSubtitle(subtitleView2.getText().toString());\n\n }\n }\n\n //check if there are 2 blocks\n if(blockCount>1) {\n\n\n EditText blockTitleView2 = (EditText)block2ViewSet.get(BLOCK_TITLE);\n model.getBlocks().get(leftBlockIndex+1).setTitle( blockTitleView2.getText().toString());\n\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock1() != null) {\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().getType() == SubBlockType.TEXT) {\n\n EditText textView3 = (EditText) block2ViewSet.get(SB1_TEXT);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().setText(textView3.getText().toString());\n\n } else {\n\n EditText subtitleView3 = (EditText) block2ViewSet.get(SB1_SUBTITLE);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().setSubtitle(subtitleView3.getText().toString());\n\n }\n }\n\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock2() != null) {\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().getType() == SubBlockType.TEXT) {\n\n EditText textView4 = (EditText) block2ViewSet.get(SB2_TEXT);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().setText(textView4.getText().toString());\n\n } else {\n\n EditText subtitleView4 = (EditText) block2ViewSet.get(SB2_SUBTITLE);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().setSubtitle(subtitleView4.getText().toString());\n\n }\n }\n }\n\n }", "@Override\n public void recalculatePositions() { \n \n }", "public void changePositionOfAdjuster() {\n final float txOffset = currentSittingTranslationX;\n final float tyOffset = currentSittingTranslationY;\n final float tzOffset = currentSittingTranslationZ;\n float rxOffset = currentSittingRotationX;\n float ryOffset = currentSittingRotationY;\n float rzOffset = currentSittingRotationZ;\n \n //get cell transform of the sceneroot of cell\n CellRendererJME ret = (CellRendererJME) editor.getCell().getCellRenderer(Cell.RendererType.RENDERER_JME);\n Entity mye = ret.getEntity();\n RenderComponent rc = (RenderComponent) mye.getComponent(RenderComponent.class);\n Node localNode = rc.getSceneRoot();\n Vector3f v3fa = localNode.getWorldTranslation();\n Quaternion quata = localNode.getWorldRotation();\n float[] angles = new float[3];\n angles = quata.toAngles(angles);\n\n //prepare the translation values\n final float tx = v3fa.x + txOffset;\n final float ty = v3fa.y + tyOffset;\n final float tz = v3fa.z + tzOffset;\n\n //prepare the rotation values\n //add 20 degree to y as an adjuster\n final float rx = (float) Math.toRadians((rxOffset + Math.toDegrees(angles[0])));\n final float ry = (float) Math.toRadians((ryOffset + Math.toDegrees(angles[1]) + 20.0f));\n final float rz = (float) Math.toRadians((rzOffset + Math.toDegrees(angles[2])));\n\n //apply the changes\n final WorldManager wm = ClientContextJME.getWorldManager();\n RenderUpdater u = new RenderUpdater() {\n public void update(Object obj) {\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalTranslation(tx, ty, tz);\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalRotation(new Quaternion(new float[]{rx, ry, rz}));\n WorldManager wm = ClientContextJME.getWorldManager();\n wm.addToUpdateList(SitAdjusterEntity.getInstance(editor.getCell()).getRootNode());\n }\n };\n wm.addRenderUpdater(u, this);\n }", "private void setFields() {\n\t\t// create nine rectangles to represent the cells\n\t\tfor (int x=0;x<3;x++) {\n\t\t\tfor (int y=0;y<3;y++) {\n\t\t\t\t// create the fields based on the dimensions of the board\n\t\t\t\tfieldsArrayGeometry[x][y]= new Rectangle2D.Double(xBoardMin+fieldWidthX*x, yBoardMin+fieldHeightY*y, fieldWidthX, fieldHeightY);\n\t\t\t}\n\t\t\t//System.out.println(Arrays.deepToString(fieldsArrayGeometry));\n\t\t}\n\t\t// write fields to file\n\t\ttry {\n FileWriter fileWriterFields = new FileWriter(fileNameFieldsDimensions,true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriterFields);\n bufferedWriter.write(\"New Fields \"+fieldWidthX+\" \"+fieldHeightY+\" \"+\"\\n\");\n \t\t\tfor (int x=0;x<3;x++) {\n \t\t\t\tfor (int y=0;y<3;y++) {\n \t\t\t\t\tbufferedWriter.write(x+\",\"+y+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMinX()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMaxX()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMinY()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMaxY()+\"\\n\");\n \t\t\t\t}\n \t\t\t}\n bufferedWriter.close(); }\n catch(IOException ex2) {\n System.out.println(\"Error writing to file '\"+ fileNameFieldsDimensions + \"'\");\n }\n\t}", "public void saveNow() {\n\t\tplugin.getFileManager().saveGroupsNow();\n\t}", "protected abstract void saveGraphicsState();", "public void resetCoordinates(){\n pos=0;\n if(this.pIndex<2){\n this.coordinates[0]=TILE_SIZE*15-DICE_SIZE;}\n else{\n this.coordinates[0]=0;}\n if(this.pIndex%3==0){\n this.coordinates[1]=0;}\n else{\n this.coordinates[1]=TILE_SIZE*15-DICE_SIZE;} \n }", "public void SaveState() {\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n temp_pictures[i][j] = pictures[i][j];\n\n }\n }\n }", "public void exportRegion(File folder) throws IOException\n {\n File blocks = new File(folder + \"/blocks.dat\");\n RandomAccessFile file = new RandomAccessFile(blocks, \"rw\");\n BlockPos size = this.range.getSize();\n\n this.range.write(file);\n\n for (int i = 0; i <= size.getX(); i++)\n {\n for (int j = 0; j <= size.getY(); j++)\n {\n for (int k = 0; k <= size.getZ(); k++)\n {\n this.saveBlock(file, i, j, k);\n }\n }\n }\n\n file.close();\n\n /* Save entities */\n this.saveTileEntities(folder);\n this.saveEntities(folder);\n }", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "@Override\n\tpublic void draw(RoomBlocks grid) {\n\t\trenderer.setProjectionMatrix(CameraHolder.instance().getOrtho().combined);\n//\t\tCont tot = new Cont();\n\t\tColor color = new Color();\n\n\t\t\n\t\tDimensions dim = grid.getDimensions().toRoomWorldDimmensions();\n\t\tgrid.forEach(bl -> {\n//\t\t\t\n\t\t\tint x = (GeneratorConstants.ROOM_BLOCK_SIZE * bl.getX()) + GeneratorConstants.ROOM_BLOCK_SIZE;\n\t\t\t\n\t\t\tx = (dim.getW() - x) + dim.getX();\n\t\t\t\n\t\t\tint pseudWorldRoomY = grid.getDimensions().getY() * Configuration.getLevelGridElementContentSize();\n\t\t\tint y = (bl.getY() + pseudWorldRoomY) * (GeneratorConstants.ROOM_BLOCK_SIZE);\n\t\t\t\n\t\t\tShapeType shType = ShapeType.Filled;\n\t\t\tboolean render = false;\n\t\t\t\n\t\t\tif(bl.isDoor()) {\n\t\t\t\trender = true;\n\t\t\t\tcolor.set(0, 0, 0, 1);\n\t\t\t} else if(bl.isWall()) {\n//\t\t\t\trender = true;\n//\t\t\t\tcolor.set(1, 1, 1, 1);\n//\t\t\t\tshType = ShapeType.Line;\n\t\t\t} else if(bl.getMetaInfo() != null) {//TODO\n\t\t\t\t\n\t\t\t\tif(bl.getMetaInfo().getType().equals(\".\")) {\n\t\t\t\t\trender = true;\n\t\t\t\t\tcolor.set(0, 0, 0, 1);\n\t\t\t\t} else if(!bl.getMetaInfo().getType().equals(\"x\")) {\n\t\t\t\t\t\n\t\t\t\t\tBrush brush = Configuration.brushesPerTile.get(bl.getMetaInfo().getType().charAt(0));\n\t\t\t\t\tif(brush != null) {// && bl.getOwner() != null\n\t\t\t\t\t\t\n//\t\t\t\t\t\tif(bl.getOwner() != null) {\n//\t\t\t\t\t\t\tSystem.out.println(\"owner: \" + brush.tile);\n//\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\trender = true;\n\t\t\t\t\t\tcolor.set(brush.color[0], brush.color[1], brush.color[2], 1);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(render) {\n\t\t\t\t\n\t\t\t\tint size = GeneratorConstants.ROOM_BLOCK_SIZE;\n\t\t\t\t\n\t\t\t\trenderer.begin(shType);\n\t\t\t\trenderer.setColor(color);\n\t\t\t\trenderer.rect(x, y, size, size);\n\t\t\t\trenderer.end();\n\t\t\t}\n\t\t\t\n//\t\t\tif(bl.getOwner() != null ) {\n//\t\t\t\tfinal int fx = x;\n//\t\t\t\tfinal int fy = y;\n//\t\t\t\t\n//\t\t\t\tbl.getOwner().forEachItems(itm -> {//desenhando os items\n//\t\t\t\t\trenderer.begin(ShapeType.Filled);\n//\t\t\t\t\trenderer.setColor(itm.color[0], itm.color[1], itm.color[2], 1);\n//\t\t\t\t\trenderer.rect(fx + itm.dx, fy + itm.dy, itm.width, itm.height);\n//\t\t\t\t\trenderer.end();\t\t\t\t\t\t\n//\t\t\t\t});\n//\t\t\t}\t\t\t\n\t\t});\n\t}", "private void recordLocationData() \r\n\t{\r\n\t\tif(loadedImage!=null)\r\n\t\t{\r\n\t\t\tString image = BitMapToString(loadedImage);\r\n\t\t\tStringBuffer stringBuffer = new StringBuffer();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < image.length(); i++) \r\n\t\t\t{\r\n\t\t\t\tif (image.charAt(i) != '\\n' && image.charAt(i) != '\\r') \r\n\t\t\t\t{\r\n\t\t\t\t\tstringBuffer.append(image.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalimage = stringBuffer.toString();\r\n\t\t\tfinaloutput=xLocation+\"\\n\"+yLocation+\"\\n\"+locationTitle+\"\\n\"+description+\"\\n\"+finalimage+\"\\n\";\r\n\t\t\t\t\r\n\t\t\tcreateLocationObject();\r\n\t\t\twritetoFile(finaloutput);\r\n\t\t\t\r\n\t\t\tdatasource.addLocation(getxLocation(), getyLocation(), locationTitle, description, finalimage); \r\n\t\t\tLog.v(\"CHECK again: \", getxLocation()+\"\\n\"+getyLocation());\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfinalimage = \"dummystring\";\r\n\t\t\tfinaloutput=xLocation+\"\\n\"+yLocation+\"\\n\"+locationTitle+\"\\n\"+description+\"\\n\"+finalimage+\"\\n\";\r\n\t\t\t\r\n\t\t\tcreateLocationObject();\r\n\t\t\twritetoFile(finaloutput);\r\n\t\t\t\r\n\t\t\tdatasource.addLocation(getxLocation(), getyLocation(), locationTitle, description, finalimage); \r\n\t\t\tLog.v(\"CHECK again: \", getxLocation()+\"\\n\"+getyLocation());\r\n\t\t}\r\n\t\t\r\n\t\tLog.v(\"ADD finaloutput: \", finaloutput);\r\n\t}", "private void save() {\n var boolGrid = editor.getBoolGrid();\n //Generate a track grid from the bool frid\n var grid = Track.createFromBoolGrid(boolGrid);\n var valid = Track.isValidTrack(grid);\n if (!valid) {\n //fire an error event\n MessageBus.fire(new ErrorEvent(\"Invalid track\", \"\", 2));\n } else {\n //Save the track and pop back\n var generator = new TrackFromGridGenerator(grid);\n var track = generator.generateTrack();\n (new TrackStorageManager()).saveTrack(track);\n menu.navigationPop();\n menu.showError(new ErrorEvent(\"Saved track!\", \"\", 2, Colour.GREEN));\n }\n }", "Tetrisblock()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "private void addPieces() {\n gridPane.getChildren().clear();\n Map<Piece, Position> pieces = controller.getAllActivePiecesPositions();\n /* Add the tiles */\n for (int row = 0; row < 8; row++) {\n for (int col = 0; col < 8; col++) {\n Tile tile = new TileView(new Position(row, col));\n gridPane.add(tile.getRootNode(),\n 1 + tile.getPosition().getCol(),\n 1 + tile.getPosition().getRow());\n GridPane.setHgrow(tile.getRootNode(), Priority.ALWAYS);\n GridPane.setVgrow(tile.getRootNode(), Priority.ALWAYS);\n getTiles()[row][col] = tile;\n tile.getRootNode().setOnMouseClicked(\n tileListener(tile));\n tile.clear();\n tile.setSymbol(\"\");\n }\n }\n /* Add the pieces */\n for (Piece p : pieces.keySet()) {\n Position placeAt = pieces.get(p);\n getTileAt(placeAt).setSymbol(p.getType().getSymbol(p.getSide()));\n }\n /* Add the coordinates around the perimeter */\n for (int i = 1; i <= 8; i++) {\n Text coord1 = new Text((char) (64 + i) + \"\");\n coord1.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord1.setFill(Color.WHITE);\n GridPane.setHalignment(coord1, HPos.CENTER);\n gridPane.add(coord1, i, 0);\n\n Text coord2 = new Text((char) (64 + i) + \"\");\n coord2.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord2.setFill(Color.WHITE);\n GridPane.setHalignment(coord2, HPos.CENTER);\n gridPane.add(coord2, i, 9);\n\n Text coord3 = new Text(\" \" + (9 - i) + \" \");\n coord3.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord3.setFill(Color.WHITE);\n GridPane.setHalignment(coord3, HPos.CENTER);\n gridPane.add(coord3, 0, i);\n\n Text coord4 = new Text(\" \" + (9 - i) + \" \");\n coord4.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord4.setFill(Color.WHITE);\n GridPane.setHalignment(coord4, HPos.CENTER);\n gridPane.add(coord4, 9, i);\n }\n }", "protected void update() {\n setWidth(gridSize);\n setHeight(gridSize);\n\n switch(direction) {\n case UP:\n setRotate(0.0);\n break;\n case RIGHT:\n setRotate(90.0);\n break;\n case DOWN:\n setRotate(180.0);\n break;\n case LEFT:\n setRotate(270.0);\n break;\n }\n\n setLayoutX(position.getX() * gridSize);\n setLayoutY(position.getY() * gridSize);\n }", "private void persistChunkBounds()\n\t{\n\t\tprevChunkBounds[BOUND_LEFT] = chunkBounds[BOUND_LEFT];\n\t\tprevChunkBounds[BOUND_RIGHT] = chunkBounds[BOUND_RIGHT];\n\t\tprevChunkBounds[BOUND_BOTTOM] = chunkBounds[BOUND_BOTTOM];\n\t\tprevChunkBounds[BOUND_TOP] = chunkBounds[BOUND_TOP];\n\t}", "@Override\n public void saveCurrent()\n {\n MazeInfo mi = (MazeInfo) mOpenMazes.getList().getSelectedValue();\n if (mi != null)\n {\n mi = mi.saveMaze();\n mOpenMazes.getList().setSelectedValue(mi, true);\n }\n }", "public boolean setBlockByVertical(World world, int x, int y, int z, float yaw, List<ImageBlockData> dataList){\n\n try {\n Plugin plugin = Bukkit.getPluginManager().getPlugin(\"DPCPlugin\");\n new BukkitRunnable() {\n @Override\n public void run() {\n for (ImageBlockData data : dataList){\n // System.out.println(\"yaw : \"+yaw);\n if (yaw < -45.0 && yaw >= -135.0) {\n // System.out.println(\"east\");\n Location loc = new Location(world, x, y - data.z, z + data.x);\n loc.getBlock().setType(data.block);\n } else if (yaw >= 45.0 && yaw < 135.0) {\n // System.out.println(\"west\");\n Location loc = new Location(world, x, y - data.z, z - data.x);\n loc.getBlock().setType(data.block);\n } else if (yaw > -45.0 && yaw < 45.0) {\n // System.out.println(\"south\");\n Location loc = new Location(world, x - data.x, y - data.z, z);\n loc.getBlock().setType(data.block);\n } else {\n // System.out.println(\"north\");\n Location loc = new Location(world, x + data.x, y - data.z, z);\n loc.getBlock().setType(data.block);\n }\n }\n }\n }.runTaskLater(plugin, 0L);\n\n } catch (Exception e){\n e.printStackTrace();\n return false;\n }\n\n\n return true;\n }", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "public static void blockMove(Player player) {\n Location location1 = (Location) plugin.getConfig().get(\"region1\");\n Location location2 = (Location) plugin.getConfig().get(\"region2\");\n\n int y = (location1.getBlockY() < location2.getBlockY() ? location2.getBlockY() : location1.getBlockY());\n\n for (Location location : blockPlace.redblockloc) {\n int x = location.getBlockX();\n int z = location.getBlockZ();\n new Location(player.getWorld(), x, y + 1, z).getBlock().setType(location.getBlock().getType());\n player.sendMessage(String.valueOf(location.getBlock().getType()));\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()==Material.WATER) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()== Material.IRON_BLOCK) {\n blockPlace.redblock.add(location.getBlock());\n }\n location.getBlock().setType(Material.AIR);\n }\n\n for (Location location : blockPlace.blueblockloc) {\n int xb = location.getBlockX();\n int zb = location.getBlockZ();\n new Location(player.getWorld(), xb, y + 1, zb).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.blueblock.remove(location.getBlock().getType());\n }\n }\n\n for (Location location : blockPlace.greenblockloc) {\n int xg = location.getBlockX();\n int zg = location.getBlockZ();\n new Location(player.getWorld(), xg, y + 1, zg).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n for (Location location : blockPlace.yellowblockloc) {\n int xy = location.getBlockX();\n int zy = location.getBlockZ();\n new Location(player.getWorld(), xy, y + 1, zy).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n }", "public void save(){\r\n if (inputValidation()) {\r\n if (modifyingPart) {\r\n saveExisting();\r\n } else {\r\n saveNew();\r\n }\r\n closeWindow();\r\n }\r\n\r\n }", "private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }", "void updatePosition() {\n if (gameScreen.cursorIsOnLeft()) \n {\n // set the panel's rightmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 11/12 - getWidth(), \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n else // Otherwise the cursor must be on the right half of the screen\n {\n // set the panel's leftmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 1/12, \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n }", "public void save() {\n RegionOwn.saveRegionOwner(this);\n }", "public void dorotate(TurnDirection dir) {\n\t\tList<Player> passengers = getPassengers();\n\t\tACBlockState[] temp = new ACBlockState[blocks.length];\n\t\t\n\t\t// First remove all blocks from the scene\n\t\tfor (int i = 0; i < blocks.length; i++) {\n\t\t\ttemp[i] = new ACBlockState(blocks[i].getState());\n\t\t\tif (blocks[i].getState() instanceof InventoryHolder)\n\t\t\t\t((InventoryHolder) blocks[i].getState()).getInventory().clear();\n\t\t\tblocks[i].setType(Material.AIR);\n\t\t}\n\t\t\n\t\tupdateMainBlock();\n\t\t\n\t\t// Make new blocks in their new respective positions\n\t\tfor (int i = 0; i < blocks.length; i++) {\n\t\t\tblocks[i].getLocation().distance(this.mainblock.getLocation());\n\t\t\tVector v = getRotationVector(blocks[i].getLocation(), this.mainblock, dir);\n\t\t\tblocks[i] = this.mainblock.getRelative(v.getBlockX(), v.getBlockY(), v.getBlockZ());\n\t\t\tsetBlock(blocks[i], temp[i], dir);\t\t\t\n\t\t}\n\t\t\n\t\tfor (Player p : passengers) {\n\t\t\tLocation l = p.getLocation().clone().add(getRotationVector(p.getLocation(), this.mainblock, dir).toLocation(p.getWorld()));\n\t\t\tl.setYaw(l.getYaw() + ((dir == TurnDirection.LEFT) ? -90 : 90)); \n\t\t\tp.teleport(l);\n\t\t}\n\t}", "private void displayWorldCoordinates() {\n int n = trackerPanel == null ? 0 : trackerPanel.getFrameNumber();\n OffsetOriginStep step = (OffsetOriginStep) getStep(n);\n if (step == null) {\n xField.setText(null);\n yField.setText(null);\n } else {\n xField.setValue(step.worldX);\n yField.setValue(step.worldY);\n }\n }", "private void refreshSettingsFields() {\r\n\t\tif(mediaSrc.getActiveCamera() != null) {\r\n\t\t\txPos.setText(Float.toString(mediaSrc.getActiveCamera().getxPos()));\r\n\t\t\tyPos.setText(Float.toString(mediaSrc.getActiveCamera().getyPos()));\r\n\t\t\tzPos.setText(Float.toString(mediaSrc.getActiveCamera().getzPos()));\r\n\t\t\thOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getHorOrientation()));\r\n\t\t\tvOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getVerOrientation()));\r\n\t\t\tfov.setText(Float.toString(mediaSrc.getActiveCamera().getFov()));\r\n\t\t}\r\n\t\t\r\n\t\txPos.setBackground(Color.WHITE);\r\n\t\tyPos.setBackground(Color.WHITE);\r\n\t\tzPos.setBackground(Color.WHITE);\r\n\t\thOrientation.setBackground(Color.WHITE);\r\n\t\tvOrientation.setBackground(Color.WHITE);\r\n\t\tfov.setBackground(Color.WHITE);\r\n\t}", "public void run() {\n\n List<BasePanel> panels = new ArrayList<BasePanel>();\n for (int i=0; i<frame.baseCount(); i++)\n panels.add(frame.baseAt(i));\n\n int i=0;\n for (BasePanel panel : panels) {\n if (panel.isBaseChanged()) {\n if (panel.getFile() != null) {\n autoSave(panel);\n }\n }\n else {\n }\n i++;\n }\n }", "private void saveObjects() {\n\t\tgo.setMeteors(meteors);\n\t\tgo.setExplosions(explosions);\n\t\tgo.setTargets(targets);\n\t\tgo.setRockets(rockets);\n\t\tgo.setCrosses(crosses);\n\t\tgo.setEarth(earth);\n\t}", "private void completeSave() {\n colorBar.updateRevertToCurrent();\n colorBar.revertColorBar();\n undoBtn.setEnabled(false);\n redoBtn.setEnabled(false);\n cmapParams.setColorMapName(seldCmapName);\n saveBtn.setEnabled(true);\n }", "void updateStepCoordiantes(){\n if(xIncreasing) {\n lat = lat + STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat + STEP_LENGTH*yCompMotion*degToMRatio;\n }\n else{\n lat = lat - STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat - STEP_LENGTH*yCompMotion*degToMRatio;\n }\n if(yIncreasing) {\n lon = lon + STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon + STEP_LENGTH*xCompMotion*degToMRatio;\n }\n else{\n lon = lon - STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon - STEP_LENGTH*xCompMotion*degToMRatio;\n }\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "public void rotate() {\n\t\tclearPiece();\n\t\trotateFirstBlock();\n\t\trotateSecondBlock();\n\t\trotateFourthBlock();\n\t\tsetPiece();\n\t\trepaint();\n\t}", "public void actualizar() {\r\n\r\n\t\tthis.panelDatos.actualizar();\r\n\t\tthis.panelJuego.paintComponents(getGraphics());\r\n\r\n\t}", "public void rebuild()\n {\n this.tilePropertyPanel.table.clearChildren();\n this.spritePropertyPanel.table.clearChildren();\n this.mapPropertyPanel.removeablePropertyPanel.table.clearChildren();\n if(map.selectedLayer != null)\n {\n this.layerPropertyPanel.setVisible(true);\n this.layerPropertyPanel.layerWidthProperty.value.setText(Integer.toString(map.selectedLayer.width));\n this.layerPropertyPanel.layerHeightProperty.value.setText(Integer.toString(map.selectedLayer.height));\n this.layerPropertyPanel.layerZProperty.value.setText(Float.toString(map.selectedLayer.z));\n }\n else\n this.layerPropertyPanel.setVisible(false);\n if(map.tileMenu.selectedTiles.size == 1)\n {\n if(map.tileMenu.selectedTiles.first().tool == TileMenuTools.TILE)\n {\n Array<PropertyField> tileProperties = map.tileMenu.selectedTiles.first().lockedProperties;\n for (int i = 0; i < tileProperties.size; i++)\n this.tilePropertyPanel.table.add(tileProperties.get(i)).padBottom(1).row();\n this.tilePropertyPanel.setVisible(true);\n }\n else if(map.tileMenu.selectedTiles.first().tool == TileMenuTools.SPRITE)\n {\n Array<PropertyField> spriteProperties = map.tileMenu.selectedTiles.first().lockedProperties;\n for (int i = 0; i < spriteProperties.size; i++)\n this.spritePropertyPanel.table.add(spriteProperties.get(i)).padBottom(1).row();\n this.spritePropertyPanel.setVisible(true);\n }\n }\n if(map.selectedSprites.size > 0)\n {\n Array<PropertyField> spriteProperties = map.selectedSprites.first().lockedProperties;\n for (int i = 0; i < spriteProperties.size; i++)\n this.spritePropertyPanel.table.add(spriteProperties.get(i)).padBottom(1).row();\n this.spritePropertyPanel.setVisible(true);\n }\n if(map.selectedSprites.size == 0 && map.tileMenu.selectedTiles.size == 0)\n {\n for(int i = 0; i < mapPropertyPanel.properties.size; i ++)\n {\n this.mapPropertyPanel.removeablePropertyPanel.table.add(mapPropertyPanel.properties.get(i)).padBottom(1).row();\n }\n this.mapPropertyPanel.removeablePropertyPanel.setVisible(true);\n }\n if(this.layerPropertyPanel.isVisible())\n this.layerPropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.layerPropertyPanel.setSize(getWidth(), 0);\n if(this.tilePropertyPanel.isVisible())\n this.tilePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.tilePropertyPanel.setSize(getWidth(), 0);\n if(this.spritePropertyPanel.isVisible())\n this.spritePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.spritePropertyPanel.setSize(getWidth(), 0);\n if(this.mapPropertyPanel.removeablePropertyPanel.isVisible())\n this.mapPropertyPanel.removeablePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.mapPropertyPanel.removeablePropertyPanel.setSize(getWidth(), 0);\n\n this.propertyPanel.rebuild();\n this.propertyTable.invalidateHierarchy();\n\n setSize(getWidth(), getHeight()); // refits everything\n }", "private void recalculatePosition()\n {\n position.x = gridCoordinate.getCol()*(width+horizontal_spacing);\n position.y = gridCoordinate.getRow()*(heigh+vertical_spacing);\n }", "public void wrap(){\n\t\tif(this.y_location >=99){\n\t\t\tthis.y_location = this.y_location%99;\n\t\t}\n\t\telse if(this.y_location <=0){\n\t\t\tthis.y_location = 99 - (this.y_location%99);\n\t\t}\n\t\tif(this.x_location >= 99){\n\t\t\tthis.x_location = this.x_location%99;\n\t\t}\n\t\telse if(this.x_location <=0){\n\t\t\tthis.x_location = 99-(this.x_location%99);\n\t\t}\n\t}", "public void putBlock(Block block){\n\t \n\t BlockPosX = 5;\n\t BlockPosY = 0;\n\t int posX = 5;\n\t int posY = 0;\n\t BlockInControl = block;\n\t \n\t int x = 0;\n\t for(int i=0;i<MAX_COL;i++){\n\t\tif(board[posY+1][i] == 1)\n\t\t x = 1;\n\t }\n\t if(x==1)\n\t\tthis.clearBoard();\n\t \n\t \n\t for(int r=0;r<4;r++){\n\t\tfor(int c=0;c<4;c++){\n\t\t if(block.getRowCol(r,c) == 1)\n\t\t\t{\n\t\t\t board[posY][posX]=1;\n\t\t\t \n\t\t\t switch(whichType){\n\t\t\t case 1: color[posY][posX] = 1;\n\t\t\t\tbreak;\n\t\t\t case 2: color[posY][posX] = 2;\n\t\t\t\tbreak;\n\t\t\t case 3: color[posY][posX] = 3;\n\t\t\t\tbreak;\n\t\t\t case 4: color[posY][posX] = 4;\n\t\t\t\tbreak;\n\t\t\t case 5: color[posY][posX] = 5;\n\t\t\t\tbreak;\n\t\t\t case 6: color[posY][posX] = 6;\n\t\t\t\tbreak;\n\t\t\t case 7: color[posY][posX] = 7;\n\t\t\t break;\n\t\t\t }\n\t\t\t}\n\t\t \n\t\t posX++;\n\t\t}\n\t posY++;\n\t posX-=4;\n\t }\n\t}", "public static void saveCurrentGrid(Cell[][] grid) throws IOException {\n StringBuilder builder = new StringBuilder();\n for(int i = 0; i < grid.length; i++) {\n for(int j = 0; j < grid.length; j++) {\n builder.append(grid[i][j].getNum()+\"\");\n if(j < grid.length - 1)\n builder.append(\",\");\n }\n builder.append(\"\\n\");\n }\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"Grid.txt\"));\n writer.write(builder.toString());\n writer.close();\n System.exit(0);\n }", "public void saveRegion(File dir) {\n\t\tif(this.nbt.getSize() > 0) {\n\t\t\tFile file = new File(dir, this.getID() + \".dat\");\n\t\t\tthis.cache.getLocalStorageHandler().getSaveHandler().queueRegion(file, this.nbt.copy());\n\t\t} else {\n\t\t\tthis.deleteRegionFile(dir);\n\t\t}\n\t\tthis.dirty = false;\n\t}", "private void saveCurrRectToStack(Object selectedLabel) {\n\t\tRotatedTextBox b = new RotatedTextBox(currRect, selectedLabel.toString(), textField.getText());\n\t\tdrawnRect.add(b);\n\t\tboxList.setListData(drawnRect);\n\t\tframe.requestFocusInWindow();\n\t\trepaint();\n\t}", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "private void saveJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveJMenuItemActionPerformed\n //save the current points\n myWriter.saveToFile(FILE_PATH, namesArray, tempArray);\n }", "public void setOriginalLocation() {\r\n for (int i = 0; i < this.enemies.size(); i++) {\r\n Point originalPoint = this.startLocations.get(i);\r\n this.enemies.get(i).setLocation(originalPoint);\r\n }\r\n }", "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 void saveLocations(){\n\n final LocationsDialog frame = this;\n WorkletContext context = WorkletContext.getInstance();\n\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n final HashMap<Integer, Location> dirty = model.getDirty();\n\n\n for(Integer id : dirty.keySet()) {\n Location location = dirty.get(id);\n\n\n if (!Helper.insert(location, \"Locations\", context)) {\n System.out.print(\"insert failed!\");\n }\n\n }// end for\n\n model.refresh();\n\n }", "private void saveBlock(RandomAccessFile file, int i, int j, int k) throws IOException\n {\n BlockPos pos = this.range.min.add(i, j, k);\n IBlockState state = world.getBlockState(pos);\n\n int id = Block.getIdFromBlock(state.getBlock());\n int meta = state.getBlock().getMetaFromState(state);\n\n file.writeShort(id);\n file.writeByte(meta);\n\n /* Add tile entity to tiles list */\n TileEntity tile = world.getTileEntity(pos);\n\n if (tile != null)\n {\n this.tiles.appendTag(tile.writeToNBT(new NBTTagCompound()));\n }\n }", "@Override\n\tpublic String getSaveString() {\n\t\tString save = \"Absorber \"+this.name+\" \"+this.x/GameBoard.PixelsPerL+\" \"+this.y/GameBoard.PixelsPerL+\" \"+this.width+\" \"+this.height;\n\t\treturn save;\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 double updatePosition(double climbDegree){\n return leftEncoder.getPosition() - climbDegree;\n }", "public void rotateCCW(){\n rotState = (rotState + 3) % 4;\n for (int i = 0; i < tiles.length; ++i){\n tiles[i] = new Point(tiles[i].y , -tiles[i].x);\n }\n }", "public void createPanelEdit() {\n setBackground(new Color(245, 245, 245));\n setBorder(BorderFactory.createEmptyBorder(0, 300, 0, 300));\n\n setLayout(new BorderLayout());\n JPanel editPanel = new JPanel(new GridBagLayout());\n\n GridBagConstraints g = new GridBagConstraints();\n g.insets = new Insets(0, 20, 40, 8);\n Border border = BorderFactory.createLineBorder(Color.lightGray, 1, true);\n editPanel.setBorder(border);\n\n Border margin1 = new EmptyBorder(50, 50, 50, 50);\n editPanel.setBorder(new CompoundBorder(editPanel.getBorder(), margin1));\n editPanel.setBackground(Color.white);\n\n JPanel contentPanel = new JPanel(new GridBagLayout());\n contentPanel.setBackground(Color.WHITE);\n GridBagConstraints gbc = new GridBagConstraints();\n\n\n backButton = new JButton(\"BACK\");\n ImageIcon backImg = new ImageIcon(\"./images/backarrow.png\");\n Image scaledEditImg = backImg.getImage().getScaledInstance(15, 15,\n Image.SCALE_AREA_AVERAGING);\n backButton.setIcon(new ImageIcon(scaledEditImg));\n backButton.setFont(new Font(\"Arial\", Font.BOLD, 10));\n backButton.setBackground(Color.white);\n backButton.setFocusPainted(false);\n backButton.addActionListener(this);\n\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.weighty = 2;\n gbc.anchor = GridBagConstraints.FIRST_LINE_START;\n contentPanel.add(backButton, gbc);\n\n saveButton = new JButton();\n\n saveButton.setPreferredSize(new Dimension(275,30));\n saveButton.setBorder(BorderFactory.createLineBorder(Color.BLACK));\n saveButton.setPreferredSize(new Dimension(70, 25));\n saveButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n ImageIcon saveImg = new ImageIcon(\"./images/save-icon.png\");\n Image scaledEditImage = saveImg.getImage().getScaledInstance(25, 20,\n Image.SCALE_AREA_AVERAGING);\n\n saveButton.setLayout(new FlowLayout(FlowLayout.LEADING));\n JLabel iconLabel = new JLabel(new ImageIcon(scaledEditImage));\n JLabel textLabel = new JLabel(\"SAVE\");\n saveButton.add(iconLabel);\n saveButton.add(textLabel);\n textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));\n\n saveButton.setBackground(Color.white);\n saveButton.addActionListener(this);\n gbc.gridx = 3;\n gbc.gridy = 40;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.CENTER;\n contentPanel.add(saveButton, gbc);\n\n\n JLabel title = new JLabel(\"ENTER PLANT DETAILS\");\n title.setFont(new Font(\"Calibri light\", Font.BOLD, 25));\n gbc.gridy = 3;\n gbc.gridx = 3;\n gbc.weighty = 5;\n gbc.gridheight = 1;\n contentPanel.add(title, gbc);\n\n\n JLabel nicknameLabel = new JLabel(\"Nickname (optional): \");\n nicknameLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 13;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(nicknameLabel, gbc);\n\n nicknameTF = new JTextField();\n nicknameTF.setPreferredSize(new Dimension(275, 30));\n nicknameTF.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n nicknameTF.setText(\"\");\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 13;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(nicknameTF, gbc);\n\n\n JLabel picLabel = new JLabel(\"Change picture (optional): \");\n picLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 14;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(picLabel, gbc);\n\n changeImageBtn = new JButton();\n ImageIcon changeImg = new ImageIcon(\"./images/jpg.png\");\n Image scaledChangeImg = changeImg.getImage().getScaledInstance(50, 50,\n Image.SCALE_AREA_AVERAGING);\n changeImageBtn.setIcon(new ImageIcon(scaledChangeImg));\n changeImageBtn.setBackground(null);\n changeImageBtn.setBorder(BorderFactory.createLineBorder(null));\n changeImageBtn.addActionListener(this);\n changeImageBtn.setToolTipText(\"Update the picture of the plant\");\n changeImageBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n changeImageBtn.setBorder(BorderFactory.createLineBorder(Color.white));\n gbc.gridx = 4;\n gbc.gridy = 14;\n gbc.weighty = 12;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n\n\n contentPanel.add(changeImageBtn, gbc);\n\n\n JLabel climateLabel = new JLabel(\"Climate: \");\n climateLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 15;\n gbc.weighty = 15;\n gbc.weightx = 2;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(climateLabel, gbc);\n\n String[] choices = {\"Inside\", \"Outside\"};\n JComboBox<String> climateMenu = new JComboBox<>(choices);\n climateMenu.setBackground(Color.white);\n climateMenu.setPreferredSize(new Dimension(275, 30));\n gbc.gridx = 4;\n gbc.gridy = 15;\n gbc.weighty = 5;\n gbc.weightx = 2;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(climateMenu, gbc);\n\n JLabel waterLabel = new JLabel(\"Interval Between Watering: \");\n waterLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 16;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(waterLabel, gbc);\n\n waterTF = new JTextField();\n waterTF.setPreferredSize(new Dimension(275, 30));\n waterTF.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n waterTF.setText(\"\");\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 16;\n gbc.weighty = 15;\n gbc.weightx = 2;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(waterTF, gbc);\n\n JLabel sizeLabel = new JLabel(\"Size (optional): \");\n sizeLabel.setToolTipText(\"This is used for our remaining days between watering estimation.\");\n sizeLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 17;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(sizeLabel, gbc);\n\n\n DefaultListModel model = new DefaultListModel();\n\n Image img1 = new ImageIcon(\"images/flower_small.png\").getImage().getScaledInstance(70, 110, Image.SCALE_SMOOTH);\n Image img2 = new ImageIcon(\"images/flower_medium.png\").getImage().getScaledInstance(80, 120, Image.SCALE_SMOOTH);\n Image img3 = new ImageIcon(\"images/flower_big.png\").getImage().getScaledInstance(90, 130, Image.SCALE_SMOOTH);\n\n model.addElement(new ImageIcon(img1));\n model.addElement(new ImageIcon(img2));\n model.addElement(new ImageIcon(img3));\n\n JList list = new JList(model);\n list.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n list.setToolTipText(\"Select an image that represents the plant size best.\");\n DefaultListCellRenderer renderer = (DefaultListCellRenderer) list.getCellRenderer();\n renderer.setHorizontalAlignment(SwingConstants.CENTER);\n\n list.setVisibleRowCount(1);\n list.setLayoutOrientation(JList.HORIZONTAL_WRAP);\n\n gbc.gridx = 4;\n gbc.gridy = 17;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.LINE_END;\n contentPanel.add(list, gbc);\n\n gbc.gridx = 4;\n gbc.gridy = 18;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n\n JTextPane tPane = new JTextPane();\n tPane.setText(\"This is used for our remaining days between watering estimation. Plants in smaller pots have less soil and will dry out faster than plants with larger pots.\");\n tPane.setEditable(false);\n StyledDocument styledDocument = tPane.getStyledDocument();\n SimpleAttributeSet center = new SimpleAttributeSet();\n StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);\n styledDocument.setParagraphAttributes(0, styledDocument.getLength(), center, false);\n contentPanel.add(tPane, gbc);\n\n JButton linkBtn = new JButton(\"(source)\");\n linkBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n linkBtn.addActionListener(e -> {\n try {\n URI url = new URI(\"https://www.thesill.com/blogs/plants-101/drink-up\");\n Desktop.getDesktop().browse(url);\n } catch (URISyntaxException | IOException exception) {\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 19;\n gbc.weighty = 0;\n gbc.weightx = 0;\n linkBtn.setBackground(null);\n linkBtn.setBorder(null);\n linkBtn.setForeground(new Color(26, 122, 169));\n contentPanel.add(linkBtn, gbc);\n\n contentPanel.setPreferredSize(new Dimension(750, 500));\n g.fill = GridBagConstraints.HORIZONTAL;\n editPanel.add(contentPanel, g);\n\n JScrollPane scrollPane = new JScrollPane(editPanel);\n add(scrollPane);\n\n }", "public void actionPerformed(ActionEvent evt){\n\t\t\t\tint save = -1;\n\t\t\t\tif(!map.getElevation().equalsIgnoreCase(\"\")){\n\t\t\t\t\tsave = JOptionPane.showConfirmDialog(null, \"Save current work?\", \"Save\", JOptionPane.YES_NO_CANCEL_OPTION);\n\t\t\t\t\tif(save != JOptionPane.CANCEL_OPTION){\n\t\t\t\t\t\tif(save == JOptionPane.YES_OPTION){\n\t\t\t\t\t\t\tsaveMap();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap.makeUniform(0);\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void setPath(){\r\n // get the reversed path\r\n ArrayList<Grid> reversedPath = new ArrayList<>();\r\n int index = _endIndex;\r\n reversedPath.add(_map.get_grid(index));\r\n while(index != _startIndex){\r\n index = _map.get_grid(index).get_parent();\r\n reversedPath.add(_map.get_grid(index));\r\n }\r\n\r\n // get the final path in the correct order\r\n int length = reversedPath.size();\r\n for(int i=length-1;i>=0;i--){\r\n _path.add(reversedPath.get(i));\r\n }\r\n }", "private void updateBoxes(){\n if(model.getMap() != null) {\n DoubleVec position = invModelToView(new DoubleVec(canvas.getWidth()*0.5,canvas.getHeight()*0.5));\n inner = new Rectangle(position, 1.0/zoomFactor * fi * canvas.getWidth(), 1.0/zoomFactor * fi * canvas.getHeight(), 0);\n outer = new Rectangle(position, 1.0/zoomFactor * fo * canvas.getWidth(), 1.0/zoomFactor * fo * canvas.getHeight(), 0);\n }\n }", "private void updateStationPositions() {\n //stations going east\n if(layout == Layout.square) {\n for (int i = 0; i < numStations; i++) {\n northbound.get(i).setPosition(i+1,2*numStations+1);\n eastbound.get(i).setPosition(0,numStations+(i+1));\n southbound.get(i).setPosition(numStations+1+i,0);\n westbound.get(i).setPosition(numStations*2+1,1+i);\n }\n }else{\n for (int i = 0; i < numStations; i++) {\n eastbound.get(i).setPosition(i,2*numStations+i);\n northbound.get(i).setPosition(numStations+i,3*numStations+i);\n southbound.get(i).setPosition(2*numStations+i,i);\n westbound.get(i).setPosition(3*numStations+i,numStations+i);\n }\n }\n\n }", "public void rotateBack() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[i][j] = tmp_grid[i][j];\n\t\t}", "Tetrisblock2()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "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 }", "void saveCurrentStation();", "public void save() { \n /*\n * Iterate over registry to pull box values\n * Creating new IOLoader for instance \n */\n for(UUID id : giftRegistry.keySet()) {\n GiftBox box = giftRegistry.get(id);\n\n String sId = id.toString();\n IOLoader<SecretSanta> config = new IOLoader<SecretSanta>(SecretSanta._this(), sId + \".yml\", \"Gifts\");\n\n FileConfiguration fCon = config.getCustomConfig();\n fCon.createSection(\"SecretSanta\");\n fCon.set(\"SecretSanta\", box.getConfig());\n\n try{\n fCon.save(config.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: \" + sId + \".yml\");\n continue;\n }\n }\n //SecretSanta._this().logDebug(\"[GiftManager] Gift Registry save successful.\");\n\n IOLoader<SecretSanta> pairedConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PairedRegistry.yml\", \"Data\");\n FileConfiguration fPaired = pairedConfig.getCustomConfig();\n fPaired.createSection(\"paired\");\n fPaired.set(\"paired\", savePairs());\n\n try{\n fPaired.save(pairedConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PairedRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PairedRegistry.yml\");\n }\n\n IOLoader<SecretSanta> playerConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PlayerRegistry.yml\", \"Data\");\n FileConfiguration fPlayer = playerConfig.getCustomConfig();\n fPlayer.createSection(\"registered\");\n fPlayer.set(\"registered\", savePlayers());\n\n try{\n fPlayer.save(playerConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PlayerRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PlayerRegistry.yml\");\n }\n\n IOLoader<SecretSanta> givenConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"GivenEmptyRegistry.yml\", \"Data\");\n FileConfiguration fGiven = givenConfig.getCustomConfig();\n fGiven.createSection(\"given\");\n fGiven.set(\"given\", saveGivens());\n\n try{\n fGiven.save(givenConfig.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: GivenEmptyRegistry.yml\");\n }\n\n SecretSanta._this().logDebug(\"[GiftManager] Saving complete.\");\n }", "private void jButtonSaveStageplaatsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveStageplaatsActionPerformed\n\n storeDisplayedStageplaats();\n \n this.dbFacade.persist((this.geselecteerdeStageplaats));\n refreshDataCache();\n refreshListbox();\n }", "public void refreshPosition() {\n\n this.setTransform(getTransform());\n }" ]
[ "0.6877454", "0.63604444", "0.5827904", "0.5771953", "0.57543796", "0.5699765", "0.56693673", "0.5662664", "0.56541157", "0.56539255", "0.56539255", "0.56105906", "0.5574456", "0.55551374", "0.5445542", "0.5398974", "0.53660786", "0.5346069", "0.5338623", "0.533796", "0.5322514", "0.5312309", "0.5294802", "0.52872026", "0.5283208", "0.52818424", "0.52626294", "0.5262608", "0.5232949", "0.52276886", "0.52235585", "0.5222507", "0.5220819", "0.51923764", "0.5191296", "0.5175799", "0.516438", "0.5142284", "0.51392317", "0.5128523", "0.51254493", "0.51139355", "0.51032203", "0.51008165", "0.5094796", "0.50751454", "0.50742877", "0.5054715", "0.5052416", "0.5051472", "0.50447166", "0.50423753", "0.5040567", "0.50365186", "0.5031952", "0.5031208", "0.50288224", "0.50281715", "0.50119025", "0.50111145", "0.50028765", "0.4997267", "0.49944952", "0.49903253", "0.49863353", "0.49822798", "0.49774626", "0.49719733", "0.49701446", "0.49667537", "0.4955339", "0.49465433", "0.4941631", "0.4937862", "0.49368006", "0.49272218", "0.49241695", "0.4920887", "0.49198794", "0.49194124", "0.49080983", "0.49080586", "0.4901382", "0.48975274", "0.48930183", "0.48881957", "0.48878124", "0.48857608", "0.48853427", "0.48835343", "0.4878308", "0.4875694", "0.48731208", "0.48706838", "0.4870169", "0.48620284", "0.48557296", "0.48546034", "0.48476055", "0.48452744" ]
0.65626204
1
saves the location of the blocks in the panelfield (relative to the rotator) while we changee the rotategrid to hold future locations
public void rotateRight(Block[][] panelField) { HashMap<Block, Point> locsaver = new HashMap<>(); Boolean rotationfinished = false; rotator.setMarked(true); Block[][] rotategrid = new Block[3][3]; rotategrid[1][1] = rotator; for (int r = 0; r < 3; r++) { for (int c = 0; c < 3; c++) { if (r == 1 && c == 1) { continue; } rotategrid[r][c] = panelField[rotator.getRow() - 1 + r][rotator.getCol() - 1 + c]; } } while (!rotationfinished) { for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { if (list.contains(rotategrid[row][col]) && !list.contains(rotategrid[col][2 - row]) && !rotategrid[row][col].isMarked()) { rotategrid[col][2 - row] = rotategrid[row][col]; rotategrid[row][col] = null; rotategrid[col][2 - row].setMarked(true); } } } rotationfinished = true; for (Block block : list) { if (block.isMarked() == false) { rotationfinished = false; break; } } } for (Block block : list) { block.setMarked(false); } // Fill the hashlist with the target coordinates of the blocks for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { if (list.contains(rotategrid[row][col])) { locsaver.put(rotategrid[row][col], new Point(rotator.getCol() - 1 + col, rotator.getRow() - 1 + row)); } } } boolean rotfinished = false; rotator.setMarked(true); while (!rotfinished) { for (Block block : list) { if (block.isMarked()) { continue; } int oldrow = block.getRow(); int oldcol = block.getCol(); Double newrow = locsaver.get(block).getY(); Double newcol = locsaver.get(block).getX(); if (panelField[newrow.intValue()][newcol.intValue()] == null) { panelField[newrow.intValue()][newcol.intValue()] = panelField[oldrow][oldcol]; panelField[oldrow][oldcol] = null; panelField[newrow.intValue()][newcol.intValue()].setMarked(true); panelField[newrow.intValue()][newcol.intValue()].setRow(newrow.intValue()); panelField[newrow.intValue()][newcol.intValue()].setCol(newcol.intValue()); } } rotfinished = true; for (Block block : list) { if (block.isMarked() == false) { rotfinished = false; break; } } } for (Block block : list) { block.setMarked(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rotateLeft(Block[][] panelField) {\n\t\tHashMap<Block, Point> locsaver = new HashMap<>();\n\n\t\tBoolean rotationfinished = false;\n\t\trotator.setMarked(true);\n\n\t\tBlock[][] rotategrid = new Block[3][3];\n\t\trotategrid[1][1] = rotator;\n\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (r == 1 && c == 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\trotategrid[r][c] = panelField[rotator.getRow() - 1 + r][rotator.getCol() - 1 + c];\n\t\t\t}\n\t\t}\n\n\t\twhile (!rotationfinished) {\n\t\t\tfor (int row = 0; row < 3; row++) {\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t\tif (list.contains(rotategrid[row][col]) && !list.contains(rotategrid[2 - col][row])\n\t\t\t\t\t\t\t&& !rotategrid[row][col].isMarked()) {\n\t\t\t\t\t\trotategrid[2 - col][row] = rotategrid[row][col];\n\t\t\t\t\t\trotategrid[row][col] = null;\n\t\t\t\t\t\trotategrid[2 - col][row].setMarked(true);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trotationfinished = true;\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked() == false) {\n\t\t\t\t\trotationfinished = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tfor (Block block : list) {\n\t\t\tblock.setMarked(false);\n\t\t}\n\n\t\t// Fill the hashlist with the target coordinates of the blocks\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\tif (list.contains(rotategrid[row][col])) {\n\t\t\t\t\tlocsaver.put(rotategrid[row][col],\n\t\t\t\t\t\t\tnew Point(rotator.getCol() - 1 + col, rotator.getRow() - 1 + row));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tboolean rotfinished = false;\n\t\trotator.setMarked(true);\n\n\t\twhile (!rotfinished) {\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tint oldrow = block.getRow();\n\t\t\t\tint oldcol = block.getCol();\n\t\t\t\tDouble newrow = locsaver.get(block).getY();\n\t\t\t\tDouble newcol = locsaver.get(block).getX();\n\t\t\t\tif (panelField[newrow.intValue()][newcol.intValue()] == null) {\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()] = panelField[oldrow][oldcol];\n\t\t\t\t\tpanelField[oldrow][oldcol] = null;\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setMarked(true);\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setRow(newrow.intValue());\n\t\t\t\t\tpanelField[newrow.intValue()][newcol.intValue()].setCol(newcol.intValue());\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trotfinished = true;\n\n\t\t\tfor (Block block : list) {\n\t\t\t\tif (block.isMarked() == false) {\n\t\t\t\t\trotfinished = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (Block block : list) {\n\t\t\tblock.setMarked(false);\n\t\t}\n\n\t}", "private void save() {\n Tile[][] field = gameController.grid.field;\n Tile[][] undoField = gameController.grid.undoField;\n// SharedPreferenceUtil.put(this, SpConstant.WIDTH, field.length);\n// SharedPreferenceUtil.put(this, SpConstant.HEIGHT, field.length);\n for (int xx = 0; xx < field.length; xx++) {\n for (int yy = 0; yy < field[0].length; yy++) {\n if (field[xx][yy] != null) {\n SharedPreferenceUtil.put(this, xx + \"_\" + yy, field[xx][yy].getValue());\n } else {\n SharedPreferenceUtil.put(this, xx + \"_\" + yy, 0);\n }\n\n if (undoField[xx][yy] != null) {\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GRID + xx + \"_\" + yy, undoField[xx][yy].getValue());\n } else {\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GRID + xx + \"_\" + yy, 0);\n }\n }\n }\n SharedPreferenceUtil.put(this, SpConstant.SCORE, gameController.currentScore);\n SharedPreferenceUtil.put(this, SpConstant.HIGH_SCORE_TEMP, gameController.historyHighScore);\n SharedPreferenceUtil.put(this, SpConstant.UNDO_SCORE, gameController.lastScore);\n SharedPreferenceUtil.put(this, SpConstant.CAN_UNDO, gameController.canUndo);\n SharedPreferenceUtil.put(this, SpConstant.GAME_STATE, gameController.gameState);\n SharedPreferenceUtil.put(this, SpConstant.UNDO_GAME_STATE, gameController.lastGameState);\n SharedPreferenceUtil.put(this, SpConstant.AUDIO_ENABLED, gameController.isAudioEnabled);\n }", "public ProtectedCuboidRegion saveRegion() {\n\t\t\n\t\tcom.sk89q.worldedit.BlockVector pos1 = \n\t\t\t\tnew com.sk89q.worldedit.BlockVector(position1.getBlockX(), position1.getBlockY(), position1.getBlockZ());\n\t\tcom.sk89q.worldedit.BlockVector pos2 =\n\t\t\t\tnew com.sk89q.worldedit.BlockVector(position2.getBlockX(), position2.getBlockY(), position2.getBlockZ());\n\t\t\n\t\tplayer.sendMessage(\"\" + name + position1.toString() + position2.toString());\n\t\t\n\t\tProtectedCuboidRegion newPlotRegion = new ProtectedCuboidRegion(name, pos1, pos2);\n\t\t\n\t\tRegionManager regionManager = Mcc.worldGuard.getRegionManager(player.getWorld());\n\t\tregionManager.addRegion(newPlotRegion);\n\t\tnewPlotRegion = (ProtectedCuboidRegion) regionManager.getRegion(name);\n\t\t\n\t\tnewPlotRegion.setPriority(2);\n\t\ttry {\n\t\t\tregionManager.save();\n\t\t} catch (ProtectionDatabaseException e) {\n\t\t\tplayer.sendMessage(ChatColor.RED + \"Critical World Guard error! Notify Funonly\");\n\t\t}\n\t\t\n\t\treturn newPlotRegion;\n\t}", "@Override\n\tpublic void setOffsetBackToFile() {\n\t\tString newXString;\n\t\tString newYString;\n\t\t newXString = String.valueOf(getX().getValueInSpecifiedUnits())+getX().getUserUnit();\n\t newYString = String.valueOf(getY().getValueInSpecifiedUnits())+getY().getUserUnit();\n\t\tjc.getElement().setAttribute(\"x\", newXString);\n\t\tjc.getElement().setAttribute(\"y\", newYString);\n\t\ttry {\n\t\t\tjc.getView().getFrame().writeFile();\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 recordLocation(){\n\t\tg2d.setColor(Color.blue);\n\t\n int x = (int)(sd.getLocationX() * scale) + width/2;\n int y = (int)(sd.getLocationY() * scale) + height/2;\n g2d.fillRect(x,y,8,8);\n\t\n\t}", "public int saveBlocks() {\n \t\tint noOfSavedBlocks = 0;\n \t\tint x = 0;\n \t\tint y = 0;\n \t\tint z = 0;\n \t\ttry {\n \t\t\tif(hasTwoCorners()) {\n \t\t\t\tthis.setBlockTypes(new int[getSizeX()][getSizeY()][getSizeZ()]);\n \t\t\t\tthis.setBlockDatas(new byte[getSizeX()][getSizeY()][getSizeZ()]);\n \t\t\t\tthis.getSignLines().clear();\n \t\t\t\tthis.getInvBlockContents().clear();\n \t\t\t\tx = getMinX();\n \t\t\t\tfor(int i = 0; i < getSizeX(); i++){\n \t\t\t\t\ty = getMinY();\n \t\t\t\t\tfor(int j = 0; j < getSizeY(); j++){\n \t\t\t\t\t\tz = getMinZ();\n \t\t\t\t\t\tfor(int k = 0;k < getSizeZ(); k++) {\n \t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\tBlock block = getWorld().getBlockAt(x, y, z);\n \t\t\t\t\t\t\t\tthis.getBlockTypes()[i][j][k] = block.getTypeId();\n \t\t\t\t\t\t\t\tthis.getBlockDatas()[i][j][k] = block.getData();\n \t\t\t\t\t\t\t\tBlockState state = block.getState();\n \t\t\t\t\t\t\t\tif(state instanceof Sign) {\n \t\t\t\t\t\t\t\t\t// Signs\n \t\t\t\t\t\t\t\t\tSign sign = (Sign)state;\n \t\t\t\t\t\t\t\t\tif(sign.getLines() != null) {\n \t\t\t\t\t\t\t\t\t\tthis.getSignLines().put(\"sign-\" + i + \"-\" + j + \"-\" + k, sign.getLines());\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t} else if(state instanceof Chest) {\n \t\t\t\t\t\t\t\t\t// Chests\n \t\t\t\t\t\t\t\t\tChest chest = (Chest)state;\n \t\t\t\t\t\t\t\t\tInventory inv = chest.getInventory();\n \t\t\t\t\t\t\t\t\tint size = inv.getSize();\n \t\t\t\t\t\t\t\t\tList<ItemStack> items = new ArrayList<ItemStack>();\n \t\t\t\t\t\t\t\t\tfor(int invIndex = 0; invIndex < size; invIndex++){\n \t\t\t\t\t\t\t\t\t\tItemStack item = inv.getItem(invIndex);\n \t\t\t\t\t\t\t\t\t\tif(item != null && item.getType().getId() != Material.AIR.getId()) {\n \t\t\t\t\t\t\t\t\t\t\titems.add(item);\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\tthis.getInvBlockContents().put(\"chest-\" + i + \"-\" + j + \"-\" + k, items);\n \t\t\t\t\t\t\t\t} else if(state instanceof Dispenser) {\n \t\t\t\t\t\t\t\t\t// Dispensers\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\tDispenser dispenser = (Dispenser)state;\n \t\t\t\t\t\t\t\t\tInventory inv = dispenser.getInventory();\n \t\t\t\t\t\t\t\t\tint size = inv.getSize();\n \t\t\t\t\t\t\t\t\tList<ItemStack> items = new ArrayList<ItemStack>();\n \t\t\t\t\t\t\t\t\tfor(int invIndex = 0; invIndex < size; invIndex++){\n \t\t\t\t\t\t\t\t\t\tItemStack item = inv.getItem(invIndex);\n \t\t\t\t\t\t\t\t\t\tif(item != null && item.getType().getId() != Material.AIR.getId()) {\n \t\t\t\t\t\t\t\t\t\t\titems.add(item);\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\tthis.getInvBlockContents().put(\"dispenser-\" + i + \"-\" + j + \"-\" + k, items);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tnoOfSavedBlocks++;\n \t\t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\t\tthis.getWar().getLogger().warning(\"Failed to save block in volume \" + getName() + \". Saved blocks so far:\" + noOfSavedBlocks \n \t\t\t\t\t\t\t\t\t\t+ \". Error at x:\" + x + \" y:\" + y + \" z:\" + z + \". Exception:\" + e.getClass().toString() + e.getMessage());\n \t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t} finally {\n \t\t\t\t\t\t\t\tz++;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t\ty++;\n \t\t\t\t\t}\n \t\t\t\t\tx++;\n \t\t\t\t}\n \t\t\t}\t\t\n \t\t} catch (Exception e) {\n \t\t\tthis.getWar().getLogger().warning(\"Failed to save volume \" + getName() + \" blocks. Saved blocks:\" + noOfSavedBlocks \n \t\t\t\t\t+ \". Error at x:\" + x + \" y:\" + y + \" z:\" + z + \". Exception:\" + e.getClass().toString() + \" \"+ e.getMessage());\n \t\t\te.printStackTrace();\n \t\t}\n \t\treturn noOfSavedBlocks;\n \t}", "public void save() {\n\n\t\tint[][] rawData = new int[2][CHUNK_SIZE * CHUNK_SIZE];\n\n\t\tfor (int l = 0; l < 2; l++) {\n\t\t\tLayer layer = Layer.get(l);\n\t\t\tfor (int y = 0; y < CHUNK_SIZE; y++) {\n\t\t\t\tfor (int x = 0; x < CHUNK_SIZE; x++) {\n\t\t\t\t\trawData[l][x + y * CHUNK_SIZE] = getTileId(layer, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.saveData = new RawChunkData(rawData);\n\t}", "public void saveGridToESRI() {\n\t\tRectangle rect = grid.getBounds();\n\t\tMapProjection proj = grid.getProjection();\n\n\t\tdouble minLon = proj.getRefXY(rect.x, rect.y).getX();\n\t\tdouble minLat = proj.getRefXY(rect.x, rect.getMaxY()).getY();\n\n\t\tdouble maxLon = proj.getRefXY(rect.getMaxX(), rect.y).getX();\n\t\tdouble maxLat = proj.getRefXY(rect.x, rect.y).getY();\n\n\t\tdouble dLon = maxLon - minLon;\n\t\tdouble dLat = maxLat - minLat;\n\n\t\t// if second x is wrapped\n\t\tif ((int) Math.rint(proj.getMapXY(maxLon, 0).getX()) !=\n\t\t\t(int) Math.rint(rect.getMaxX()))\n\t\t\t// if first x is NOT wrapped\n\t\t\tif ((int) Math.rint(proj.getMapXY(minLon, 0).getX()) ==\n\t\t\t\t(int) Math.rint(rect.x))\n\t\t\t\tdLon += 360;\n\n\t\tint nCols = rect.width;\n\t\tint nRows = (int) (nCols * dLat / dLon);\n\n\t\tdouble cell_size = dLon / nCols;\n\n\t\tFile file = new File(\"untitled\" + MapTools.saveCount++);\n\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tJLabel label = new JLabel(\"Save \" + nCols + \" by \" + nRows + \" grid in ESRI format as?\");\n\t\tpanel.add( label , BorderLayout.NORTH);\n\n\t\tJPanel p2 = new JPanel(new GridLayout(0,1));\n\t\tButtonGroup bg = new ButtonGroup();\n\t\tJRadioButton b = new JRadioButton(\"ASCII\", true);\n\t\tbg.add(b);\n\t\tp2.add(b);\n\t\tfinal JRadioButton b2 = new JRadioButton(\"Binary\");\n\t\tbg.add(b2);\n\t\tp2.add(b2);\n\t\tpanel.add(p2);\n\n\t\tint s = JOptionPane.showConfirmDialog( map.getTopLevelAncestor(), panel, \"Save grid\", JOptionPane.OK_CANCEL_OPTION);\n\t\t// Close on cancel\n\t\tif(s == JOptionPane.CANCEL_OPTION) {\n\t\t\treturn;\n\t\t}\n\n\t\tJFileChooser chooser = MapApp.getFileChooser();\n\t\tchooser.setSelectedFile(file);\n\t\tchooser.setFileFilter(null);\n\t\tint confirm = JOptionPane.NO_OPTION;\n\n\t\twhile (confirm == JOptionPane.NO_OPTION) {\n\t\t\tint ok = chooser.showSaveDialog(map.getTopLevelAncestor());\n\t\t\tif (ok == chooser.CANCEL_OPTION)\n\t\t\t\treturn;\n\t\t\t// append .asc to file if save as ESRI ascii is choosen \n\t\t\tfile = chooser.getSelectedFile();\n\t\t\tif ( !file.getName().endsWith(\".asc\") && !b2.isSelected()) {\n\t\t\t\tfile = new File(file.getPath() + \".asc\");\n\t\t\t}\n\n\t\t\tif (file.exists()) {\n\t\t\t\tconfirm = JOptionPane.showConfirmDialog(map.getTopLevelAncestor(), \"File exists, Overwrite?\");\n\t\t\t\tif (confirm == JOptionPane.CANCEL_OPTION) return;\n\t\t\t}\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfinal File saveTo = file;\n\t\tfinal int cols = nCols;\n\t\tfinal int rows = nRows;\n\t\tfinal double mLon = minLon;\n\t\tfinal double mLat = minLat;\n\t\tfinal double c_size = cell_size;\n\n\t\t((MapApp) map.getApp()).addProcessingTask(\"Saving Grid...\", new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tif (b2.isSelected())\n\t\t\t\t\t\tsaveGridToESRI_Bin(saveTo, cols, rows, mLon, mLat, c_size);\n\t\t\t\t\telse\n\t\t\t\t\t\tsaveGridToESRI_ASCII(saveTo, cols, rows, mLon, mLat, c_size);\n\t\t\t\t} catch(Exception ex) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(map.getTopLevelAncestor(),\n\t\t\t\t\t\t\t\t\"an error occurred during this operation:\\t\"\n\t\t\t\t\t\t\t\t+ \" \"+ ex.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "@Override\n\tpublic void posSave() {\n\t\t\n\t}", "private void saveDividerLocations() {\n GuiDisplayUtil.saveCurrentBoundsToPrefs();\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_1, this.jSplitPane1.getDividerLocation());\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_2, this.jSplitPaneTables.getDividerLocation());\n GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_3, chatPanelMain.getSplitDividerLocation());\n }", "private void setWorldCoordinatesFromFields() {\n if (trackerPanel == null) return;\n OffsetOriginStep step = (OffsetOriginStep) getStep(trackerPanel.getFrameNumber());\n boolean different = step.worldX != xField.getValue() || step.worldY != yField.getValue();\n if (different) {\n XMLControl trackControl = new XMLControlElement(this);\n XMLControl coordsControl = new XMLControlElement(trackerPanel.getCoords());\n step.setWorldXY(xField.getValue(), yField.getValue());\n step.getPosition().showCoordinates(trackerPanel);\n Undo.postTrackAndCoordsEdit(this, trackControl, coordsControl);\n }\n }", "void storeValues(int posx, int posy, int piece) {\n\t\tprevPosX = posx;\n\t\tprevPosY = posy;\n\t\tprevName = \"\" + prevPosX + \"\" + prevPosY;\n\t\tprevComp = (JLabel) curComp;\n\t\tprevPiece = piece;\n\t\tpiece = Logic.arr[posx][posy];\n\t}", "@Override\n\tpublic void saveBlocks() {\n\t\tint saved = 0;\n\t\ttry {\n\t\t\tsaved = ZoneVolumeMapper.saveZoneBlocksAndEntities(this, this.zone.getName());\n\t\t} catch (SQLException ex) {\n\t\t\tWar.war.log(\"Failed to save warzone \" + zone.getName() + \": \" + ex.getMessage(), Level.WARNING);\n\t\t\tex.printStackTrace();\n\t\t}\n\t\tWar.war.log(\"Saved \" + saved + \" blocks in warzone \" + this.zone.getName() + \".\", java.util.logging.Level.INFO);\n\t\tthis.isSaved = true;\n\t}", "public void save() {\r\n IniReader.write(FILE_NAME, \"x\", x, \"y\", y, \"fullscreen\", fullscreen, \"controlType\", controlType, \"vol\", volMul,\r\n \"keyUpMouse\", getKeyUpMouseName(), \"keyDownMouse\", getKeyDownMouseName(), \"keyUp\", getKeyUpName(), \"keyDown\", keyDownName,\r\n \"keyLeft\", keyLeftName, \"keyRight\", keyRightName, \"keyShoot\", keyShootName, \"keyShoot2\", getKeyShoot2Name(),\r\n \"keyAbility\", getKeyAbilityName(), \"keyEscape\", getKeyEscapeName(), \"keyMap\", keyMapName, \"keyInventory\", keyInventoryName,\r\n \"keyTalk\", getKeyTalkName(), \"keyPause\", getKeyPauseName(), \"keyDrop\", getKeyDropName(), \"keySellMenu\", getKeySellMenuName(),\r\n \"keyBuyMenu\", getKeyBuyMenuName(), \"keyChangeShipMenu\", getKeyChangeShipMenuName(), \"keyHireShipMenu\", getKeyHireShipMenuName());\r\n }", "private void saveLocation()\n {\n willLocationBeSaved = !willLocationBeSaved;\n }", "public void saveState() {\n savedPen.setValues(pm.pen);\n }", "private void saveValues() {\r\n this.pl_expert.setParam(\"displayNodeDegree\", (String) this.nodeDegreeSpinner.getValue());\r\n this.pl_expert.setParam(\"displayEdges\", (String) this.displayEdgesSpinner.getValue());\r\n this.pl_expert.setParam(\"scale\", (String) this.scaleSpinner.getValue());\r\n this.pl_expert.setParam(\"minWeight\", (String) this.minweightSpinner.getValue());\r\n this.pl_expert.setParam(\"iterations\", (String) this.iterationsSpinner.getValue());\r\n this.pl_expert.setParam(\"mutationParameter\", this.mutationParameter.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"Update_param\", this.Update_param.getSelection().getActionCommand());\r\n this.pl_expert.setParam(\"vote_value\", (String) this.vote_value.getValue());\r\n this.pl_expert.setParam(\"keep_value\", (String) this.keep_value.getValue());\r\n this.pl_expert.setParam(\"mut_value\", (String) this.mut_value.getValue());\r\n this.pl_expert.setParam(\"only_sub\", new Boolean(this.only_sub.isSelected()).toString());\r\n\r\n this.is_alg_started = false;\r\n }", "@Override protected Parcelable onSaveInstanceState() {\n Parcelable superState = super.onSaveInstanceState();\n SavedState ss = new SavedState(superState);\n ss.rotated = rotated;\n ss.totalSpacingDegree = totalSpacingDegree;\n ss.satelliteDistance = satelliteDistance;\n ss.measureDiff = measureDiff;\n ss.expandDuration = expandDuration;\n ss.closeItemsOnClick = closeItemsOnClick;\n return ss;\n }", "private void buildPanelEast() {\n\r\n }", "protected void refresh() {\r\n // Toggle attached direction.\r\n org.bukkit.material.Sign material = new org.bukkit.material.Sign(this.getBlock().getType());\r\n material.setData(this.getSignMaterial().getData());\r\n \r\n material.setFacingDirection(material.getAttachedFace());\r\n this.getBlock().setData(material.getData());\r\n \r\n material.setFacingDirection(material.getAttachedFace());\r\n this.getBlock().setData(material.getData());\r\n }", "private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }", "private void saveMove(){\n\t\tpreviousTile=monster.currentTile;\r\n\t}", "public void actualiza(){\r\n //pregunto si se presiono una tecla de dirección\r\n if(bTecla) {\r\n int iX = basPrincipal.getX();\r\n int iY = basPrincipal.getY();\r\n if(iDir == 1) {\r\n iY -= getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 2) {\r\n iX += getWidth() / iMAXANCHO;\r\n }\r\n if(iDir == 3) {\r\n iY += getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 4) {\r\n iX -= getWidth() / iMAXANCHO;\r\n }\r\n //limpio la bandera\r\n bTecla = false;\r\n \r\n //asigno posiciones en caso de no salirme\r\n if(iX >= 0 && iY >= 0 && iX + basPrincipal.getAncho() <= getWidth()\r\n && iY + basPrincipal.getAlto() <= getHeight()) {\r\n basPrincipal.setX(iX);\r\n basPrincipal.setY(iY);\r\n } \r\n }\r\n \r\n //Muevo los chimpys\r\n for(Base basChimpy : lklChimpys) {\r\n basChimpy.setX(basChimpy.getX() - iAceleracion);\r\n }\r\n \r\n //Muevo los diddys\r\n for(Base basDiddy : lklDiddys) {\r\n basDiddy.setX(basDiddy.getX() + iAceleracion);\r\n }\r\n\r\n }", "public void saveState() {\n mementos = new ArrayList<>(mementos.subList(0, statePointer + 1));\n Notebook notebookToAdd = new Notebook(this.notebook);\n notebookToAdd.setCurrentClassroom(this.notebook.getCurrentClassroom());\n Memento mementoToAdd = new Memento(notebookToAdd);\n mementos.add(mementoToAdd);\n statePointer++;\n }", "private void drawNewDrawPanel(final Integer blkSize) {\n\t\tfrmNewBlock = new JFrame();\n\t\tfrmNewBlock.setPreferredSize(new Dimension(750, 700));\n\t\tfrmNewBlock.setTitle(\"New Block\");\n\t\tfrmNewBlock.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\tfrmNewBlock.pack();\n\t\tfrmNewBlock.setVisible(true);\n\n\t\tcontrolPanel = new JPanel();\n\t\tcontrolPanel.setLayout(new MigLayout(\"\", \"[100][15][3][287][287][3]\",\n\t\t\t\t\"[][12.00][25][25][25][500][][]\"));\n\n\t\tRuler ruler = new Ruler(blkSize);\n\t\tcontrolPanel.add(ruler, \"cell 2 0 4 6\");\n\n\t\tbuttonGroup = new ButtonGroup();\n\n\t\tbtnNew = new JButton(\"Start New Block\");\n\t\tbuttonGroup.add(btnNew);\n\t\tbtnNew.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew NewBlockFrame();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnNew, \"cell 0 2\");\n\n\t\tbtnReset = new JButton(\"Reset Block\");\n\t\tbuttonGroup.add(btnReset);\n\t\tbtnReset.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tcontrolPanel.repaint();\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnReset, \"cell 0 3,growx\");\n\n\t/*\tbtnUndo = new JButton(\"Undo Last\");\n\t\tbuttonGroup.add(btnUndo);\n\t\tbtnUndo.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tblkLines = DrawPiece.getBlkLines();\n\t\t\t\tblkLines = DrawPiece.removeBlkLine(blkLines);\n\t\t\t\truler.repaint();\n\t\t\t\truler.add(new DrawBlock(blkLines));\n\t\t\t\truler.repaint();\n\t\t\t\t\n\t\t\t\t\t*/\t\t\t\t\t\t\n\n//\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t.getGraphics();\n//\n//\t\t\t\tThread myThread = new Thread() {\n//\n//\t\t\t\t\tpublic void run() {\n//\t\t\t\t\t\tGraphics2D g2 = (Graphics2D) drawPiece.drawPieceSingleton\n//\t\t\t\t\t\t\t\t.getGraphics();\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tdrawPiece.redrawBlkLines(g2, blkLines);\t\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t}\n//\n//\t\t\t\t};\n//\t\t\t\tmyThread.start();\n//\n//\t\t\t\tg2.setColor(Color.RED);\n//\n//\t\t\t}\n//\t});\n//\t\tcontrolPanel.add(btnUndo, \"cell 3 6,alignx left\");\n\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbuttonGroup.add(btnSave);\n\t\tbtnSave.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tRandom rand = new Random();\n\t\t\t\tString blkName = JOptionPane.showInputDialog(\"Please enter \"\n\t\t\t\t\t\t+ \"a name for the block: \");\n\t\t\t\tint id = (int)QuiltPad.blockRepository.count() + 1;\n\t\t\t\tint uPieces = rand.nextInt(12) + 1;\n\t\t\t\tBlock block = new Block(id, blkName, blkSize, uPieces, blkLines);\n\t\t\t\tQuiltPad.blockRepository.save(block);\n\t\t\t\tfrmNewBlock.dispose();\n\t\t\t\tnew BlockFrame();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tcontrolPanel.add(btnSave, \"cell 4 6,alignx right\");\n\t\t\n\t\tfrmNewBlock.getContentPane().add(controlPanel);\n\n\t}", "public void writeback(){\r\n \tthis.settings.genChainLength = Integer.parseInt(genChainLengthField.getText());\r\n \tthis.settings.genChainLengthFlux = Integer.parseInt(genChainLengthFluxField.getText());\r\n \tthis.settings.stepGenDistance = Integer.parseInt(stepGenDistanceField.getText());\r\n \tthis.settings.rows = Integer.parseInt(rowsField.getText());\r\n \tthis.settings.cols = Integer.parseInt(colsField.getText());\r\n \tthis.settings.cellWidth = Integer.parseInt(cellWidthField.getText());\r\n \tthis.settings.startRow = Integer.parseInt(startRowField.getText());\r\n \tthis.settings.startCol = Integer.parseInt(startColField.getText());\r\n \tthis.settings.endRow = Integer.parseInt(endRowField.getText());\r\n \tthis.settings.endCol = Integer.parseInt(endColField.getText());\r\n \tthis.settings.progRevealRadius = Integer.parseInt(progRevealRadiusField.getText());\r\n \tthis.settings.progDraw = progDrawCB.isSelected();\r\n \tthis.settings.progDrawSpeed = Integer.parseInt(progDrawSpeedField.getText());\r\n }", "public void generateElement(Block[][] panelField) {\n\t\tswitch (type) {\n\n\t\tcase 0:\n\t\t\tfor (int col = 3; col < 7; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(0);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 5) {\n\t\t\t\t\trotator = panelField[1][5];\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(1);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][3] = new Block(0, 3);\n\t\t\tpanelField[0][3].setType(1);\n\t\t\tlist.add(panelField[0][3]);\n\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(2);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][5] = new Block(0, 5);\n\t\t\tpanelField[0][5].setType(2);\n\t\t\tlist.add(panelField[0][5]);\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tfor (int row = 0; row < 2; row++) {\n\t\t\t\t\tpanelField[row][col] = new Block(row, col);\n\t\t\t\t\tpanelField[row][col].setType(3);\n\t\t\t\t\tlist.add(panelField[row][col]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 4:\n\t\t\tfor (int col = 3; col < 5; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(4);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tpanelField[0][col] = new Block(0, col);\n\t\t\t\tpanelField[0][col].setType(4);\n\t\t\t\tlist.add(panelField[0][col]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\tfor (int col = 3; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(5);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpanelField[0][4] = new Block(0, 4);\n\t\t\tpanelField[0][4].setType(5);\n\t\t\tlist.add(panelField[0][4]);\n\t\t\tbreak;\n\n\t\tcase 6:\n\t\t\tfor (int col = 4; col < 6; col++) {\n\t\t\t\tpanelField[1][col] = new Block(1, col);\n\t\t\t\tpanelField[1][col].setType(6);\n\t\t\t\tlist.add(panelField[1][col]);\n\t\t\t\tif (col == 4) {\n\t\t\t\t\trotator = panelField[1][4];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int col = 3; col < 5; col++) {\n\t\t\t\tpanelField[0][col] = new Block(0, col);\n\t\t\t\tpanelField[0][col].setType(6);\n\t\t\t\tlist.add(panelField[0][col]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "@Override\n public void setDisplayedLocation(Location loc) {\n pane.setVvalue(loc.getyCoord());\n pane.setHvalue(loc.getxCoord());\n setCurrentFloor(loc.getLevel());\n displayedLocation = getDisplayedLocation();\n }", "public void saveSettings() {\n try {\n Settings.setDegausserPort((String) this.demagnetizerPort.getSelectedItem());\n Settings.setDegausserDelay(((Number) this.demagDelay.getSelectedItem()).intValue());\n Settings.setDegausserRamp(((Number) this.demagRamp.getSelectedItem()).intValue());\n Settings.setDegausserMaximumField(((Number) this.maximumField.getValue()).doubleValue());\n Settings.setHandlerPort((String) this.handlerPort.getSelectedItem());\n Settings.setHandlerAcceleration(((Number) this.acceleration.getValue()).intValue());\n Settings.setHandlerAxialAFPosition(((Number) this.axialAFPosition.getValue()).intValue());\n Settings.setHandlerBackgroundPosition(((Number) this.backgroundPosition.getValue()).intValue());\n Settings.setHandlerDeceleration(((Number) this.deceleration.getValue()).intValue());\n Settings.setHandlerMeasurementPosition(((Number) this.measurementPosition.getValue()).intValue());\n Settings.setHandlerMeasurementVelocity(((Number) this.measurementVelocity.getValue()).intValue());\n Settings.setHandlerRotation(((Number) this.rotation.getValue()).intValue());\n Settings.setHandlerSampleLoadPosition(((Number) this.sampleLoadPosition.getValue()).intValue());\n Settings.setHandlerTransverseYAFPosition(((Number) this.transverseYAFPosition.getValue()).intValue());\n Settings.setHandlerVelocity(((Number) this.velocity.getValue()).intValue());\n Settings.setHandlerRotationVelocity(((Number) this.rotationVelocity.getValue()).intValue());\n Settings.setHandlerRotationDeceleration(((Number) this.rotationDec.getValue()).intValue());\n Settings.setHandlerRotationAcceleration(((Number) this.rotationAcc.getValue()).intValue());\n\n Settings.setMagnetometerPort((String) this.magnetometerPort.getSelectedItem());\n Settings.setMagnetometerXAxisCalibration(((Number) this.xAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerYAxisCalibration(((Number) this.yAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerZAxisCalibration(((Number) this.zAxisCalibration.getValue()).doubleValue());\n creator.setVisible(false);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public MapEditor() throws LWJGLException {\n // TODO: Comment me\n setMinimumSize(new Dimension(1024, 800));\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setBounds(100, 100, 800, 796);\n contentPane = new JPanel();\n contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n setContentPane(contentPane);\n contentPane.setLayout(new MigLayout(\"\", \"[grow][grow]\",\n \"[][][603.00,grow,baseline]\"));\n \n // TODO: Comment me\n JToolBar toolBar = new JToolBar();\n toolBar.setBorder(UIManager.getBorder(\"ToolBar.border\"));\n contentPane.add(toolBar, \"flowx,cell 0 0 2 1,growx\");\n \n // TODO: Comment me\n JButton btnSave = new JButton(\"\");\n btnSave.setIcon(new ImageIcon(\"res/save.png\"));\n btnSave.setToolTipText(\"Save\");\n btnSave.setBorder(null);\n toolBar.add(btnSave);\n \n // TODO: Comment me\n Component horizontalStrut = Box.createHorizontalStrut(20);\n horizontalStrut.setMaximumSize(new Dimension(5, 32767));\n horizontalStrut.setPreferredSize(new Dimension(5, 0));\n horizontalStrut.setMinimumSize(new Dimension(5, 0));\n toolBar.add(horizontalStrut);\n \n // TODO: Comment me\n JButton btnLoad = new JButton(\"\");\n btnLoad.setBorder(null);\n btnLoad.setToolTipText(\"Load\");\n btnLoad.setIcon(new ImageIcon(\"res/load.png\"));\n toolBar.add(btnLoad);\n \n // TODO: Comment me\n Component horizontalStrut_1 = Box.createHorizontalStrut(20);\n toolBar.add(horizontalStrut_1);\n \n // TODO: Comment me\n JButton btnExport = new JButton(\"\");\n btnExport.setBorder(null);\n btnExport.setIcon(new ImageIcon(\"res/export.png\"));\n btnExport.setToolTipText(\"Export\");\n toolBar.add(btnExport);\n \n // TODO: Comment me\n Component horizontalStrut_2 = Box.createHorizontalStrut(20);\n toolBar.add(horizontalStrut_2);\n \n // TODO: Comment me\n JButton btnUndo = new JButton(\"\");\n btnUndo.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n currentTab.getEditorCanvas().undo();\n }\n });\n btnUndo.setBorder(null);\n btnUndo.setToolTipText(\"Undo\");\n btnUndo.setIcon(new ImageIcon(\"res/undo.png\"));\n toolBar.add(btnUndo);\n \n // TODO: Comment me\n Component horizontalStrut_3 = Box.createHorizontalStrut(20);\n horizontalStrut_3.setPreferredSize(new Dimension(5, 0));\n horizontalStrut_3.setMinimumSize(new Dimension(5, 0));\n horizontalStrut_3.setMaximumSize(new Dimension(5, 32767));\n toolBar.add(horizontalStrut_3);\n \n // TODO: Comment me\n JButton btnRedo = new JButton(\"\");\n btnRedo.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n currentTab.getEditorCanvas().redo();\n }\n });\n btnRedo.setBorder(null);\n btnRedo.setIcon(new ImageIcon(\"res/redo.png\"));\n btnRedo.setToolTipText(\"Redo\");\n toolBar.add(btnRedo);\n\n // TODO: Comment me\n JPanel toolboxPanel = new JPanel();\n toolboxPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n contentPane.add(toolboxPanel, \"cell 0 1 2 1,grow\");\n toolboxPanel.setLayout(new MigLayout(\"\", \"[666px,grow]\", \"[122px]\"));\n Toolbox toolbox = new Toolbox();\n toolboxPanel.add(toolbox, \"cell 0 0,growx,aligny top\");\n\n // TODO: Comment me\n JPanel map2dPanel = new JPanel();\n map2dPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\n map2dPanel.setBorder(new TitledBorder(null, \"2D Map\",\n TitledBorder.LEADING, TitledBorder.TOP, null,\n null));\n map2dPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n map2dPanel.setLayout(new MigLayout(\"\", \"[19px,grow,fill]\",\n \"[19px,grow,fill]\"));\n Map2D map2d = new Map2D();\n map2dPanel.add(map2d, \"cell 0 0,alignx left,aligny top\");\n contentPane.add(map2dPanel, \"cell 0 2,grow\");\n\n // TODO: Comment me.\n btnSave.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n map2d.save();\n }\n });\n \n // TODO: Comment me.\n btnLoad.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n map2d.load();\n }\n });\n\n // TODO: Comment me\n JPanel map3dPanel = new JPanel();\n map3dPanel.setBorder(new TitledBorder(null, \"3D Map\",\n TitledBorder.LEADING, TitledBorder.TOP, null,\n null));\n map3dPanel.setBackground(UIManager.getColor(\"Panel.background\"));\n map3dPanel.setLayout(new MigLayout(\"\", \"[10px,grow]\", \"[10px,grow][]\"));\n map3dPanel.add(new Map3D(), \"cell 0 0,grow\");\n contentPane.add(map3dPanel, \"cell 1 2 1 2,grow\");\n }", "private void createFinalLine() {\n //Up\n if (orOpActive.row > origin.row) {\n for (int i = origin.row + 1; i <= orOpActive.row; i++) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n\n //Down\n if (orOpActive.row < origin.row) {\n for (int i = origin.row - 1; i >= orOpActive.row; i--) {\n game.gridMap.get(i).get(origin.column).setState(game.STATE_FINAL);\n //setState(gridMap.get(i).get(origin.column), STATE_FINAL);\n }\n }\n //Right\n if (orOpActive.column > origin.column) {\n for (int i = origin.column + 1; i <= orOpActive.column; i++) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n //Left\n if (orOpActive.column < origin.column) {\n for (int i = origin.column - 1; i >= orOpActive.column; i--) {\n game.gridMap.get(origin.row).get(i).setState(game.STATE_FINAL);\n //setState(gridMap.get(origin.row).get(i), STATE_FINAL);\n }\n }\n }", "void save3(PrintWriter pw){\n\t\t\t pw.println(\" \");\n\t\t\t int YEG = 0;\n int XEG = 0;\n for(int i =0; i < this.position.length;i++){\n for(int p= 0; p < this.position.length; p++){\n if(this.position[i][p] == 1){\n YEG = i;\n XEG = p;\n }//end of if statement\n }//end of inner for loop\n }//end of outer for loop\n pw.println(YEG + \" \" + XEG);\n\t\t }", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "public void saveCameraPosition() {\n \t\tCameraPosition camera = mMap.getCameraPosition();\n \t\tSharedPreferences settings = context.getSharedPreferences(\"MAP\", 0);\n \t\tSharedPreferences.Editor editor = settings.edit();\n \t\teditor.putFloat(\"lat\", (float) camera.target.latitude);\n \t\teditor.putFloat(\"lng\", (float) camera.target.longitude);\n \t\teditor.putFloat(\"bea\", camera.bearing);\n \t\teditor.putFloat(\"tilt\", camera.tilt);\n \t\teditor.putFloat(\"zoom\", camera.zoom);\n \t\teditor.commit();\n \t}", "void saveSet() {\n if( file==null ) {\n int returnVal = fc.showSaveDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n }\n System.out.println(\"Saving to: \" + file.getName());\n try {\n int count = tabbedPane.getTabCount();\n ArrayList l = new ArrayList();\n for(int i=0; i< count; i++) {\n rrpanel= (RoombaRecorderPanel)tabbedPane.getComponentAt(i);\n l.add(rrpanel.copy());\n }\n FileOutputStream fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //oos.writeObject(loopButton);\n //oos.writeObject(\n oos.writeObject(l);\n oos.close();\n } catch( Exception e ) {\n System.out.println(\"Save error \"+e);\n }\n }", "public void saveBlocks() {\n\n if (blockCount == 0 || leftBlockIndex < 0)\n return;\n\n EditText blockTitleView1 = (EditText)block1ViewSet.get(BLOCK_TITLE);\n model.getBlocks().get(leftBlockIndex).setTitle( blockTitleView1.getText().toString());\n\n if (model.getBlocks().get(leftBlockIndex).getSubBlock1() != null) {\n if (model.getBlocks().get(leftBlockIndex).getSubBlock1().getType() == SubBlockType.TEXT) {\n\n EditText textView1 = (EditText) block1ViewSet.get(SB1_TEXT);\n model.getBlocks().get(leftBlockIndex).getSubBlock1().setText(textView1.getText().toString());\n\n } else {\n\n EditText subtitleView1 = (EditText) block1ViewSet.get(SB1_SUBTITLE);\n model.getBlocks().get(leftBlockIndex).getSubBlock1().setSubtitle(subtitleView1.getText().toString());\n\n }\n }\n\n if (model.getBlocks().get(leftBlockIndex).getSubBlock2() != null) {\n if (model.getBlocks().get(leftBlockIndex).getSubBlock2().getType() == SubBlockType.TEXT) {\n\n EditText textView2 = (EditText) block1ViewSet.get(SB2_TEXT);\n model.getBlocks().get(leftBlockIndex).getSubBlock2().setText(textView2.getText().toString());\n\n } else {\n\n EditText subtitleView2 = (EditText) block1ViewSet.get(SB2_SUBTITLE);\n model.getBlocks().get(leftBlockIndex).getSubBlock2().setSubtitle(subtitleView2.getText().toString());\n\n }\n }\n\n //check if there are 2 blocks\n if(blockCount>1) {\n\n\n EditText blockTitleView2 = (EditText)block2ViewSet.get(BLOCK_TITLE);\n model.getBlocks().get(leftBlockIndex+1).setTitle( blockTitleView2.getText().toString());\n\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock1() != null) {\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().getType() == SubBlockType.TEXT) {\n\n EditText textView3 = (EditText) block2ViewSet.get(SB1_TEXT);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().setText(textView3.getText().toString());\n\n } else {\n\n EditText subtitleView3 = (EditText) block2ViewSet.get(SB1_SUBTITLE);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock1().setSubtitle(subtitleView3.getText().toString());\n\n }\n }\n\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock2() != null) {\n if (model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().getType() == SubBlockType.TEXT) {\n\n EditText textView4 = (EditText) block2ViewSet.get(SB2_TEXT);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().setText(textView4.getText().toString());\n\n } else {\n\n EditText subtitleView4 = (EditText) block2ViewSet.get(SB2_SUBTITLE);\n model.getBlocks().get(leftBlockIndex + 1).getSubBlock2().setSubtitle(subtitleView4.getText().toString());\n\n }\n }\n }\n\n }", "@Override\n public void recalculatePositions() { \n \n }", "public void changePositionOfAdjuster() {\n final float txOffset = currentSittingTranslationX;\n final float tyOffset = currentSittingTranslationY;\n final float tzOffset = currentSittingTranslationZ;\n float rxOffset = currentSittingRotationX;\n float ryOffset = currentSittingRotationY;\n float rzOffset = currentSittingRotationZ;\n \n //get cell transform of the sceneroot of cell\n CellRendererJME ret = (CellRendererJME) editor.getCell().getCellRenderer(Cell.RendererType.RENDERER_JME);\n Entity mye = ret.getEntity();\n RenderComponent rc = (RenderComponent) mye.getComponent(RenderComponent.class);\n Node localNode = rc.getSceneRoot();\n Vector3f v3fa = localNode.getWorldTranslation();\n Quaternion quata = localNode.getWorldRotation();\n float[] angles = new float[3];\n angles = quata.toAngles(angles);\n\n //prepare the translation values\n final float tx = v3fa.x + txOffset;\n final float ty = v3fa.y + tyOffset;\n final float tz = v3fa.z + tzOffset;\n\n //prepare the rotation values\n //add 20 degree to y as an adjuster\n final float rx = (float) Math.toRadians((rxOffset + Math.toDegrees(angles[0])));\n final float ry = (float) Math.toRadians((ryOffset + Math.toDegrees(angles[1]) + 20.0f));\n final float rz = (float) Math.toRadians((rzOffset + Math.toDegrees(angles[2])));\n\n //apply the changes\n final WorldManager wm = ClientContextJME.getWorldManager();\n RenderUpdater u = new RenderUpdater() {\n public void update(Object obj) {\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalTranslation(tx, ty, tz);\n SitAdjusterEntity.getInstance(editor.getCell()).getRootNode()\n .setLocalRotation(new Quaternion(new float[]{rx, ry, rz}));\n WorldManager wm = ClientContextJME.getWorldManager();\n wm.addToUpdateList(SitAdjusterEntity.getInstance(editor.getCell()).getRootNode());\n }\n };\n wm.addRenderUpdater(u, this);\n }", "public void saveNow() {\n\t\tplugin.getFileManager().saveGroupsNow();\n\t}", "private void setFields() {\n\t\t// create nine rectangles to represent the cells\n\t\tfor (int x=0;x<3;x++) {\n\t\t\tfor (int y=0;y<3;y++) {\n\t\t\t\t// create the fields based on the dimensions of the board\n\t\t\t\tfieldsArrayGeometry[x][y]= new Rectangle2D.Double(xBoardMin+fieldWidthX*x, yBoardMin+fieldHeightY*y, fieldWidthX, fieldHeightY);\n\t\t\t}\n\t\t\t//System.out.println(Arrays.deepToString(fieldsArrayGeometry));\n\t\t}\n\t\t// write fields to file\n\t\ttry {\n FileWriter fileWriterFields = new FileWriter(fileNameFieldsDimensions,true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriterFields);\n bufferedWriter.write(\"New Fields \"+fieldWidthX+\" \"+fieldHeightY+\" \"+\"\\n\");\n \t\t\tfor (int x=0;x<3;x++) {\n \t\t\t\tfor (int y=0;y<3;y++) {\n \t\t\t\t\tbufferedWriter.write(x+\",\"+y+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMinX()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMaxX()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMinY()+\",\"+\n \t\t\t\t\t\t\t(int) fieldsArrayGeometry[x][y].getMaxY()+\"\\n\");\n \t\t\t\t}\n \t\t\t}\n bufferedWriter.close(); }\n catch(IOException ex2) {\n System.out.println(\"Error writing to file '\"+ fileNameFieldsDimensions + \"'\");\n }\n\t}", "protected abstract void saveGraphicsState();", "public void resetCoordinates(){\n pos=0;\n if(this.pIndex<2){\n this.coordinates[0]=TILE_SIZE*15-DICE_SIZE;}\n else{\n this.coordinates[0]=0;}\n if(this.pIndex%3==0){\n this.coordinates[1]=0;}\n else{\n this.coordinates[1]=TILE_SIZE*15-DICE_SIZE;} \n }", "public void SaveState() {\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n temp_pictures[i][j] = pictures[i][j];\n\n }\n }\n }", "public void exportRegion(File folder) throws IOException\n {\n File blocks = new File(folder + \"/blocks.dat\");\n RandomAccessFile file = new RandomAccessFile(blocks, \"rw\");\n BlockPos size = this.range.getSize();\n\n this.range.write(file);\n\n for (int i = 0; i <= size.getX(); i++)\n {\n for (int j = 0; j <= size.getY(); j++)\n {\n for (int k = 0; k <= size.getZ(); k++)\n {\n this.saveBlock(file, i, j, k);\n }\n }\n }\n\n file.close();\n\n /* Save entities */\n this.saveTileEntities(folder);\n this.saveEntities(folder);\n }", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "@Override\n\tpublic void draw(RoomBlocks grid) {\n\t\trenderer.setProjectionMatrix(CameraHolder.instance().getOrtho().combined);\n//\t\tCont tot = new Cont();\n\t\tColor color = new Color();\n\n\t\t\n\t\tDimensions dim = grid.getDimensions().toRoomWorldDimmensions();\n\t\tgrid.forEach(bl -> {\n//\t\t\t\n\t\t\tint x = (GeneratorConstants.ROOM_BLOCK_SIZE * bl.getX()) + GeneratorConstants.ROOM_BLOCK_SIZE;\n\t\t\t\n\t\t\tx = (dim.getW() - x) + dim.getX();\n\t\t\t\n\t\t\tint pseudWorldRoomY = grid.getDimensions().getY() * Configuration.getLevelGridElementContentSize();\n\t\t\tint y = (bl.getY() + pseudWorldRoomY) * (GeneratorConstants.ROOM_BLOCK_SIZE);\n\t\t\t\n\t\t\tShapeType shType = ShapeType.Filled;\n\t\t\tboolean render = false;\n\t\t\t\n\t\t\tif(bl.isDoor()) {\n\t\t\t\trender = true;\n\t\t\t\tcolor.set(0, 0, 0, 1);\n\t\t\t} else if(bl.isWall()) {\n//\t\t\t\trender = true;\n//\t\t\t\tcolor.set(1, 1, 1, 1);\n//\t\t\t\tshType = ShapeType.Line;\n\t\t\t} else if(bl.getMetaInfo() != null) {//TODO\n\t\t\t\t\n\t\t\t\tif(bl.getMetaInfo().getType().equals(\".\")) {\n\t\t\t\t\trender = true;\n\t\t\t\t\tcolor.set(0, 0, 0, 1);\n\t\t\t\t} else if(!bl.getMetaInfo().getType().equals(\"x\")) {\n\t\t\t\t\t\n\t\t\t\t\tBrush brush = Configuration.brushesPerTile.get(bl.getMetaInfo().getType().charAt(0));\n\t\t\t\t\tif(brush != null) {// && bl.getOwner() != null\n\t\t\t\t\t\t\n//\t\t\t\t\t\tif(bl.getOwner() != null) {\n//\t\t\t\t\t\t\tSystem.out.println(\"owner: \" + brush.tile);\n//\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\trender = true;\n\t\t\t\t\t\tcolor.set(brush.color[0], brush.color[1], brush.color[2], 1);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(render) {\n\t\t\t\t\n\t\t\t\tint size = GeneratorConstants.ROOM_BLOCK_SIZE;\n\t\t\t\t\n\t\t\t\trenderer.begin(shType);\n\t\t\t\trenderer.setColor(color);\n\t\t\t\trenderer.rect(x, y, size, size);\n\t\t\t\trenderer.end();\n\t\t\t}\n\t\t\t\n//\t\t\tif(bl.getOwner() != null ) {\n//\t\t\t\tfinal int fx = x;\n//\t\t\t\tfinal int fy = y;\n//\t\t\t\t\n//\t\t\t\tbl.getOwner().forEachItems(itm -> {//desenhando os items\n//\t\t\t\t\trenderer.begin(ShapeType.Filled);\n//\t\t\t\t\trenderer.setColor(itm.color[0], itm.color[1], itm.color[2], 1);\n//\t\t\t\t\trenderer.rect(fx + itm.dx, fy + itm.dy, itm.width, itm.height);\n//\t\t\t\t\trenderer.end();\t\t\t\t\t\t\n//\t\t\t\t});\n//\t\t\t}\t\t\t\n\t\t});\n\t}", "private void save() {\n var boolGrid = editor.getBoolGrid();\n //Generate a track grid from the bool frid\n var grid = Track.createFromBoolGrid(boolGrid);\n var valid = Track.isValidTrack(grid);\n if (!valid) {\n //fire an error event\n MessageBus.fire(new ErrorEvent(\"Invalid track\", \"\", 2));\n } else {\n //Save the track and pop back\n var generator = new TrackFromGridGenerator(grid);\n var track = generator.generateTrack();\n (new TrackStorageManager()).saveTrack(track);\n menu.navigationPop();\n menu.showError(new ErrorEvent(\"Saved track!\", \"\", 2, Colour.GREEN));\n }\n }", "private void recordLocationData() \r\n\t{\r\n\t\tif(loadedImage!=null)\r\n\t\t{\r\n\t\t\tString image = BitMapToString(loadedImage);\r\n\t\t\tStringBuffer stringBuffer = new StringBuffer();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < image.length(); i++) \r\n\t\t\t{\r\n\t\t\t\tif (image.charAt(i) != '\\n' && image.charAt(i) != '\\r') \r\n\t\t\t\t{\r\n\t\t\t\t\tstringBuffer.append(image.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalimage = stringBuffer.toString();\r\n\t\t\tfinaloutput=xLocation+\"\\n\"+yLocation+\"\\n\"+locationTitle+\"\\n\"+description+\"\\n\"+finalimage+\"\\n\";\r\n\t\t\t\t\r\n\t\t\tcreateLocationObject();\r\n\t\t\twritetoFile(finaloutput);\r\n\t\t\t\r\n\t\t\tdatasource.addLocation(getxLocation(), getyLocation(), locationTitle, description, finalimage); \r\n\t\t\tLog.v(\"CHECK again: \", getxLocation()+\"\\n\"+getyLocation());\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfinalimage = \"dummystring\";\r\n\t\t\tfinaloutput=xLocation+\"\\n\"+yLocation+\"\\n\"+locationTitle+\"\\n\"+description+\"\\n\"+finalimage+\"\\n\";\r\n\t\t\t\r\n\t\t\tcreateLocationObject();\r\n\t\t\twritetoFile(finaloutput);\r\n\t\t\t\r\n\t\t\tdatasource.addLocation(getxLocation(), getyLocation(), locationTitle, description, finalimage); \r\n\t\t\tLog.v(\"CHECK again: \", getxLocation()+\"\\n\"+getyLocation());\r\n\t\t}\r\n\t\t\r\n\t\tLog.v(\"ADD finaloutput: \", finaloutput);\r\n\t}", "Tetrisblock()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "protected void update() {\n setWidth(gridSize);\n setHeight(gridSize);\n\n switch(direction) {\n case UP:\n setRotate(0.0);\n break;\n case RIGHT:\n setRotate(90.0);\n break;\n case DOWN:\n setRotate(180.0);\n break;\n case LEFT:\n setRotate(270.0);\n break;\n }\n\n setLayoutX(position.getX() * gridSize);\n setLayoutY(position.getY() * gridSize);\n }", "private void addPieces() {\n gridPane.getChildren().clear();\n Map<Piece, Position> pieces = controller.getAllActivePiecesPositions();\n /* Add the tiles */\n for (int row = 0; row < 8; row++) {\n for (int col = 0; col < 8; col++) {\n Tile tile = new TileView(new Position(row, col));\n gridPane.add(tile.getRootNode(),\n 1 + tile.getPosition().getCol(),\n 1 + tile.getPosition().getRow());\n GridPane.setHgrow(tile.getRootNode(), Priority.ALWAYS);\n GridPane.setVgrow(tile.getRootNode(), Priority.ALWAYS);\n getTiles()[row][col] = tile;\n tile.getRootNode().setOnMouseClicked(\n tileListener(tile));\n tile.clear();\n tile.setSymbol(\"\");\n }\n }\n /* Add the pieces */\n for (Piece p : pieces.keySet()) {\n Position placeAt = pieces.get(p);\n getTileAt(placeAt).setSymbol(p.getType().getSymbol(p.getSide()));\n }\n /* Add the coordinates around the perimeter */\n for (int i = 1; i <= 8; i++) {\n Text coord1 = new Text((char) (64 + i) + \"\");\n coord1.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord1.setFill(Color.WHITE);\n GridPane.setHalignment(coord1, HPos.CENTER);\n gridPane.add(coord1, i, 0);\n\n Text coord2 = new Text((char) (64 + i) + \"\");\n coord2.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord2.setFill(Color.WHITE);\n GridPane.setHalignment(coord2, HPos.CENTER);\n gridPane.add(coord2, i, 9);\n\n Text coord3 = new Text(\" \" + (9 - i) + \" \");\n coord3.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord3.setFill(Color.WHITE);\n GridPane.setHalignment(coord3, HPos.CENTER);\n gridPane.add(coord3, 0, i);\n\n Text coord4 = new Text(\" \" + (9 - i) + \" \");\n coord4.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord4.setFill(Color.WHITE);\n GridPane.setHalignment(coord4, HPos.CENTER);\n gridPane.add(coord4, 9, i);\n }\n }", "@Override\n public void saveCurrent()\n {\n MazeInfo mi = (MazeInfo) mOpenMazes.getList().getSelectedValue();\n if (mi != null)\n {\n mi = mi.saveMaze();\n mOpenMazes.getList().setSelectedValue(mi, true);\n }\n }", "private void persistChunkBounds()\n\t{\n\t\tprevChunkBounds[BOUND_LEFT] = chunkBounds[BOUND_LEFT];\n\t\tprevChunkBounds[BOUND_RIGHT] = chunkBounds[BOUND_RIGHT];\n\t\tprevChunkBounds[BOUND_BOTTOM] = chunkBounds[BOUND_BOTTOM];\n\t\tprevChunkBounds[BOUND_TOP] = chunkBounds[BOUND_TOP];\n\t}", "public void save(){\r\n if (inputValidation()) {\r\n if (modifyingPart) {\r\n saveExisting();\r\n } else {\r\n saveNew();\r\n }\r\n closeWindow();\r\n }\r\n\r\n }", "public boolean setBlockByVertical(World world, int x, int y, int z, float yaw, List<ImageBlockData> dataList){\n\n try {\n Plugin plugin = Bukkit.getPluginManager().getPlugin(\"DPCPlugin\");\n new BukkitRunnable() {\n @Override\n public void run() {\n for (ImageBlockData data : dataList){\n // System.out.println(\"yaw : \"+yaw);\n if (yaw < -45.0 && yaw >= -135.0) {\n // System.out.println(\"east\");\n Location loc = new Location(world, x, y - data.z, z + data.x);\n loc.getBlock().setType(data.block);\n } else if (yaw >= 45.0 && yaw < 135.0) {\n // System.out.println(\"west\");\n Location loc = new Location(world, x, y - data.z, z - data.x);\n loc.getBlock().setType(data.block);\n } else if (yaw > -45.0 && yaw < 45.0) {\n // System.out.println(\"south\");\n Location loc = new Location(world, x - data.x, y - data.z, z);\n loc.getBlock().setType(data.block);\n } else {\n // System.out.println(\"north\");\n Location loc = new Location(world, x + data.x, y - data.z, z);\n loc.getBlock().setType(data.block);\n }\n }\n }\n }.runTaskLater(plugin, 0L);\n\n } catch (Exception e){\n e.printStackTrace();\n return false;\n }\n\n\n return true;\n }", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "public static void blockMove(Player player) {\n Location location1 = (Location) plugin.getConfig().get(\"region1\");\n Location location2 = (Location) plugin.getConfig().get(\"region2\");\n\n int y = (location1.getBlockY() < location2.getBlockY() ? location2.getBlockY() : location1.getBlockY());\n\n for (Location location : blockPlace.redblockloc) {\n int x = location.getBlockX();\n int z = location.getBlockZ();\n new Location(player.getWorld(), x, y + 1, z).getBlock().setType(location.getBlock().getType());\n player.sendMessage(String.valueOf(location.getBlock().getType()));\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()==Material.WATER) {\n blockPlace.redblock.remove(location.getBlock().getType());\n }\n if(location.getBlock().getType()== Material.IRON_BLOCK) {\n blockPlace.redblock.add(location.getBlock());\n }\n location.getBlock().setType(Material.AIR);\n }\n\n for (Location location : blockPlace.blueblockloc) {\n int xb = location.getBlockX();\n int zb = location.getBlockZ();\n new Location(player.getWorld(), xb, y + 1, zb).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n if(location.getBlock().getType()==Material.AIR) {\n blockPlace.blueblock.remove(location.getBlock().getType());\n }\n }\n\n for (Location location : blockPlace.greenblockloc) {\n int xg = location.getBlockX();\n int zg = location.getBlockZ();\n new Location(player.getWorld(), xg, y + 1, zg).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n for (Location location : blockPlace.yellowblockloc) {\n int xy = location.getBlockX();\n int zy = location.getBlockZ();\n new Location(player.getWorld(), xy, y + 1, zy).getBlock().setType(location.getBlock().getType());\n location.getBlock().setType(Material.AIR);\n }\n }", "private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }", "void updatePosition() {\n if (gameScreen.cursorIsOnLeft()) \n {\n // set the panel's rightmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 11/12 - getWidth(), \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n else // Otherwise the cursor must be on the right half of the screen\n {\n // set the panel's leftmost edge to be 1/12th from the edge\n // set the panel's bottommost edge to be 1/6th from the edge\n setLocation(\n gameScreen.getScreenWidth() * 1/12, \n gameScreen.getScreenHeight() * 5/6 - getHeight());\n }\n }", "public void save() {\n RegionOwn.saveRegionOwner(this);\n }", "public void dorotate(TurnDirection dir) {\n\t\tList<Player> passengers = getPassengers();\n\t\tACBlockState[] temp = new ACBlockState[blocks.length];\n\t\t\n\t\t// First remove all blocks from the scene\n\t\tfor (int i = 0; i < blocks.length; i++) {\n\t\t\ttemp[i] = new ACBlockState(blocks[i].getState());\n\t\t\tif (blocks[i].getState() instanceof InventoryHolder)\n\t\t\t\t((InventoryHolder) blocks[i].getState()).getInventory().clear();\n\t\t\tblocks[i].setType(Material.AIR);\n\t\t}\n\t\t\n\t\tupdateMainBlock();\n\t\t\n\t\t// Make new blocks in their new respective positions\n\t\tfor (int i = 0; i < blocks.length; i++) {\n\t\t\tblocks[i].getLocation().distance(this.mainblock.getLocation());\n\t\t\tVector v = getRotationVector(blocks[i].getLocation(), this.mainblock, dir);\n\t\t\tblocks[i] = this.mainblock.getRelative(v.getBlockX(), v.getBlockY(), v.getBlockZ());\n\t\t\tsetBlock(blocks[i], temp[i], dir);\t\t\t\n\t\t}\n\t\t\n\t\tfor (Player p : passengers) {\n\t\t\tLocation l = p.getLocation().clone().add(getRotationVector(p.getLocation(), this.mainblock, dir).toLocation(p.getWorld()));\n\t\t\tl.setYaw(l.getYaw() + ((dir == TurnDirection.LEFT) ? -90 : 90)); \n\t\t\tp.teleport(l);\n\t\t}\n\t}", "private void displayWorldCoordinates() {\n int n = trackerPanel == null ? 0 : trackerPanel.getFrameNumber();\n OffsetOriginStep step = (OffsetOriginStep) getStep(n);\n if (step == null) {\n xField.setText(null);\n yField.setText(null);\n } else {\n xField.setValue(step.worldX);\n yField.setValue(step.worldY);\n }\n }", "private void refreshSettingsFields() {\r\n\t\tif(mediaSrc.getActiveCamera() != null) {\r\n\t\t\txPos.setText(Float.toString(mediaSrc.getActiveCamera().getxPos()));\r\n\t\t\tyPos.setText(Float.toString(mediaSrc.getActiveCamera().getyPos()));\r\n\t\t\tzPos.setText(Float.toString(mediaSrc.getActiveCamera().getzPos()));\r\n\t\t\thOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getHorOrientation()));\r\n\t\t\tvOrientation.setText(Float.toString(mediaSrc.getActiveCamera().getVerOrientation()));\r\n\t\t\tfov.setText(Float.toString(mediaSrc.getActiveCamera().getFov()));\r\n\t\t}\r\n\t\t\r\n\t\txPos.setBackground(Color.WHITE);\r\n\t\tyPos.setBackground(Color.WHITE);\r\n\t\tzPos.setBackground(Color.WHITE);\r\n\t\thOrientation.setBackground(Color.WHITE);\r\n\t\tvOrientation.setBackground(Color.WHITE);\r\n\t\tfov.setBackground(Color.WHITE);\r\n\t}", "public void run() {\n\n List<BasePanel> panels = new ArrayList<BasePanel>();\n for (int i=0; i<frame.baseCount(); i++)\n panels.add(frame.baseAt(i));\n\n int i=0;\n for (BasePanel panel : panels) {\n if (panel.isBaseChanged()) {\n if (panel.getFile() != null) {\n autoSave(panel);\n }\n }\n else {\n }\n i++;\n }\n }", "private void saveObjects() {\n\t\tgo.setMeteors(meteors);\n\t\tgo.setExplosions(explosions);\n\t\tgo.setTargets(targets);\n\t\tgo.setRockets(rockets);\n\t\tgo.setCrosses(crosses);\n\t\tgo.setEarth(earth);\n\t}", "private void completeSave() {\n colorBar.updateRevertToCurrent();\n colorBar.revertColorBar();\n undoBtn.setEnabled(false);\n redoBtn.setEnabled(false);\n cmapParams.setColorMapName(seldCmapName);\n saveBtn.setEnabled(true);\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "void updateStepCoordiantes(){\n if(xIncreasing) {\n lat = lat + STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat + STEP_LENGTH*yCompMotion*degToMRatio;\n }\n else{\n lat = lat - STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat - STEP_LENGTH*yCompMotion*degToMRatio;\n }\n if(yIncreasing) {\n lon = lon + STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon + STEP_LENGTH*xCompMotion*degToMRatio;\n }\n else{\n lon = lon - STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon - STEP_LENGTH*xCompMotion*degToMRatio;\n }\n }", "public void rotate() {\n\t\tclearPiece();\n\t\trotateFirstBlock();\n\t\trotateSecondBlock();\n\t\trotateFourthBlock();\n\t\tsetPiece();\n\t\trepaint();\n\t}", "public void actualizar() {\r\n\r\n\t\tthis.panelDatos.actualizar();\r\n\t\tthis.panelJuego.paintComponents(getGraphics());\r\n\r\n\t}", "public void rebuild()\n {\n this.tilePropertyPanel.table.clearChildren();\n this.spritePropertyPanel.table.clearChildren();\n this.mapPropertyPanel.removeablePropertyPanel.table.clearChildren();\n if(map.selectedLayer != null)\n {\n this.layerPropertyPanel.setVisible(true);\n this.layerPropertyPanel.layerWidthProperty.value.setText(Integer.toString(map.selectedLayer.width));\n this.layerPropertyPanel.layerHeightProperty.value.setText(Integer.toString(map.selectedLayer.height));\n this.layerPropertyPanel.layerZProperty.value.setText(Float.toString(map.selectedLayer.z));\n }\n else\n this.layerPropertyPanel.setVisible(false);\n if(map.tileMenu.selectedTiles.size == 1)\n {\n if(map.tileMenu.selectedTiles.first().tool == TileMenuTools.TILE)\n {\n Array<PropertyField> tileProperties = map.tileMenu.selectedTiles.first().lockedProperties;\n for (int i = 0; i < tileProperties.size; i++)\n this.tilePropertyPanel.table.add(tileProperties.get(i)).padBottom(1).row();\n this.tilePropertyPanel.setVisible(true);\n }\n else if(map.tileMenu.selectedTiles.first().tool == TileMenuTools.SPRITE)\n {\n Array<PropertyField> spriteProperties = map.tileMenu.selectedTiles.first().lockedProperties;\n for (int i = 0; i < spriteProperties.size; i++)\n this.spritePropertyPanel.table.add(spriteProperties.get(i)).padBottom(1).row();\n this.spritePropertyPanel.setVisible(true);\n }\n }\n if(map.selectedSprites.size > 0)\n {\n Array<PropertyField> spriteProperties = map.selectedSprites.first().lockedProperties;\n for (int i = 0; i < spriteProperties.size; i++)\n this.spritePropertyPanel.table.add(spriteProperties.get(i)).padBottom(1).row();\n this.spritePropertyPanel.setVisible(true);\n }\n if(map.selectedSprites.size == 0 && map.tileMenu.selectedTiles.size == 0)\n {\n for(int i = 0; i < mapPropertyPanel.properties.size; i ++)\n {\n this.mapPropertyPanel.removeablePropertyPanel.table.add(mapPropertyPanel.properties.get(i)).padBottom(1).row();\n }\n this.mapPropertyPanel.removeablePropertyPanel.setVisible(true);\n }\n if(this.layerPropertyPanel.isVisible())\n this.layerPropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.layerPropertyPanel.setSize(getWidth(), 0);\n if(this.tilePropertyPanel.isVisible())\n this.tilePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.tilePropertyPanel.setSize(getWidth(), 0);\n if(this.spritePropertyPanel.isVisible())\n this.spritePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.spritePropertyPanel.setSize(getWidth(), 0);\n if(this.mapPropertyPanel.removeablePropertyPanel.isVisible())\n this.mapPropertyPanel.removeablePropertyPanel.setSize(getWidth(), toolHeight);\n else\n this.mapPropertyPanel.removeablePropertyPanel.setSize(getWidth(), 0);\n\n this.propertyPanel.rebuild();\n this.propertyTable.invalidateHierarchy();\n\n setSize(getWidth(), getHeight()); // refits everything\n }", "private void recalculatePosition()\n {\n position.x = gridCoordinate.getCol()*(width+horizontal_spacing);\n position.y = gridCoordinate.getRow()*(heigh+vertical_spacing);\n }", "public void wrap(){\n\t\tif(this.y_location >=99){\n\t\t\tthis.y_location = this.y_location%99;\n\t\t}\n\t\telse if(this.y_location <=0){\n\t\t\tthis.y_location = 99 - (this.y_location%99);\n\t\t}\n\t\tif(this.x_location >= 99){\n\t\t\tthis.x_location = this.x_location%99;\n\t\t}\n\t\telse if(this.x_location <=0){\n\t\t\tthis.x_location = 99-(this.x_location%99);\n\t\t}\n\t}", "public void putBlock(Block block){\n\t \n\t BlockPosX = 5;\n\t BlockPosY = 0;\n\t int posX = 5;\n\t int posY = 0;\n\t BlockInControl = block;\n\t \n\t int x = 0;\n\t for(int i=0;i<MAX_COL;i++){\n\t\tif(board[posY+1][i] == 1)\n\t\t x = 1;\n\t }\n\t if(x==1)\n\t\tthis.clearBoard();\n\t \n\t \n\t for(int r=0;r<4;r++){\n\t\tfor(int c=0;c<4;c++){\n\t\t if(block.getRowCol(r,c) == 1)\n\t\t\t{\n\t\t\t board[posY][posX]=1;\n\t\t\t \n\t\t\t switch(whichType){\n\t\t\t case 1: color[posY][posX] = 1;\n\t\t\t\tbreak;\n\t\t\t case 2: color[posY][posX] = 2;\n\t\t\t\tbreak;\n\t\t\t case 3: color[posY][posX] = 3;\n\t\t\t\tbreak;\n\t\t\t case 4: color[posY][posX] = 4;\n\t\t\t\tbreak;\n\t\t\t case 5: color[posY][posX] = 5;\n\t\t\t\tbreak;\n\t\t\t case 6: color[posY][posX] = 6;\n\t\t\t\tbreak;\n\t\t\t case 7: color[posY][posX] = 7;\n\t\t\t break;\n\t\t\t }\n\t\t\t}\n\t\t \n\t\t posX++;\n\t\t}\n\t posY++;\n\t posX-=4;\n\t }\n\t}", "public static void saveCurrentGrid(Cell[][] grid) throws IOException {\n StringBuilder builder = new StringBuilder();\n for(int i = 0; i < grid.length; i++) {\n for(int j = 0; j < grid.length; j++) {\n builder.append(grid[i][j].getNum()+\"\");\n if(j < grid.length - 1)\n builder.append(\",\");\n }\n builder.append(\"\\n\");\n }\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"Grid.txt\"));\n writer.write(builder.toString());\n writer.close();\n System.exit(0);\n }", "public void saveRegion(File dir) {\n\t\tif(this.nbt.getSize() > 0) {\n\t\t\tFile file = new File(dir, this.getID() + \".dat\");\n\t\t\tthis.cache.getLocalStorageHandler().getSaveHandler().queueRegion(file, this.nbt.copy());\n\t\t} else {\n\t\t\tthis.deleteRegionFile(dir);\n\t\t}\n\t\tthis.dirty = false;\n\t}", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "private void saveJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveJMenuItemActionPerformed\n //save the current points\n myWriter.saveToFile(FILE_PATH, namesArray, tempArray);\n }", "private void saveCurrRectToStack(Object selectedLabel) {\n\t\tRotatedTextBox b = new RotatedTextBox(currRect, selectedLabel.toString(), textField.getText());\n\t\tdrawnRect.add(b);\n\t\tboxList.setListData(drawnRect);\n\t\tframe.requestFocusInWindow();\n\t\trepaint();\n\t}", "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 }", "public void setOriginalLocation() {\r\n for (int i = 0; i < this.enemies.size(); i++) {\r\n Point originalPoint = this.startLocations.get(i);\r\n this.enemies.get(i).setLocation(originalPoint);\r\n }\r\n }", "private void saveLocations(){\n\n final LocationsDialog frame = this;\n WorkletContext context = WorkletContext.getInstance();\n\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n final HashMap<Integer, Location> dirty = model.getDirty();\n\n\n for(Integer id : dirty.keySet()) {\n Location location = dirty.get(id);\n\n\n if (!Helper.insert(location, \"Locations\", context)) {\n System.out.print(\"insert failed!\");\n }\n\n }// end for\n\n model.refresh();\n\n }", "private void saveBlock(RandomAccessFile file, int i, int j, int k) throws IOException\n {\n BlockPos pos = this.range.min.add(i, j, k);\n IBlockState state = world.getBlockState(pos);\n\n int id = Block.getIdFromBlock(state.getBlock());\n int meta = state.getBlock().getMetaFromState(state);\n\n file.writeShort(id);\n file.writeByte(meta);\n\n /* Add tile entity to tiles list */\n TileEntity tile = world.getTileEntity(pos);\n\n if (tile != null)\n {\n this.tiles.appendTag(tile.writeToNBT(new NBTTagCompound()));\n }\n }", "@Override\n\tpublic String getSaveString() {\n\t\tString save = \"Absorber \"+this.name+\" \"+this.x/GameBoard.PixelsPerL+\" \"+this.y/GameBoard.PixelsPerL+\" \"+this.width+\" \"+this.height;\n\t\treturn save;\n\t}", "public double updatePosition(double climbDegree){\n return leftEncoder.getPosition() - climbDegree;\n }", "public void actionPerformed(ActionEvent evt){\n\t\t\t\tint save = -1;\n\t\t\t\tif(!map.getElevation().equalsIgnoreCase(\"\")){\n\t\t\t\t\tsave = JOptionPane.showConfirmDialog(null, \"Save current work?\", \"Save\", JOptionPane.YES_NO_CANCEL_OPTION);\n\t\t\t\t\tif(save != JOptionPane.CANCEL_OPTION){\n\t\t\t\t\t\tif(save == JOptionPane.YES_OPTION){\n\t\t\t\t\t\t\tsaveMap();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap.makeUniform(0);\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void rotateCCW(){\n rotState = (rotState + 3) % 4;\n for (int i = 0; i < tiles.length; ++i){\n tiles[i] = new Point(tiles[i].y , -tiles[i].x);\n }\n }", "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 createPanelEdit() {\n setBackground(new Color(245, 245, 245));\n setBorder(BorderFactory.createEmptyBorder(0, 300, 0, 300));\n\n setLayout(new BorderLayout());\n JPanel editPanel = new JPanel(new GridBagLayout());\n\n GridBagConstraints g = new GridBagConstraints();\n g.insets = new Insets(0, 20, 40, 8);\n Border border = BorderFactory.createLineBorder(Color.lightGray, 1, true);\n editPanel.setBorder(border);\n\n Border margin1 = new EmptyBorder(50, 50, 50, 50);\n editPanel.setBorder(new CompoundBorder(editPanel.getBorder(), margin1));\n editPanel.setBackground(Color.white);\n\n JPanel contentPanel = new JPanel(new GridBagLayout());\n contentPanel.setBackground(Color.WHITE);\n GridBagConstraints gbc = new GridBagConstraints();\n\n\n backButton = new JButton(\"BACK\");\n ImageIcon backImg = new ImageIcon(\"./images/backarrow.png\");\n Image scaledEditImg = backImg.getImage().getScaledInstance(15, 15,\n Image.SCALE_AREA_AVERAGING);\n backButton.setIcon(new ImageIcon(scaledEditImg));\n backButton.setFont(new Font(\"Arial\", Font.BOLD, 10));\n backButton.setBackground(Color.white);\n backButton.setFocusPainted(false);\n backButton.addActionListener(this);\n\n gbc.gridx = 0;\n gbc.gridy = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.weighty = 2;\n gbc.anchor = GridBagConstraints.FIRST_LINE_START;\n contentPanel.add(backButton, gbc);\n\n saveButton = new JButton();\n\n saveButton.setPreferredSize(new Dimension(275,30));\n saveButton.setBorder(BorderFactory.createLineBorder(Color.BLACK));\n saveButton.setPreferredSize(new Dimension(70, 25));\n saveButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n ImageIcon saveImg = new ImageIcon(\"./images/save-icon.png\");\n Image scaledEditImage = saveImg.getImage().getScaledInstance(25, 20,\n Image.SCALE_AREA_AVERAGING);\n\n saveButton.setLayout(new FlowLayout(FlowLayout.LEADING));\n JLabel iconLabel = new JLabel(new ImageIcon(scaledEditImage));\n JLabel textLabel = new JLabel(\"SAVE\");\n saveButton.add(iconLabel);\n saveButton.add(textLabel);\n textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));\n\n saveButton.setBackground(Color.white);\n saveButton.addActionListener(this);\n gbc.gridx = 3;\n gbc.gridy = 40;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.CENTER;\n contentPanel.add(saveButton, gbc);\n\n\n JLabel title = new JLabel(\"ENTER PLANT DETAILS\");\n title.setFont(new Font(\"Calibri light\", Font.BOLD, 25));\n gbc.gridy = 3;\n gbc.gridx = 3;\n gbc.weighty = 5;\n gbc.gridheight = 1;\n contentPanel.add(title, gbc);\n\n\n JLabel nicknameLabel = new JLabel(\"Nickname (optional): \");\n nicknameLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 13;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(nicknameLabel, gbc);\n\n nicknameTF = new JTextField();\n nicknameTF.setPreferredSize(new Dimension(275, 30));\n nicknameTF.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n nicknameTF.setText(\"\");\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 13;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(nicknameTF, gbc);\n\n\n JLabel picLabel = new JLabel(\"Change picture (optional): \");\n picLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 14;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(picLabel, gbc);\n\n changeImageBtn = new JButton();\n ImageIcon changeImg = new ImageIcon(\"./images/jpg.png\");\n Image scaledChangeImg = changeImg.getImage().getScaledInstance(50, 50,\n Image.SCALE_AREA_AVERAGING);\n changeImageBtn.setIcon(new ImageIcon(scaledChangeImg));\n changeImageBtn.setBackground(null);\n changeImageBtn.setBorder(BorderFactory.createLineBorder(null));\n changeImageBtn.addActionListener(this);\n changeImageBtn.setToolTipText(\"Update the picture of the plant\");\n changeImageBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n changeImageBtn.setBorder(BorderFactory.createLineBorder(Color.white));\n gbc.gridx = 4;\n gbc.gridy = 14;\n gbc.weighty = 12;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n\n\n contentPanel.add(changeImageBtn, gbc);\n\n\n JLabel climateLabel = new JLabel(\"Climate: \");\n climateLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 15;\n gbc.weighty = 15;\n gbc.weightx = 2;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(climateLabel, gbc);\n\n String[] choices = {\"Inside\", \"Outside\"};\n JComboBox<String> climateMenu = new JComboBox<>(choices);\n climateMenu.setBackground(Color.white);\n climateMenu.setPreferredSize(new Dimension(275, 30));\n gbc.gridx = 4;\n gbc.gridy = 15;\n gbc.weighty = 5;\n gbc.weightx = 2;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(climateMenu, gbc);\n\n JLabel waterLabel = new JLabel(\"Interval Between Watering: \");\n waterLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 16;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(waterLabel, gbc);\n\n waterTF = new JTextField();\n waterTF.setPreferredSize(new Dimension(275, 30));\n waterTF.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n waterTF.setText(\"\");\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 16;\n gbc.weighty = 15;\n gbc.weightx = 2;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.EAST;\n contentPanel.add(waterTF, gbc);\n\n JLabel sizeLabel = new JLabel(\"Size (optional): \");\n sizeLabel.setToolTipText(\"This is used for our remaining days between watering estimation.\");\n sizeLabel.setFont(new Font(\"Calibri light\", Font.PLAIN, 18));\n gbc.gridx = 0;\n gbc.gridy = 17;\n gbc.weighty = 15;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.WEST;\n contentPanel.add(sizeLabel, gbc);\n\n\n DefaultListModel model = new DefaultListModel();\n\n Image img1 = new ImageIcon(\"images/flower_small.png\").getImage().getScaledInstance(70, 110, Image.SCALE_SMOOTH);\n Image img2 = new ImageIcon(\"images/flower_medium.png\").getImage().getScaledInstance(80, 120, Image.SCALE_SMOOTH);\n Image img3 = new ImageIcon(\"images/flower_big.png\").getImage().getScaledInstance(90, 130, Image.SCALE_SMOOTH);\n\n model.addElement(new ImageIcon(img1));\n model.addElement(new ImageIcon(img2));\n model.addElement(new ImageIcon(img3));\n\n JList list = new JList(model);\n list.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n list.setToolTipText(\"Select an image that represents the plant size best.\");\n DefaultListCellRenderer renderer = (DefaultListCellRenderer) list.getCellRenderer();\n renderer.setHorizontalAlignment(SwingConstants.CENTER);\n\n list.setVisibleRowCount(1);\n list.setLayoutOrientation(JList.HORIZONTAL_WRAP);\n\n gbc.gridx = 4;\n gbc.gridy = 17;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n gbc.anchor = GridBagConstraints.LINE_END;\n contentPanel.add(list, gbc);\n\n gbc.gridx = 4;\n gbc.gridy = 18;\n gbc.weighty = 0;\n gbc.weightx = 0;\n gbc.gridwidth = 1;\n\n JTextPane tPane = new JTextPane();\n tPane.setText(\"This is used for our remaining days between watering estimation. Plants in smaller pots have less soil and will dry out faster than plants with larger pots.\");\n tPane.setEditable(false);\n StyledDocument styledDocument = tPane.getStyledDocument();\n SimpleAttributeSet center = new SimpleAttributeSet();\n StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);\n styledDocument.setParagraphAttributes(0, styledDocument.getLength(), center, false);\n contentPanel.add(tPane, gbc);\n\n JButton linkBtn = new JButton(\"(source)\");\n linkBtn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n linkBtn.addActionListener(e -> {\n try {\n URI url = new URI(\"https://www.thesill.com/blogs/plants-101/drink-up\");\n Desktop.getDesktop().browse(url);\n } catch (URISyntaxException | IOException exception) {\n }\n });\n gbc.gridx = 4;\n gbc.gridy = 19;\n gbc.weighty = 0;\n gbc.weightx = 0;\n linkBtn.setBackground(null);\n linkBtn.setBorder(null);\n linkBtn.setForeground(new Color(26, 122, 169));\n contentPanel.add(linkBtn, gbc);\n\n contentPanel.setPreferredSize(new Dimension(750, 500));\n g.fill = GridBagConstraints.HORIZONTAL;\n editPanel.add(contentPanel, g);\n\n JScrollPane scrollPane = new JScrollPane(editPanel);\n add(scrollPane);\n\n }", "private void setPath(){\r\n // get the reversed path\r\n ArrayList<Grid> reversedPath = new ArrayList<>();\r\n int index = _endIndex;\r\n reversedPath.add(_map.get_grid(index));\r\n while(index != _startIndex){\r\n index = _map.get_grid(index).get_parent();\r\n reversedPath.add(_map.get_grid(index));\r\n }\r\n\r\n // get the final path in the correct order\r\n int length = reversedPath.size();\r\n for(int i=length-1;i>=0;i--){\r\n _path.add(reversedPath.get(i));\r\n }\r\n }", "private void updateBoxes(){\n if(model.getMap() != null) {\n DoubleVec position = invModelToView(new DoubleVec(canvas.getWidth()*0.5,canvas.getHeight()*0.5));\n inner = new Rectangle(position, 1.0/zoomFactor * fi * canvas.getWidth(), 1.0/zoomFactor * fi * canvas.getHeight(), 0);\n outer = new Rectangle(position, 1.0/zoomFactor * fo * canvas.getWidth(), 1.0/zoomFactor * fo * canvas.getHeight(), 0);\n }\n }", "public void rotateBack() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[i][j] = tmp_grid[i][j];\n\t\t}", "private void updateStationPositions() {\n //stations going east\n if(layout == Layout.square) {\n for (int i = 0; i < numStations; i++) {\n northbound.get(i).setPosition(i+1,2*numStations+1);\n eastbound.get(i).setPosition(0,numStations+(i+1));\n southbound.get(i).setPosition(numStations+1+i,0);\n westbound.get(i).setPosition(numStations*2+1,1+i);\n }\n }else{\n for (int i = 0; i < numStations; i++) {\n eastbound.get(i).setPosition(i,2*numStations+i);\n northbound.get(i).setPosition(numStations+i,3*numStations+i);\n southbound.get(i).setPosition(2*numStations+i,i);\n westbound.get(i).setPosition(3*numStations+i,numStations+i);\n }\n }\n\n }", "Tetrisblock2()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "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 }", "void saveCurrentStation();", "public void save() { \n /*\n * Iterate over registry to pull box values\n * Creating new IOLoader for instance \n */\n for(UUID id : giftRegistry.keySet()) {\n GiftBox box = giftRegistry.get(id);\n\n String sId = id.toString();\n IOLoader<SecretSanta> config = new IOLoader<SecretSanta>(SecretSanta._this(), sId + \".yml\", \"Gifts\");\n\n FileConfiguration fCon = config.getCustomConfig();\n fCon.createSection(\"SecretSanta\");\n fCon.set(\"SecretSanta\", box.getConfig());\n\n try{\n fCon.save(config.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: \" + sId + \".yml\");\n continue;\n }\n }\n //SecretSanta._this().logDebug(\"[GiftManager] Gift Registry save successful.\");\n\n IOLoader<SecretSanta> pairedConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PairedRegistry.yml\", \"Data\");\n FileConfiguration fPaired = pairedConfig.getCustomConfig();\n fPaired.createSection(\"paired\");\n fPaired.set(\"paired\", savePairs());\n\n try{\n fPaired.save(pairedConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PairedRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PairedRegistry.yml\");\n }\n\n IOLoader<SecretSanta> playerConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PlayerRegistry.yml\", \"Data\");\n FileConfiguration fPlayer = playerConfig.getCustomConfig();\n fPlayer.createSection(\"registered\");\n fPlayer.set(\"registered\", savePlayers());\n\n try{\n fPlayer.save(playerConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PlayerRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PlayerRegistry.yml\");\n }\n\n IOLoader<SecretSanta> givenConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"GivenEmptyRegistry.yml\", \"Data\");\n FileConfiguration fGiven = givenConfig.getCustomConfig();\n fGiven.createSection(\"given\");\n fGiven.set(\"given\", saveGivens());\n\n try{\n fGiven.save(givenConfig.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: GivenEmptyRegistry.yml\");\n }\n\n SecretSanta._this().logDebug(\"[GiftManager] Saving complete.\");\n }", "private void jButtonSaveStageplaatsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveStageplaatsActionPerformed\n\n storeDisplayedStageplaats();\n \n this.dbFacade.persist((this.geselecteerdeStageplaats));\n refreshDataCache();\n refreshListbox();\n }", "public void refreshPosition() {\n\n this.setTransform(getTransform());\n }" ]
[ "0.6560521", "0.63615006", "0.58301485", "0.57728875", "0.5753353", "0.5700336", "0.56712675", "0.5663565", "0.5655946", "0.5655946", "0.5654148", "0.5606739", "0.5574428", "0.55577046", "0.54484844", "0.5402577", "0.53689545", "0.53475994", "0.53406847", "0.5334657", "0.5325306", "0.531192", "0.52975476", "0.528831", "0.52840614", "0.528349", "0.5264523", "0.52597064", "0.523251", "0.52297604", "0.52232766", "0.5222915", "0.52220416", "0.5193877", "0.5193681", "0.5178674", "0.51663834", "0.5141712", "0.5140767", "0.5127364", "0.5125866", "0.5116811", "0.51030713", "0.5102506", "0.5095171", "0.5078417", "0.5073337", "0.50556284", "0.50548637", "0.5051295", "0.5043229", "0.5043082", "0.5039796", "0.5039627", "0.5031235", "0.50311446", "0.5030098", "0.50281376", "0.5011568", "0.5008464", "0.50061065", "0.4997955", "0.49907628", "0.49894547", "0.4986752", "0.49849114", "0.49814543", "0.4973082", "0.497056", "0.49701276", "0.49573767", "0.49467432", "0.49396735", "0.49368525", "0.49366552", "0.49286917", "0.49267894", "0.49235067", "0.49222347", "0.49217567", "0.49082062", "0.4907588", "0.49034157", "0.48982865", "0.4894186", "0.48870474", "0.48865455", "0.48865145", "0.48864162", "0.48848605", "0.48785233", "0.48747873", "0.4872367", "0.48716027", "0.48700956", "0.485937", "0.48586643", "0.48561385", "0.48497623", "0.4846625" ]
0.6875951
0
TODO Autogenerated method stub
@Override public String execute() throws Exception { int status = multiPlanService.getMultiPlanMembers(multiPlanId); if(status == 0){ result.setMultiPlanMembers(multiPlanService.getMultiPlanMembers()); result.setStatus(0); } return SUCCESS; }
{ "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
private static String skipUntilNumber = "1.0780"; private static boolean saveAllowed = true;
@Test public void main() throws IOException { currentArticle = null; for(String line: FileUtils.readLines(new File("D:\\projects\\вёрстка томов ИИ\\9 том\\термины.txt"))) { Matcher matcher = compile("\\|([^\\|]+)\\|\\s[–\\-—]\\s(.+)").matcher(line); if (matcher.find()) { if (currentArticle != null) { saveItem(); currentArticle = null; } String term = matcher.group(1); String body = matcher.group(2); if(body.indexOf("см. ") != 0) { currentArticle = new Article(term, body); } /*else { String alias = body.replace("см. ", "").replace("«", "").replace("»", "").replace(".", ""); saveAliases(alias, term); }*/ } else if (currentArticle != null) { currentArticle.setContent(currentArticle.getContent() + "<br/>"+line); } } if (currentArticle != null) { saveItem(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isAutoSkip();", "public static void setGsSearchLosDiscard(double val) {\n gsSearchLosDiscard = val;\n }", "int needsSaving();", "boolean getNddSkipValidateB(Record inputRecord);", "public void save_order_without_payment(String advert, String userWhoGive,String userWhoGet,Date date,Date start, Date finish,Float price);", "public boolean shouldHoldRecorderForSecond() {\n return true;\n }", "static void setNotSaved(){saved=false;}", "@Test\n\tpublic void testSkippedCallnums() \n\t{\n\t\tString id = \"skippedCallnum\";\n\t\tassertLCVol1NotLopped(id);\n\t\tassertNoLoppedLC(id);\n\t\t// skipped call number should not be present\n\t solrFldMapTest.assertSolrFldHasNoValue(testFilePath, id, fldName, \"NO CALL NUMBER\");\n\t}", "private void record_number(double number) {\n\t\tcalculate_number = number;\n\t}", "public static boolean isTrialRecording()\n {\n return false;\n }", "private void savingAccountInterest(){\n if(this.watch.checkElapsedTime() >= 30){\n this.watch.stop(); // stopping stopwatch\n this.timeInterval = this.watch.elapsedTime(); // saving elapsed time in variable\n System.out.println(\"this.timeInterval == \"+this.timeInterval);\n this.bal += this.bal * 0.05 * Math.floor(this.timeInterval/30); // incrementing balance by 5% every 30 seconds\n this.watch.start();\n }\n }", "boolean isSkipCalculations();", "public void markFileAsNotSaved()\r\n {\r\n saved = false;\r\n }", "public void makePlayerSkipNextRound() {\n\t\tcurrent.setSkipNextRound(true);\n\t}", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "@Test(timeout = 4000)\n public void test24() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.m_FindNumBins = true;\n byte[] byteArray0 = new byte[3];\n byteArray0[0] = (byte)108;\n byteArray0[1] = (byte)27;\n byteArray0[2] = (byte)14;\n FileSystemHandling.appendDataToFile((EvoSuiteFile) null, byteArray0);\n discretize0.setBins((-830));\n discretize0.getOptions();\n assertEquals((-830), discretize0.getBins());\n }", "public void setSkip(boolean skip) {\n this.skip = skip;\n }", "@Override\n\tpublic double saveNumber()\n\t{\n\t\treturn num;\n\t}", "boolean canBeSkipped();", "public void skip()\n {\n skip(1);\n }", "protected boolean setSkipToPage(int num) {\n\t\tif (mControlView != null) {\n\t\t\tString result = \"\";\n\t\t\tint currentPos = num;\n\t\t\tint count = getTotalPage();\n\t\t\tif (currentPos > 0 && count > 0 && num <= count) {\n\t\t\t\tresult = currentPos + \"/\" + count;\n\t\t\t\tmControlView.setPhotoTimeType(result);\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public void setPricePerSquareFoot(double newPricePerSquareFoot){\nif(newPricePerSquareFoot > 0){\npricePerSquareFoot = newPricePerSquareFoot;\n}\n}", "public void eliminateSleep(boolean flag) { \n\t\tif (flag) {\n\t\t\tsleepTime = 5;\n\t\t} else {\n\t\t\tsleepTime = 250;\n\t\t}\n\t}", "public void setSkip(final boolean skip) {\n _skip = skip;\n }", "@Override\n\tpublic void skip() {\n\t}", "public void setSkip(java.lang.Boolean skip) {\r\n this.skip = skip;\r\n }", "public void setSkipNum(int skipNum) {\r\n this.skipNum = skipNum;\r\n this.endNum = this.skipNum + this.limitNum +1;\r\n }", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.precision((-1484));\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public void skip(int position) { // Called when user drags the slider \r\n if (position < 0 || position > audioLength) \r\n return; \r\n audioPosition = position; \r\n if (midi) \r\n sequencer.setTickPosition(position); \r\n else \r\n clip.setMicrosecondPosition(position * 1000); \r\n progress.setValue(position); // in case skip( ) is called from outside \r\n }", "public double withdrawFromSavings(double value)\r\n {\r\n if (value > savings)\r\n {\r\n value = savings;\r\n savings = 0;\r\n } else\r\n {\r\n savings -= value;\r\n }\r\n\r\n return value;\r\n }", "public int getPauseAfterWriteBank() \n {\n return getPauseAfterWritePatch(); \n }", "private void saveAverageIfNecessary() {\n if (counter % 10000 == 0 || counter == 10 || counter == 100\n || counter == 1000) {\n averages.add(new Average());\n }\n }", "void setDSTSavings(int dstSavings);", "@Override\n\tpublic void doSave(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t model.setPrice(\"0\");\n\t\t }\n\t\t double dprice =Double.parseDouble(model.getPrice());\n\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t model.setPrice(f1+\"\");\n\t model.setSource(\"001\");\n\t\t\n\t\tsuper.doSave(model, request, response);\n\t}", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.falseNegativeRate(121);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n String string0 = EWrapperMsgGenerator.tickPrice((-1), 13, Integer.MAX_VALUE, 0);\n assertEquals(\"id=-1 modelOptComp=2.147483647E9 noAutoExecute\", string0);\n }", "@Ignore(\"test in testPGNT0102002, testPGNT0101001, testPGNT0101002\")\n public void testDAM30507001() {\n }", "@BeforeTest\r\n\tpublic void checkTestSkip(){\r\n\t\t\t\t\r\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suite_cart_xls,this.getClass().getSimpleName())){\r\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\r\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\r\n\t\t\t\t}\r\n\trunmodes=TestUtil.getDataSetRunmodes(suite_cart_xls, this.getClass().getSimpleName());\t\r\n\t\t\t}", "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 void mo23023f() {\n this.f26122b.edit().putLong(\"has.ask.rate.at\", -1).apply();\n }", "@Test\n public void testSetStartingPrice() {\n service.setStartingPrice(2000.0F);\n assertEquals(2000.0F, service.getStartingPrice(), 0.001);\n \n }", "String getUseExponentialBackOff();", "@Test(timeout = 4000)\n public void test029() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalsePositives(295);\n assertEquals(0.0, double0, 0.01);\n }", "private boolean notTooManySkips(ArrayList<Integer> jValues)\r\n\t{\r\n\t\tint length = jValues.size();\r\n\t\tint span = jValues.get(jValues.size() - 1) - jValues.get(0) + 1;\r\n\r\n\t\treturn span - length <= MAX_SKIPS;\r\n\t}", "@Override\n public boolean isEpochCheckEnabled() {\n return false;\n }", "@Test\n public void testWriteParkReport() {\n System.out.println(\"writeParkReport\");\n List<String> write = new ArrayList<>();\n write.add(\"ePT03;100;0\\n\");\n write.add(\"ePT02;20;3846\\n\");\n boolean expResult = true;\n boolean result = WriteReport.writeParkReport(write, \"parkReport.txt\");\n assertEquals(expResult, result);\n expResult = false;\n result = WriteReport.writeParkReport(write, \"\");\n assertEquals(expResult, result);\n \n }", "private boolean NOT(boolean b) {\r\n in = saves[--save];\r\n return !b;\r\n }", "public static void noExistingLimitPrinter(String type) {\n System.out.println(line);\n if (type.equals(ParserStringList.LIMIT_TYPE_B)) {\n System.out.println(NO_BUDGET_MSG);\n } else {\n System.out.println(NO_SAVING_MSG);\n }\n System.out.println(line);\n }", "@Test(timeout = 4000)\n public void test08() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.setPeriodicPruning((-1));\n int int0 = naiveBayesMultinomialText0.getPeriodicPruning();\n assertEquals((-1), int0);\n }", "public void setSkipNotMatch(java.lang.Short skipNotMatch) {\r\n this.skipNotMatch = skipNotMatch;\r\n }", "void skip();", "public void setIgnore() {\n\t\t\tignore = true;\n\t\t}", "@Test\n\tpublic void test250000() {\n\n\tdouble tax = Main.calcTax(250_000.);\n\tassertEquals(7750., tax, .01);\n\n\t}", "public boolean skip() {\n return skip;\n }", "public int getSkipCount ()\n {\n return skipCount;\n }", "public void skip(boolean b) {\n skip = b;\n }", "@Override\n public String getSavingsValue() {\n\n final String savingsValue = getElement(getDriver(), By.className(SAVINGS_DOLLAR_AMOUNT),\n TINY_TIMEOUT).getText();\n setLogString(\"Savings Amount :\" + savingsValue, true, CustomLogLevel.HIGH);\n return savingsValue;\n }", "public SkipList()\n {\n\tthis(0.5);\n }", "@Test\n public void testBankNoteSerialNumber() {\n double value = 20;\n setFactory(\"ThaiMoneyFactory\");\n BankNote bankNote = (BankNote) moneyFactory.createMoney(value);\n long prevSerialNumber = bankNote.getSerial();\n for (int round = 0; round < 5; round++) {\n bankNote = (BankNote) moneyFactory.createMoney(value);\n assertNotEquals(bankNote.getSerial(), prevSerialNumber);\n prevSerialNumber = bankNote.getSerial();\n }\n setFactory(\"MalayMoneyFactory\");\n bankNote = (BankNote) moneyFactory.createMoney(value);\n prevSerialNumber = bankNote.getSerial();\n for (int round = 0; round < 5; round++) {\n bankNote = (BankNote) moneyFactory.createMoney(value);\n assertNotEquals(bankNote.getSerial(), prevSerialNumber);\n prevSerialNumber = bankNote.getSerial();\n }\n }", "public void setminimumBalance(double parseDouble) {\n\t\n}", "@Override\n public boolean save()\n {\n return false;\n }", "public void afterTextChanged(Editable s) {\n\n if(!String.valueOf(s).matches(\"\")) {\n\n String valStr = String.valueOf(s);\n int valInt = Integer.parseInt(valStr);\n\n if (valInt <= 40000000) {\n\n seekBar.setProgress(valInt / 100000);\n\n Log.d(\"SEEKBAREDITTEXTVALLOG\", \"Value :\" + \" \" + valInt / 100000);\n\n expectedPriceEdtx.setSelection(expectedPriceEdtx.getText().toString().length());\n\n } else {\n\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n expectedPriceEdtx.setText(\"40000000\");\n Toasty.error(activity, \"Cannot add more than 4 Crore\", Toasty.LENGTH_SHORT).show();\n }\n });\n\n }\n }\n }", "@Test(priority=7)\n\tpublic void validateAddingNiftyPrice() throws InterruptedException\n\t{\n\t\tc.enterNiftyPriceField.sendKeys(c.todaysNiftyValue.getText().replace(\",\",\"\"));\n\t\tc.addButton.click();\n\t\tThread.sleep(2000);\n\t\tAssert.assertTrue(c.msg.getText().equalsIgnoreCase(\"Joined Successfully.\"));\n\t\tAssert.assertTrue(c.editButton.getText().equalsIgnoreCase(\"Edit\"));\n\t}", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedFalseNegativeRate();\n assertEquals(Double.NaN, double0, 0.01);\n }", "@Test\n\tpublic void testGive20Back() {\n\t\n\t}", "@Test\n public void persistenceTest3()\n {\n // Initiate a blacklist and add some numbers to it\n Blacklist testBlacklist = new Blacklist();\n testBlacklist.addBlacklistedNumber(5555550123L);\n testBlacklist.addBlacklistedNumber(1234567890L);\n testBlacklist.addBlacklistedNumber(9876543210L);\n\n // Save and load the blacklist numbers\n m_fileSystem.saveBlacklistNumbers(testBlacklist);\n ArrayList<Long> loadedNumbers = m_fileSystem.loadBlacklistNumbers();\n\n // Set seen flags\n int firstMatch = 0;\n int secondMatch = 0;\n int thirdMatch = 0;\n\n // Go over all numbers, marking each number seen\n for(Long number : loadedNumbers)\n {\n if(number == 5555550123L)\n {\n firstMatch++;\n }\n else if(number == 1234567890L)\n {\n secondMatch++;\n }\n else if(number == 9876543210L)\n {\n thirdMatch++;\n }\n }\n\n // Make sure every number was seen exactly once\n assertEquals(firstMatch, 1);\n assertEquals(secondMatch, 1);\n assertEquals(thirdMatch, 1);\n }", "@Test(timeout = 4000)\n public void test030() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalseNegatives(2458);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(0.0, double0, 0.01);\n }", "@Test\n public void testGetStartingPrice() {\n Float result = service.getStartingPrice();\n assertEquals(5000.0F, result, 0.001);\n \n }", "@Test\n public void skipWhile() {\n Observable.interval(100, TimeUnit.SECONDS, mTestScheduler)\n .map(num -> num + 1)\n .take(7)\n .skipWhile(aLong -> aLong != 4)\n .subscribe(mList::add);\n\n mTestScheduler.advanceTimeBy(1000, TimeUnit.SECONDS);\n assertEquals(mList, Arrays.asList(4L, 5L, 6L, 7L));\n }", "@Test(enabled = true, retryAnalyzer=RetryAnalyzer.class)\r\n\tpublic void testParkingBookingPreparationTimeAndCleanupNotConsidered() throws IOException{\r\n\t\tReporter.log(\"<span style='font-weight:bold;color:#000033'> \"\r\n\t\t\t\t+ \"C118064: Preparation and Cleanup time should not be considered while calculating Total Cost in Parking reservation\", true);\r\n\r\n\t\t int random = (int)(Math.random() * 10)+24;\r\n\t\t String date = this.getFutureDate(random);\r\n\t\t String region = \"1preRgRef\";\r\n\t\t String from = \"18:00\";\r\n\t\t String until = \"19:00\";\r\n\t\t String prakingResv = \"prePrkDefRef\";\r\n\t\t String prepTime = \"00:30\";\r\n\t\t String cleanupTime = \"00:30\";\r\n\t\t String responsible=getUserLastNameOfLoggedInUser();\r\n\r\n\t\t SoftAssert softAssert = new SoftAssert();\r\n\t\t softAssert.setMethodName(\"testParkingBookingPreparationTimeAndCleanupNotConsidered\");\r\n\t\t \r\n\t\t expandAdministration();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t expandSubMainMenu(\"Reservation\");\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t waitAndClick(XPATH_NEWRESERVATIONS);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t //C118064\r\n\t\t setRegion(region);\r\n\t\t setDate(date);\r\n\t\t setTimeFrom(from);\r\n\t\t setTimeUntil(until);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickParkingTab();\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSearch();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t clickLaunchReservation(prakingResv);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimePrepareFromReservationPanel(prepTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setTimeCleanupFromReservationPanel(cleanupTime);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t setResponsible(responsible);\r\n\t\t waitForExtJSAjaxComplete(10);\r\n\r\n\t\t clickSummaryTab();\r\n\t\t waitForExtJSAjaxComplete(20);\r\n\r\n\t\t String getSummaryText = getItemDetailsFromReservationSummary(prakingResv);\r\n\t\t softAssert.assertTrue( getSummaryText.contains(\"1 h x 4.00 EUR\"),\"Total cost is calculated without considering Prepare/Cleanup time\");\r\n\t\t softAssert.assertTrue(getSummaryTitle().contains(\"4.04 EUR\"),\"summary title is ok before adding additional Equipment, Vehicles & Parking\");\r\n\t}", "@Override\n public String getSavingsPercentage() {\n\n final String savingsPercent = getElement(getDriver(), By.className(SAVINGS_PERCENTAGE),\n TINY_TIMEOUT).getText();\n setLogString(\"Savings Percentage:\" + savingsPercent + \"%\", true, CustomLogLevel.HIGH);\n return savingsPercent + \"%\";\n }", "public void setNumDeparting() {\n if (isStopped() && !embarkingPassengersSet){\n \tRandom rand = new Random();\n \tint n = rand.nextInt(this.numPassengers+1);\n \tif (this.numPassengers - n <= 0) {\n \t\tthis.numPassengers = 0;\n n = this.numPassengers;\n \t} else {\n this.numPassengers = this.numPassengers - n;\n }\n trkMdl.passengersUnboarded(trainID, n);\n }\n \t//return 0;\n }", "private void btnSaveActionPerformed(ActionEvent e) {\n String inputString=delayInput.getText();\n if(!inputString.isEmpty()){\n float data=Float.parseFloat(inputString);\n if(!Float.isNaN(data)){\n setDelayTime(data);\n processWindowEvent(new WindowEvent(this,WindowEvent.WINDOW_CLOSING));\n }\n }\n }", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n String string0 = JSONObject.doubleToString((-0.80100864F));\n assertEquals(\"-0.8010086417198181\", string0);\n }", "@Override\r\n\tpublic boolean savetdfy(Tuanbiao tuanbiao) throws Exception {\n\t\treturn false;\r\n\t}", "private void m10991bR(boolean z) {\n String str = \"p_siops_iposhnkiykat_slo\";\n bEy.setBoolean(\"key_splash_skip_position\", z);\n }", "@Test\n\tpublic void invalidNumYrs() {\n\t\tWebElement new_page = wdriver.findElement(By.name(\"payment_form\"));\n\t\t\n\t\tdouble dwnpymnt = Double.valueOf(new_page.findElement(By.name(\"downpayment\")).getAttribute(\"value\"));\n\t\t\n\t\t// get initial value of interest\n\t\tdouble interest = Double.valueOf(new_page.findElement(By.name(\"interest\")).getAttribute(\"value\"));\n\t\t\n\t\t// modify number of years to non-numeric characters\n\t\tnew_page.findElement(By.name(\"year\")).clear();\n\t\tnew_page.findElement(By.name(\"year\")).sendKeys(\"abcd\");\n\t\t\n\t\tint year = 0;\n\t\tdouble price_tax = Double.valueOf(new_page.findElement(By.name(\"price_with_taxes\")).getAttribute(\"value\"));\n\t\t\n\t\tdouble price_interest = priceWithInterest(price_tax, dwnpymnt, interest, year);\n\t\tint nMnths = numMonths(year);\n\t\tdouble ttl = totalPrice(price_interest, dwnpymnt);\n\t\tdouble ttl_per_mnth = totalPricePerMonth(price_interest, nMnths);\n\t\t\n\t\t// click calculate button\n\t\tnew_page.findElement(By.name(\"calculate_payment_button\")).click();\n\t\twait(2);\n\t\t\n\t\tWebElement solutions = wdriver.findElement(By.name(\"payment_form\"));\n\t\t\n\t\tDecimalFormat twoDForm = new DecimalFormat(\"#.##\");\n\t\t\n\t\tassertEquals(Double.valueOf(twoDForm.format(dwnpymnt)), Double.valueOf(solutions.findElement(By.id(\"total_downpayment\")).getAttribute(\"value\")));\n\t\tassertEquals(Double.valueOf(twoDForm.format(ttl_per_mnth)), Double.valueOf(solutions.findElement(By.id(\"total_price_per_month\")).getAttribute(\"value\")));\n\t\tassertEquals(Integer.valueOf(nMnths), Integer.valueOf(solutions.findElement(By.id(\"n_of_months\")).getAttribute(\"value\")));\n\t\tassertEquals(Double.valueOf(twoDForm.format(ttl)), Double.valueOf(solutions.findElement(By.id(\"total_price\")).getAttribute(\"value\")));\n\t}", "public void setNextTakeOff(boolean nextTakeOff) {\r\n\t\tthis.nextTakeOff = nextTakeOff;\r\n\t}", "private void m145780j() {\n String str;\n if (!this.f119477j.mo115499a() && !this.f119478k) {\n if ((this.f119477j.f119578d & 536870912) != 0) {\n str = \"WAL\";\n } else {\n str = \"PERSIST\";\n }\n m145773d(str);\n }\n }", "public void setFirstExtreme(double fe){\r\n firstExtreme = fe;\r\n }", "void setIgnoreForRecovery(boolean value) {\n ignoreForRecovery = value;\n }", "void preWithdraw(double amount) {\n\t\tSystem.out.println(\"Your account is not saver account.\");\n\t}", "public boolean ignore() {\n\t\tif(ignoreT<=0) return false; // if ignoreT is 0, the user gets control again\n\t\telse return true; // otherwise the user doesn't have control\n\t}", "void setExtremeSpikeIncrease(VariableAmount increase);", "public static void incrNotFounds() { ++notFounds; }", "@Test(timeout = 4000)\n public void test072() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[7];\n evaluation0.updateMargins(doubleArray0, 3, (-1));\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test(timeout = 4000)\n public void test038() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.falseNegativeRate(0);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public int getSkipCount()\n {\n return skipCount;\n }", "@Override\n\tpublic void useSavedNumber(double num)\n\t{\n\t\tString[] options = {\"Solubility - before\", \"Solubility - after\", \"Pressure - before\", \"Pressure - after\"};\n\t\tString result = (String)JOptionPane.showInputDialog(panel, \"Choose where to use the number.\", \"Choose number\", JOptionPane.PLAIN_MESSAGE, null, \n\t\t\t\toptions, options[0]);\n\t\tif(result == null) return;\n\t\tif(result.equals(options[0])) solubility.setBeforeValue(num);\n\t\telse if(result.equals(options[1])) solubility.setAfterValue(num);\n\t\telse if(result.equals(options[2])) pressure.setBeforeValue(num);\n\t\telse pressure.setAfterValue(num);\n\t}", "bool setFrequency(double newFrequency)\n {\n if (newFrequency > 534 && newFrequency < 1606)\n {\n frequency = newFrequency\n return true;\n }\n return false;\n }", "public int getDSTSavings() { throw new RuntimeException(\"Stub!\"); }", "public void visiualizeSkipList(){\r\n\t\tint number=0;\r\n\t\tNode dummy = sl.getFrom(0,0);\r\n\t\t\r\n\t\tNode next;\r\n\t\tfor(int i=sl.height(); i>=0; i--){\r\n\t\t\t\r\n\t\t\tnext = sl.getFrom(i,0);\r\n\t\t\t\r\n\t\t\tfor(int j=0; j<(sl.size()+2); j++){\r\n\r\n\t\t\t\tnumber = next.getKey();\r\n\t\t\t\t//F.p(number);\r\n\t\t\t\tif(number==dummy.getKey()){\r\n\r\n\t\t\t\t\tif(number==minf)\r\n\t\t\t\t\t\tSystem.out.print(\"-inf\");\r\n\t\t\t\t\telse if(number==inf)\r\n\t\t\t\t\t\tSystem.out.print(\"---inf\");\r\n\t\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(\"-\",2)+number);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(repeatStr(\"-\",4));\r\n\t\t\t\t\r\n\t\t\t\tif(dummy.getKey()==number)\r\n\t\t\t\t\tnext = next.getRight();\r\n\t\t\t\t\r\n\t\t\t\tdummy = dummy.getRight();\r\n\t\t\t}\r\n\t\t\tdummy = sl.getFrom(0,0);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "Rate save(Rate u);", "public void setBoostExpiration(){\r\n\t\tboostExpiration = GameController.getTimer() + 1000000000l * length;\r\n\t}", "void skip(int n);", "public static void noSavingsPrinter() {\n System.out.println(line);\n System.out.println(NO_ACHIEVED_SAVINGS_MSG);\n System.out.println(line);\n }", "public int getSkipNum() {\r\n return this.skipNum;\r\n }", "@Test\n @Tag(\"slow\")\n public void testWOOD1P() {\n CuteNetlibCase.doTest(\"WOOD1P.SIF\", \"1.44290241157344\", \"9.99999999999964\", NumberContext.of(7, 4));\n }", "@Test(timeout = 4000)\n public void test028() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numTrueNegatives(2308);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public void setSecondExtreme(double se){\r\n secondExtreme = se;\r\n }", "public int getBatchDownloadWaitTime()\n {\n return 1000; \n }" ]
[ "0.54681635", "0.5224682", "0.5150507", "0.50887334", "0.5080969", "0.5036506", "0.5019767", "0.50196683", "0.5007765", "0.4995363", "0.4985221", "0.4973437", "0.4970334", "0.49385425", "0.49264675", "0.4924415", "0.4919111", "0.49079844", "0.48883122", "0.48655036", "0.4864825", "0.48557767", "0.48407897", "0.48339674", "0.48317018", "0.4828183", "0.48156914", "0.48096564", "0.48032856", "0.48027843", "0.47855183", "0.47844407", "0.47844255", "0.47803", "0.47675332", "0.47619057", "0.47514632", "0.4742612", "0.4731753", "0.4725353", "0.47238845", "0.4714506", "0.4714064", "0.4713406", "0.47003463", "0.46998706", "0.46991178", "0.46955296", "0.46953255", "0.46873444", "0.46854383", "0.4675951", "0.46754134", "0.46681136", "0.46669325", "0.4665944", "0.46631187", "0.4660132", "0.46584338", "0.46567035", "0.46498522", "0.46469834", "0.4644489", "0.46371832", "0.46343052", "0.46251267", "0.4624909", "0.46106115", "0.4609493", "0.46074623", "0.4606881", "0.46024328", "0.4598708", "0.45967752", "0.4595365", "0.45942748", "0.4586507", "0.45805407", "0.4578432", "0.45783293", "0.4574881", "0.4574765", "0.45670727", "0.45565376", "0.45563015", "0.45546073", "0.45534605", "0.45438853", "0.4543707", "0.45406628", "0.45403746", "0.45390186", "0.45326582", "0.45315722", "0.452897", "0.45212972", "0.4520069", "0.45176828", "0.45161954", "0.45160505", "0.45140108" ]
0.0
-1
/ Nothing to do here, as this will never be used as key
@Override public int compareTo(PrefWritable arg0) { // TODO Auto-generated method stub return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public String getKey();", "Object getKey();", "@Override\n protected final Object getKey()\n {\n return this;\n }", "@Override\n public int key() {\n return this.key;\n }", "protected String getKey(int index)\n/* */ {\n/* 1425 */ return null;\n/* */ }", "String key();", "@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getKey() {\n\t\treturn null;\r\n\t}", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "java.lang.String getKey();", "@Override\n public String getKey() {\n return key;\n }", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "String getKey();", "@Override\n\t\tpublic K getKey(){\n\t\t\treturn key;\n\t\t}", "public java.lang.String getKey(){\n return localKey;\n }", "@Override\n\tpublic String getKey() {\n\t\treturn null;\n\t}", "@Override\n public int getKey() {\n return key_;\n }", "@Override\r\n public K firstKey() {\n return null;\r\n }", "public String getKey();", "public String getKey();", "public String getKey();", "public String getKey();", "int getKey();", "int getKey();", "@Override\n public int getKey() {\n return key_;\n }", "@Override\n default String getKey(){\n return key();\n }", "@Override\n\tpublic String getKey() {\n\t\treturn key;\n\t}", "@Override\n public int getKey() {\n return this.key;\n }", "public Object getKey() { return name; }", "BListKey getKey();", "@Override\n public int hashCode() {\n return key.hashCode();\n }", "@Override\n\t\tpublic K getKey() {\n\t\t\treturn k;\n\t\t}", "public abstract String getRefKey();", "private void setKey() {\n\t\t \n\t}", "K getKey();", "K getKey();", "K getKey();", "K getKey();", "XClass getMapKey();", "@Override\n public String getKey()\n {\n return id; \n }", "protected abstract Object _get(String key);", "T key();", "@Override\n public byte key() {\n return keys[entryIndex];\n }", "protected Object getKeyArray()\n/* */ {\n/* 91 */ return this.m_keyTable;\n/* */ }", "public Object getKey() {\r\n return key;\r\n }", "@Override\r\n\t\tpublic K getKey() {\n\t\t\treturn pair.getFirst();\r\n\t\t}", "@Override\n\tpublic Iterator getKeyIterator() {\n\t\treturn new KeyIterator();\n\t}", "@Override\n public String toString(){\n return key;\n }", "final int getKeyPosition(final Object key) {\r\n return Math.abs(key.hashCode()) % buckets.length;\r\n }", "public int getKey(){\n return key;\n }", "protected int firstIndex(Object key)\r\n {\r\n return key.hashCode() & mask;\r\n }", "public abstract String mapItemToKey(String str);", "@Override\n\tpublic Object key() {\n\t\treturn id;\n\t}", "public Object getKey()\n {\n return key;\n }", "public int getKey() {\n\t\treturn 0;\n\t}", "@Override\r\n public K lastKey() {\n return null;\r\n }", "@Override\n public int hashCode() {\n return 1;\n }", "private Node _locate(Object key){\n\t\tint hashCode = key.hashCode();\r\n\t\tint bucketNum = hashCode % _numBuckets;\r\n\t\treturn _locate(key, bucketNum);\r\n\t}", "@Override\n\tpublic String getKey() {\n\t\treturn id+\"\";\n\t}", "KeyMetadata metadata();", "@Override\n public String toString() {\n return key;\n }", "public String getMinKey();", "@Override\n\tpublic boolean containsKey(Object arg0) {\n\t\treturn false;\n\t}", "@Override\r\n public K floorKey(final K key) {\n return null;\r\n }", "public String key() {\n return key;\n }", "public String key() {\n return key;\n }", "private void rebuildKey() {\r\n\r\n final StringBuffer sb = new StringBuffer();\r\n\r\n sb.append(getClassField().getCanonicalName());\r\n for (final Object k : this.keyPartList) {\r\n sb.append(k.toString()).append('|');\r\n }\r\n this.key = sb.toString();\r\n }", "int getKey(int i);", "public abstract int getKeybind();", "abstract public String getImageKey();", "public KeyedEntry() { }", "private int locate(Key key) {\n\t\tint index = hash(key);\n\t\twhile(this.keys[index] != null && !this.keys[index].equals(key)) {\n\t\t\tindex = increment(index);\n\t\t}\n\t\treturn index;\n\t}", "private int indexFor(K key) {\n int hash = hash(key.hashCode());\n return hash % this.container.length;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn getKey() != null ? getKey().hashCode() : 0;\n\t}", "String newKey();", "abstract K getFirstLeafKey();", "abstract K getFirstLeafKey();", "public String key() {\n return this.key;\n }", "public String key() {\n return this.key;\n }", "public String key() {\n return this.key;\n }", "public String key() {\n return this.key;\n }", "@Override\n\tpublic Iterator<K> getKeyIterator() {\n\t\treturn null;\n\t}", "protected String getKey(String baseKey){\n \treturn getKey(baseKey, id);\n }", "@Override\n\t\tpublic Text createKey() {\n\t\t\treturn null;\n\t\t}", "public String getKey() {\n\treturn key;\n }", "String getLookupKey();" ]
[ "0.71935457", "0.6947487", "0.6920234", "0.6893605", "0.6834606", "0.6741819", "0.6725343", "0.6725343", "0.6716331", "0.6716331", "0.6716331", "0.6716331", "0.6716331", "0.6716331", "0.67140275", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.6683904", "0.665146", "0.6633999", "0.6630699", "0.6612837", "0.6562867", "0.65407056", "0.65407056", "0.65407056", "0.65407056", "0.6534492", "0.6534492", "0.64967966", "0.6458445", "0.64131474", "0.6400837", "0.6384112", "0.6367561", "0.6365023", "0.6355476", "0.635041", "0.634945", "0.634265", "0.634265", "0.634265", "0.634265", "0.63377947", "0.63131684", "0.62838733", "0.6279131", "0.62618", "0.62591445", "0.6252926", "0.62523514", "0.6244171", "0.6237589", "0.62277204", "0.6224674", "0.6224371", "0.62197393", "0.6212607", "0.62080544", "0.6175105", "0.6152127", "0.61487794", "0.6141655", "0.61202854", "0.6108624", "0.6103924", "0.6101558", "0.60993546", "0.60962284", "0.60958385", "0.60958385", "0.6082408", "0.60692304", "0.60546327", "0.60510534", "0.6048835", "0.6043114", "0.6031878", "0.6031814", "0.60222447", "0.60192305", "0.60192305", "0.60116833", "0.60116833", "0.60116833", "0.60116833", "0.60108846", "0.5991946", "0.59891284", "0.5988637", "0.59865326" ]
0.0
-1
check if the Worker are busy
@Override public void receive(Task task) throws RemoteException, BusyWorkerException { if (this.isBusy) { throw new BusyWorkerException("I'm busy right now"); } // run a new task on a separated thread (new ProcessTask(task)).start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isBusy();", "public boolean isBusy() {\n\t\treturn false;\n\t}", "public boolean busyReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_BUSY];\n\t\t}", "public boolean isBusy() {\n\t\treturn this.call != null;\n\t}", "public synchronized boolean isBusy(){\n return isBusy;\n }", "public boolean isAlive(){\r\n\t\treturn Thread.currentThread() == workerThread;\r\n\t}", "@Override\n\tpublic boolean isBusy() {\n\t\treturn false;\n\t}", "boolean hasWork();", "public boolean isAvailable(){\r\n return blockingQueue.size() < maxWorkQueueSize;\r\n }", "public boolean isDone(){\r\n\t\tif(worker.getState()==Thread.State.TERMINATED) return true;\r\n\t\treturn false;\r\n\t}", "public boolean isBusy() {\n return isBusy;\n }", "private boolean isBusy() {\n return currentStudent != null;\n }", "public boolean isBusy() {\n\t\treturn isBusy;\n\t}", "@Override\n public boolean isBusy() {\n return false;\n }", "private boolean areAllExecutorsBusy(Slave s) {\n int count = 0;\n for (Executor executor : s.getComputer().getExecutors()) {\n if (!executor.isBusy()) {\n count++;\n }\n }\n return (count == 0);\n }", "public boolean isBusy() {\n\t\treturn this.busy;\n\t}", "public boolean hasWorkToDo() {\n return !this.incUpdateQueue.isEmpty();\n }", "private boolean isHealthy() {\n if (!fsOk) {\n // File system problem\n return false;\n }\n // Verify that all threads are alive\n if (!(leases.isAlive() && compactSplitThread.isAlive() &&\n cacheFlusher.isAlive() && logRoller.isAlive() &&\n workerThread.isAlive())) {\n // One or more threads are no longer alive - shut down\n stop();\n return false;\n }\n return true;\n }", "public void checkOffTask() {\n isDone = true;\n }", "boolean isWaiting()\n {\n return waitFlags != 0;\n }", "public boolean isAvailable() {\n return LocalTime.now().isAfter(busyEndTime);\n }", "private boolean isWorkSearch() {\n int i = 0;\n for (Thread thread : this.threadsSaerch) {\n if (thread != null && thread.isAlive()) {\n i++;\n }\n }\n return i == 0;\n }", "public boolean isBusy (int reg) {\n\t\treturn finalized[reg].isBusy();\n\t}", "private static boolean killAllWorkersExceptItself() {\n\t\treturn false;\n\t\t\n\t}", "public boolean isXmtBusy() {\n return false;\n }", "void doCheckHealthy();", "public boolean isPausable();", "public boolean isATMReadyTOUse() throws java.lang.InterruptedException;", "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}", "private boolean isExhausted() {\n return runnableTasks.isEmpty()\n && runnableActions.isEmpty() && runningTasks == 0;\n }", "private static boolean hasErrFound() {\r\n\t\tsynchronized (workerLock) {\r\n\t\t\treturn (errFoundByThread != -1);\r\n\t\t}\r\n\t}", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "@Override\n\tpublic boolean isBusy() throws DeviceException {\n\t\treturn false;\n\t}", "public boolean isReady();", "public boolean isReady();", "public boolean isBusyLoading() {\n\t\treturn false; // return (AppStatusLine.isBusyLoading());\n\t}", "public synchronized void makeBusy(){\n isBusy = true;\n }", "boolean motorsAreBusy();", "private boolean hasWaiters()\r\n/* 438: */ {\r\n/* 439:526 */ return this.waiters > 0;\r\n/* 440: */ }", "public boolean isIdle() {\n return queue.isEmpty();\n }", "boolean available()\n {\n synchronized (m_lock)\n {\n return (null == m_runnable) && (!m_released);\n }\n }", "public WorkerStatus getStatus(){\r\n\t\ttry {\r\n\t\t\t//System.out.println(\"Place 1\");\r\n\t\t\treturn this.workerStatusHandler.getWorkerStatus(this.getPassword());\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t//System.out.println(\"Place 2\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tdead = true;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "boolean isReady();", "boolean isReady();", "boolean isReady();", "private boolean isAnyThreadWorking()\n\t{\n\t\tboolean someoneIsWorking = false;\n\t\tfor (int i = 0; i < threads.size(); i++)\n\t\t{\n\t\t\tThread thread = threads.get(i);\n\t\t\tif (thread.isAlive() && thread.getState() == State.RUNNABLE)\n\t\t\t{\n\t\t\t\tsomeoneIsWorking = true;\n\t\t\t}\n\t\t}\n\t\treturn someoneIsWorking;\n\t}", "boolean isMonitoringTerminated();", "public boolean mustWait() {\n return mustWait;\n }", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "public boolean isOccupied(){\n \t\treturn occupiedSeconds > 0;\n \t}", "public boolean isComplete() {\n return addedFrontWork.size() == 0 && addedBackWork.size() == 0 && sawAllDone.get();\n }", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean hasStuck() {\r\n return stuck;\r\n\t}", "boolean isDone();", "boolean getHealthy();", "protected boolean isFinished()\n {\n return timer.get() > driveDuration;\n }", "public boolean isDone();", "public boolean isDone();", "protected abstract long waitOnQueue();", "public boolean isRunning() {\n\t\treturn !loopTask.stop;\n\t}", "@Override\n\tpublic boolean isJobRunning() {\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n return Math.abs(pid.getError()) < 0.25;\n }", "private boolean isBusyNow() {\n if (tip.visibleProperty().getValue()){\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"FTP Client\");\n alert.setHeaderText(\"Please wait current download finish!\");\n alert.initOwner(main.getWindow());\n alert.showAndWait();\n return true;\n }\n return false;\n }", "boolean hasProgress();", "boolean hasProgress();", "public void timeToCheckWorker() {\n notifyCanMove(this.getCurrentTurn().getCurrentPlayer());\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "public boolean isSuspended();", "public boolean IsAlive() {\n\treturn process != null;\n }", "boolean isAvailable( long millis );", "public static boolean checkResources(){\n for(Instruction i : waitingList){\n if(resourceArr[i.resourceType - 1] >= i.resourceAmount){\n return true;\n }\n }\n for(int i = 0 ; i < taskPointers.length; i ++){\n int pointerIndex = taskPointers[i];\n Task currTask = taskList.get(i);\n if(currTask.terminateTime == - 1 && (currTask.isAborted == false) && Collections.disjoint(waitingList, currTask.instructionList)){\n Instruction currInstruction = currTask.instructionList.get(pointerIndex);\n Type instructionType = currInstruction.instructionType;\n int resourceType = currInstruction.resourceType;\n if(instructionType != Type.request){\n return true;\n }else{\n if(resourceArr[currInstruction.resourceType - 1] >= currInstruction.resourceAmount){\n return true;\n }\n }\n }\n\n }\n return false;\n }", "boolean isPendingToRead();", "@Override\n public boolean isReady() {\n return !isDone;\n }", "boolean isDone(long number) throws NoSuchJobException;", "public void checkWorkers() throws IOExceptionFromController {\n for (Player player : players) {\n if (!player.hasLost() && player.getWorkers().size() == 0) eliminatePlayer(player, \"outOfWorkers\");\n }\n }", "public boolean hasProgress();", "public boolean inProgress(){return (this.currentTicket != null);}", "protected final boolean tabuReplicasBusy(List<Future<SubSearchType>> tabuFutures) {\n Iterator<Future<SubSearchType>> itr = tabuFutures.iterator();\r\n while (itr.hasNext()) {\r\n if (itr.next().isDone()) {\r\n itr.remove();\r\n }\r\n }\r\n // if busy futures remain, return true\r\n return tabuFutures.size() > 0;\r\n }", "@SuppressWarnings(\"deprecation\") //For more on why this is added, see - https://stackoverflow.com/q/45519439/5550161\n public boolean isBusyRecording() {\n ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n if (ScreenRecordService.class.getName().equals(service.service.getClassName())) {\n return true;\n }\n }\n return false;\n }", "boolean hasTask();", "public boolean availableServer(){\n for(int i = 0; i < cntServer; i++){\n if(serverArray[i].busy == false){return true;}\n }\n return false;\n }", "public boolean areUstilWorking() {\n\t\t\n\t\treturn this.working;\n\t\t\n\t}", "@Override\n\t\tprotected Boolean doInBackground(Void... params) {\n\t\t\tboolean result = true;\n\t\t\ttry {\n\t\t\t\tThread.sleep(60000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// We were interrupted\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "public boolean isRunning() { return _timer!=null && _timer.isRunning(); }", "private void checkCrossThreads() {\t\r\n\t\t\tisJumppingBetweenThreads = (currentThread != Thread.currentThread());\r\n\t\t}", "boolean hasStopped()\n {\n if (running && ! isAlive())\n {\n nextStartTime = System.currentTimeMillis() + minDurationInMillis;\n running = false;\n return true;\n }\n return false;\n }", "public boolean operationWaiting(){\n\t\tif (var2Set) return true; else return false;\n\t}", "@Override\n\tpublic boolean isReady() {\n\t\treturn (this.baseTime == this.timeRemaining);\n\t}", "public void check() {\n\t\t\ttry {\n\t\t\t\twhile (num < MAX) {\n\t\t\t\t\tMessage msg = Message.obtain();\n\t\t\t\t\tlong workingNum = num;\n\t\t\t\t\tif (isPrime(workingNum)) {\n\t\t\t\t\t\tif (workingNum == 1)\n\t\t\t\t\t\t\tworkingNum = 2;\n\t\t\t\t\t\tmsg.obj = workingNum;\n\t\t\t\t\t\thandler.sendMessage(msg);\n\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t}\n\n\t\t\t\t\tnum += 2;\n\n\t\t\t\t}\n\n\t\t\t\tMessage msg = Message.obtain();\n\t\t\t\tLog.d(TAG, \"Counter has reached Max\");\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"max\", \"Counter has reached Max\");\n\t\t\t\tmsg.setData(bundle);\n\t\t\t\thandler.sendMessage(msg);\n\n\t\t\t\t// If the Thread is interrupted.\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tLog.d(TAG, \"Thread interrupted\");\n\t\t\t}\n\n\t\t}", "public boolean isStillProcessing() {\r\n\tif(logger.isDebugEnabled())\r\n\t\tlogger.debug(\"BytesnotReadChangedCount is: \" + bytesReadNotChangedCount);\r\n\tif (bytesReadNotChangedCount > 3) {\r\n\t //Abort processing\r\n\t return false;\r\n\t} else {\r\n\t return true;\r\n\t}\r\n }", "Boolean isAvailable();", "private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }" ]
[ "0.759219", "0.7246641", "0.7233746", "0.6938958", "0.69077206", "0.689626", "0.6878394", "0.68452716", "0.6809268", "0.6775162", "0.67344975", "0.67338634", "0.6691736", "0.6665435", "0.6633116", "0.65911686", "0.65330803", "0.6520072", "0.648571", "0.64221317", "0.6402955", "0.63818395", "0.636586", "0.62772393", "0.62575793", "0.62503237", "0.62288105", "0.6222233", "0.6195646", "0.6160524", "0.61545175", "0.61318254", "0.6126876", "0.6112376", "0.6112376", "0.6109061", "0.61021954", "0.61018896", "0.6095159", "0.60621274", "0.6061869", "0.60568154", "0.60537994", "0.60537994", "0.60537994", "0.6045097", "0.6026057", "0.60083085", "0.6004322", "0.6004322", "0.6004322", "0.6004322", "0.6004322", "0.6003379", "0.59902143", "0.59823453", "0.59823453", "0.59823453", "0.59823453", "0.59823453", "0.59823453", "0.59738123", "0.59720737", "0.5958454", "0.5942277", "0.5926248", "0.5926248", "0.58973044", "0.5897255", "0.58971673", "0.5892393", "0.5875026", "0.5866895", "0.5866895", "0.5851317", "0.58472896", "0.584684", "0.5842304", "0.5821229", "0.5809816", "0.5801516", "0.5799492", "0.57976675", "0.57964957", "0.5789918", "0.578856", "0.57796866", "0.5768298", "0.5764244", "0.57624257", "0.5760657", "0.5754536", "0.57526296", "0.57511425", "0.5738008", "0.57348585", "0.57331216", "0.573089", "0.57297873", "0.57292795", "0.5713043" ]
0.0
-1
The getCurrentLeague method gets the currentLeague
public static boolean getCurrentLeague(String lID, List<LeagueBean> leagueList) { boolean status = false; // query status Connection conn = null; // DB Connection PreparedStatement league = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); league = conn.prepareStatement("SELECT leagueID, leagueName, leagueStatus from league where leagueID = ?"); league.setString(1, lID); rs = league.executeQuery(); status = rs.next(); //return to the start of the result set rs.beforeFirst(); //Loop through and add the results of the query to a LeagueBean then add it to the list while(rs.next()) { LeagueBean lb = new LeagueBean(); lb.setLeagueId(rs.getString(1)); lb.setLeagueName(rs.getString(2)); lb.setStatus(rs.getString(3)); leagueList.add(lb); } // close all connections and catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (league != null) { try { league.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "public League getLeagueName() {\n return leagueName;\n }", "public int getLeagueId() {\n return leagueId;\n }", "public Long getLeagueId() {\n return (this.leagueId);\n }", "public LiveData<LeagueEntity> getLeague() {\n return observableLeague;\n }", "@ModelAttribute(\"currentLeague\")\n\tpublic League getCurrentLeague(UserSubscription subscription) {\n\t\treturn subscription.getLeague();\n\t}", "public Game getCurrentGame()\r\n {\r\n return currentGame;\r\n }", "public static GameClient getCurrentGame() {\n\t\treturn arcade.getCurrentGame();\n\t}", "public League getLeagueDetails(String leagueName) {\n return League.getLeagueByName(leagueName);\n }", "public String getActiveGame() {\n return myActiveGame;\n }", "Team getMyTeam();", "public String getAwayTeam();", "private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }", "int getTeam();", "public String getHomeTeam();", "Match getTeam1LooserOfMatch();", "public Team getTeam() {\n return team;\n }", "public final EObject entryRuleLeague() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject iv_ruleLeague = null;\r\n\r\n\r\n try {\r\n // InternalEsportDsl.g:804:47: (iv_ruleLeague= ruleLeague EOF )\r\n // InternalEsportDsl.g:805:2: iv_ruleLeague= ruleLeague EOF\r\n {\r\n newCompositeNode(grammarAccess.getLeagueRule()); \r\n pushFollow(FOLLOW_1);\r\n iv_ruleLeague=ruleLeague();\r\n\r\n state._fsp--;\r\n\r\n current =iv_ruleLeague; \r\n match(input,EOF,FOLLOW_2); \r\n\r\n }\r\n\r\n }\r\n\r\n catch (RecognitionException re) {\r\n recover(input,re);\r\n appendSkippedTokens();\r\n }\r\n finally {\r\n }\r\n return current;\r\n }", "@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }", "public League setLeague(String leagueName) {\n logger.info(leagueName + \" was set\");\n return new League(leagueName);\n }", "public Player getCurrentTurn() {\r\n\t\treturn this.currentTurn;\r\n\t}", "public static Player getCurrPlayer(){\n\t\treturn players.get(curr);\n\t}", "public SoccerTeam getLoser() {\n SoccerTeam loser = null;\n\n if (this.scoreOne < this.scoreTwo) {\n loser = this.teamOne;\n }\n else if (this.scoreOne > this.scoreTwo) {\n loser = this.teamTwo;\n }\n\n return loser;\n }", "public int getTeam() {\n return team;\n }", "public static Team whoLostGameTeam() {\r\n\t\tint lowest = Main.loseScoreNumb;\r\n\t\tTeam loser = null;\r\n\t\t\r\n\t\t//Team one is the looser.\r\n\t\tif (Utils.stringToInt(Main.team1Score) >= lowest) {\r\n\t\t\tlowest = Utils.stringToInt(Main.team1Score);\r\n\t\t\tloser = Main.teamOne;\r\n\t\t}\r\n\t\t//Team two is the loser.\r\n\t\tif (Utils.stringToInt(Main.team2Score) >= lowest) {\r\n\t\t\tlowest = Utils.stringToInt(Main.team2Score);\r\n\t\t\tloser = Main.teamTwo;\r\n\t\t}\r\n\t\t\r\n\t\treturn loser;\r\n\t}", "Match getTeam2LooserOfMatch();", "@Override\n public String getCurrentPlayer() {\n return godPower.getCurrentPlayer();\n }", "public Room getCurrentRoom() {\n return playerRoom;\n }", "public Room getCurrentRoom() {\r\n return player.getCurrentRoom();\r\n }", "public User getCurrentUser() {\n\t\treturn users.get(userTurn);\n\t}", "public static Team whoWonGameTeam() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tTeam winner = null;\r\n\t\t\r\n\t\t//Winner is team one.\r\n\t\tif (Utils.stringToInt(Main.team1Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team1Score);\r\n\t\t\twinner = Main.teamOne;\r\n\t\t}\r\n\t\t//Winner is team two.\r\n\t\tif (Utils.stringToInt(Main.team2Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team2Score);\r\n\t\t\twinner = Main.teamTwo;\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}", "public Team getTeam1 () {\n return team1;\n }", "void findOpponent() {\n\t\tif(gameHelper == null){return;}\n\t\tif (gameHelper.isSignedIn()) {\n\t\t\tIntent intent = Games.TurnBasedMultiplayer\n\t\t\t\t\t.getSelectOpponentsIntent(gameHelper.getApiClient(), 1, 1);\n\t\t\tstartActivityForResult(intent, RC_SELECT_PLAYERS);\n\t\t} else if (gameHelper.isConnecting()) {\n\t\t\tToast.makeText(getActivity(), R.string.wait_connecting_to_google,\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}", "public Team getTeam() {\r\n\t\treturn team;\r\n\t}", "String getWonTeam() {\r\n return this.teamName;\r\n }", "int getCurrentTurn();", "public Lobby getLobbyFrame() {\r\n return lobbyFrame;\r\n }", "public int getCurrentTurn()\r\n {\r\n return currentTurn;\r\n }", "public static Game getGame() {\r\n\t\treturn game;\r\n\t}", "public String getTeam() {\n return team;\n }", "public Player getCurrentPlayer(){\n return this.currentPlayer;\n }", "@Override\n public String getTeam(){\n return this.team;\n }", "public static Game getGame() {\n return game;\n }", "@Override\r\n\tpublic String getTeam() {\n\t\treturn team;\r\n\t}", "public int getCurrentTurn(){\n return m_currentTurn;\n }", "public static Game getGame() {\n\t\treturn game;\n\t}", "public Loan getCurrentLoan() {\n\t\treturn currentLoan;\n\t}", "public int getCurrentTurn() {\n return currentTurn;\n }", "public int getTeam() {\n return team_;\n }", "public Player getCurrentPlayer()\n\t{\n\t\treturn current;\n\t}", "public Player getCurrentPlayer(Match match) {\r\n LOGGER.debug(\"--> getCurrentPlayer: match=\" + match);\r\n Player currentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 1) {\r\n currentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 2) {\r\n currentPlayer = match.getPlayer2();\r\n } else if (match.getCurrentPlayer() == 0) {\r\n currentPlayer = match.getPlayer1();\r\n } else {\r\n throw new GeneralException(\"match has no defined currentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getCurrentPlayer\");\r\n return currentPlayer;\r\n }", "public SoccerTeam getTeamOne() {\n return teamOne;\n }", "public Game getGame()\n\t{\n\t\treturn game;\n\t}", "public User getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "public String getHomeTeam(){\n\t\treturn _homeTeam.getTeamName();\n\t}", "public String getHomeTeam() {\n return homeTeam;\n }", "public Player getCurrent(){\n\t\tPlayer p;\n\t\ttry{\n\t\t\tp = this.players.get(this.currElem);\n\t\t\t\n\t\t} catch(IndexOutOfBoundsException e){\n\t\t\tSystem.out.println(\"There isn't any players.\");\n\t\t\tp = null;\n\t\t}\n\t\t\t\n\t\treturn p; \n\t}", "public BowlingGame getGame();", "public String getCurrLexeme()\n {\n return myCurrLexeme;\n }", "public List<Hero> getTeam() {\r\n return team;\r\n }", "@java.lang.Override\n public int getCurrentTurn() {\n return currentTurn_;\n }", "public static Team getWinner() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getWinner();\n\t\treturn null;\n\t}", "public int getCurrentPlayer() {\n return player;\n }", "public Game getGame () {\n return game;\n }", "public String getCurrentPlayer() {\r\n return this.playerIds[this.currentPlayer];\r\n }", "@java.lang.Override\n public int getCurrentTurn() {\n return currentTurn_;\n }", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "public static boolean getLeagueForEdit(LeagueBean l) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getLeague = null;\t\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetLeague = conn.prepareStatement(\"SELECT leagueName, leaguePlayoffs, leaguePlayoffTeams, leagueStatus from league WHERE leagueId=?\");\r\n\t\t\tgetLeague.setString(1, l.getLeagueId());\r\n\t\t\trs = getLeague.executeQuery();\r\n\r\n\t\t\tif(rs.next()) {\r\n\t\t\t\tl.setLeagueName(rs.getString(1));\r\n\t\t\t\tl.setLeaguePlayoffs(rs.getString(2));\r\n\t\t\t\tl.setLeaguePlayoffTeams(rs.getString(3));\r\n\t\t\t\tl.setStatus(rs.getString(4));\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getLeague != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetLeague.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public int getTeam() {\n return team_;\n }", "protected Game getGame(){\n\t\treturn game;\n\t}", "public SoccerTeam getWinner() {\n SoccerTeam winner = null;\n\n if (this.scoreOne > this.scoreTwo) {\n winner = this.teamOne;\n }\n else if (this.scoreOne < this.scoreTwo) {\n winner = this.teamTwo;\n }\n\n return winner;\n }", "public Game getGame() {\r\n return game;\r\n }", "public Player getCurrentPlayer(){\n String playerId = getUser().get_playerId();\n\n Player player = null;\n\n try {\n player = getCurrentGame().getPlayer(playerId);\n } catch(InvalidGameException e) {\n e.printStackTrace();\n System.out.println(\"This is the real Error\");\n }\n\n return player;\n }", "public Game getGame()\n {\n return game;\n }", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "public Room getCurrentRoom()\n {\n return currentRoom;\n }", "public SpectatorGameInfo getCurrentGame(Platform server, long summonerId)\n {\n DataCallBuilder builder = new DataCallBuilder().withURLParameter(Constants.SUMMONER_ID_PLACEHOLDER, String.valueOf(summonerId))\n .withEndpoint(URLEndpoint.V3_SPECTATOR_CURRENT)\n .withPlatform(server);\n \n \n Optional chl = DataCall.getCacheProvider().get(URLEndpoint.V3_SPECTATOR_CURRENT, server, summonerId);\n if (chl.isPresent())\n {\n return (SpectatorGameInfo) chl.get();\n }\n \n \n try\n {\n SpectatorGameInfo fg = (SpectatorGameInfo) builder.build();\n DataCall.getCacheProvider().store(URLEndpoint.V3_SPECTATOR_CURRENT, fg, server, summonerId);\n return fg;\n } catch (ClassCastException e)\n {\n return null;\n }\n }", "protected Game getGame() {\n return game;\n }", "public Room getCurrentRoom() {\r\t\treturn currentRoom;\r\t}", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public String getCurrentPlayer() {\n return currentPlayer;\n }", "public GameLogic getGame(){\n\t\treturn game;\n\t}", "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public String getTeam() {\n\t\treturn team;\n\t}", "private Team getTeam(String teamName) {\n return scoreboard.getTeam(trimString(teamName));\n }", "public Game getGame() {\n return game;\n }", "public Game getGame() {\n return game;\n }", "public Game getGame() {\n return game;\n }", "public Game getGame() {\n return game;\n }", "public Player getOpponent() {\n\t\treturn opponent;\n\t}", "public static GameBoard getGame(){\n\t\t\treturn gameBoard;\n\t\t}", "public FightTeam team();", "public Game getGame() {\r\n\t\treturn _game;\r\n\t}", "public int getCurrentPlayer() {\n\t\treturn player;\n\t}", "public Player getActivePlayer() {\r\n return activePlayer;\r\n }", "public Player checkForWinner() {\n if (playersInGame.size() == 1) {\n Player winner = playersInGame.get(0);\n\n // --- DEBUG LOG ---\n // The winner of the game\n Logger.log(\"WINNING PLAYER:\", winner.toString());\n\n return winner;\n } else {\n return null;\n }\n }", "protected ClientList getCurrentPlayers() {\r\n\t\treturn this.players;\r\n\t}", "public String getTeam() {\r\n\t\treturn Team;\r\n\t}" ]
[ "0.7644577", "0.72201854", "0.6856015", "0.672492", "0.6517058", "0.6471171", "0.64703465", "0.6308764", "0.6156975", "0.60055685", "0.5982005", "0.5943079", "0.5908957", "0.5872724", "0.58321786", "0.5755685", "0.5725469", "0.57174957", "0.5713648", "0.56611544", "0.56607914", "0.5636573", "0.55929655", "0.55589837", "0.55472654", "0.55465734", "0.5542597", "0.55329496", "0.55073476", "0.55067414", "0.5503936", "0.5491685", "0.54890513", "0.5476224", "0.54679096", "0.5460098", "0.5447242", "0.54434633", "0.5435242", "0.54260564", "0.54258394", "0.54245806", "0.5412317", "0.54051495", "0.54049987", "0.54038376", "0.5403428", "0.54011846", "0.53971744", "0.5396648", "0.5386159", "0.5378374", "0.5375977", "0.536313", "0.5352152", "0.53499615", "0.53464305", "0.5345621", "0.5345349", "0.5344943", "0.532031", "0.5313274", "0.5298358", "0.52978075", "0.529102", "0.52903825", "0.52896595", "0.52896595", "0.5288203", "0.52814525", "0.5281392", "0.52762115", "0.52724767", "0.52698994", "0.52671444", "0.52575177", "0.5256294", "0.5249456", "0.52457666", "0.5244289", "0.5243083", "0.52402496", "0.5234017", "0.52227646", "0.52227646", "0.5218304", "0.52175325", "0.5215852", "0.5215852", "0.5215852", "0.5215852", "0.5212768", "0.5208551", "0.5207869", "0.5206605", "0.52000046", "0.51940775", "0.5193189", "0.5190244", "0.5188785" ]
0.562524
22
The getAllLeagues method gets all leagues into the List
public static boolean getAllLeagues(List<LeagueBean> leagueList) { boolean status = false; // query status Connection conn = null; // DB Connection PreparedStatement league = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); league = conn.prepareStatement("SELECT leagueID, leagueName from league"); rs = league.executeQuery(); status = rs.next(); //return to the start of the result set rs.beforeFirst(); //Loop through and add the results of the query to a LeagueBean then add it to the list while(rs.next()) { LeagueBean lb = new LeagueBean(); lb.setLeagueId(rs.getString(1)); lb.setLeagueName(rs.getString(2)); leagueList.add(lb); } // close all connections and catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (league != null) { try { league.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n private List createLeagueList() {\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n HashMap m = new HashMap();\n m.put( \"League\", leagues_array.get(i)); // the key and it's value.\n result.add( m );\n }\n return (List)result;\n }", "@GET(\"v1/competitions/\")\n Call<List<Leagues>> getAllData();", "@Override\n public List<League> getLeaguesByCategory(int categoryId) throws ServiceException {\n try {\n return leagueDAO.getLeaguesByCategory(categoryId);\n } catch (DAOException exc){\n LOG.error(exc);\n throw new ServiceException(exc);\n }\n }", "public List<Team> getAllByLeague(League leagueID) {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAllByLeague(leagueID);\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "public static ArrayList<Loan> getAllLoans() throws SQLException{\n\t\tConnection conn = DataSource.getConnection();\n\t\tArrayList<Loan> result = null;\n\t\ttry{\n\t\t\t\n\t\t\tresult = new ArrayList<Loan>();\n\t\t\tString query = \"SELECT * FROM loan;\";\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tResultSet rs = stat.executeQuery(query);\n\t\t\twhile (rs.next()){\n\t\t\t\tresult.add((new Loan(rs.getString(\"client_id\"), rs.getDouble(\"principal_amount\"), rs.getDouble(\"interest_rate\"), rs.getInt(\"no_years\"), \n\t\t\t\t\t\trs.getInt(\"no_payments_yearly\"), rs.getString(\"start_date\"))));\n\t\t\t}\n\t\t\treturn result;\n\t\t}finally{\n\t\t\tconn.close();\n\t\t}\n\t}", "@GET\n public List<Lehrer> getAllLehrer() {\n Log.d(\"Webservice Lehrer Get:\");\n Query query = em.createNamedQuery(\"findAllTeachers\");\n List<Lehrer> lehrer = query.getResultList();\n return lehrer;\n }", "@Override\r\n\tpublic List<String> getAllTeam() {\n\t\treturn dao.getAllTeam();\r\n\t}", "public ArrayList getLecturers();", "public ArrayList<CollegeFootballTeam> getTeamList();", "public Iterator getLobbies() {\n rrwl_lobbylist.readLock().lock();\n try {\n return lobbyList.iterator();\n } finally {\n rrwl_lobbylist.readLock().unlock();\n }\n }", "public ArrayList<LoteriaDto> listarLoterias() {\n\n ArrayList<LoteriaDto> lista = new ArrayList();\n Connection con = null;\n try {\n con = Recurso.Conexion.getPool().getDataSource().getConnection();\n String sql = \"SELECT codigo,nombre,dia,hora,minuto,ruta FROM loteria\";\n PreparedStatement str;\n str = con.prepareStatement(sql);\n ResultSet rs = str.executeQuery();\n\n while (rs.next()) {\n LoteriaDto dto = new LoteriaDto();\n dto.setCodigo(rs.getInt(1));\n dto.setNombre(rs.getString(2));\n dto.setDia(rs.getInt(3));\n dto.setHora(rs.getInt(4));\n dto.setMinuto(rs.getInt(5));\n dto.setRuta(rs.getString(6));\n lista.add(dto);\n\n }\n str.close();\n rs.close();\n } catch (SQLException ex) {\n ex.printStackTrace();\n } finally {\n if (con != null) {\n try {\n con.close();\n } catch (SQLException ex) {\n Logger.getLogger(GestorLoteria.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return lista;\n }\n }", "List<Language> getAll();", "public List<Lingua> creaListaLingue() {\n \n List<Lingua> list = linguaFacade.getLingue();\n return list;\n }", "ArrayList<Player> getAllPlayer();", "public List<Team> getAll() {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAll();\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "@Override\n public void update(ArrayList<League> leagues) {\n\n }", "public ArrayList<Team> getList(){\n\t\treturn this.teams;\n\t}", "public List<Volunteer> getAllIdleVolunteers() throws DALException {\n return facadeDAO.getAllIdleVolunteers();\n }", "@Override\r\n\tpublic ArrayList<TeamPO> getAllTeams() {\n\t\treturn teams.getAllTeams() ;\r\n\t}", "public List getAll(){\n\t\tList<Person> personList = personRepository.getAll();\n\t\treturn personList;\n\t}", "public ArrayList<Bot> getAllBots() {\n final String errorMessage = \"Error getting all bots\";\n ResultSet retrievedBots = dbConnector.selectQuery(\"SELECT c.name, bot_id, active_time, probability, activity_status\" +\n \" FROM Bots as b, Company as c WHERE b.company_id = c.company_id;\");\n ArrayList<Bot> bots = null;\n try {\n bots = new ArrayList<Bot>();\n while (retrievedBots.next()) {\n bots.add(toBot(retrievedBots));\n }\n } catch (SQLException e) {\n System.out.println(errorMessage);\n }\n return bots;\n }", "List<GameResult> getAllGameResults();", "public ArrayList<Person> getAllPeople()\r\n\t{\r\n\t\treturn dataService.getAllPeople();\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<Lecture> listLectures() {\n\t\treturn this.lectureDao.listLectures();\n\t}", "public ArrayList<Team> populateDefaultTeams() {\n\t\t\n\t\t///\n\t\t/// declare local variables\n\t\t///\n\t\t\n\t\tArrayList<Team> result = new ArrayList<Team>();\t// holds the resulting list of teams\n\n\t\tString query; \t\t\t\t\t\t\t\t\t// holds query string\n\t\tPreparedStatement stmt; \t\t\t\t\t\t// holds Prepared Statement to execute on the database\n\t\tResultSet rs; \t\t\t\t\t\t\t\t\t// holds the result from the database\n\t\t\n\t\ttry {\n\t\t\n\t\t\t// concatenate select query\n\t\t\tquery = \"SELECT * FROM \" + tableDefaultTeams + \" WHERE \" + columnTeamGender + \" = \" + \"?;\";\n\t\n\t\t\t// initialize the prepare statement, execute it, and\n\t\t\t// store the result\n\t\t\tstmt = conn.prepareStatement(query);\n\t\t\tstmt.setString(1, \"F\");\t\t// TODO: REMOVE HARDCODED GENDER IN SPRINT 2\n\t\t\trs = stmt.executeQuery();\n\t\t\t\n\t\t\twhile (rs.next()) {\n\t\t\t\tTeam team = new Team();\n\t\t\t\t// store the result from the database in the team object\n\t\t\t\tteam.setTeamId(rs.getInt(columnTeamId));\n\t\t\t\tteam.setName(rs.getString(columnTeamName));\n\t\t\t\tteam.setAddress(rs.getString(columnTeamAdress));\n\t\t\t\tteam.setCity(rs.getString(columnTeamCity));\n\t\t\t\tteam.setState(rs.getString(columnTeamState));\n\t\t\t\tteam.setZip(rs.getString(columnTeamZip));\n\t\t\t\tteam.setGender(rs.getString(columnTeamGender));\n\t\t\t\tteam.setLat(rs.getString(columnTeamLat));\n\t\t\t\tteam.setLng(rs.getString(columnTeamLng));\n\t\t\t\tresult.add(team);\n\t\t\t}\n\t\t\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.out.println(sqle.getMessage());\n\t\t}\n\t\t\n\t\t// return the list of teams\n\t\treturn result;\n\t\t\n\t}", "public ArrayList<Language> listLanguages(){\n\t\t\t\n\t\t\tconnectToDatabase();\n\t\t\tArrayList<Language> languageArray = new ArrayList<Language>();\n\t\t\ttry {\n\t\t\t\tStatement create = connection.createStatement();\n\t\t\t\tResultSet result = create.executeQuery(\"Select languages.ID as id, languages.Name AS language FROM languages;\");\n\n\t\t\t\twhile(result.next()){\n\t\t\t\t\t\n\t\t\t\t\tLanguage newLanguage = new Language(result.getInt(\"id\"), result.getString(\"language\"));\n\t\t\t\t\tlanguageArray.add(newLanguage);\n\t\t\t\t}\n\t\t\t\treturn languageArray;\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.out.println(\"An error occurred when retrieving languages from the database.\");\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn languageArray;\n\t\t\t}\n\t\t\t\n\t\t}", "public abstract List<ClueItem> getClues();", "public List<Person> getAllPerson() {\n \t\n //Collection<Person> c = personMap.values();\n List<Person> list = new ArrayList<Person>();\n //list.addAll(c);*/\n list = queryExecutor.selectAll();\n return list;\n }", "@RequestMapping(value = \"/lotes\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Lote> getAllLotes() {\n log.debug(\"REST request to get all Lotes\");\n return loteService.findAll();\n }", "public ArrayList<Book> getListBooklanguage(String laguage);", "@Override\n\tpublic List<Person> getListPeople() {\n\t\tList<Person> people = new ArrayList<>();\n\t\tpeople.add(new Person(\"Juan\", 25));\n\t\tpeople.add(new Person(\"Ana\", 30));\n\t\tpeople.add(new Person(\"Eva\", 42));\n\t\tpeople.add(new Person(\"Piter\", 27));\n\t\tLOG.info(\"HELLO FROM SERVICE\");\n\t\treturn people;\n\t}", "public List<Team> getAllTeams() { \r\n\t\t\tif(teams==null)\t{\r\n\t\t\t\tteams=dao.listTeams(); //LIST\t\t\t\r\n\t\t\tfor(Team atemp:teams){\t\t\tthis.mapTeam.put(atemp.getTeam(), atemp);\t\t}\r\n\t\t\t\t}\r\n\t\t\treturn teams;\r\n\t\t}", "@Override\n public Collection<LoanEligibility> findAll() {\n Collection<LoanEligibility> loanEligibilitys = loanEligibilityRepository.find(new LoanEligibility(), new SearchTemplate());\n return loanEligibilitys;\n }", "public ArrayList<League> getSeasonDetails(String year) {\n return League.getAllLeaguesPerSeason(Integer.parseInt(year));\n }", "public static ArrayList<String> allSeasons(){\n PremierLeagueManager.loadingData();\n\n // sort the seasons using the comparator\n Comparator<String> comparator = (season1, season2) -> {\n\n if(Integer.parseInt(season1.split(\"-\")[0]) > Integer.parseInt(season2.split(\"-\")[0])){\n return 1;\n }\n return -1;\n\n };\n\n // setting the seasons with distinct seasons only\n PremierLeagueManager.setAllSeasonAdded((ArrayList<String>)\n PremierLeagueManager.getAllSeasonAdded().stream().distinct().collect(Collectors.toList()));\n\n // sorting the seasons\n PremierLeagueManager.getAllSeasonAdded().sort(comparator);\n\n // getting the seasons and return them\n return PremierLeagueManager.getAllSeasonAdded();\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<Lecture> listLectures() {\n\t\tSession session = this.sessionFactory.getCurrentSession();\n\t\tList<Lecture> LecturesList = session.createQuery(\"from Lecture\").list();\n\t\treturn LecturesList;\n\t}", "public void refreshAllWordsList()\n {\n // create list\n ArrayList<String> allWordsList = new ArrayList<>();\n \n // get all word from every tree and store them in the list\n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n ArrayList<WordDefinition> allWordsInTree = lexiNodeTrees.get(i).getAllWordsFromTree();\n for(WordDefinition word : allWordsInTree)\n {\n allWordsList.add(word.getWord());\n }\n }\n \n // sort the list in alphabetical order\n Collections.sort(allWordsList);\n \n // show the list in the UI\n DefaultListModel model = new DefaultListModel();\n \n for(String word : allWordsList)\n {\n model.addElement(word);\n }\n \n this.getAllWordsList().setModel(model);\n }", "@Override\r\n public GameList getAllRentedGames(User user) throws RemoteException, SQLException {\r\n return gameListClientModel.getRentedGames(user);\r\n }", "public List<Lote> listarLotes() {\n List<Lote> listaLotes;\n listaLotes = jpaLote.findLoteEntities();\n List<Lote> listaFiltrada = new ArrayList<Lote>();\n for (Lote lote : listaLotes) {\n if (lote.getEstado() == true){\n listaFiltrada.add(lote);\n }\n }\n return listaFiltrada;\n }", "public LiveData<LeagueEntity> getLeague() {\n return observableLeague;\n }", "public static List getAllYears() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT godiste FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n int naziv = result.getInt(\"godiste\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "public List<Hotel> getAvailableHotels(){\n return databaseManager.findAvailableHotels();\n }", "@Override\n\tpublic List<TeamInfo> findAll() {\n\t\treturn repository.findAll();\n\t}", "@Override\r\n\tpublic List<Hotel> getAllHotels() {\n\t\treturn showHotelList();\r\n\t}", "List<RadarTechnologies> getAllRadarTechnologies();", "public ArrayList<String> collegeList() throws Exception {\n\t\tConnection con = null;\n\t\tcon = DBConnector.dbConnection();\n\t\tArrayList<String> colleges = new ArrayList<String>();\n\t\ttry {\n\t\t\tPreparedStatement st = con.prepareStatement(\"select college_name from college\");\n\n\t\t\tResultSet rs = st.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tcolleges.add(rs.getString(1));\n\t\t\t}\n\t\t\tcon.close();\n\t\t} catch (SQLSyntaxErrorException e) {\n\t\t\tthrow new SQLSyntaxErrorException(\"Error in SQL syntax\");\n\t\t} catch (SQLException e) {\n\t\t\tthrow new SQLException(\"Connection with database failed\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Some error occured\");\n\t\t}\n\n\t\treturn colleges;\n\t}", "@Override\n\tpublic List<Tourneys> getAllTourneys() {\n\t\tList<Tourneys>listOfTourneys = new ArrayList<>();\n\t\tString sql = \"select * from tournaments\";\n\t\t\n\t\tSqlRowSet results = jdbcTemplate.queryForRowSet(sql);\n\t\t\twhile(results.next()) {\n\t\t\t\tTourneys tourney = mapRowToTourneys(results);\n\t\t\t\tlistOfTourneys.add(tourney);\n\t\t\t}\t\n\t\treturn listOfTourneys;\n\t}", "ArrayList<Habit> getHabits();", "public List<Anime> listAll(){\n return List.of(new Anime(1L,\"DB2\"), new Anime(2L,\"Berseke\"));\n }", "@GetMapping(\"/localisations\")\n @Timed\n public List<Localisation> getAllLocalisations() {\n log.debug(\"REST request to get all Localisations\");\n return localisationService.findAll();\n }", "List<Team> findAll();", "public List<PlayerWon> findByLeagueId(int leagueId);", "public List<Idea> allIdeas() {\n return ideaRepo.findAll();\n }", "@Override\n public List<UserRoom> getUserRoomList() {\n logger.info(\"Start getUserRoomList\");\n List<UserRoom> userRoomList = new ArrayList<>();\n try {\n connection = DBManager.getConnection();\n preparedStatement = connection.prepareStatement(Requests.SELECT_FROM_USER_ROOM);\n rs = preparedStatement.executeQuery();\n while (rs.next()) {\n userRoomList.add(myResultSet(rs));\n }\n } catch (SQLException sqlException) {\n Logger.getLogger(sqlException.getMessage());\n } finally {\n closing(connection, preparedStatement, rs);\n }\n logger.info(\"Completed getUserRoomList\");\n return userRoomList;\n }", "abstract ArrayList<User> getAllUsers();", "public List<BranchLeader> findBranchLeadersByHallEventId(final Long hallEventId) {\n return new ArrayList<BranchLeader>();\n }", "public static List<CandidateAll> getAll(String query) {\r\n\t\tList<CandidateAll> userList = new ArrayList<CandidateAll>();\r\n\t\tConnection conn = null;\r\n\t\ttry {\r\n\t\t\tconn = ConnectDB.getConnection();\r\n\t\t\ttry (PreparedStatement ps = conn.prepareStatement(query)) {\r\n\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tCandidateAll user = new CandidateAll();\r\n\t\t\t\t\tuser.setFirstName(rs.getString(1));\r\n\t\t\t\t\tuser.setLastName(rs.getString(2));\r\n\t\t\t\t\tuser.setBirthDate(rs.getInt(3));\r\n\t\t\t\t\tuser.setAddress(rs.getString(4));\r\n\t\t\t\t\tuser.setPhone(rs.getString(5));\r\n\t\t\t\t\tuser.setEmail(rs.getString(6));\r\n\t\t\t\t\tuser.setCandidate_type(rs.getInt(7));\r\n\t\t\t\t\tuser.setExpInYear(rs.getInt(8));\r\n\t\t\t\t\tuser.setProSkill(rs.getString(9));\r\n\t\t\t\t\tuser.setGraduation_date(rs.getInt(10));\r\n\t\t\t\t\tuser.setGraduation_rank(rs.getString(11));\r\n\t\t\t\t\tuser.setEduCation(rs.getString(12));\r\n\t\t\t\t\tuser.setMajors(rs.getString(13));\r\n\t\t\t\t\tuser.setSemester(rs.getInt(14));\r\n\t\t\t\t\tuser.setUniversity_name(rs.getString(15));\r\n\t\t\t\t\tuserList.add(user);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (conn != null)\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn userList;\r\n\t}", "@RequestMapping(value = \"/livres\", method = RequestMethod.GET)\n public ResponseEntity<?> getAllLivres() {\n List<Livre> listLivre = null;\n try {\n listLivre = livreService.getAllLivres();\n } catch (Exception e) {\n return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);\n }\n\n return ResponseEntity.status(HttpStatus.OK).body(listLivre);\n }", "@Override\n\tpublic List<Games> allGamesView() {\n\t\treturn gameDAO.viewAllGame();\n\t}", "public List<Tour> findAllTours(){\n\t\treturn tourRepository.findAll();\n\t}", "public DefaultListModel<Person> getAllPeopleDLM()\r\n\t{\r\n\t\tDefaultListModel<Person> list = new DefaultListModel<Person>();\r\n\t\t\r\n\t\tfor(Person person : this.getAllPeople())\r\n\t\t\tlist.addElement(person);\r\n\t\t\r\n\t\treturn list;\r\n\t}", "List<Athlete> getAll();", "public List<Company> getAllCompanies() {\n\t\t \n\t List<Company> listOfCompanies = new ArrayList<Company>();\n\n\t Cursor cursor = mDatabase.query(MySQLiteHelper.TABLE_COMPANIES,\n\t mAllColumns, null, null, null, null, null);\n\n\t cursor.moveToFirst();\n\t while (!cursor.isAfterLast()) {\n\t Company hunt = cursorToCompany(cursor);\n\t listOfCompanies.add(hunt);\n\t cursor.moveToNext();\n\t }\n\t \n\t cursor.close();\n\t return listOfCompanies;\n\t }", "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "public List<ProgressionCourrier> getAllUsers() {\n Query q = getEntityManager().createQuery(\"select U from ProgressionCourrier U order by U.nomPrenoms\");\n // set parameters\n List<ProgressionCourrier> suggestions = q.getResultList();\n\n // avoid returing null to managed beans\n if (suggestions == null) {\n suggestions = new ArrayList<>();\n }\n\n // return the suggestions\n return suggestions;\n\n }", "public List<UsersRobots> findAll(){\n CriteriaBuilder cb = entityManager.getCriteriaBuilder();\n CriteriaQuery<UsersRobots> cq = cb.createQuery(UsersRobots.class);\n Root<UsersRobots> rootEntry = cq.from(UsersRobots.class);\n CriteriaQuery<UsersRobots> all = cq.select(rootEntry);\n TypedQuery<UsersRobots> allQuery = entityManager.createQuery(all);\n return allQuery.getResultList();\n }", "public List<LugarEntity> findall(){\n Query q = em.createQuery(\"SELECT p FROM LugarEntity p\");\n return q.getResultList();\n }", "@SuppressWarnings(\"unchecked\")\n private List createTeamList() {\n\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n /* each group need each HashMap-Here for each group we have 3 subgroups */\n ArrayList secList = new ArrayList();\n for( int n = 0 ; n < SplashScreen.full_teams_array.get(i).size() ; n++ ) {\n HashMap child = new HashMap();\n child.put( \"Team\", SplashScreen.full_teams_array.get(i).get(n) );\n boolean favorite_found = false;\n for(int j=0; j<SplashScreen.new_favorites_array.size(); j++) {\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(SplashScreen.new_favorites_array.get(j)[1]) &&\n leagues_array.get(i).equals(SplashScreen.new_favorites_array.get(j)[0]) ) {\n favorite_found = true;\n }\n }\n if(favorite_found) { child.put( \"Favorite\", \"1\" ); }\n else { child.put( \"Favorite\", \"0\" ); }/*\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(favorite_team) &&\n leagues_array.get(i).equals(favorite_league) ) {\n child.put( \"Favorite\", \"1\" );\n } else {\n }\n child.put( \"Favorite\", \"0\" );/*\n }*/\n secList.add( child );\n }\n result.add( secList );\n }\n return result;\n }", "java.util.List<java.lang.Long> getParticipantsList();", "List<GameResult> getAllResults();", "public List<Loan> getLoans() {\n\t\treturn new ArrayList<Loan>(loans.values());\r\n\t}", "public List<Ramen> getAllRamen(){\r\n //return ramens;\r\n // Originally (above) for hardcoded list, but now it's looking into Crud Repository\r\n List<Ramen> ramens = new ArrayList<>();\r\n ramenRepository.findAll() //An iterable\r\n .forEach(ramens::add); //Lambda expression. For each in iterable, adds to ramens\r\n return ramens;\r\n }", "public LiveData<List<HighScore>> getAllHighScores() {\n return allHighScores;\n }", "@Transactional\n\tpublic List<University> listAllUniversity() {\n\n\t\tCriteriaBuilder builder = getSession().getCriteriaBuilder();\n\t\tCriteriaQuery<University> criteriaQuery = builder.createQuery(University.class);\n\t\tRoot<University> root = criteriaQuery.from(University.class);\n\t\tcriteriaQuery.select(root);\n\t\tQuery<University> query = getSession().createQuery(criteriaQuery);\n\n\t\t// query.setFirstResult((page - 1) * 5);\n\t\t// query.setMaxResults(5);\n\t\treturn query.getResultList();\n\t}", "public List<Player> loadAll() throws SQLException {\n\t\tfinal Connection connection = _database.getConnection();\n\t\tfinal String sql = \"SELECT * FROM \" + table_name + \" ORDER BY id ASC \";\n\t\tfinal List<Player> searchResults = listQuery(connection.prepareStatement(sql));\n\n\t\treturn searchResults;\n\t}", "public LobbyList getLobbyList()\r\n\t{\r\n\t\treturn receiver.getList();\r\n\t}", "public League getLeagueName() {\n return leagueName;\n }", "@Override\n public ArrayList<League> select(String id) {\n return null;\n }", "public List<Team> getAllOrdered() {\n TeamDB tdb = new TeamDB();\n return tdb.getAllOrdered();\n }", "java.util.List<org.landxml.schema.landXML11.LanesDocument.Lanes> getLanesList();", "@WebMethod public List<Team> getAllTeams();", "public ArrayList<Persona> getLEstudiantes() {\n return LEstudiantes;\n }", "public List<Language> getAllLanguages() {\r\n\r\n\t\tStringBuilder sbHql = new StringBuilder();\r\n\t\tsbHql.append(\"from Language\");\r\n\r\n\t\tQuery query = getSession().createQuery(sbHql.toString());\r\n\r\n\t\tList<Language> languages = query.list();\r\n\r\n\t\treturn languages;\r\n\t}", "@Override public GameList getAllGamesFromServer() throws RemoteException, SQLException {\r\n return gameListClientModel.getGamesFromServer();\r\n }", "@NotNull\n @Override\n public List<Lesson> getLessons() {\n return getLessons(false);\n }", "List<Player> getPlayers();", "public List<Country> getAll() throws Exception;", "public static Lecturer getLecturers() {\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/lecturers/findFirstLecturer/\" + MainApp.getCurrentUser().getRoomId())).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n return gson.fromJson(response.body(), new TypeToken<Lecturer>() {\n }.getType());\n }", "ArrayList<E> getAll();", "public ArrayList<Vehicle> getVehicles() {\r\n ArrayList<Vehicle> allVehicles = new ArrayList<>();\r\n for (Lane lane : lanes) {\r\n allVehicles.addAll(lane.getVehicles());\r\n }\r\n return allVehicles;\r\n }", "public List<SamplePerson> getAllPeople() {\n //TODO\n throw new NotImplementedException();\n }", "List<Horse> getAllHorses();", "public List<Match> getAllMatch() {\n return matchRepository.selectAllMatchesFromDatabase();\n }", "public List<Livro> getLista(String exemplar) throws SQLException {\n // Prepara conexão p/ receber o comando SQL\n String sql = \"SELECT * FROM livro WHERE exemplar like ?\";\n PreparedStatement stmt = this.conexao.prepareStatement(sql);\n stmt.setString(1, exemplar);\n\n // Recebe o resultado da consulta SQL\n ResultSet rs = stmt.executeQuery();\n\n List<Livro> lista = new ArrayList<>();\n\n // Enquanto existir registros, pega os valores do ReultSet e vai adicionando na lista\n while (rs.next()) {\n // A cada loop, é instanciado um novo objeto, p/ servir de ponte no envio de registros p/ a lista\n Livro l = new Livro();\n\n // \"c\" -> Registro novo - .setNome recebe o campo do banco de String \"nome\" \n l.setId(Integer.valueOf(rs.getString(\"id_livro\")));\n l.setId_genero(Integer.valueOf(rs.getString(\"id_genero\")));\n l.setExemplar(rs.getString(\"exemplar\"));\n l.setAutor(rs.getString(\"autor\"));\n l.setEdicao(Byte.valueOf(rs.getString(\"edicao\")));\n l.setAno(Short.valueOf(rs.getString(\"ano\")));\n l.setDisponibilidade(rs.getString(\"disponibilidade\"));\n\n // Adiciona o registro na lista\n lista.add(l);\n }\n\n // Fecha a conexão com o BD\n rs.close();\n stmt.close();\n\n // Retorna a lista de registros, gerados pela consulta\n return lista;\n }", "@Override\n public HashMap<String, ArrayList<League>> conditionedSelect(String[] conditions) {\n String query;\n Connection connection = DBConnector.getConnection();\n PreparedStatement statement = null;\n ResultSet retrievedLeagues = null;\n HashMap<String, ArrayList<League>> leagues = new HashMap<>();\n\n if (conditions.length == 0) {\n query = \"select * from [Leagues]\";\n } else {\n query = \"select * from [Leagues] where\";\n\n for (int i = 0; i < conditions.length; i++) {\n if (i % 2 == 0) {\n query += \" \" + conditions[i];\n } else {\n query += \" = ?\";\n if (i < conditions.length - 1)\n query += \" and\";\n }\n }\n }\n try {\n statement = connection.prepareStatement(query);\n\n if (conditions.length > 0) {\n int i = 0;\n while (i < conditions.length) {\n switch (conditions[i].toLowerCase()) {\n case \"leaguename\":\n statement.setString((int) (i / 2) + 1, conditions[i + 1]);\n break;\n\n case \"year\":\n case \"winPoints\":\n case \"drawPoints\":\n case \"losePoints\":\n statement.setInt((int) (i / 2) + 1, Integer.valueOf(conditions[i + 1]));\n break;\n\n case \"schedulingmethod\":\n statement.setBoolean((int) (i / 2) + 1, conditions[i + 1].equals(\"1\"));\n\n default:\n break;\n }\n i += 2;\n }\n }\n\n retrievedLeagues = statement.executeQuery();\n\n\n while (retrievedLeagues.next()) {\n String leagueName = retrievedLeagues.getString(1);\n int season = retrievedLeagues.getInt(2);\n boolean scheduling = retrievedLeagues.getBoolean(3);\n int winPoints = retrievedLeagues.getInt(4);\n int losePoints = retrievedLeagues.getInt(5);\n int drawPoints = retrievedLeagues.getInt(6);\n\n League league = new League(leagueName, season, scheduling, winPoints, drawPoints, losePoints);\n String seasonString = Integer.toString(season);\n ArrayList<League> leaguesList;\n\n if (leagues.containsKey(seasonString)) {\n leaguesList = leagues.get(seasonString);\n } else {\n leaguesList = new ArrayList<>();\n leagues.put(seasonString, leaguesList);\n }\n\n leaguesList.add(league);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage());\n }\n\n return leagues;\n }", "private ArrayList<WobblyScore> getWobblyLeaderboard() {\n ArrayList<WobblyScore> wobblyScores = new ArrayList<>();\n String json = DiscordUser.getWobbliesLeaderboard(codManager.getGameId());\n if(json == null) {\n return wobblyScores;\n }\n JSONArray scores = new JSONArray(json);\n for(int i = 0; i < scores.length(); i++) {\n wobblyScores.add(WobblyScore.fromJSON(scores.getJSONObject(i), codManager));\n }\n WobblyScore.sortLeaderboard(wobblyScores, true);\n return wobblyScores;\n }", "@Override\n\tpublic List<Lending> findAllLending() {\n\t\t\n\t\tList<Lending> objectList = new ArrayList<Lending>();\n\t\tLending lending = new Lending();\n\t\tResultSet resultset = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tconnection = getConnection();\n\t\t\tstatement = connection.prepareStatement(\"select * from lending;\");\n\t\t\tresultset = statement.executeQuery();\n\t\t\twhile(resultset!=null && resultset.next())\n\t\t\t{\n\t\t\t\tint id = resultset.getInt(1);\n\t\t\t\tint user_id = resultset.getInt(2);\n\t\t\t\tUserService us_se = new UserServiceImpl();\n\t\t\t\tUser user = us_se.findUserById(user_id);\n\t\t\t\tint lib_book_id = resultset.getInt(3);\n\t\t\t\tLibraryBookService lb_se = new LibraryBookServiceImpl();\n\t\t\t\tLibraryBook book = lb_se.findLibraryBookById(lib_book_id);\n\t\t\t\tString lending_date = resultset.getString(4);\n\t\t\t\tString return_date = resultset.getString(5);\n\t\t\t\tString returned_date = resultset.getString(6);\n\t\t\t\tint lending_status = resultset.getInt(7);\n\t\t\t\t\n\t\t\t\tlending = new Lending(id,user,book,lending_date,return_date,returned_date,lending_status);\n\t\t\t\t\n\t\t\t\tobjectList.add(lending);\n\t\t\t\t\n\t\t\t\tConstants.Response.MSG = Constants.Response.MSG_SUCCESS;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\tConstants.Response.MSG = Constants.Response.MSG_FAILED;\n\t\t\tSystem.out.println(\"Error occured in data finding\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcloseDBResource();\n\t\treturn objectList;\n\t}", "public ArrayList<String> getAlllectureAttendance() {\n\t\tArrayList<String> attendance_lecture = new ArrayList<String>();\n\t\t// Select All Query\n\t\tString selectQuery = \"SELECT DISTINCT \" + KEY_LECTURE_NUM_ATTENDANCE\n\t\t\t\t+ \" FROM \" + TABLE_TEACHER_ATTENDANCE;\n\t\tCursor cursor = db.rawQuery(selectQuery, null);\n\n\t\t// looping through all rows and adding to list\n\t\tcursor.moveToFirst();\n\t\twhile (cursor.isAfterLast() == false) {// Adding contact to list\n\t\t\tattendance_lecture.add(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(KEY_LECTURE_NUM_ATTENDANCE)));\n\t\t\tLog.d(\"lecture_num\", cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(KEY_LECTURE_NUM_ATTENDANCE)));\n\t\t\tcursor.moveToNext();\n\t\t}\n\t\tcursor.close();\n\t\t// return contact list\n\t\treturn attendance_lecture;\n\t}", "public static List<Groupe> getAll() {\n\n // Creation de l'entity manager\n EntityManager em = GestionFactory.factory.createEntityManager();\n\n // Recherche\n @SuppressWarnings(\"unchecked\")\n List<Groupe> list = em.createQuery(\"SELECT e FROM Groupe e\").getResultList();\n\n return list;\n }" ]
[ "0.6444976", "0.62862223", "0.6085311", "0.59860325", "0.5755836", "0.57340246", "0.57043135", "0.5702328", "0.5701117", "0.56420225", "0.5640987", "0.5611254", "0.5610714", "0.5559757", "0.5453801", "0.54503727", "0.54338336", "0.540832", "0.5346251", "0.5290943", "0.5277847", "0.5277796", "0.52702487", "0.52573246", "0.5252976", "0.5249518", "0.52445966", "0.5229796", "0.5226456", "0.5221512", "0.5208681", "0.51920736", "0.51838446", "0.5181814", "0.51802725", "0.5178226", "0.5170225", "0.51698446", "0.5167672", "0.51672256", "0.5163377", "0.51471335", "0.5144331", "0.5134699", "0.5124014", "0.5116309", "0.5112965", "0.5111147", "0.5105738", "0.5105028", "0.50951564", "0.50937164", "0.5090213", "0.5089959", "0.50831294", "0.50798243", "0.5078654", "0.5078184", "0.50777817", "0.5075332", "0.50748926", "0.507434", "0.5072325", "0.5071942", "0.5064938", "0.5063375", "0.50624776", "0.5054614", "0.5050591", "0.50464046", "0.50461614", "0.5045192", "0.5042308", "0.5038423", "0.50299776", "0.5027911", "0.5027893", "0.50264865", "0.50248224", "0.50194764", "0.50175536", "0.50105536", "0.5004935", "0.50029194", "0.49992272", "0.4998729", "0.49936202", "0.499335", "0.49886894", "0.4988457", "0.49821612", "0.49740416", "0.49651438", "0.4963974", "0.4962883", "0.49627241", "0.4961757", "0.49524567", "0.49464378", "0.4939726" ]
0.6247118
2
The getLeagueDivisions method gets the division and league names
public static boolean getLeagueDivisions(String lID, List<DivisionBean> divisionList) { boolean status = false; // query status Connection conn = null; // DB Connection PreparedStatement division = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); division = conn.prepareStatement("SELECT d.divisionID, d.leagueName from division d inner join" + " leaguexdivision ld on ld.divisionID = d.divisionID where ld.leagueID = ? limit 1"); division.setString(1, lID); rs = division.executeQuery(); status = rs.next(); //return to the start of the result set rs.beforeFirst(); //Loop through and add the results of the query to a LeagueBean then add it to the list while(rs.next()) { DivisionBean lb = new DivisionBean(); lb.setDivisionId(rs.getString(1)); lb.setDivisionName(rs.getString(2)); divisionList.add(lb); } // close all connections and catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (division != null) { try { division.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean getDivisionsByLeague(List<DivisionBean> divs, String leagueId) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getDivisions = null;\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetDivisions = conn.prepareStatement(\"SELECT division.divisionID, divisionName from division, leaguexdivision WHERE leagueID=? AND division.divisionID=leaguexdivision.divisionID\");\r\n\t\t\tgetDivisions.setString(1, leagueId);\r\n\t\t\trs = getDivisions.executeQuery();\r\n\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean div = new DivisionBean();\r\n\t\t\t\tdiv.setDivisionId(rs.getString(1));\r\n\t\t\t\tdiv.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivs.add(div);\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getDivisions != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetDivisions.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public String getDivisionName() {\n return divisionName;\n }", "public League getLeagueName() {\n return leagueName;\n }", "public static boolean getDivisionsWithNoLeague(List<DivisionBean> divs) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getDivisions = null;\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetDivisions = conn.prepareStatement(\"SELECT d.divisionID, d.divisionName FROM division d natural left join leaguexdivision ld WHERE ld.divisionID IS NULL;\");\r\n\t\t\trs = getDivisions.executeQuery();\r\n\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean div = new DivisionBean();\r\n\t\t\t\tdiv.setDivisionId(rs.getString(1));\r\n\t\t\t\tdiv.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivs.add(div);\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getDivisions != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetDivisions.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "@RequestMapping(value = \"/associations/{id}/divisions\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Division> getAssociationGames(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association games: {}\", id);\n\t\tDivision example = new Division();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\texample.setAssociation(exampleAssociation);\n\t\treturn divisionRepository.findAll(Example.of(example));\n\t}", "@Override\r\n public List<GameDto> getFixturesByLeagueAndSeason(LeagueKeys league, SeasonKeys season) {\n String seasonString = Arrays.stream(season.getKey().split(\"/\")).reduce(\"\", (s, t) -> s + t.substring(2,4));\r\n return client.getFixturesByLeagueAndSeason(league.getParam(), seasonString).stream().map(g->toGame(g,season)).collect(toList());\r\n }", "public String getDivision() {\n return division;\n }", "public static List<String> getAttackerFromEngland() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> attackerName= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getPosition().equals(\"Attacker\")&&squad.get(i).getNationality().equals(\"England\")){\n\n attackerName.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n\n\n }\n }\n return attackerName;\n }", "public ArrayList<League> getSeasonDetails(String year) {\n return League.getAllLeaguesPerSeason(Integer.parseInt(year));\n }", "public java.lang.String getDivision() {\n return division;\n }", "public static ArrayList<String> allSeasons(){\n PremierLeagueManager.loadingData();\n\n // sort the seasons using the comparator\n Comparator<String> comparator = (season1, season2) -> {\n\n if(Integer.parseInt(season1.split(\"-\")[0]) > Integer.parseInt(season2.split(\"-\")[0])){\n return 1;\n }\n return -1;\n\n };\n\n // setting the seasons with distinct seasons only\n PremierLeagueManager.setAllSeasonAdded((ArrayList<String>)\n PremierLeagueManager.getAllSeasonAdded().stream().distinct().collect(Collectors.toList()));\n\n // sorting the seasons\n PremierLeagueManager.getAllSeasonAdded().sort(comparator);\n\n // getting the seasons and return them\n return PremierLeagueManager.getAllSeasonAdded();\n }", "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "public static List<String> getAllTeams() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n TeamsPojo pojo = objectMapper.readValue(response.getEntity().getContent(),TeamsPojo.class);\n List<String> willBeReturned = new ArrayList<>();\n List<Teams> teams = pojo.getTeams();\n for (int i =0 ; i<teams.size();i++){\n willBeReturned.add(teams.get(i).getName());\n }\n\n\n return willBeReturned;\n }", "public List<Division> getDivisionParStructure( long idStructure)\n\t{\n List<Division> dicvs=divisionRepository.getDivisionParStructure(idStructure);\n// for(Division a:dicvs)\n// {\n// \t listeDivs.add(a);\n// }\n \n\n\t\tList<Division> Divisions = new ArrayList<>();\n\t\tdivisionRepository.getDivisionParStructure(idStructure).forEach(Divisions::add);\n\t\treturn Divisions;\n\n\t}", "public Set<Cdss4NsarLabor> getLabResults();", "List<SubDivision> findByDivisionIdOrderByCodeAsc(Division divisionId);", "public int getDivisionId() {\n return divisionId;\n }", "public Map<String, String> getNamesAndDptsOfEmployeesFromDepartmentTabs() {\n\n List<WebElement> teamCats = teamPageFactory.teamDepartments;\n int qtyCategories = teamCats.size();\n Map<String, String> otherEmployeesNamesDpts = new HashMap<>();\n\n for (int i = 1; i < qtyCategories; i++) {\n teamCats.get(i).click();\n otherEmployeesNamesDpts.putAll(getNamesAndDepartmentsOfEmployees());\n }\n return otherEmployeesNamesDpts;\n }", "public Division getDivision() throws Exception {\n\tDivision bean = null;\n\tif (getGroupcode() != null)\n\t bean = (Division)getGroups();\n\telse if (getDepartmentcode() != null)\n\t bean = (Division)getDepartments();\n\telse if (getServicecode() != null)\n\t bean = (Division)getServices();\n\telse if (getDirectioncode() != null)\n\t bean = (Division)getDirections();\n\t \n\treturn bean;\n\n}", "public String f9Division() throws Exception {\r\n\t\t\r\n\t\tString query = \" SELECT DISTINCT DIV_ID,NVL(DIV_NAME,' ') \"\r\n\t\t\t\t\t\t+ \" FROM HRMS_DIVISION\"\r\n\t\t\t\t\t\t+ \" WHERE 1=1 AND IS_ACTIVE='Y'\";\r\n\t\t\r\n\t\tif(bulkForm16.getUserProfileDivision() !=null && bulkForm16.getUserProfileDivision().length()>0)\r\n\t\t\tquery+= \" AND DIV_ID IN (\"+bulkForm16.getUserProfileDivision() +\")\"; \r\n\t\t\tquery+= \" ORDER BY DIV_ID \";\r\n\r\n\t\tString[] headers = { getMessage(\"division.code\"),\r\n\t\t\t\tgetMessage(\"division\") };\r\n\r\n\t\tString[] headerWidth = { \"30\", \"70\" };\r\n\r\n\t\tString[] fieldNames = { \"divisionId\", \"divisionName\" };\r\n\r\n\t\tint[] columnIndex = { 0, 1 };\r\n\r\n\t\tString submitFlag = \"false\";\r\n\r\n\t\tString submitToMethod = \"\";\r\n\t\tsetF9Window(query, headers, headerWidth, fieldNames, columnIndex,\r\n\t\t\t\tsubmitFlag, submitToMethod);\r\n\t\treturn \"f9page\";\r\n\t}", "public void printTeamsInLeague(){\n for (T i : teams){\n System.out.println(i.getTeamName());\n }\n }", "public static String getDivisionName(int divisionID) throws SQLException{\r\n Connection conn = DBConnection.getConnection();\r\n String selectStatement = \"SELECT * FROM first_level_divisions WHERE Division_ID = ?;\";\r\n DBQuery.setPreparedStatement(conn, selectStatement);\r\n PreparedStatement ps = DBQuery.getPreparedStatement();\r\n\r\n ps.setInt(1, divisionID);\r\n ps.execute();\r\n ResultSet rs = ps.getResultSet();\r\n\r\n rs.next();\r\n return rs.getString(\"Division\");\r\n }", "public final EObject ruleLeague() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n Token otherlv_3=null;\r\n Token otherlv_8=null;\r\n Token otherlv_10=null;\r\n Token otherlv_12=null;\r\n AntlrDatatypeRuleToken lv_name_2_0 = null;\r\n\r\n AntlrDatatypeRuleToken lv_size_4_0 = null;\r\n\r\n AntlrDatatypeRuleToken lv_year_5_0 = null;\r\n\r\n Enumerator lv_season_6_0 = null;\r\n\r\n EObject lv_groupstage_13_0 = null;\r\n\r\n\r\n\r\n \tenterRule();\r\n\r\n try {\r\n // InternalEsportDsl.g:817:2: ( ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? ) )\r\n // InternalEsportDsl.g:818:2: ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? )\r\n {\r\n // InternalEsportDsl.g:818:2: ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? )\r\n // InternalEsportDsl.g:819:3: () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )?\r\n {\r\n // InternalEsportDsl.g:819:3: ()\r\n // InternalEsportDsl.g:820:4: \r\n {\r\n\r\n \t\t\t\tcurrent = forceCreateModelElement(\r\n \t\t\t\t\tgrammarAccess.getLeagueAccess().getLeagueAction_0(),\r\n \t\t\t\t\tcurrent);\r\n \t\t\t\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,19,FOLLOW_4); \r\n\r\n \t\t\tnewLeafNode(otherlv_1, grammarAccess.getLeagueAccess().getLeagueKeyword_1());\r\n \t\t\r\n // InternalEsportDsl.g:830:3: ( (lv_name_2_0= ruleEString ) )\r\n // InternalEsportDsl.g:831:4: (lv_name_2_0= ruleEString )\r\n {\r\n // InternalEsportDsl.g:831:4: (lv_name_2_0= ruleEString )\r\n // InternalEsportDsl.g:832:5: lv_name_2_0= ruleEString\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getNameEStringParserRuleCall_2_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_5);\r\n lv_name_2_0=ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"name\",\r\n \t\t\t\t\t\tlv_name_2_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EString\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_3=(Token)match(input,12,FOLLOW_11); \r\n\r\n \t\t\tnewLeafNode(otherlv_3, grammarAccess.getLeagueAccess().getColonKeyword_3());\r\n \t\t\r\n // InternalEsportDsl.g:853:3: ( (lv_size_4_0= ruleEInt ) )\r\n // InternalEsportDsl.g:854:4: (lv_size_4_0= ruleEInt )\r\n {\r\n // InternalEsportDsl.g:854:4: (lv_size_4_0= ruleEInt )\r\n // InternalEsportDsl.g:855:5: lv_size_4_0= ruleEInt\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getSizeEIntParserRuleCall_4_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_11);\r\n lv_size_4_0=ruleEInt();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"size\",\r\n \t\t\t\t\t\tlv_size_4_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EInt\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:872:3: ( (lv_year_5_0= ruleEInt ) )\r\n // InternalEsportDsl.g:873:4: (lv_year_5_0= ruleEInt )\r\n {\r\n // InternalEsportDsl.g:873:4: (lv_year_5_0= ruleEInt )\r\n // InternalEsportDsl.g:874:5: lv_year_5_0= ruleEInt\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getYearEIntParserRuleCall_5_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_17);\r\n lv_year_5_0=ruleEInt();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"year\",\r\n \t\t\t\t\t\tlv_year_5_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EInt\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:891:3: ( (lv_season_6_0= ruleSeason ) )\r\n // InternalEsportDsl.g:892:4: (lv_season_6_0= ruleSeason )\r\n {\r\n // InternalEsportDsl.g:892:4: (lv_season_6_0= ruleSeason )\r\n // InternalEsportDsl.g:893:5: lv_season_6_0= ruleSeason\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getSeasonSeasonEnumRuleCall_6_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_18);\r\n lv_season_6_0=ruleSeason();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"season\",\r\n \t\t\t\t\t\tlv_season_6_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.Season\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:910:3: ( ( ruleEString ) )?\r\n int alt16=2;\r\n int LA16_0 = input.LA(1);\r\n\r\n if ( ((LA16_0>=RULE_STRING && LA16_0<=RULE_ID)) ) {\r\n alt16=1;\r\n }\r\n switch (alt16) {\r\n case 1 :\r\n // InternalEsportDsl.g:911:4: ( ruleEString )\r\n {\r\n // InternalEsportDsl.g:911:4: ( ruleEString )\r\n // InternalEsportDsl.g:912:5: ruleEString\r\n {\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getZoneZoneCrossReference_7_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_19);\r\n ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:926:3: (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )?\r\n int alt18=2;\r\n int LA18_0 = input.LA(1);\r\n\r\n if ( (LA18_0==13) ) {\r\n alt18=1;\r\n }\r\n switch (alt18) {\r\n case 1 :\r\n // InternalEsportDsl.g:927:4: otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')'\r\n {\r\n otherlv_8=(Token)match(input,13,FOLLOW_4); \r\n\r\n \t\t\t\tnewLeafNode(otherlv_8, grammarAccess.getLeagueAccess().getLeftParenthesisKeyword_8_0());\r\n \t\t\t\r\n // InternalEsportDsl.g:931:4: ( ( ruleEString ) )\r\n // InternalEsportDsl.g:932:5: ( ruleEString )\r\n {\r\n // InternalEsportDsl.g:932:5: ( ruleEString )\r\n // InternalEsportDsl.g:933:6: ruleEString\r\n {\r\n\r\n \t\t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\r\n\r\n \t\t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getQualifiesForQualificationCrossReference_8_1_0());\r\n \t\t\t\t\t\r\n pushFollow(FOLLOW_8);\r\n ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:947:4: (otherlv_10= ',' ( ( ruleEString ) ) )*\r\n loop17:\r\n do {\r\n int alt17=2;\r\n int LA17_0 = input.LA(1);\r\n\r\n if ( (LA17_0==14) ) {\r\n alt17=1;\r\n }\r\n\r\n\r\n switch (alt17) {\r\n \tcase 1 :\r\n \t // InternalEsportDsl.g:948:5: otherlv_10= ',' ( ( ruleEString ) )\r\n \t {\r\n \t otherlv_10=(Token)match(input,14,FOLLOW_4); \r\n\r\n \t \t\t\t\t\tnewLeafNode(otherlv_10, grammarAccess.getLeagueAccess().getCommaKeyword_8_2_0());\r\n \t \t\t\t\t\r\n \t // InternalEsportDsl.g:952:5: ( ( ruleEString ) )\r\n \t // InternalEsportDsl.g:953:6: ( ruleEString )\r\n \t {\r\n \t // InternalEsportDsl.g:953:6: ( ruleEString )\r\n \t // InternalEsportDsl.g:954:7: ruleEString\r\n \t {\r\n\r\n \t \t\t\t\t\t\t\tif (current==null) {\r\n \t \t\t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t \t\t\t\t\t\t\t}\r\n \t \t\t\t\t\t\t\r\n\r\n \t \t\t\t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getQualifiesForQualificationCrossReference_8_2_1_0());\r\n \t \t\t\t\t\t\t\r\n \t pushFollow(FOLLOW_8);\r\n \t ruleEString();\r\n\r\n \t state._fsp--;\r\n\r\n\r\n \t \t\t\t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t \t\t\t\t\t\t\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop17;\r\n }\r\n } while (true);\r\n\r\n otherlv_12=(Token)match(input,15,FOLLOW_20); \r\n\r\n \t\t\t\tnewLeafNode(otherlv_12, grammarAccess.getLeagueAccess().getRightParenthesisKeyword_8_3());\r\n \t\t\t\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:974:3: ( (lv_groupstage_13_0= ruleGroupStage ) )?\r\n int alt19=2;\r\n int LA19_0 = input.LA(1);\r\n\r\n if ( (LA19_0==26) ) {\r\n alt19=1;\r\n }\r\n switch (alt19) {\r\n case 1 :\r\n // InternalEsportDsl.g:975:4: (lv_groupstage_13_0= ruleGroupStage )\r\n {\r\n // InternalEsportDsl.g:975:4: (lv_groupstage_13_0= ruleGroupStage )\r\n // InternalEsportDsl.g:976:5: lv_groupstage_13_0= ruleGroupStage\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getGroupstageGroupStageParserRuleCall_9_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_2);\r\n lv_groupstage_13_0=ruleGroupStage();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"groupstage\",\r\n \t\t\t\t\t\tlv_groupstage_13_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.GroupStage\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n \tleaveRule();\r\n\r\n }\r\n\r\n catch (RecognitionException re) {\r\n recover(input,re);\r\n appendSkippedTokens();\r\n }\r\n finally {\r\n }\r\n return current;\r\n }", "public ArrayList<String> getGroupNames() {\n ArrayList<String> temp = new ArrayList<String>();\n\n for (Map.Entry<String, Integer[]> entry : tutLabGroups.entrySet()) {\n if (entry.getKey().equals(\"_LEC\")) {\n continue;\n }\n\n temp.add(entry.getKey());\n }\n\n return temp;\n }", "public static void viewOutcomeOfPlayedFixtures() throws IOException\n\t{\n\t\tString leagueName = getInputFromEndUser(\"Enter the name of the league/division/tournament (case sensitive) to display its current results.\",\n\t\t\t\"View results of played fixtures.\");\n\t\tif (leagueName.equals(\"\"))\n\t\t\treturn;\n\t\telse\n\t\t{\n\t\t\tFile allLeaguesFile = new File(\"AllDivisionsTournamentsLeagues.txt\");\n\t\t\tif (!allLeaguesFile.exists())\n\t\t\t\tJOptionPane.showMessageDialog(null, \"There are no divisions/tournaments/leagues to load.\", \"Error\", 2);\n\t\t\telse\n\t\t\t{\n\t\t\t\tFileReader allLeaguesReader = new FileReader(\"AllDivisionsTournamentsLeagues.txt\");\n\t\t\t\tScanner allLeaguesScanner = new Scanner(allLeaguesReader);\n\t\t\t\tString lineFromAllLeagues = \"\";\n\t\t\t\twhile (allLeaguesScanner.hasNext() && !lineFromAllLeagues.contains(leagueName))\n\t\t\t\t\tlineFromAllLeagues = allLeaguesScanner.nextLine();\n\t\t\t\tallLeaguesScanner.close();\tallLeaguesReader.close();\n\t\t\t\tif (!lineFromAllLeagues.contains(leagueName))\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Division/Tournament/League \\\"\"+leagueName+\"\\\" not found.\" +\n\t\t\t\t\t\t\"\\n\\nPlease check that you typed the name correctly.\", \"Error\", 2);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tFileReader resultsReader = new FileReader(leagueName+\"Results.txt\");\n\t\t\t\t\tScanner resultsScanner = new Scanner(resultsReader);\n\t\t\t\t\tString lineFromResults = \"\";\n\t\t\t\t\tString[] results;\n\t\t\t\t\tFileReader fixturesReader = new FileReader(leagueName+\"Fixtures.txt\");\n\t\t\t\t\tScanner fixturesScanner = new Scanner(fixturesReader);\n\t\t\t\t\tString lineFromFixtures = \"\";\n\t\t\t\t\tString[] fixtures;\n\t\t\t\t\tint fixtureNumber, homeTeamNumber, awayTeamNumber, homeTeamScore, awayTeamScore;\n\t\t\t\t\tString homeTeamName = \"\", awayTeamName = \"\";\n\t\t\t\t\twhile (resultsScanner.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tlineFromResults = resultsScanner.nextLine();\n\t\t\t\t\t\tresults = lineFromResults.split(\",\");\n\t\t\t\t\t\tlineFromFixtures = fixturesScanner.nextLine();\n\t\t\t\t\t\tfixtures = lineFromFixtures.split(\",\");\n\t\t\t\t\t\tfixtureNumber = Integer.parseInt(results[0]);\n\t\t\t\t\t\thomeTeamNumber = Integer.parseInt(fixtures[1]);\n\t\t\t\t\t\tawayTeamNumber = Integer.parseInt(fixtures[2]);\n\t\t\t\t\t\thomeTeamName = getTeamName(homeTeamNumber, leagueName);\n\t\t\t\t\t\tawayTeamName = getTeamName(awayTeamNumber, leagueName);\n\t\t\t\t\t\thomeTeamScore = Integer.parseInt(results[1]);\n\t\t\t\t\t\tawayTeamScore = Integer.parseInt(results[2]);\n\t\t\t\t\t\tSystem.out.printf(\"%-5s%20s\", fixtureNumber+\".\", homeTeamName+\" \"+homeTeamScore+\" v \"+awayTeamScore+\" \"+awayTeamName+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tfixturesScanner.close();\tfixturesReader.close();\n\t\t\t\t\tresultsScanner.close();\t\tresultsReader.close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public String getStatsOfTeams(){\n\n String res = \"\";\n\n if (teams.size() <= 0){\n return \"No team registered in tournament\";\n }\n\n for(int num=0; num<teams.size(); num++)\n {\n SoccerTeam team = teams.get(num);\n res += team.toString() + \"\\n\";\n }\n return res;\n }", "public void setDivision(java.lang.String division) {\n this.division = division;\n }", "public abstract String division();", "public int getLeagueId() {\n return leagueId;\n }", "public List<Team> getAllByLeague(League leagueID) {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAllByLeague(leagueID);\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "public int getDivisionID() {\n return divisionID;\n }", "public static List<String> getDefenders() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Map<String,Object> stringObjectMap=objectMapper.readValue(response.getEntity().getContent(),new TypeReference<Map<String,Object>>(){});\n List<Map<String,Object>> squad = (List<Map<String, Object>>) stringObjectMap.get(\"squad\");\n List<String> defenderName= new ArrayList<>();\n for (int i = 0; i <squad.size(); i++) {\n try {\n if(squad.get(i).get(\"position\").equals(\"Defender\")){\n\n defenderName.add((String)squad.get(i).get(\"name\"));\n }\n }catch (NullPointerException e){\n continue;\n }\n\n }\n return defenderName;\n\n }", "public String getStatsOfGames(){\n\n String res = \"\";\n\n if (games.size() <= 0){\n return \"No game registered in tournament\";\n }\n\n for(int num=0; num<games.size(); num++)\n {\n SoccerGames game = games.get(num);\n res += \"Game Id: \" + game.getGameId() + \" \"+ game.getHostTeam().getName() + \": \" + game.goalsScored +\n \" VS \" + game.getOpponentTeam().getName() + \": \" + game.concededGoal;\n\n }\n return res;\n }", "public List<String> getNamesFromDepartments() {\n List<String> employeeNames = new ArrayList<>();\n List<WebElement> teamDepartments = teamPageFactory.teamDepartments;\n for (int i = 1; i < countDepartmentTabs(); i++) {\n teamDepartments.get(i).click();\n employeeNames.addAll(getTexts(teamPageFactory.displayedEmployeeNames));\n }\n if (employeeNames.isEmpty()) Reporter.log(\"FAILURE: no employee name elements found\", true);\n return employeeNames;\n }", "@SuppressWarnings(\"unchecked\")\n private List createLeagueList() {\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n HashMap m = new HashMap();\n m.put( \"League\", leagues_array.get(i)); // the key and it's value.\n result.add( m );\n }\n return (List)result;\n }", "@Override\n\tpublic List<String> getTeamNames(Integer id) {\n\t\treturn null;\n\t}", "@Override\n public HashMap<String, ArrayList<League>> conditionedSelect(String[] conditions) {\n String query;\n Connection connection = DBConnector.getConnection();\n PreparedStatement statement = null;\n ResultSet retrievedLeagues = null;\n HashMap<String, ArrayList<League>> leagues = new HashMap<>();\n\n if (conditions.length == 0) {\n query = \"select * from [Leagues]\";\n } else {\n query = \"select * from [Leagues] where\";\n\n for (int i = 0; i < conditions.length; i++) {\n if (i % 2 == 0) {\n query += \" \" + conditions[i];\n } else {\n query += \" = ?\";\n if (i < conditions.length - 1)\n query += \" and\";\n }\n }\n }\n try {\n statement = connection.prepareStatement(query);\n\n if (conditions.length > 0) {\n int i = 0;\n while (i < conditions.length) {\n switch (conditions[i].toLowerCase()) {\n case \"leaguename\":\n statement.setString((int) (i / 2) + 1, conditions[i + 1]);\n break;\n\n case \"year\":\n case \"winPoints\":\n case \"drawPoints\":\n case \"losePoints\":\n statement.setInt((int) (i / 2) + 1, Integer.valueOf(conditions[i + 1]));\n break;\n\n case \"schedulingmethod\":\n statement.setBoolean((int) (i / 2) + 1, conditions[i + 1].equals(\"1\"));\n\n default:\n break;\n }\n i += 2;\n }\n }\n\n retrievedLeagues = statement.executeQuery();\n\n\n while (retrievedLeagues.next()) {\n String leagueName = retrievedLeagues.getString(1);\n int season = retrievedLeagues.getInt(2);\n boolean scheduling = retrievedLeagues.getBoolean(3);\n int winPoints = retrievedLeagues.getInt(4);\n int losePoints = retrievedLeagues.getInt(5);\n int drawPoints = retrievedLeagues.getInt(6);\n\n League league = new League(leagueName, season, scheduling, winPoints, drawPoints, losePoints);\n String seasonString = Integer.toString(season);\n ArrayList<League> leaguesList;\n\n if (leagues.containsKey(seasonString)) {\n leaguesList = leagues.get(seasonString);\n } else {\n leaguesList = new ArrayList<>();\n leagues.put(seasonString, leaguesList);\n }\n\n leaguesList.add(league);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage());\n }\n\n return leagues;\n }", "@GET(\"v1/competitions/\")\n Call<List<Leagues>> getAllData();", "private String[] getGamesList() {\n\n\t\tGames games = new Games();\n\n\t\tint maxRecords = games.count();\n\t\tArrayList<Game> records = games.findAll(maxRecords, 0);\n\t\tIterator<Game> it = records.iterator();\n\n\t\tString[] output = new String[maxRecords];\n\t\tint i = 0;\n\n\t\twhile (it.hasNext()) {\n\n\t\t\tGame game = it.next();\n\t\t\toutput[i] = \"[\" + game.getId() + \"] \" + game.getName();\n\t\t\ti++;\n\n\t\t}\n\n\t\treturn output;\n\n\t}", "public Collection getLevels(){\n List<String> levels = new ArrayList<>();\n File directoryPath = new File(DATA_PATH+gameName+\"/\");\n for (String s : directoryPath.list()) {\n if (isLevelFile(s)){\n levels.add(getLevelName(s));\n }\n }\n Collections.sort(levels);\n return Collections.unmodifiableList(levels);\n }", "@Override\n public void onResponse(String response) {\n listTeams(response);\n\n }", "public List<String> getGroups(String worldName, String playerName)\n {\n List<String> groups = new LinkedList<String>();\n\n if (handler2 != null)\n {\n List<Group> gs = handler2.getGroups(playerName);\n\n for (Group group : gs)\n {\n groups.add(group.getName().toLowerCase());\n }\n return groups;\n }\n\n if (handler != null)\n {\n @SuppressWarnings(\"deprecation\")\n String group = handler.getGroup(worldName, playerName);\n\n if (group != null)\n {\n groups.add(group.toLowerCase());\n }\n }\n\n return groups;\n }", "public String getSubdivision() {\n return subdivision;\n }", "public void setDivision(String division) {\n if(division== null){\n division = \"\";\n }\n this.division = division;\n }", "public static List<FixturesForm> getSeasonAtGlance(String tabName) {\n\n List<FixturesForm>fixturesFormList = null;\n FixturesForm fixturesForm = null;\n String query = SQLConstants.GET_SEASON_AT_GLANCE.replaceAll(\"#\",tabName.toLowerCase().replaceAll(\"\\\\W\", \"\"));\n \n System.out.println(\"[INFO] Generated Query:\"+query);\n\n try {\n fixturesFormList = new ArrayList<FixturesForm>();\n Connection con = JdbcConnection.getConnection();\n PreparedStatement pstmt = con.prepareStatement(query);\n\n ResultSet rs = pstmt.executeQuery();\n\n while (rs.next()) {\n fixturesForm = new FixturesForm();\n fixturesForm.setId(rs.getLong(\"id\"));\n fixturesForm.setLeftTeamId(rs.getLong(\"leftTeamid\"));\n fixturesForm.setRightTeamId(rs.getLong(\"rightTeamid\"));\n fixturesForm.setLeftTeamName(getTeam(con, rs.getLong(\"leftTeamid\")).getName());\n fixturesForm.setRightTeamName(getTeam(con, rs.getLong(\"rightTeamid\")).getName());\n fixturesForm.setVenue(rs.getString(\"venue\"));\n fixturesForm.setDate(rs.getString(\"date\"));\n \n fixturesFormList.add(fixturesForm);\n \n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return fixturesFormList;\n\n }", "@Test\r\n\tpublic void testGetNumDivisions() {\r\n\t\tint numDivisions = 2;\r\n\t\tassertEquals(numDivisions, stats.getNumDivisions());\r\n\t}", "public void divisionsChanged(){\r\n voltagePerDivisionLabel.setText(getScienceNumber(VoltagePerDivision) + \"V/Division\");\r\n SecondsPerDivisionLabel.setText(getScienceNumber(secondsPerDivision)+\"S/Div\");\r\n }", "public static List<String> getAllGoalkeepers() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\", \"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\", \"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Map<String, Object> stringObjectMap = objectMapper.readValue(response.getEntity().getContent(), new TypeReference<Map<String, Object>>() {\n });\n List<Map<String, Object>> squad = (List<Map<String, Object>>) stringObjectMap.get(\"squad\");\n List<String> goalKeeperName = new ArrayList<>();\n for (int i = 0; i < squad.size(); i++) {\n try {\n if (squad.get(i).get(\"position\").equals(\"Goalkeeper\")) {\n\n goalKeeperName.add((String) squad.get(i).get(\"name\"));\n }\n } catch (NullPointerException e) {\n continue;\n }\n }\n\n return goalKeeperName;\n }", "@Override\n\tpublic HashSet<String> getTeams() {\n return new HashSet<String>();\n\t}", "private void buildDivisionComboBox() {\n List<String> args = Collections.singletonList(Constants.WILDCARD);\n Country selectedCountry = countryComboBox.getSelectionModel().getSelectedItem();\n if (selectedCountry != null) {\n args = Collections.singletonList(String.valueOf(selectedCountry.getCountryID()));\n }\n\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectDivisionsByCountry.sql\"),\n args\n );\n\n ObservableList<FirstLevelDivision> divisions = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Division_ID\");\n String name = rs.getString(\"Division\");\n int countryID = rs.getInt(\"Country_ID\");\n divisions.add(new FirstLevelDivision(id, name, countryID));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n divisionComboBox.setItems(divisions);\n\n divisionComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(FirstLevelDivision item) {\n return item.getDivisionName();\n }\n\n @Override\n public FirstLevelDivision fromString(String string) {\n return null;\n }\n });\n }", "public static List<String> getMidfielders() throws IOException, URISyntaxException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> midFielderName= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getPosition().equals(\"Midfielder\")){\n\n midFielderName.add(squad.get(i).getName());\n }}catch (NullPointerException e){\n continue;\n\n }\n }\n return midFielderName;\n }", "public static ArrayList<Match> generateMatch(String season){\n LeagueManager premierLeagueManagerService = PremierLeagueManager.getInstance();\n int numberOfClubsPresent = PremierLeagueManager.getPremierLeagueFootballClubList().size();\n\n // This condition is to make sure that there is at least 2 clubs to play a match\n if(numberOfClubsPresent > 1){\n\n // there 2 or more clubs present so we can generate a match\n // loading the data from the file\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n Random random = new Random();\n\n // step 01: randomly select 2 clubs\n int randomClub_01 = random.nextInt(guiSeasonFilteredClubs.size());\n FootballClub selectedClub_O1 = guiSeasonFilteredClubs.get(randomClub_01);\n int randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n\n // This is to make sure that the same club is not selected again for the match\n while (randomClub_02==randomClub_01){\n randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n }\n FootballClub selectedClub_O2 = guiSeasonFilteredClubs.get(randomClub_02);\n\n // step 02: randomly generate the necessary data\n int numberGoalScored_club_1 = random.nextInt(7);\n int numberGoalScored_club_2 = random.nextInt(7);\n\n // setting the random date and random season depending on the randomly selected year\n int[] possibleYears = new int[2];\n\n int seasonYear = Integer.parseInt(season.split(\"-\")[0]);\n\n possibleYears[0] = seasonYear;\n possibleYears[1] = seasonYear + 1;\n\n // making sure that the months are in given range for the year select for the season\n // premier league happens every year from August to next May\n int day = random.nextInt(30)+1;\n int randomYearIndexSelected = random.nextInt(2);\n int year = possibleYears[randomYearIndexSelected];\n int month;\n\n // if randomYearIndexSelected = 0, then the months have to be in the range from 8 to 12 else 1 to 5\n if(randomYearIndexSelected==0){\n // 8 to 12\n month = random.nextInt(5) + 8;\n\n }else{\n // 1 to 5\n month = random.nextInt(5) + 1;\n\n }\n\n DateMatch date = new DateMatch(day, month, year);\n String[] matchTypes = new String[]{\"Home\", \"Away\"};\n String matchType = matchTypes[random.nextInt(2)];\n\n // step 03: call the addPlayedMatch() wisely by passing all the generated random data\n premierLeagueManagerService.addPlayedMatch(season,selectedClub_O1.getName(), selectedClub_O2.getName(),\n numberGoalScored_club_1, numberGoalScored_club_2, date, matchType);\n\n // step 04: call the save file method\n premierLeagueManagerService.saveDataIntoFile();\n\n // step 05: call the load file method\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches for a season and returning\n return getMatchesForSeason(guiSeasonFilteredClubs);\n }\n // if there are less than 2 clubs we can't generate a match\n return null;\n }", "public ArrayList<CollegeFootballTeam> getTeamList();", "public String getHomeTeam();", "public ArrayList<CollegeFootballTeam> rankTeams();", "TeamResultWrapper findTeams(String personId,\n String partOfGroupname, int offset, int pageSize);", "@Override\r\n\tpublic synchronized String toString(){\r\n\r\n\t\tString result = String.valueOf(numberOfSplittedGroups);\r\n\r\n\t\tif(!hierarchy.isEmpty()){\r\n\t\t\tresult = result + Constants.A3_SEPARATOR + hierarchy.get(0);\r\n\t\t\tfor(int i = 1; i < hierarchy.size(); i ++){\r\n\t\t\t\tresult = result + Constants.A3_SEPARATOR + hierarchy.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private ArrayList<double[]> generatePoints(int divisions) {\n\t\tArrayList<double[]> result = new ArrayList<double[]>();\n\t\tdouble[] weight = new double[Run.NUMBER_OF_OBJECTIVES];\n\t\t\n\t\tif (divisions != 0) {\n\t\t\tgenerateRecursive(result, weight, Run.NUMBER_OF_OBJECTIVES, divisions, divisions, 0);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public Map<String, String> getNamesAndDepartmentsOfEmployees() {\n HashMap<String, String> nameDpt = new HashMap<>();\n List<String> names = getNamesFromAllTab();\n List<String> dpts = getEmployeeDepartmentsFromDisplayedDptTab();\n\n for (int i = 0; i < countEmployeeCardsDisplayed(); i++) {\n nameDpt.put(names.get(i), dpts.get(i));\n }\n return nameDpt;\n }", "public void getGroups() {\n String listOfCode = prefs.getString(\"listOfCode\");\n if (!listOfCode.isEmpty()) {\n for (String groupPair : listOfCode.split(\",\"))\n if (!groupPair.isEmpty()) {\n final String nickname = groupPair.substring(0, groupPair.indexOf('|'));\n String code = groupPair.substring(groupPair.indexOf('|') + 1);\n ServerAPI.groupInformation(code, new RequestHandler<Group>() {\n @Override\n public void callback(Group result) {\n if (result == null) {\n return;\n }\n savedGroups.add(new Pair<String, Group>(nickname, result));\n populateListView();\n }\n });\n }\n }\n }", "public JSONObject getCompetitionTeams() {\r\n\t\t\r\n\t\tString api = this.url + \"competition/\" + idCompetition + \"/teams\";\r\n\t\tJSONObject jo = null;\r\n\t\tString line = \"\";\r\n\t\tString dataFilter = \"\";\r\n\t\ttry{\r\n\t\t\tHttpURLConnection openConnection = (HttpURLConnection) new URL(api).openConnection();\r\n\t\t\topenConnection.setRequestProperty(\"X-Auth-Token\", token);\r\n\t\t\tInputStream in = openConnection.getInputStream();\r\n\r\n\t\t\tInputStreamReader input = new InputStreamReader( in );\r\n\t\t\tBufferedReader buf = new BufferedReader( input );\r\n\t\t\t\r\n\t\t\twhile ( ( line = buf.readLine() ) != null ) {\r\n\t\t\t\tdataFilter += line;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tin.close();\r\n\t\t\tjo = (JSONObject) JSONValue.parseWithException(dataFilter);\r\n\t\t}\r\n\t\tcatch(ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (IOException e ) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn jo;\r\n\t}", "@Test\r\n\tpublic void findAllTeams() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: findAllTeams \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\tList<Team> response = null;\r\n\t\tresponse = service.findAllTeams(startResult, maxRows);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: findAllTeams\r\n\t}", "public static String BeforeSplitStrategyHints(Player Gamer, Player Dealer){\n\t\tString ReturnString = \"\";\n\t\tif(Gamer.Hand[0].getValue() == 1 && Gamer.Hand[1].getValue() == 1){\n\t\t\t// Pair of Aces\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getValue() == 2 && Gamer.Hand[1].getValue() == 2) \n\t\t\t|| (Gamer.Hand[0].getValue() == 3 && Gamer.Hand[1].getValue() == 3)){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 4 && Gamer.Hand[1].getValue() == 4){\n\t\t\tif(Dealer.Score >= 5 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 5 && Gamer.Hand[1].getValue() == 5){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 6 && Gamer.Hand[1].getValue() == 6){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 7 && Gamer.Hand[1].getValue() == 7){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t ReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 8 && Gamer.Hand[1].getValue() == 8){\n\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 9 && Gamer.Hand[1].getValue() == 9){\n\t\t\tif((Dealer.Score >= 2 && Dealer.Score <= 6) || (Dealer.Score >= 8 && Dealer.Score <= 9)){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 10 && Gamer.Hand[1].getValue() == 10){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\treturn ReturnString;\n\t}", "@Test\r\n\tpublic void loadTeams() {\r\n\t\tSet<Team> response = null;\r\n\t\tresponse = service.loadTeams();\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: loadTeams\r\n\t}", "private void populateTeams() {\n\n // TODO: Can't get teams assigned to judges for now. Instead, getting all teams in an event\n AsyncHttpClient client = new AsyncHttpClient();\n client.addHeader(\"Authorization\", \"Token token=\" + this.user.getToken().getAccess_token());\n client.get(LoginActivity.API_ROOT + \"events/\" + currEvent.getId() + \"/teams\",\n new BaseJsonHttpResponseHandler<Team[]>() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, String rawJsonResponse,\n Team[] response) {\n teams_lv = (ListView) findViewById(R.id.teams_lv);\n teamsArr = response;\n\n // \"All\" will be the default category\n displayedTeams = teamsArr;\n\n // Make an \"empty\" Event in the case that there are no Events.\n if (teamsArr.length == 0) {\n teamsArr = new Team[1];\n teamsArr[0] = new Team(-1, -1, \"(No teams. Please see an admin for help.)\",\n null);\n teams_lv.setAdapter(new TeamAdapter(SelectionActivity.this,\n teamsArr));\n } else {\n teams_lv.setAdapter(new TeamAdapter(SelectionActivity.this,\n teamsArr));\n teams_lv.setOnItemClickListener(new TeamClickListener());\n }\n Log.d(\"GET TEAMS\", \"success\");\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable error,\n String rawJsonData, Team[] errorResponse) {\n Log.d(\"GET TEAMS\", \"failure\");\n }\n\n @Override\n protected Team[] parseResponse(String rawJsonData, boolean isFailure)\n throws Throwable {\n\n if (!isFailure) {\n // Need to extract array from the first/outer JSON object\n JSONArray teamsJSONArr = new JSONObject(rawJsonData)\n .getJSONArray(\"event_teams\");\n return new Gson().fromJson(teamsJSONArr.toString(), Team[].class);\n } else return null;\n }\n });\n }", "private void buildGroups() {\n if(groups.size() == 1){\n Group aGroup = groups.get(0);\n for (Team team : teams) {\n aGroup.add(team);\n }\n return;\n }\n\n for (Team team : teams) {\n groups.get(getIndex()).add(team);\n }\n }", "public interface League {\n String getIdLeague();\n String getNameLeague();\n String getLogoLeague();\n}", "@RequestMapping(value = \"/associations/{id}/division-events\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<DivisionEvent> getDivisionEvents(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association DivisionEvents: {}\", id);\n\t\tDivisionEvent example = new DivisionEvent();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\tDivision exampleDivision = new Division();\n\t\texampleDivision.setAssociation(exampleAssociation);\n\t\texample.setDivision(exampleDivision);\n\t\treturn divisionEventRepository.findAll(Example.of(example));\n\t}", "@Override\r\n\tpublic ArrayList<String[]> getSeasonHotPlayer(String sift) {\n\t\tStatement stat = null;\r\n\t\tResultSet rs = null;\r\n\t\tString currentSeason = \"20142015\";\r\n\t\tArrayList<String[]> result = new ArrayList<String[]>();\r\n\t\tString playerPath = \"\";\r\n\t\tString teamPath = \"\";\r\n\t\ttry{\r\n\t\t\tstat = connection.createStatement();\r\n\t\t\trs = stat.executeQuery(\"select AbsolutePath from Path where category ='Player'\");\r\n\t\t\tplayerPath = rs.getString(1);\r\n\t\t\trs = stat.executeQuery(\"select AbsolutePath from Path where category ='Team'\");\r\n\t\t\tteamPath = rs.getString(1);\r\n\t\t\trs = stat.executeQuery(\"select PlayerName,\"+sift+\",TeamAbb,PlayerName,TeamAbb from LiftRate T1,Player T2 where T1.PlayerName=T2.Name order by \"+sift+\" desc limit 5\");\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tString[] tempList = new String[5];\r\n\t\t\t\tfor(int i =0;i<5;i++){\r\n\t\t\t\t\ttempList[i] = rs.getString(i+1);\r\n\t\t\t\t}\r\n\t\t\t\ttempList[3] = playerPath + tempList[3] + \".png\";\r\n\t\t\t\ttempList[4] = teamPath + tempList[4] + \".png\";\r\n\t\t\t\tresult.add(tempList);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfor(int i=0;i<result.size();i++){\r\n\t\t\tSystem.out.println(Arrays.asList(result.get(i)));\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void splitTeams()\r\n\t{\r\n\t\tfor (Mitarbeiter m : mitarbeiter.values())\r\n\t\t{\r\n\t\t\tint test = m.getAzvMonat().firstEntry().getValue().getITeam();\r\n\t\t\t\r\n\t\t\tswitch (test)\r\n\t\t\t{\r\n\t\t\tcase 1:\r\n\t\t\tteam1.put(m.getPersonalNR(), m);\t\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 2:\r\n\t\t\tteam2.put(m.getPersonalNR(), m);\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 3:\r\n\t\t\tteam3.put(m.getPersonalNR(), m);\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tteam4.put(m.getPersonalNR(), m);\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t// Für den einfacheren späteren Zugriff werden die Teams in eine seperate Liste gepackt:\t\r\n\tteams.put(1, team1);\r\n\tteams.put(2, team2);\r\n\tteams.put(3, team3);\r\n\tteams.put(4, team4);\r\n\t\r\n\tsetGesamtsummeProzentanteile();\t\r\n\t}", "public java.util.Enumeration findCarsByDivision(com.hps.july.persistence.DivisionKey arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n com.hps.july.persistence.CarHome localHome = ejbHome();\n java.util.Enumeration ejbs = localHome.findCarsByDivision(arg0);\n return (java.util.Enumeration) createAccessBeans(ejbs);\n }", "public List<Team> getAllTeamsBySeason(Season s) { \r\n\t\t\tif(teamsBySeason==null)\t{\r\n\t\t\t\tteamsBySeason=dao.listTeamsforSeason(s); //LIST\t\t\r\n\t\t\tfor(Team atemp:teamsBySeason){ this.mapTeamBySeason.put(atemp.getTeam(), atemp);}\r\n\t\t\t}\r\n\t\t\treturn teamsBySeason;\r\n\t\t}", "public Long getLeagueId() {\n return (this.leagueId);\n }", "void getSearchSeasonData();", "public static void viewFutureFixtures() throws IOException\n\t{\n\t\tString leagueName = getInputFromEndUser(\"Enter the name of the league/division/tournament (case sensitive) to display its upcoming fixtures.\",\n\t\t\t\"View fixtures that have yet to be played.\");\n\t\tif (leagueName.equals(\"\"))\n\t\t\treturn;\n\t\telse\n\t\t{\n\t\t\tFile allLeaguesFile = new File(\"AllDivisionsTournamentsLeagues.txt\");\n\t\t\tif (!allLeaguesFile.exists())\n\t\t\t\tJOptionPane.showMessageDialog(null, \"There are no divisions/tournaments/leagues to load.\", \"Error\", 2);\n\t\t\telse\n\t\t\t{\n\t\t\t\tFileReader allLeaguesReader = new FileReader(\"AllDivisionsTournamentsLeagues.txt\");\n\t\t\t\tScanner allLeaguesScanner = new Scanner(allLeaguesReader);\n\t\t\t\tString lineFromAllLeagues = \"\";\n\t\t\t\twhile (allLeaguesScanner.hasNext() && !lineFromAllLeagues.contains(leagueName))\n\t\t\t\t\tlineFromAllLeagues = allLeaguesScanner.nextLine();\n\t\t\t\tallLeaguesScanner.close();\tallLeaguesReader.close();\n\t\t\t\tif (!lineFromAllLeagues.contains(leagueName))\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Division/Tournament/League \\\"\"+leagueName+\"\\\" not found.\" +\n\t\t\t\t\t\t\"\\n\\nPlease check that you typed the name correctly.\", \"Error\", 2);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tFile aFile1 = new File(leagueName+\"Results.txt\");\n\t\t\t\t\tFileReader aFileRead = new FileReader(leagueName+\"Fixtures.txt\");\n\t\t\t\t\tint lineCount = 0, count = 0;\n\t\t\t\t\tint fixtureNumber, homeTeamNumber, awayTeamNumber;\n\t\t\t\t\tString homeTeamName = \"\", awayTeamName = \"\";\n\t\t\t\t\tString aLineFromFile = \"\";\n\t\t\t\t\tString[] fixtures;\n\t\t\n\t\t\t\t\tScanner in = new Scanner(aFile1);\n\t\t\t\t\twhile (in.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tin.nextLine();\n\t\t\t\t\t\tlineCount++;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tin = new Scanner(aFileRead);\n\t\t\t\t\twhile (in.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\taLineFromFile = in.nextLine();\n\t\t\t\t\t\tif(count > lineCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfixtures = aLineFromFile.split(\",\");\n\t\t\t\t\t\t\tfixtureNumber = Integer.parseInt(fixtures[0]);\n\t\t\t\t\t\t\thomeTeamNumber = Integer.parseInt(fixtures[1]);\n\t\t\t\t\t\t\tawayTeamNumber = Integer.parseInt(fixtures[2]);\n\t\t\t\t\t\t\thomeTeamName = getTeamName(homeTeamNumber, leagueName);\n\t\t\t\t\t\t\tawayTeamName = getTeamName(awayTeamNumber, leagueName);\n\t\t\t\t\t\t\tSystem.out.println(fixtureNumber+\". \" + homeTeamName+\" v \"+awayTeamName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\taFileRead.close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "java.lang.String getGameName();", "java.lang.String getGameName();", "public League getLeagueDetails(String leagueName) {\n return League.getLeagueByName(leagueName);\n }", "@SuppressWarnings(\"unchecked\")\n private List createTeamList() {\n\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n /* each group need each HashMap-Here for each group we have 3 subgroups */\n ArrayList secList = new ArrayList();\n for( int n = 0 ; n < SplashScreen.full_teams_array.get(i).size() ; n++ ) {\n HashMap child = new HashMap();\n child.put( \"Team\", SplashScreen.full_teams_array.get(i).get(n) );\n boolean favorite_found = false;\n for(int j=0; j<SplashScreen.new_favorites_array.size(); j++) {\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(SplashScreen.new_favorites_array.get(j)[1]) &&\n leagues_array.get(i).equals(SplashScreen.new_favorites_array.get(j)[0]) ) {\n favorite_found = true;\n }\n }\n if(favorite_found) { child.put( \"Favorite\", \"1\" ); }\n else { child.put( \"Favorite\", \"0\" ); }/*\n if(SplashScreen.full_teams_array.get(i).get(n).toString().equals(favorite_team) &&\n leagues_array.get(i).equals(favorite_league) ) {\n child.put( \"Favorite\", \"1\" );\n } else {\n }\n child.put( \"Favorite\", \"0\" );/*\n }*/\n secList.add( child );\n }\n result.add( secList );\n }\n return result;\n }", "public List<PlayerWon> findByLeagueId(int leagueId);", "private List<Position> getHalos() {\n\t\t\tList<Position> halos = new ArrayList<Position>();\n\t\t\tGamePiece selectedPiece = game.getSelectedPiece();\n\t\t\tif (selectedPiece != null) {\n\t\t\t\thalos.add(selectedPiece.getPosition());\n\t\t\t\thalos.addAll(selectedPiece.getLegalMoves());\n\t\t\t}\n\t\t\treturn halos;\n\t\t}", "public SubjectDivisions divisionIds(List<String> divisionIds) {\n this.divisionIds = divisionIds;\n return this;\n }", "public List getParticipationGroups() \n { \n Connection con = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n List result = new LinkedList();\n \n try {\n \n //retrieve all the Participation Groups\n con = DBUtil.getConnection();\n ps = con.prepareStatement(SQL_SELECT_PARTICIPATION_GROUPS);\n rs = ps.executeQuery();\n \n //put the results into a list of ParticipationGroupData objects\n while (rs.next()) {\n ParticipationGroupData group = new ParticipationGroupData();\n group.setGroupPk(new Integer(rs.getInt(\"particip_group_pk\")));\n group.setName(rs.getString(\"particip_group_nm\"));\n group.setDescription(rs.getString(\"particip_group_desc\"));\n result.add(group);\n } \n } catch (SQLException e) {\n throw new EJBException(\"Error retrieving Participation Groups in MaintainParticipationGroupsBean.getParticipationGroups()\", e);\n } finally {\n DBUtil.cleanup(con, ps, rs);\n }\n \n //return the list of objects\n return result;\n }", "@Test\r\n\tpublic void findAllGames() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: findAllGames \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tList<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.findAllGames4tsw(tswacct, startResult, maxRows);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: findAllGames\r\n\t}", "@Test\r\n\tpublic void loadGames() {\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tSet<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.loadGames4tsw(tswacct);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: loadGames\r\n\t}", "public String GetGamesList()\n\t{\n\t\tString gameslist = \"\";\n\t\tfor (int i = 0; i < gametype.length; i++)\n\t\t{\n\t\t\tgameslist += \"Game Number \" + i + \"\\t\" + gametype[i].GetName() + \"\\n\";\n\t\t\tif (gametype[i].Game_Status())\n\t\t\t{\n\t\t\t\tgameslist += \"There is currently a game in progress\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgameslist += \"No game is being played at the moment\\n\";\n\t\t\t}\n\n\t\t\tif (gametype[i].SizeofQueue() >= 2)\n\t\t\t{\n\t\t\t\tgameslist += \"Number of players in queue:\\t\" + gametype[i].SizeofQueue() + \"\\n\\n\";\n\t\t\t}\n\t\t\telse if (gametype[i].SizeofQueue() == 1)\n\t\t\t{\n\t\t\t\tgameslist += \"There is currently one player waiting to play a game\\n\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgameslist += \"There is currently nobody waiting to play a game\\n\\n\";\n\t\t\t}\n\t\t}\n\t\treturn gameslist;\n\t}", "public static List<String> getSpainCoach() throws URISyntaxException, IOException {\n\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/77\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> nameOfSpainTeamCoach= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getRole().equals(\"COACH\")){\n\n nameOfSpainTeamCoach.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n continue;\n }\n\n }\n return nameOfSpainTeamCoach;\n }", "@Override\n public List<League> getLeaguesByCategory(int categoryId) throws ServiceException {\n try {\n return leagueDAO.getLeaguesByCategory(categoryId);\n } catch (DAOException exc){\n LOG.error(exc);\n throw new ServiceException(exc);\n }\n }", "private void getTeams() {\n if(progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n progressDialog = new ProgressDialog(getContext());\n progressDialog.setCancelable(true);\n if(getArguments()!=null) {\n progressDialog.setMessage(\"Fetching Match Schedules\");\n }\n else {\n progressDialog.setMessage(\"Processing\");\n }\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setProgress(0);\n progressDialog.show();\n db.collection(\"teams\").get().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 JSONObject object = new JSONObject(document.getData());\n try {\n teamsObject.put(document.getId(), object);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n if(getArguments()!=null) {\n if (dataBundle.getString(\"from\").equals(\"league Features\")) {\n getSchedules();\n }\n else if(dataBundle.getString(\"from\").equals(\"TM-matches\")){\n getTeamSchedules();\n }\n }\n else {\n getSchedules();\n }\n } else {\n Toast.makeText(context, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "public List<Season> getSeasons() {\n if (this.seasons.isEmpty()) {\n this.seasons = EntityManager.getInstance().getRefereeSeasons(this);\n }\n return this.seasons;\n //TODO:Pull From DB\n }", "Match getTeam1LooserOfMatch();", "public List<WebPresentationGroup> getWebPresentationGroups();", "@Override\n\tpublic void getScoreBoard(Lane lane) {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Lane Number: \" + lane.getId());\n\n\t\tTreeMap<Integer, List<String>> winners = new TreeMap<>(Collections.reverseOrder());\n\n\t\tfor (Player player : lane.getPlayers()) {\n\t\t\tgetScoreCardByPlayer(player);\n\t\t\tint totalScore = player.getScoreCard().getTotalScore();\n\t\t\tList<String> winner = new ArrayList<>();\n\t\t\tif (winners.containsKey(totalScore)) {\n\t\t\t\twinner = winners.get(totalScore);\n\t\t\t}\n\t\t\twinner.add(player.getName());\n\t\t\twinners.put(totalScore, winner);\n\t\t}\n\t\tSystem.out.println(\"Winner: \" + winners.get(winners.firstKey()));\n\t\tSystem.out.println();\n\t}", "public static ArrayList<Match> allMatches(String season){\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches filtered by season\n ArrayList<Match> matchesDisplayed = getMatchesForSeason(guiSeasonFilteredClubs);\n\n return matchesDisplayed;\n }", "List<GameResult> getAllGameResults();", "public static Map<String, String> getSeasonInfoList(){\n\t\tMap<String, String> rs = new LinkedHashMap<String, String>();\n\t\trs.put(\"-1\", \"---please select---\");\n\t\trs.put(\"SP\", \"Spring\");\n\t\trs.put(\"SU\", \"Summer\");\n\t\trs.put(\"AU\", \"Autumn\");\n\t\trs.put(\"WI\", \"Winter\");\n\t\t\n\t\treturn rs;\n\t}", "private String[] guardaDivisoes() throws EmptyExcpetion{\n\n String[] salasSemInimigo = new String[this.divisoes.size()];\n int contador=0;\n\n\n for(int i=0;i<this.getDivisoes().size();i++){\n\n String divisao = this.getDivisoes().iteratorBFS(i).next();\n\n if(verificaSeEInimigo(divisao)==false){\n salasSemInimigo[contador]=divisao;\n contador++;\n }\n }\n\n return salasSemInimigo;\n }", "public String[] getAvailableTeams() {\n\n int team1 = 0;\n int team2 = 0;\n if (activePlayers > 0) {\n for (int i = 0; i < activePlayers; i++) {\n if (players[i].getTeam() == teams[0]) {\n team1++;\n continue;\n }\n team2++;\n }\n\n String[] team = new String[2];\n if ((activePlayers == numMaxPlayers - 1) && (team1 == 0 || team2 == 0)) {\n if (team1 == 0) {\n team[0] = teams[0].toString();\n return team;\n }\n team[0] = teams[1].toString();\n return team;\n }\n }\n return new String[]{teams[0].toString(), teams[1].toString(), null};\n }", "int getTeam();", "public String[] getTeamNames()\r\n\t{\r\n\t\t\r\n\t\tString[] names = new String[NUM_TEAMS];\r\n\t\t\r\n\t\tfor(int i = 0; i < teams.size(); i++)\r\n\t\t{\r\n\t\t\tnames[i] = teams.get(i).getName();\t\r\n\t\t}\r\n\r\n\t\treturn names;\r\n\t}" ]
[ "0.6048132", "0.58376515", "0.5779007", "0.57311016", "0.56839675", "0.557573", "0.54404676", "0.53826237", "0.53577095", "0.53576624", "0.52251637", "0.5194058", "0.5165604", "0.5155795", "0.51326036", "0.50822943", "0.5074189", "0.5072362", "0.5065648", "0.5047834", "0.5033659", "0.49935234", "0.49934822", "0.49747583", "0.49447942", "0.49341655", "0.49241406", "0.49030218", "0.48892495", "0.4879005", "0.48786137", "0.48572448", "0.48503047", "0.48485035", "0.48401493", "0.48299286", "0.48057508", "0.48009872", "0.47871885", "0.4787144", "0.47809097", "0.47808862", "0.4764935", "0.47608176", "0.4758877", "0.4748125", "0.47228152", "0.4710931", "0.47093663", "0.4697559", "0.46974796", "0.4693262", "0.46882766", "0.4686976", "0.46775407", "0.46669936", "0.46488315", "0.46463573", "0.46461338", "0.46348777", "0.46331498", "0.4632016", "0.46243724", "0.46169493", "0.46147478", "0.46017885", "0.45984405", "0.459411", "0.4592504", "0.45895892", "0.4580018", "0.4576745", "0.45687866", "0.45659193", "0.45612982", "0.45603964", "0.45603964", "0.45521867", "0.45453733", "0.45336682", "0.45334503", "0.45060557", "0.44951698", "0.44939736", "0.4493122", "0.44874242", "0.44860306", "0.4483509", "0.447295", "0.44694456", "0.4464104", "0.445815", "0.44510588", "0.4443021", "0.44420993", "0.44395322", "0.44391978", "0.44376144", "0.44324243", "0.44301334" ]
0.5884512
1
The getDivisionsByLeague method gets the divisions based on leagueId
public static boolean getDivisionsByLeague(List<DivisionBean> divs, String leagueId) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement getDivisions = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); getDivisions = conn.prepareStatement("SELECT division.divisionID, divisionName from division, leaguexdivision WHERE leagueID=? AND division.divisionID=leaguexdivision.divisionID"); getDivisions.setString(1, leagueId); rs = getDivisions.executeQuery(); while(rs.next()) { DivisionBean div = new DivisionBean(); div.setDivisionId(rs.getString(1)); div.setDivisionName(rs.getString(2)); divs.add(div); status = true; } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (getDivisions != null) { try { getDivisions.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"/associations/{id}/divisions\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Division> getAssociationGames(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association games: {}\", id);\n\t\tDivision example = new Division();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\texample.setAssociation(exampleAssociation);\n\t\treturn divisionRepository.findAll(Example.of(example));\n\t}", "public static boolean getLeagueDivisions(String lID, List<DivisionBean> divisionList) {\r\n\r\n\t\tboolean status = false;\t\t\t\t\t\t\t// query status\r\n\t\tConnection conn = null;\t\t\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement division = null;\t\t\t\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tdivision = conn.prepareStatement(\"SELECT d.divisionID, d.leagueName from division d inner join\"\r\n\t\t\t\t\t+ \" leaguexdivision ld on ld.divisionID = d.divisionID where ld.leagueID = ? limit 1\");\r\n\t\t\tdivision.setString(1, lID);\r\n\t\t\trs = division.executeQuery();\r\n\t\t\tstatus = rs.next();\r\n\r\n\t\t\t//return to the start of the result set\r\n\t\t\trs.beforeFirst();\r\n\r\n\t\t\t//Loop through and add the results of the query to a LeagueBean then add it to the list\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean lb = new DivisionBean();\r\n\t\t\t\tlb.setDivisionId(rs.getString(1));\r\n\t\t\t\tlb.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivisionList.add(lb);\r\n\t\t\t}\r\n\r\n\t\t\t// close all connections and catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (division != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdivision.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public List<Division> getDivisionParStructure( long idStructure)\n\t{\n List<Division> dicvs=divisionRepository.getDivisionParStructure(idStructure);\n// for(Division a:dicvs)\n// {\n// \t listeDivs.add(a);\n// }\n \n\n\t\tList<Division> Divisions = new ArrayList<>();\n\t\tdivisionRepository.getDivisionParStructure(idStructure).forEach(Divisions::add);\n\t\treturn Divisions;\n\n\t}", "public int getLeagueId() {\n return leagueId;\n }", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "@Override\r\n public List<GameDto> getFixturesByLeagueAndSeason(LeagueKeys league, SeasonKeys season) {\n String seasonString = Arrays.stream(season.getKey().split(\"/\")).reduce(\"\", (s, t) -> s + t.substring(2,4));\r\n return client.getFixturesByLeagueAndSeason(league.getParam(), seasonString).stream().map(g->toGame(g,season)).collect(toList());\r\n }", "public static boolean getDivisionsWithNoLeague(List<DivisionBean> divs) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getDivisions = null;\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetDivisions = conn.prepareStatement(\"SELECT d.divisionID, d.divisionName FROM division d natural left join leaguexdivision ld WHERE ld.divisionID IS NULL;\");\r\n\t\t\trs = getDivisions.executeQuery();\r\n\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean div = new DivisionBean();\r\n\t\t\t\tdiv.setDivisionId(rs.getString(1));\r\n\t\t\t\tdiv.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivs.add(div);\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getDivisions != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetDivisions.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public Long getLeagueId() {\n return (this.leagueId);\n }", "@Override\n\tpublic List<GameResponseDTO> findAllByLessonId(long lessonId) {\n\t\tList<GameResponseDTO> gameResponseDTOList = new ArrayList<>();\n\t\ttry {\n\t\t\tList<Game> gameList = iGameRepository.findByLessonIdAndStatusNot(lessonId, DELETED_STATUS);\n\t\t\tif (!gameList.isEmpty()) {\n\t\t\t\tfor (Game game : gameList) {\n\t\t\t\t\tGameResponseDTO gameResponseDTO = modelMapper.map(game, GameResponseDTO.class);\n\t\t\t\t\tgameResponseDTOList.add(gameResponseDTO);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Find all games by lessonId = \" + lessonId + \"! \" + e.getMessage());\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn gameResponseDTOList;\n\t}", "@Override\n public List<League> getLeaguesByCategory(int categoryId) throws ServiceException {\n try {\n return leagueDAO.getLeaguesByCategory(categoryId);\n } catch (DAOException exc){\n LOG.error(exc);\n throw new ServiceException(exc);\n }\n }", "public List<PlayerWon> findByLeagueId(int leagueId);", "@Override\n public ArrayList<League> select(String id) {\n return null;\n }", "@GetMapping(path = \"/contest/{id}\",produces = MediaType.APPLICATION_JSON_VALUE)\n @ApiResponses(value =\n {\n @ApiResponse(code = 200, message = \"success\", response = BetOnTeam.class),\n @ApiResponse(code = 404, message = \"Bad request\", response = ResultException.class),\n @ApiResponse(code = 500, message = \"Unfortunately there is technical error while processing your request\", response = ResultException.class)\n }\n )\n @PreAuthorize(\"hasAnyRole('Admin','User')\")\n public ResponseEntity<Result<List<BetOnTeamWithUser>>> getContestByMatchId(@PathVariable int id) throws Exception {\n Result<List<BetOnTeamWithUser>> contestList = betonteamservice.findContestById(id);\n return new ResponseEntity<>(contestList, HttpStatus.valueOf(contestList.getCode()));\n }", "@Override\n\tpublic List<Games> specificGameView(int id) {\n\t\treturn gameDAO.viewSpecificGame(id);\n\t}", "@RequestMapping(value = \"/associations/{id}/games\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Game> getGames(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association Games: {}\", id);\n\t\tGame example = new Game();\n\t\tDivisionEvent exampleDivisionEvent = new DivisionEvent();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\tDivision exampleDivision = new Division();\n\t\texampleDivision.setAssociation(exampleAssociation);\n\t\texampleDivisionEvent.setDivision(exampleDivision);\n\t\tTimeslot exampleTimeslot = new Timeslot();\n\t\texampleTimeslot.setDivisionEvent(exampleDivisionEvent);\n\t\texample.setTimeslot(exampleTimeslot);\n\t\treturn gameRepository.findAll(Example.of(example));\n\t}", "@Override\n\tpublic List<Lane> getLaneFromLaneId(Integer laneId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = currentSession.createQuery(\"from Lane where laneId='\"+laneId+\"'\", Lane.class);\t\n\t\t\t\t\n\t\tList<Lane> theLane = theQuery.getResultList(); \n\t\t\t\t\n\t\treturn theLane;\n\t}", "public int getDivisionId() {\n return divisionId;\n }", "@GetMapping(\"/games/{id}/sets\")\n public List<Set> getCardsByGameId(@PathVariable(value = \"id\") long gameId, Pageable pageable) {\n Page<Set> set = setRepository.findByGameId(gameId, pageable);\n List<Set> setList = new ArrayList<>();\n int a = set.getContent().size();\n for (int x = 0; x < a; x++) {\n List<Card> cardList = new ArrayList<>();\n// if (!cardRepository.findBySetId(set.getContent().get(x).getId(), pageable).hasContent())\n// {\n// continue;\n// }\n Page<Card> card = cardRepository.findBySetId(set.getContent().get(x).getId(), pageable);\n// if (card != null) {\n// if (card.getContent().size() > 0) {\n cardList.addAll(card.getContent());\n// }\n// }\n// if(!cardList.isEmpty()) {\n set.getContent().get(x).setCard(cardList);\n setList.add(set.getContent().get(x));\n// }\n }\n return setList;\n }", "public List<Card> getCardsOf(Long idGame, Long idPlayer){\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return null;\n }\n\n List<Player> players = game.getPlayers();\n for(Player player : players) {\n if(idPlayer.equals(player.getPlayer_identifier())) {\n return player.getCards();\n }\n }\n\n return null;\n }", "List<SubDivision> findByDivisionIdOrderByCodeAsc(Division divisionId);", "@GET\n\t@Path(\"/player/{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getGroupsForPlayer(@QueryParam(\"hash\") String hash, @PathParam(\"id\") String id) {\n\t\tController<Player> controller = new Controller<>();\n\t\tString jsonResponse = \"\";\n\t\ttry {\n\t\t\tsuper.hasPermission(hash);\n\t\t\tList<PlayerGroup> models = controller.findById(stringToNumber(id), Player.class).getPlayerGroups();\n\t\t\tjsonResponse = mapper.writeValueAsString(models);\n\t\t} catch (NoPermissionExeption e) {\n\t\t\treturn noPermissionResult();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn Response.status(Response.Status.NO_CONTENT).entity(String.format(\"Kein Eintrag für [ %s ] mit der ID [ %s ]\", Player.class.getName(), id)).build();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(jsonResponse).build();\n\t\t}\n\t\treturn createResponse(jsonResponse);\n\t}", "TeamResultWrapper findTeams(String personId,\n String partOfGroupname, int offset, int pageSize);", "public List<Team> getAllByLeague(League leagueID) {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAllByLeague(leagueID);\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "Subdivision findById(Long id);", "@RequestMapping(value = \"/associations/{id}/division-events\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<DivisionEvent> getDivisionEvents(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association DivisionEvents: {}\", id);\n\t\tDivisionEvent example = new DivisionEvent();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\tDivision exampleDivision = new Division();\n\t\texampleDivision.setAssociation(exampleAssociation);\n\t\texample.setDivision(exampleDivision);\n\t\treturn divisionEventRepository.findAll(Example.of(example));\n\t}", "@GET(\"v1/competitions/\")\n Call<List<Leagues>> getAllData();", "TeamResultWrapper findAllTeams(String personId, int offset,\n int pageSize);", "List<ECollisionType> getCollisions(Long id, Long lecturerId,\r\n\t\t\tList<Long> roomIds, Long cohortId, int numberOfAppointments,\r\n\t\t\tDate startDate, Date endDate);", "public List<Match> listMatches(int id_s) {\r\n\t\tString sql = \"SELECT * FROM matches WHERE Season=?\" ;\r\n\t\t\r\n\t\tList<Match> result = new ArrayList<>() ;\r\n\t\t\r\n\t\tConnection conn = DBConnect.getConnection();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tPreparedStatement st = conn.prepareStatement(sql);\r\n\t\t\tst.setInt(1, id_s);\r\n\r\n\t\t\tResultSet rs = st.executeQuery();\r\n\r\n\t\t\t\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tLocalDate input = rs.getDate(\"Date\").toLocalDate() ;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tresult.add( new Match(rs.getInt(\"match_id\"), seasonMap.get(rs.getInt(\"Season\")), \r\n\t\t\t\t\t\trs.getString(\"Div\"), input, teamMap.get(rs.getString(\"HomeTeam\")), \r\n\t\t\t\t\t\tteamMap.get(rs.getString(\"AwayTeam\")),rs.getInt(\"FTHG\"), \r\n\t\t\t\t\t\trs.getInt(\"FTAG\"), rs.getString(\"FTR\")) ) ;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tconn.close();\r\n\t\t\treturn result ;\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}", "TrackerGroups getTrackerGroups(final Integer id);", "List<Team> findTeamsByUserId(UserId userId);", "private FirstLevelDivision getDivisionByID(int divisionID) {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectDivisionByID.sql\"),\n Collections.singletonList(String.valueOf(divisionID)));\n\n FirstLevelDivision division = null;\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Division_ID\");\n String name = rs.getString(\"Division\");\n int countryID = rs.getInt(\"Country_ID\");\n division = new FirstLevelDivision(id, name, countryID);\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n return division;\n }", "@Override\n\tpublic Integer getDivisionId(final Integer fieldId, final Connection connection)\n\t{\n\t\tInteger divId = null;\n\t\t// String sql=\"SELECT distinct BNDRY_NUM FROM EG_BOUNDARY where ID_BNDRY='\"+divid+\"'\";\n\t\tfinal String sql = \"Select PARENT from EG_BOUNDARY where ID_BNDRY=:fieldId\";\n\t\tif (LOGGER.isDebugEnabled())\n\t\t\tLOGGER.debug(\"Division id query-->>>>>>>> \" + sql);\n\t\ttry {\n\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(sql);\n\t\t\tpst.setParameter(\"fieldId\", fieldId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\tdivId = Integer.parseInt(element[0].toString());\n\t\t\tif (LOGGER.isDebugEnabled())\n\t\t\t\tLOGGER.debug(\"Division id is >>>>>>>\" + divId);\n\t\t} catch (final HibernateException e)\n\t\t{\n\t\t\tLOGGER.error(\"Exp=\" + e.getMessage());\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn divId;\n\t}", "public ArrayList<League> getSeasonDetails(String year) {\n return League.getAllLeaguesPerSeason(Integer.parseInt(year));\n }", "@Transactional(readOnly = true)\n public List<TechPracticesDTO> findAllByCompetitorId(Long id) {\n log.debug(\"Request to get all TechPractices by competitor id {}\", id);\n return techPracticesRepository.findAllByCompetitorId(id).stream()\n .map(techPracticesMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n\tpublic String getDivisionCode(final Integer divid, final Connection connection)\n\t{\n\t\tString divCode = null;\n\t\tfinal String sql = \"SELECT distinct BNDRY_NUM FROM EG_BOUNDARY where ID_BNDRY= ?\";\n\t\tif (LOGGER.isDebugEnabled())\n\t\t\tLOGGER.debug(\"Divisio code query-->>>>>>>> \" + sql);\n\t\ttry {\n\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(sql);\n\t\t\tpst.setInteger(0, divid);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\tdivCode = element[0].toString();\n\t\t\t\tif (LOGGER.isDebugEnabled())\n\t\t\t\t\tLOGGER.debug(\"divCode >>>>>>>\" + divCode);\n\t\t\t}\n\n\t\t} catch (final HibernateException e)\n\t\t{\n\t\t\tLOGGER.error(\"Exp=\" + e.getMessage(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn divCode;\n\t}", "public GameGetDTO getGameInformationById(Long gameId){\n\n GameGetDTO gameGetDTO = new GameGetDTO();\n GameEntity game = getGameById(gameId);\n gameGetDTO.setId(game.getId());\n\n //Get the name of the active Player\n gameGetDTO.setActivePlayerName(playerService.getPlayerById(game.getActivePlayerId()).getUsername());\n\n //Get the name of the passive players, save them in a list (bots as well)\n List<String> playerNames = new ArrayList<String>();\n for (Long id: game.getPassivePlayerIds()){\n playerNames.add(playerService.getPlayerById(id).getUsername());\n }\n //Add bots\n for (Bot bot: game.getBots()){\n playerNames.add(bot.getName());\n }\n gameGetDTO.setPassivePlayerNames(playerNames);\n //Add the name of the active player to the list of the passive players and return list with all players\n List<String> playerNames2 = new ArrayList<String>();\n for (PlayerEntity player : game.getPlayers()){playerNames2.add(player.getUsername());}\n //Add bots\n for (Bot bot: game.getBots()){\n playerNames2.add(bot.getName());\n }\n gameGetDTO.setPlayerNames(playerNames2);\n return gameGetDTO;\n }", "private Collection<ConnectionEntry> getColleaguesInCommon(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS_IN_COMMON.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, value.toString());\n \t\t} else {\n \n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.USERID, value.toString());\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tCollection<ConnectionEntry> colleaguesInCommon = Converter.returnConnectionEntries(data, \"connectionEntry\");\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleaguesInCommon;\n \t\t\n \t}", "public static ArrayList<String> allSeasons(){\n PremierLeagueManager.loadingData();\n\n // sort the seasons using the comparator\n Comparator<String> comparator = (season1, season2) -> {\n\n if(Integer.parseInt(season1.split(\"-\")[0]) > Integer.parseInt(season2.split(\"-\")[0])){\n return 1;\n }\n return -1;\n\n };\n\n // setting the seasons with distinct seasons only\n PremierLeagueManager.setAllSeasonAdded((ArrayList<String>)\n PremierLeagueManager.getAllSeasonAdded().stream().distinct().collect(Collectors.toList()));\n\n // sorting the seasons\n PremierLeagueManager.getAllSeasonAdded().sort(comparator);\n\n // getting the seasons and return them\n return PremierLeagueManager.getAllSeasonAdded();\n }", "@GET\n @Path(\"/conciliacion/{id}\")\n @Produces({MediaType.APPLICATION_JSON})\n public List<EscenarioDTO> getByConciliacion(@PathParam(\"id\") int id) {\n logger.log(Level.INFO, \"id:{0}\", id);\n List<EscenarioDTO> lstDTO;\n List<Escenario> lst;\n lst = managerDAO.findByConciliacion(id);\n lstDTO = lst.stream().map(item -> item.toDTO()).distinct().sorted(comparing(EscenarioDTO::getId)).collect(toList());\n List<EscenarioDTO> lstFinal = (List<EscenarioDTO>) (List<?>) lstDTO;\n return lstFinal;\n }", "public ArrayList getDimensions(String grpId) {\r\n ArrayList finalList = new ArrayList();\r\n// PbBussGrpResourceBundle resBundle = new PbBussGrpResourceBundle();\r\n try {\r\n\r\n PbReturnObject retObj = null;\r\n String finalQuery = null;\r\n String[] colNames = null;\r\n Object obj[] = new Object[1];\r\n obj[0] = grpId;\r\n String sql = getResourceBundle().getString(\"getBusinessGroupDimList\");\r\n finalQuery = buildQuery(sql, obj);\r\n retObj = execSelectSQL(finalQuery);\r\n colNames = retObj.getColumnNames();\r\n for (int i = 0; i < retObj.getRowCount(); i++) {\r\n BusinessGrpsTreeTable dimension = new BusinessGrpsTreeTable();\r\n dimension.setDimensionName(retObj.getFieldValueString(i, colNames[1]));\r\n dimension.setDimensionId(String.valueOf(retObj.getFieldValueInt(i, colNames[0])));\r\n ArrayList tableList = new ArrayList();\r\n\r\n tableList = getTableList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimTableList(tableList);\r\n ArrayList membersList = new ArrayList();\r\n membersList = getMembersList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimMembersList(membersList);\r\n ArrayList hierarchyList = new ArrayList();\r\n hierarchyList = getHeirarchyList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimHierarchyList(hierarchyList);\r\n //.println.println(\"hierarchy list==\" + hierarchyList.size());\r\n finalList.add(dimension);\r\n }\r\n } catch (Exception e) {\r\n logger.error(\"Exception:\", e);\r\n }\r\n\r\n return finalList;\r\n }", "@Override\n\tpublic List<Lane> getDistinctLaneDirections(Integer tollPlazaId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = currentSession.createQuery(\"from Lane where tollPlazaId='\"+tollPlazaId+\"' and statusFlag='ACTIVE'\", Lane.class);\t\n\t\t\t\t\n\t\tList<Lane> lanes = theQuery.getResultList();\n\t\t\t\t\n\t\t\n \tMap<String, Lane> removeDuplicates = new HashMap<String, Lane>();\n\t\t\n\t\tfor (Lane l: lanes) {\n\t\t\tremoveDuplicates.put(l.getLaneDirection(), l);\n\t\t}\n\t\t\n\t\tlanes.clear();\n\t\t\n\t\t Iterator it = removeDuplicates.entrySet().iterator();\n\t\t while (it.hasNext()) {\n\t\t Map.Entry pair = (Map.Entry)it.next();\n\t\t lanes.add((Lane) pair.getValue());\n\t\t it.remove(); // avoids a ConcurrentModificationException\n\t\t }\n\n\t\treturn lanes;\n\t}", "public int getDivisionID() {\n return divisionID;\n }", "@Override\n\tpublic void getScoreBoard(Lane lane) {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Lane Number: \" + lane.getId());\n\n\t\tTreeMap<Integer, List<String>> winners = new TreeMap<>(Collections.reverseOrder());\n\n\t\tfor (Player player : lane.getPlayers()) {\n\t\t\tgetScoreCardByPlayer(player);\n\t\t\tint totalScore = player.getScoreCard().getTotalScore();\n\t\t\tList<String> winner = new ArrayList<>();\n\t\t\tif (winners.containsKey(totalScore)) {\n\t\t\t\twinner = winners.get(totalScore);\n\t\t\t}\n\t\t\twinner.add(player.getName());\n\t\t\twinners.put(totalScore, winner);\n\t\t}\n\t\tSystem.out.println(\"Winner: \" + winners.get(winners.firstKey()));\n\t\tSystem.out.println();\n\t}", "public static List<FixturesForm> getSeasonAtGlance(String tabName) {\n\n List<FixturesForm>fixturesFormList = null;\n FixturesForm fixturesForm = null;\n String query = SQLConstants.GET_SEASON_AT_GLANCE.replaceAll(\"#\",tabName.toLowerCase().replaceAll(\"\\\\W\", \"\"));\n \n System.out.println(\"[INFO] Generated Query:\"+query);\n\n try {\n fixturesFormList = new ArrayList<FixturesForm>();\n Connection con = JdbcConnection.getConnection();\n PreparedStatement pstmt = con.prepareStatement(query);\n\n ResultSet rs = pstmt.executeQuery();\n\n while (rs.next()) {\n fixturesForm = new FixturesForm();\n fixturesForm.setId(rs.getLong(\"id\"));\n fixturesForm.setLeftTeamId(rs.getLong(\"leftTeamid\"));\n fixturesForm.setRightTeamId(rs.getLong(\"rightTeamid\"));\n fixturesForm.setLeftTeamName(getTeam(con, rs.getLong(\"leftTeamid\")).getName());\n fixturesForm.setRightTeamName(getTeam(con, rs.getLong(\"rightTeamid\")).getName());\n fixturesForm.setVenue(rs.getString(\"venue\"));\n fixturesForm.setDate(rs.getString(\"date\"));\n \n fixturesFormList.add(fixturesForm);\n \n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return fixturesFormList;\n\n }", "List<GameResult> getAllGameResults();", "protected Lotofacil buscarLotofacilId(long id) {\r\n\t\treturn LotofacilListagemResultados.repositorio.buscarLotofacilId(id);\r\n\t}", "Game getGameById(long id);", "public List<Game> getAllGames() {\n List<Game> games = new ArrayList<>(data.values());\n games.sort((o1, o2) -> {\n if (o1.getId() < o2.getId()) {\n return 1;\n } else if (o1.getId() > o2.getId()) {\n return -1;\n } else {\n return 0;\n }\n });\n return games;\n }", "List<Team> getTeamsFromApi(List<Long> teamIds);", "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "@Test\r\n\tpublic void findAllGames() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: findAllGames \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tList<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.findAllGames4tsw(tswacct, startResult, maxRows);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: findAllGames\r\n\t}", "@Override\n\tpublic List<Lane> getLaneWithSameDirection(String laneDirection, Integer tollPId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = \n\t\t\t\tcurrentSession.createQuery(\"from Lane where tollPlazaId='\"+tollPId+\"' and laneDirection='\"+laneDirection+\"' and statusFlag='ACTIVE'\", Lane.class);\t\n\t\n\t\tList<Lane> lanes = theQuery.getResultList();\n\t\t\n\t\treturn lanes;\n\t\t\n\t}", "public static ArrayList<Match> generateMatch(String season){\n LeagueManager premierLeagueManagerService = PremierLeagueManager.getInstance();\n int numberOfClubsPresent = PremierLeagueManager.getPremierLeagueFootballClubList().size();\n\n // This condition is to make sure that there is at least 2 clubs to play a match\n if(numberOfClubsPresent > 1){\n\n // there 2 or more clubs present so we can generate a match\n // loading the data from the file\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n Random random = new Random();\n\n // step 01: randomly select 2 clubs\n int randomClub_01 = random.nextInt(guiSeasonFilteredClubs.size());\n FootballClub selectedClub_O1 = guiSeasonFilteredClubs.get(randomClub_01);\n int randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n\n // This is to make sure that the same club is not selected again for the match\n while (randomClub_02==randomClub_01){\n randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n }\n FootballClub selectedClub_O2 = guiSeasonFilteredClubs.get(randomClub_02);\n\n // step 02: randomly generate the necessary data\n int numberGoalScored_club_1 = random.nextInt(7);\n int numberGoalScored_club_2 = random.nextInt(7);\n\n // setting the random date and random season depending on the randomly selected year\n int[] possibleYears = new int[2];\n\n int seasonYear = Integer.parseInt(season.split(\"-\")[0]);\n\n possibleYears[0] = seasonYear;\n possibleYears[1] = seasonYear + 1;\n\n // making sure that the months are in given range for the year select for the season\n // premier league happens every year from August to next May\n int day = random.nextInt(30)+1;\n int randomYearIndexSelected = random.nextInt(2);\n int year = possibleYears[randomYearIndexSelected];\n int month;\n\n // if randomYearIndexSelected = 0, then the months have to be in the range from 8 to 12 else 1 to 5\n if(randomYearIndexSelected==0){\n // 8 to 12\n month = random.nextInt(5) + 8;\n\n }else{\n // 1 to 5\n month = random.nextInt(5) + 1;\n\n }\n\n DateMatch date = new DateMatch(day, month, year);\n String[] matchTypes = new String[]{\"Home\", \"Away\"};\n String matchType = matchTypes[random.nextInt(2)];\n\n // step 03: call the addPlayedMatch() wisely by passing all the generated random data\n premierLeagueManagerService.addPlayedMatch(season,selectedClub_O1.getName(), selectedClub_O2.getName(),\n numberGoalScored_club_1, numberGoalScored_club_2, date, matchType);\n\n // step 04: call the save file method\n premierLeagueManagerService.saveDataIntoFile();\n\n // step 05: call the load file method\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches for a season and returning\n return getMatchesForSeason(guiSeasonFilteredClubs);\n }\n // if there are less than 2 clubs we can't generate a match\n return null;\n }", "public JsonArray getAllDivergent(String conversationID, String agentUtterance){\n FormBody.Builder formBuilder = new FormBody.Builder();\n formBuilder.add(\"conversation_id\",conversationID);\n formBuilder.add(\"agent_response\",agentUtterance);\n\n Request request = new Request.Builder()\n .url(coreUrl+ \"get_all_divergent\")\n .post(formBuilder.build())\n .addHeader(headerVariable,headerValue)\n .build();\n try{\n Response response = client.newCall(request).execute();\n if(response.isSuccessful()){\n JsonReader reader = Json.createReader(new StringReader(response.body().string()));\n logger.info(\"Retrieved all divergent modified answers for conversation '{}' and utterance '{}'\",conversationID,agentUtterance);\n response.close();\n return reader.readArray();\n }\n } catch (IOException e) {\n logger.error(\"Could not retrieve all divergent modified answers of conversation '{}' for utterance '{}'\",conversationID,agentUtterance);\n e.printStackTrace();\n }\n return Json.createArrayBuilder().build();\n }", "@Override\n public List<HeroVillain> getHeroesVillainsByPowerId(int powerId) {\n List<HeroVillain> hVList = jdbcTemplate.query(SQL_SELECT_HEROESVILLAINS_BY_POWER_ID, \n new HeroVillainMapper(), powerId);\n // set the powers for each hero or villain\n return associatePowersWithHeroesVillains(hVList);\n }", "public List<AllTimeSeasonBean> getAllTimeRecord(){\n String q = \"select new com.main.pcblroyals.bean.AllTimeSeasonBean( \" +\n \"sum(case when g.teamScore > g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore = g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore < g.opponentScore then 1 else 0 end) \" +\n \") \" +\n \"from seasons s \" +\n \"join games g on s.id = g.season.id \";\n Query query = entityManager.createQuery(q);\n return (List<AllTimeSeasonBean>) query.getResultList();\n }", "public List<Team> getAllTeamsBySeason(Season s) { \r\n\t\t\tif(teamsBySeason==null)\t{\r\n\t\t\t\tteamsBySeason=dao.listTeamsforSeason(s); //LIST\t\t\r\n\t\t\tfor(Team atemp:teamsBySeason){ this.mapTeamBySeason.put(atemp.getTeam(), atemp);}\r\n\t\t\t}\r\n\t\t\treturn teamsBySeason;\r\n\t\t}", "@Override\n public HashMap<String, ArrayList<League>> conditionedSelect(String[] conditions) {\n String query;\n Connection connection = DBConnector.getConnection();\n PreparedStatement statement = null;\n ResultSet retrievedLeagues = null;\n HashMap<String, ArrayList<League>> leagues = new HashMap<>();\n\n if (conditions.length == 0) {\n query = \"select * from [Leagues]\";\n } else {\n query = \"select * from [Leagues] where\";\n\n for (int i = 0; i < conditions.length; i++) {\n if (i % 2 == 0) {\n query += \" \" + conditions[i];\n } else {\n query += \" = ?\";\n if (i < conditions.length - 1)\n query += \" and\";\n }\n }\n }\n try {\n statement = connection.prepareStatement(query);\n\n if (conditions.length > 0) {\n int i = 0;\n while (i < conditions.length) {\n switch (conditions[i].toLowerCase()) {\n case \"leaguename\":\n statement.setString((int) (i / 2) + 1, conditions[i + 1]);\n break;\n\n case \"year\":\n case \"winPoints\":\n case \"drawPoints\":\n case \"losePoints\":\n statement.setInt((int) (i / 2) + 1, Integer.valueOf(conditions[i + 1]));\n break;\n\n case \"schedulingmethod\":\n statement.setBoolean((int) (i / 2) + 1, conditions[i + 1].equals(\"1\"));\n\n default:\n break;\n }\n i += 2;\n }\n }\n\n retrievedLeagues = statement.executeQuery();\n\n\n while (retrievedLeagues.next()) {\n String leagueName = retrievedLeagues.getString(1);\n int season = retrievedLeagues.getInt(2);\n boolean scheduling = retrievedLeagues.getBoolean(3);\n int winPoints = retrievedLeagues.getInt(4);\n int losePoints = retrievedLeagues.getInt(5);\n int drawPoints = retrievedLeagues.getInt(6);\n\n League league = new League(leagueName, season, scheduling, winPoints, drawPoints, losePoints);\n String seasonString = Integer.toString(season);\n ArrayList<League> leaguesList;\n\n if (leagues.containsKey(seasonString)) {\n leaguesList = leagues.get(seasonString);\n } else {\n leaguesList = new ArrayList<>();\n leagues.put(seasonString, leaguesList);\n }\n\n leaguesList.add(league);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage());\n }\n\n return leagues;\n }", "public List<PlayerGame> findAllByGame(Long gameId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId))\n .collect(Collectors.toList());\n }", "List<Club> findByRaceOrderByPoints(Integer idRace) throws IOException;", "List<Subdivision> findByCriteria( SubdivisionVo subdivisionVo);", "public java.util.Enumeration findCarsByDivision(com.hps.july.persistence.DivisionKey arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n com.hps.july.persistence.CarHome localHome = ejbHome();\n java.util.Enumeration ejbs = localHome.findCarsByDivision(arg0);\n return (java.util.Enumeration) createAccessBeans(ejbs);\n }", "public List<Worker> getWorkersByDepartmentIdAndAvailabilityUsingCriteria(int departmentId, WorkerAvailability availability) {\n CriteriaBuilder builder = currentSession.getCriteriaBuilder();\n\n CriteriaQuery<Worker> criteria = builder.createQuery(Worker.class);\n Root<Worker> root = criteria.from(Worker.class);\n\n criteria.select(root).where(builder.and(builder.equal(root.get(\"department\").get(\"id\"), departmentId)),\n (builder.equal(root.get(\"availability\"), availability)));\n\n Query<Worker> q = currentSession.createQuery(criteria);\n\n return q.getResultList();\n\n }", "public List<TicketSite> getTicketSitesOfATeam(String teamId);", "public List<Game> getGamesForTable() throws ServiceException {\r\n\r\n List<Game> allNotPlayedGames = null;\r\n try {\r\n allNotPlayedGames = gameDao.findAllNotPlayedGames();\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n List<Game> gamesForTable = new ArrayList<>();\r\n\r\n for(Game game : allNotPlayedGames){\r\n\r\n buildGame(game);\r\n\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if (validHorseBets) {\r\n gamesForTable.add(game);\r\n }\r\n }\r\n\r\n return gamesForTable;\r\n }", "@GetMapping(\"/leaderboard\")\n @Timed\n @PermitAll\n public ResponseEntity<Leaderboard> getAllTeams() {\n log.debug(\"REST request to get a leaderboard\");\n\n return ResponseEntity.ok().body(this.leaderboardService.findAll());\n }", "public static List<String> getAllTeams() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n TeamsPojo pojo = objectMapper.readValue(response.getEntity().getContent(),TeamsPojo.class);\n List<String> willBeReturned = new ArrayList<>();\n List<Teams> teams = pojo.getTeams();\n for (int i =0 ; i<teams.size();i++){\n willBeReturned.add(teams.get(i).getName());\n }\n\n\n return willBeReturned;\n }", "public static List<String> getAttackerFromEngland() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> attackerName= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getPosition().equals(\"Attacker\")&&squad.get(i).getNationality().equals(\"England\")){\n\n attackerName.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n\n\n }\n }\n return attackerName;\n }", "public static Hashtag[] getByProjectId(long gameid) throws IOException {\r\n\t\treturn Api.executeCall(service.getByProjectId(gameid));\r\n\t}", "@Test\r\n\tpublic void findAllTeams() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: findAllTeams \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\tList<Team> response = null;\r\n\t\tresponse = service.findAllTeams(startResult, maxRows);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: findAllTeams\r\n\t}", "@Override\n public List<Competency> getAllAreaCompetencies(int id) {\n if (!areas.containsKey(id)) {\n return null;\n }\n\n Area area = areas.get(id);\n\n return area.getCompetencies();\n }", "public VwTeams get(int teamId)\n\t{\n\t\tVwTeams [] results = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tresults = dao.findWhereTeamIdEquals(teamId);\t\t\t\n\t\t}\n\t\tcatch (VwTeamsDaoException e)\n\t\t{\n\t\t\tlogger.error(e.getMessage());\n\t\t\t\n\t\t\terror.setCode(Errors.Codes.DB_DAO.getCode());\n\t\t\terror.setWindowTitle(Errors.Codes.DB_DAO.getWindowTitle());\n\t\t\terror.setMessage(Errors.Codes.DB_DAO.getMessage());\n\t\t\t\n\t\t\terror.setExceptionMessage(e.getMessage());\n\t\t\t\n\t\t\tpdr.setError(error);\n\t\t\t\n\t\t\tif (logger.isDebugEnabled())\n\t\t\t\te.printStackTrace();\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn results.length == 0 ? null : results[0];\n\t}", "@SuppressWarnings(\"unchecked\")\n private List createLeagueList() {\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n HashMap m = new HashMap();\n m.put( \"League\", leagues_array.get(i)); // the key and it's value.\n result.add( m );\n }\n return (List)result;\n }", "public List<RPSGame> getGamesByPlayer(String playerId) {\n\t\tif (playerId == null) {\n\t\t\tthrow new RuntimeException(\"Player ID can't be null!\");\n\t\t}\n\t\treturn games.entrySet().stream().map(entry -> entry.getValue()).filter(game -> game.isPlayerGame(playerId))\n\t\t\t\t.collect(Collectors.toList());\n\n\t}", "private static void divideDeck(int numPlayers) {\n\t\tint i = 0;\n\t\tfor (Card card : deck)\n\t\t{\n\t\t\tplayers.get(i % numPlayers).addCardToDeck(card);\n\t\t\ti++;\n\t\t}\n\t}", "public LiveData<LeagueEntity> getLeague() {\n return observableLeague;\n }", "private Game getGameById(long idGame) {\n Game game;\n synchronized (this.games) {\n if (!this.games.containsKey(idGame)) {\n return null;\n }\n game = this.games.get(idGame);\n }\n return game;\n }", "public Game findGameById(int gameId, User user) throws ServiceException {\r\n\r\n Game game = null;\r\n try {\r\n game = gameDao.findByID(gameId);\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n\r\n if (game == null){\r\n return null;\r\n }\r\n\r\n if (user == null || !user.getRole().equals(Role.USER)){\r\n buildGame(game);\r\n return game;\r\n }\r\n\r\n buildGame(game);\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if(!validHorseBets){\r\n return null;\r\n }\r\n\r\n return game;\r\n }", "Set<OptionDTO> getDependentOptionTree(Integer optionId);", "public League getLeagueName() {\n return leagueName;\n }", "public CheckersGame getGameByID(Integer gameID){\n return games.get(gameID);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof League)) {\n return false;\n }\n League other = (League) object;\n if ((this.leagueId == null && other.leagueId != null) || (this.leagueId != null && !this.leagueId.equals(other.leagueId))) {\n return false;\n }\n return true;\n }", "TrackerGroups loadTrackerGroups(final Integer id);", "public League getLeagueDetails(String leagueName) {\n return League.getLeagueByName(leagueName);\n }", "@RequestMapping(value = \"/game/byStudio/{studio}\", method = RequestMethod.GET)\n @ResponseStatus(value = HttpStatus.OK)\n public List<Game> getGameByStudio(@PathVariable String studio) {\n return serviceLayer.getGameByStudio(studio);\n }", "public Set<Cdss4NsarLabor> getLabResults();", "@RequestMapping(value = \"/companies/{companyId}/fleets/{fleetId}/vehicles/{vehicleId\" +\n \"}/contracts\", method = RequestMethod.GET)\n @PreAuthorize(\"hasPermission(#vehicleId, 'vehicle', 'READ') && hasPermission(#companyId, 'company', 'READ') && hasPermission(#fleetId, 'fleet', 'READ')\")\n public ResponseEntity<?> getByCompanyFleetVehicleId(@PathVariable int companyId,@PathVariable int fleetId,@PathVariable int vehicleId,Pageable pagination, ContractFilter filter, BindingResult result) {\n filter.setClientCompany(companyId);\n filter.setFleet(fleetId);\n filter.setVehicle(vehicleId);\n return super.listAll(pagination,filter,result);\n }", "void getParticipants(@NonNull final String conversationId, @Nullable Callback<ComapiResult<List<Participant>>> callback);", "TeamResultWrapper findTeamsByMember(String personId,\n String partOfGroupname, int offset, int pageSize);", "List<Subdivision> findAll();", "private void getTeams() {\n if(progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n progressDialog = new ProgressDialog(getContext());\n progressDialog.setCancelable(true);\n if(getArguments()!=null) {\n progressDialog.setMessage(\"Fetching Match Schedules\");\n }\n else {\n progressDialog.setMessage(\"Processing\");\n }\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setProgress(0);\n progressDialog.show();\n db.collection(\"teams\").get().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 JSONObject object = new JSONObject(document.getData());\n try {\n teamsObject.put(document.getId(), object);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n if(getArguments()!=null) {\n if (dataBundle.getString(\"from\").equals(\"league Features\")) {\n getSchedules();\n }\n else if(dataBundle.getString(\"from\").equals(\"TM-matches\")){\n getTeamSchedules();\n }\n }\n else {\n getSchedules();\n }\n } else {\n Toast.makeText(context, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "default Set<UUID> getOpponents(UUID playerId, boolean excludeDeadPlayers) {\n Player player = getPlayer(playerId);\n if (player == null) {\n return new HashSet<>();\n }\n\n return player.getInRange().stream()\n .filter(opponentId -> !opponentId.equals(playerId))\n .filter(opponentId -> !excludeDeadPlayers || !getPlayer(opponentId).hasLost())\n .collect(Collectors.toSet());\n }", "public Team get(Long id);", "@GET\n @Path(\"Current/Team/{teamId}\")\n public Response getTeamByCurrentUser(@PathParam(\"teamId\") Long teamId) {\n Response r = Response.noContent().build();\n User currentUser = userFacade.getCurrentUser();\n final Collection<Game> playedGames = gameFacade.findRegisteredGames(currentUser.getId());\n for (Game g : playedGames) {\n Collection<Team> teams = g.getTeams();\n for (Team t : teams) {\n if (teamId.equals(t.getId())) {\n for (Player p : t.getPlayers()) {\n if (p.getUserId().equals(currentUser.getId())) {\n r = Response.ok().entity(t).build();\n }\n }\n }\n }\n }\n return r;\n }", "public ArrayList<CollegeFootballTeam> getTeamList();", "Response getGameDetails(String gameIdAsString);", "private List<Horse> parseHorses(String[] horsesId) throws ServiceException {\r\n\r\n List<Horse> horses = new ArrayList<>();\r\n for (String stringId : horsesId){\r\n int id = Integer.parseInt(stringId);\r\n Horse horse = null;\r\n try {\r\n horse = horseDao.findByID(id);\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n horses.add(horse);\r\n }\r\n\r\n return horses;\r\n }", "public Division getDivision() throws Exception {\n\tDivision bean = null;\n\tif (getGroupcode() != null)\n\t bean = (Division)getGroups();\n\telse if (getDepartmentcode() != null)\n\t bean = (Division)getDepartments();\n\telse if (getServicecode() != null)\n\t bean = (Division)getServices();\n\telse if (getDirectioncode() != null)\n\t bean = (Division)getDirections();\n\t \n\treturn bean;\n\n}", "public ModelGame findGameById () {\n Scanner input = new Scanner(System.in); // Create a Scanner object\n System.out.println(\"Enter the ID of the game you wish to return:\");\n int id = input.nextInt(); // Read user input of id\n for (ModelGame game : this.allGames) {\n if (game.getGameId() == id) {\n return game;\n }\n }\n return null;\n }" ]
[ "0.6205245", "0.6128162", "0.58111566", "0.5664763", "0.5663375", "0.5659185", "0.56155145", "0.5437285", "0.54101175", "0.53872997", "0.5315197", "0.5301925", "0.5209798", "0.52082556", "0.52043575", "0.51256275", "0.50868595", "0.5078035", "0.5030444", "0.50061524", "0.49799684", "0.4952633", "0.4913939", "0.48624468", "0.48337123", "0.48191997", "0.4773743", "0.47648442", "0.47541735", "0.475387", "0.47508523", "0.4725499", "0.47210458", "0.47114006", "0.47025275", "0.47009936", "0.4686679", "0.46576148", "0.46539837", "0.46377346", "0.46188468", "0.4617114", "0.46146765", "0.46087012", "0.45938355", "0.4583206", "0.45677096", "0.4567621", "0.45657423", "0.45552924", "0.45543465", "0.4551576", "0.454965", "0.45477858", "0.45422792", "0.45404792", "0.45380077", "0.45301884", "0.45047396", "0.44979057", "0.4495565", "0.44792044", "0.44783345", "0.44773862", "0.44732657", "0.44648778", "0.44632706", "0.44509637", "0.44426933", "0.44399774", "0.44362944", "0.4435941", "0.44348535", "0.44322908", "0.44249743", "0.4420153", "0.4416462", "0.4401322", "0.4397834", "0.43914592", "0.4389027", "0.43822432", "0.43767056", "0.43748924", "0.43714416", "0.43698", "0.43641865", "0.43594676", "0.4349576", "0.43473667", "0.43458825", "0.4340833", "0.43320996", "0.4329261", "0.4327094", "0.4326265", "0.43243012", "0.43174747", "0.43172407", "0.431227" ]
0.6936462
0
The getDivisionsByLeague method gets the divisions based on leagueId
public static boolean getDivisionsWithNoLeague(List<DivisionBean> divs) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement getDivisions = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); getDivisions = conn.prepareStatement("SELECT d.divisionID, d.divisionName FROM division d natural left join leaguexdivision ld WHERE ld.divisionID IS NULL;"); rs = getDivisions.executeQuery(); while(rs.next()) { DivisionBean div = new DivisionBean(); div.setDivisionId(rs.getString(1)); div.setDivisionName(rs.getString(2)); divs.add(div); status = true; } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (getDivisions != null) { try { getDivisions.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean getDivisionsByLeague(List<DivisionBean> divs, String leagueId) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getDivisions = null;\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetDivisions = conn.prepareStatement(\"SELECT division.divisionID, divisionName from division, leaguexdivision WHERE leagueID=? AND division.divisionID=leaguexdivision.divisionID\");\r\n\t\t\tgetDivisions.setString(1, leagueId);\r\n\t\t\trs = getDivisions.executeQuery();\r\n\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean div = new DivisionBean();\r\n\t\t\t\tdiv.setDivisionId(rs.getString(1));\r\n\t\t\t\tdiv.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivs.add(div);\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getDivisions != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetDivisions.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "@RequestMapping(value = \"/associations/{id}/divisions\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Division> getAssociationGames(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association games: {}\", id);\n\t\tDivision example = new Division();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\texample.setAssociation(exampleAssociation);\n\t\treturn divisionRepository.findAll(Example.of(example));\n\t}", "public static boolean getLeagueDivisions(String lID, List<DivisionBean> divisionList) {\r\n\r\n\t\tboolean status = false;\t\t\t\t\t\t\t// query status\r\n\t\tConnection conn = null;\t\t\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement division = null;\t\t\t\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tdivision = conn.prepareStatement(\"SELECT d.divisionID, d.leagueName from division d inner join\"\r\n\t\t\t\t\t+ \" leaguexdivision ld on ld.divisionID = d.divisionID where ld.leagueID = ? limit 1\");\r\n\t\t\tdivision.setString(1, lID);\r\n\t\t\trs = division.executeQuery();\r\n\t\t\tstatus = rs.next();\r\n\r\n\t\t\t//return to the start of the result set\r\n\t\t\trs.beforeFirst();\r\n\r\n\t\t\t//Loop through and add the results of the query to a LeagueBean then add it to the list\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tDivisionBean lb = new DivisionBean();\r\n\t\t\t\tlb.setDivisionId(rs.getString(1));\r\n\t\t\t\tlb.setDivisionName(rs.getString(2));\r\n\t\t\t\tdivisionList.add(lb);\r\n\t\t\t}\r\n\r\n\t\t\t// close all connections and catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (division != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdivision.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public List<Division> getDivisionParStructure( long idStructure)\n\t{\n List<Division> dicvs=divisionRepository.getDivisionParStructure(idStructure);\n// for(Division a:dicvs)\n// {\n// \t listeDivs.add(a);\n// }\n \n\n\t\tList<Division> Divisions = new ArrayList<>();\n\t\tdivisionRepository.getDivisionParStructure(idStructure).forEach(Divisions::add);\n\t\treturn Divisions;\n\n\t}", "public int getLeagueId() {\n return leagueId;\n }", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "@Override\r\n public List<GameDto> getFixturesByLeagueAndSeason(LeagueKeys league, SeasonKeys season) {\n String seasonString = Arrays.stream(season.getKey().split(\"/\")).reduce(\"\", (s, t) -> s + t.substring(2,4));\r\n return client.getFixturesByLeagueAndSeason(league.getParam(), seasonString).stream().map(g->toGame(g,season)).collect(toList());\r\n }", "public Long getLeagueId() {\n return (this.leagueId);\n }", "@Override\n\tpublic List<GameResponseDTO> findAllByLessonId(long lessonId) {\n\t\tList<GameResponseDTO> gameResponseDTOList = new ArrayList<>();\n\t\ttry {\n\t\t\tList<Game> gameList = iGameRepository.findByLessonIdAndStatusNot(lessonId, DELETED_STATUS);\n\t\t\tif (!gameList.isEmpty()) {\n\t\t\t\tfor (Game game : gameList) {\n\t\t\t\t\tGameResponseDTO gameResponseDTO = modelMapper.map(game, GameResponseDTO.class);\n\t\t\t\t\tgameResponseDTOList.add(gameResponseDTO);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Find all games by lessonId = \" + lessonId + \"! \" + e.getMessage());\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn gameResponseDTOList;\n\t}", "@Override\n public List<League> getLeaguesByCategory(int categoryId) throws ServiceException {\n try {\n return leagueDAO.getLeaguesByCategory(categoryId);\n } catch (DAOException exc){\n LOG.error(exc);\n throw new ServiceException(exc);\n }\n }", "public List<PlayerWon> findByLeagueId(int leagueId);", "@Override\n public ArrayList<League> select(String id) {\n return null;\n }", "@GetMapping(path = \"/contest/{id}\",produces = MediaType.APPLICATION_JSON_VALUE)\n @ApiResponses(value =\n {\n @ApiResponse(code = 200, message = \"success\", response = BetOnTeam.class),\n @ApiResponse(code = 404, message = \"Bad request\", response = ResultException.class),\n @ApiResponse(code = 500, message = \"Unfortunately there is technical error while processing your request\", response = ResultException.class)\n }\n )\n @PreAuthorize(\"hasAnyRole('Admin','User')\")\n public ResponseEntity<Result<List<BetOnTeamWithUser>>> getContestByMatchId(@PathVariable int id) throws Exception {\n Result<List<BetOnTeamWithUser>> contestList = betonteamservice.findContestById(id);\n return new ResponseEntity<>(contestList, HttpStatus.valueOf(contestList.getCode()));\n }", "@Override\n\tpublic List<Games> specificGameView(int id) {\n\t\treturn gameDAO.viewSpecificGame(id);\n\t}", "@RequestMapping(value = \"/associations/{id}/games\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Game> getGames(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association Games: {}\", id);\n\t\tGame example = new Game();\n\t\tDivisionEvent exampleDivisionEvent = new DivisionEvent();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\tDivision exampleDivision = new Division();\n\t\texampleDivision.setAssociation(exampleAssociation);\n\t\texampleDivisionEvent.setDivision(exampleDivision);\n\t\tTimeslot exampleTimeslot = new Timeslot();\n\t\texampleTimeslot.setDivisionEvent(exampleDivisionEvent);\n\t\texample.setTimeslot(exampleTimeslot);\n\t\treturn gameRepository.findAll(Example.of(example));\n\t}", "@Override\n\tpublic List<Lane> getLaneFromLaneId(Integer laneId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = currentSession.createQuery(\"from Lane where laneId='\"+laneId+\"'\", Lane.class);\t\n\t\t\t\t\n\t\tList<Lane> theLane = theQuery.getResultList(); \n\t\t\t\t\n\t\treturn theLane;\n\t}", "public int getDivisionId() {\n return divisionId;\n }", "@GetMapping(\"/games/{id}/sets\")\n public List<Set> getCardsByGameId(@PathVariable(value = \"id\") long gameId, Pageable pageable) {\n Page<Set> set = setRepository.findByGameId(gameId, pageable);\n List<Set> setList = new ArrayList<>();\n int a = set.getContent().size();\n for (int x = 0; x < a; x++) {\n List<Card> cardList = new ArrayList<>();\n// if (!cardRepository.findBySetId(set.getContent().get(x).getId(), pageable).hasContent())\n// {\n// continue;\n// }\n Page<Card> card = cardRepository.findBySetId(set.getContent().get(x).getId(), pageable);\n// if (card != null) {\n// if (card.getContent().size() > 0) {\n cardList.addAll(card.getContent());\n// }\n// }\n// if(!cardList.isEmpty()) {\n set.getContent().get(x).setCard(cardList);\n setList.add(set.getContent().get(x));\n// }\n }\n return setList;\n }", "public List<Card> getCardsOf(Long idGame, Long idPlayer){\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return null;\n }\n\n List<Player> players = game.getPlayers();\n for(Player player : players) {\n if(idPlayer.equals(player.getPlayer_identifier())) {\n return player.getCards();\n }\n }\n\n return null;\n }", "List<SubDivision> findByDivisionIdOrderByCodeAsc(Division divisionId);", "@GET\n\t@Path(\"/player/{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getGroupsForPlayer(@QueryParam(\"hash\") String hash, @PathParam(\"id\") String id) {\n\t\tController<Player> controller = new Controller<>();\n\t\tString jsonResponse = \"\";\n\t\ttry {\n\t\t\tsuper.hasPermission(hash);\n\t\t\tList<PlayerGroup> models = controller.findById(stringToNumber(id), Player.class).getPlayerGroups();\n\t\t\tjsonResponse = mapper.writeValueAsString(models);\n\t\t} catch (NoPermissionExeption e) {\n\t\t\treturn noPermissionResult();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn Response.status(Response.Status.NO_CONTENT).entity(String.format(\"Kein Eintrag für [ %s ] mit der ID [ %s ]\", Player.class.getName(), id)).build();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(jsonResponse).build();\n\t\t}\n\t\treturn createResponse(jsonResponse);\n\t}", "TeamResultWrapper findTeams(String personId,\n String partOfGroupname, int offset, int pageSize);", "public List<Team> getAllByLeague(League leagueID) {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAllByLeague(leagueID);\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "Subdivision findById(Long id);", "@RequestMapping(value = \"/associations/{id}/division-events\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<DivisionEvent> getDivisionEvents(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association DivisionEvents: {}\", id);\n\t\tDivisionEvent example = new DivisionEvent();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\tDivision exampleDivision = new Division();\n\t\texampleDivision.setAssociation(exampleAssociation);\n\t\texample.setDivision(exampleDivision);\n\t\treturn divisionEventRepository.findAll(Example.of(example));\n\t}", "@GET(\"v1/competitions/\")\n Call<List<Leagues>> getAllData();", "TeamResultWrapper findAllTeams(String personId, int offset,\n int pageSize);", "List<ECollisionType> getCollisions(Long id, Long lecturerId,\r\n\t\t\tList<Long> roomIds, Long cohortId, int numberOfAppointments,\r\n\t\t\tDate startDate, Date endDate);", "public List<Match> listMatches(int id_s) {\r\n\t\tString sql = \"SELECT * FROM matches WHERE Season=?\" ;\r\n\t\t\r\n\t\tList<Match> result = new ArrayList<>() ;\r\n\t\t\r\n\t\tConnection conn = DBConnect.getConnection();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tPreparedStatement st = conn.prepareStatement(sql);\r\n\t\t\tst.setInt(1, id_s);\r\n\r\n\t\t\tResultSet rs = st.executeQuery();\r\n\r\n\t\t\t\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tLocalDate input = rs.getDate(\"Date\").toLocalDate() ;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tresult.add( new Match(rs.getInt(\"match_id\"), seasonMap.get(rs.getInt(\"Season\")), \r\n\t\t\t\t\t\trs.getString(\"Div\"), input, teamMap.get(rs.getString(\"HomeTeam\")), \r\n\t\t\t\t\t\tteamMap.get(rs.getString(\"AwayTeam\")),rs.getInt(\"FTHG\"), \r\n\t\t\t\t\t\trs.getInt(\"FTAG\"), rs.getString(\"FTR\")) ) ;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tconn.close();\r\n\t\t\treturn result ;\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}", "TrackerGroups getTrackerGroups(final Integer id);", "List<Team> findTeamsByUserId(UserId userId);", "private FirstLevelDivision getDivisionByID(int divisionID) {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectDivisionByID.sql\"),\n Collections.singletonList(String.valueOf(divisionID)));\n\n FirstLevelDivision division = null;\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Division_ID\");\n String name = rs.getString(\"Division\");\n int countryID = rs.getInt(\"Country_ID\");\n division = new FirstLevelDivision(id, name, countryID);\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n return division;\n }", "@Override\n\tpublic Integer getDivisionId(final Integer fieldId, final Connection connection)\n\t{\n\t\tInteger divId = null;\n\t\t// String sql=\"SELECT distinct BNDRY_NUM FROM EG_BOUNDARY where ID_BNDRY='\"+divid+\"'\";\n\t\tfinal String sql = \"Select PARENT from EG_BOUNDARY where ID_BNDRY=:fieldId\";\n\t\tif (LOGGER.isDebugEnabled())\n\t\t\tLOGGER.debug(\"Division id query-->>>>>>>> \" + sql);\n\t\ttry {\n\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(sql);\n\t\t\tpst.setParameter(\"fieldId\", fieldId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\tdivId = Integer.parseInt(element[0].toString());\n\t\t\tif (LOGGER.isDebugEnabled())\n\t\t\t\tLOGGER.debug(\"Division id is >>>>>>>\" + divId);\n\t\t} catch (final HibernateException e)\n\t\t{\n\t\t\tLOGGER.error(\"Exp=\" + e.getMessage());\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn divId;\n\t}", "public ArrayList<League> getSeasonDetails(String year) {\n return League.getAllLeaguesPerSeason(Integer.parseInt(year));\n }", "@Transactional(readOnly = true)\n public List<TechPracticesDTO> findAllByCompetitorId(Long id) {\n log.debug(\"Request to get all TechPractices by competitor id {}\", id);\n return techPracticesRepository.findAllByCompetitorId(id).stream()\n .map(techPracticesMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n\tpublic String getDivisionCode(final Integer divid, final Connection connection)\n\t{\n\t\tString divCode = null;\n\t\tfinal String sql = \"SELECT distinct BNDRY_NUM FROM EG_BOUNDARY where ID_BNDRY= ?\";\n\t\tif (LOGGER.isDebugEnabled())\n\t\t\tLOGGER.debug(\"Divisio code query-->>>>>>>> \" + sql);\n\t\ttry {\n\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(sql);\n\t\t\tpst.setInteger(0, divid);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\tdivCode = element[0].toString();\n\t\t\t\tif (LOGGER.isDebugEnabled())\n\t\t\t\t\tLOGGER.debug(\"divCode >>>>>>>\" + divCode);\n\t\t\t}\n\n\t\t} catch (final HibernateException e)\n\t\t{\n\t\t\tLOGGER.error(\"Exp=\" + e.getMessage(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn divCode;\n\t}", "public GameGetDTO getGameInformationById(Long gameId){\n\n GameGetDTO gameGetDTO = new GameGetDTO();\n GameEntity game = getGameById(gameId);\n gameGetDTO.setId(game.getId());\n\n //Get the name of the active Player\n gameGetDTO.setActivePlayerName(playerService.getPlayerById(game.getActivePlayerId()).getUsername());\n\n //Get the name of the passive players, save them in a list (bots as well)\n List<String> playerNames = new ArrayList<String>();\n for (Long id: game.getPassivePlayerIds()){\n playerNames.add(playerService.getPlayerById(id).getUsername());\n }\n //Add bots\n for (Bot bot: game.getBots()){\n playerNames.add(bot.getName());\n }\n gameGetDTO.setPassivePlayerNames(playerNames);\n //Add the name of the active player to the list of the passive players and return list with all players\n List<String> playerNames2 = new ArrayList<String>();\n for (PlayerEntity player : game.getPlayers()){playerNames2.add(player.getUsername());}\n //Add bots\n for (Bot bot: game.getBots()){\n playerNames2.add(bot.getName());\n }\n gameGetDTO.setPlayerNames(playerNames2);\n return gameGetDTO;\n }", "private Collection<ConnectionEntry> getColleaguesInCommon(String sourceId, String targetId, Map<String, String> parameters) throws ProfileServiceException{\n \t\t\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"checkColleague\");\n \t\t}\n \t\tif (StringUtil.isEmpty(sourceId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_4);\n \t\t}\n \t\tif (StringUtil.isEmpty(targetId)) {\n \t\t\tthrow new IllegalArgumentException(Messages.InvalidArgument_5);\n \t\t}\n \t\tDocument data = null;\n \t\tif(parameters == null){\n \t\t\tparameters = new HashMap<String, String>();\n \t\t}\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS_IN_COMMON.getProfileType());\n \t\tif (isEmail(sourceId)) {\n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.EMAIL, value.toString());\n \t\t} else {\n \n \t\t\tStringBuilder value = new StringBuilder(sourceId);\n \t\t\tvalue = value.append(\",\").append(targetId);\n \t\t\tparameters.put(ProfileRequestParams.USERID, value.toString());\n \t\t}\n \t\tparameters.put(\"connectionType\",\"colleague\");\n \n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tCollection<ConnectionEntry> colleaguesInCommon = Converter.returnConnectionEntries(data, \"connectionEntry\");\n \n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getColleagues\");\n \t\t}\n \t\treturn colleaguesInCommon;\n \t\t\n \t}", "public static ArrayList<String> allSeasons(){\n PremierLeagueManager.loadingData();\n\n // sort the seasons using the comparator\n Comparator<String> comparator = (season1, season2) -> {\n\n if(Integer.parseInt(season1.split(\"-\")[0]) > Integer.parseInt(season2.split(\"-\")[0])){\n return 1;\n }\n return -1;\n\n };\n\n // setting the seasons with distinct seasons only\n PremierLeagueManager.setAllSeasonAdded((ArrayList<String>)\n PremierLeagueManager.getAllSeasonAdded().stream().distinct().collect(Collectors.toList()));\n\n // sorting the seasons\n PremierLeagueManager.getAllSeasonAdded().sort(comparator);\n\n // getting the seasons and return them\n return PremierLeagueManager.getAllSeasonAdded();\n }", "@GET\n @Path(\"/conciliacion/{id}\")\n @Produces({MediaType.APPLICATION_JSON})\n public List<EscenarioDTO> getByConciliacion(@PathParam(\"id\") int id) {\n logger.log(Level.INFO, \"id:{0}\", id);\n List<EscenarioDTO> lstDTO;\n List<Escenario> lst;\n lst = managerDAO.findByConciliacion(id);\n lstDTO = lst.stream().map(item -> item.toDTO()).distinct().sorted(comparing(EscenarioDTO::getId)).collect(toList());\n List<EscenarioDTO> lstFinal = (List<EscenarioDTO>) (List<?>) lstDTO;\n return lstFinal;\n }", "public ArrayList getDimensions(String grpId) {\r\n ArrayList finalList = new ArrayList();\r\n// PbBussGrpResourceBundle resBundle = new PbBussGrpResourceBundle();\r\n try {\r\n\r\n PbReturnObject retObj = null;\r\n String finalQuery = null;\r\n String[] colNames = null;\r\n Object obj[] = new Object[1];\r\n obj[0] = grpId;\r\n String sql = getResourceBundle().getString(\"getBusinessGroupDimList\");\r\n finalQuery = buildQuery(sql, obj);\r\n retObj = execSelectSQL(finalQuery);\r\n colNames = retObj.getColumnNames();\r\n for (int i = 0; i < retObj.getRowCount(); i++) {\r\n BusinessGrpsTreeTable dimension = new BusinessGrpsTreeTable();\r\n dimension.setDimensionName(retObj.getFieldValueString(i, colNames[1]));\r\n dimension.setDimensionId(String.valueOf(retObj.getFieldValueInt(i, colNames[0])));\r\n ArrayList tableList = new ArrayList();\r\n\r\n tableList = getTableList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimTableList(tableList);\r\n ArrayList membersList = new ArrayList();\r\n membersList = getMembersList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimMembersList(membersList);\r\n ArrayList hierarchyList = new ArrayList();\r\n hierarchyList = getHeirarchyList(String.valueOf(retObj.getFieldValueInt(i, colNames[0])), grpId);\r\n dimension.setDimHierarchyList(hierarchyList);\r\n //.println.println(\"hierarchy list==\" + hierarchyList.size());\r\n finalList.add(dimension);\r\n }\r\n } catch (Exception e) {\r\n logger.error(\"Exception:\", e);\r\n }\r\n\r\n return finalList;\r\n }", "@Override\n\tpublic List<Lane> getDistinctLaneDirections(Integer tollPlazaId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = currentSession.createQuery(\"from Lane where tollPlazaId='\"+tollPlazaId+\"' and statusFlag='ACTIVE'\", Lane.class);\t\n\t\t\t\t\n\t\tList<Lane> lanes = theQuery.getResultList();\n\t\t\t\t\n\t\t\n \tMap<String, Lane> removeDuplicates = new HashMap<String, Lane>();\n\t\t\n\t\tfor (Lane l: lanes) {\n\t\t\tremoveDuplicates.put(l.getLaneDirection(), l);\n\t\t}\n\t\t\n\t\tlanes.clear();\n\t\t\n\t\t Iterator it = removeDuplicates.entrySet().iterator();\n\t\t while (it.hasNext()) {\n\t\t Map.Entry pair = (Map.Entry)it.next();\n\t\t lanes.add((Lane) pair.getValue());\n\t\t it.remove(); // avoids a ConcurrentModificationException\n\t\t }\n\n\t\treturn lanes;\n\t}", "public int getDivisionID() {\n return divisionID;\n }", "@Override\n\tpublic void getScoreBoard(Lane lane) {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Lane Number: \" + lane.getId());\n\n\t\tTreeMap<Integer, List<String>> winners = new TreeMap<>(Collections.reverseOrder());\n\n\t\tfor (Player player : lane.getPlayers()) {\n\t\t\tgetScoreCardByPlayer(player);\n\t\t\tint totalScore = player.getScoreCard().getTotalScore();\n\t\t\tList<String> winner = new ArrayList<>();\n\t\t\tif (winners.containsKey(totalScore)) {\n\t\t\t\twinner = winners.get(totalScore);\n\t\t\t}\n\t\t\twinner.add(player.getName());\n\t\t\twinners.put(totalScore, winner);\n\t\t}\n\t\tSystem.out.println(\"Winner: \" + winners.get(winners.firstKey()));\n\t\tSystem.out.println();\n\t}", "public static List<FixturesForm> getSeasonAtGlance(String tabName) {\n\n List<FixturesForm>fixturesFormList = null;\n FixturesForm fixturesForm = null;\n String query = SQLConstants.GET_SEASON_AT_GLANCE.replaceAll(\"#\",tabName.toLowerCase().replaceAll(\"\\\\W\", \"\"));\n \n System.out.println(\"[INFO] Generated Query:\"+query);\n\n try {\n fixturesFormList = new ArrayList<FixturesForm>();\n Connection con = JdbcConnection.getConnection();\n PreparedStatement pstmt = con.prepareStatement(query);\n\n ResultSet rs = pstmt.executeQuery();\n\n while (rs.next()) {\n fixturesForm = new FixturesForm();\n fixturesForm.setId(rs.getLong(\"id\"));\n fixturesForm.setLeftTeamId(rs.getLong(\"leftTeamid\"));\n fixturesForm.setRightTeamId(rs.getLong(\"rightTeamid\"));\n fixturesForm.setLeftTeamName(getTeam(con, rs.getLong(\"leftTeamid\")).getName());\n fixturesForm.setRightTeamName(getTeam(con, rs.getLong(\"rightTeamid\")).getName());\n fixturesForm.setVenue(rs.getString(\"venue\"));\n fixturesForm.setDate(rs.getString(\"date\"));\n \n fixturesFormList.add(fixturesForm);\n \n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return fixturesFormList;\n\n }", "List<GameResult> getAllGameResults();", "protected Lotofacil buscarLotofacilId(long id) {\r\n\t\treturn LotofacilListagemResultados.repositorio.buscarLotofacilId(id);\r\n\t}", "Game getGameById(long id);", "public List<Game> getAllGames() {\n List<Game> games = new ArrayList<>(data.values());\n games.sort((o1, o2) -> {\n if (o1.getId() < o2.getId()) {\n return 1;\n } else if (o1.getId() > o2.getId()) {\n return -1;\n } else {\n return 0;\n }\n });\n return games;\n }", "List<Team> getTeamsFromApi(List<Long> teamIds);", "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "@Test\r\n\tpublic void findAllGames() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: findAllGames \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tList<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.findAllGames4tsw(tswacct, startResult, maxRows);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: findAllGames\r\n\t}", "@Override\n\tpublic List<Lane> getLaneWithSameDirection(String laneDirection, Integer tollPId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t\n\t\t//create a query\n\t\tQuery<Lane> theQuery = \n\t\t\t\tcurrentSession.createQuery(\"from Lane where tollPlazaId='\"+tollPId+\"' and laneDirection='\"+laneDirection+\"' and statusFlag='ACTIVE'\", Lane.class);\t\n\t\n\t\tList<Lane> lanes = theQuery.getResultList();\n\t\t\n\t\treturn lanes;\n\t\t\n\t}", "public static ArrayList<Match> generateMatch(String season){\n LeagueManager premierLeagueManagerService = PremierLeagueManager.getInstance();\n int numberOfClubsPresent = PremierLeagueManager.getPremierLeagueFootballClubList().size();\n\n // This condition is to make sure that there is at least 2 clubs to play a match\n if(numberOfClubsPresent > 1){\n\n // there 2 or more clubs present so we can generate a match\n // loading the data from the file\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n Random random = new Random();\n\n // step 01: randomly select 2 clubs\n int randomClub_01 = random.nextInt(guiSeasonFilteredClubs.size());\n FootballClub selectedClub_O1 = guiSeasonFilteredClubs.get(randomClub_01);\n int randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n\n // This is to make sure that the same club is not selected again for the match\n while (randomClub_02==randomClub_01){\n randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n }\n FootballClub selectedClub_O2 = guiSeasonFilteredClubs.get(randomClub_02);\n\n // step 02: randomly generate the necessary data\n int numberGoalScored_club_1 = random.nextInt(7);\n int numberGoalScored_club_2 = random.nextInt(7);\n\n // setting the random date and random season depending on the randomly selected year\n int[] possibleYears = new int[2];\n\n int seasonYear = Integer.parseInt(season.split(\"-\")[0]);\n\n possibleYears[0] = seasonYear;\n possibleYears[1] = seasonYear + 1;\n\n // making sure that the months are in given range for the year select for the season\n // premier league happens every year from August to next May\n int day = random.nextInt(30)+1;\n int randomYearIndexSelected = random.nextInt(2);\n int year = possibleYears[randomYearIndexSelected];\n int month;\n\n // if randomYearIndexSelected = 0, then the months have to be in the range from 8 to 12 else 1 to 5\n if(randomYearIndexSelected==0){\n // 8 to 12\n month = random.nextInt(5) + 8;\n\n }else{\n // 1 to 5\n month = random.nextInt(5) + 1;\n\n }\n\n DateMatch date = new DateMatch(day, month, year);\n String[] matchTypes = new String[]{\"Home\", \"Away\"};\n String matchType = matchTypes[random.nextInt(2)];\n\n // step 03: call the addPlayedMatch() wisely by passing all the generated random data\n premierLeagueManagerService.addPlayedMatch(season,selectedClub_O1.getName(), selectedClub_O2.getName(),\n numberGoalScored_club_1, numberGoalScored_club_2, date, matchType);\n\n // step 04: call the save file method\n premierLeagueManagerService.saveDataIntoFile();\n\n // step 05: call the load file method\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches for a season and returning\n return getMatchesForSeason(guiSeasonFilteredClubs);\n }\n // if there are less than 2 clubs we can't generate a match\n return null;\n }", "public JsonArray getAllDivergent(String conversationID, String agentUtterance){\n FormBody.Builder formBuilder = new FormBody.Builder();\n formBuilder.add(\"conversation_id\",conversationID);\n formBuilder.add(\"agent_response\",agentUtterance);\n\n Request request = new Request.Builder()\n .url(coreUrl+ \"get_all_divergent\")\n .post(formBuilder.build())\n .addHeader(headerVariable,headerValue)\n .build();\n try{\n Response response = client.newCall(request).execute();\n if(response.isSuccessful()){\n JsonReader reader = Json.createReader(new StringReader(response.body().string()));\n logger.info(\"Retrieved all divergent modified answers for conversation '{}' and utterance '{}'\",conversationID,agentUtterance);\n response.close();\n return reader.readArray();\n }\n } catch (IOException e) {\n logger.error(\"Could not retrieve all divergent modified answers of conversation '{}' for utterance '{}'\",conversationID,agentUtterance);\n e.printStackTrace();\n }\n return Json.createArrayBuilder().build();\n }", "@Override\n public List<HeroVillain> getHeroesVillainsByPowerId(int powerId) {\n List<HeroVillain> hVList = jdbcTemplate.query(SQL_SELECT_HEROESVILLAINS_BY_POWER_ID, \n new HeroVillainMapper(), powerId);\n // set the powers for each hero or villain\n return associatePowersWithHeroesVillains(hVList);\n }", "public List<AllTimeSeasonBean> getAllTimeRecord(){\n String q = \"select new com.main.pcblroyals.bean.AllTimeSeasonBean( \" +\n \"sum(case when g.teamScore > g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore = g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore < g.opponentScore then 1 else 0 end) \" +\n \") \" +\n \"from seasons s \" +\n \"join games g on s.id = g.season.id \";\n Query query = entityManager.createQuery(q);\n return (List<AllTimeSeasonBean>) query.getResultList();\n }", "public List<Team> getAllTeamsBySeason(Season s) { \r\n\t\t\tif(teamsBySeason==null)\t{\r\n\t\t\t\tteamsBySeason=dao.listTeamsforSeason(s); //LIST\t\t\r\n\t\t\tfor(Team atemp:teamsBySeason){ this.mapTeamBySeason.put(atemp.getTeam(), atemp);}\r\n\t\t\t}\r\n\t\t\treturn teamsBySeason;\r\n\t\t}", "@Override\n public HashMap<String, ArrayList<League>> conditionedSelect(String[] conditions) {\n String query;\n Connection connection = DBConnector.getConnection();\n PreparedStatement statement = null;\n ResultSet retrievedLeagues = null;\n HashMap<String, ArrayList<League>> leagues = new HashMap<>();\n\n if (conditions.length == 0) {\n query = \"select * from [Leagues]\";\n } else {\n query = \"select * from [Leagues] where\";\n\n for (int i = 0; i < conditions.length; i++) {\n if (i % 2 == 0) {\n query += \" \" + conditions[i];\n } else {\n query += \" = ?\";\n if (i < conditions.length - 1)\n query += \" and\";\n }\n }\n }\n try {\n statement = connection.prepareStatement(query);\n\n if (conditions.length > 0) {\n int i = 0;\n while (i < conditions.length) {\n switch (conditions[i].toLowerCase()) {\n case \"leaguename\":\n statement.setString((int) (i / 2) + 1, conditions[i + 1]);\n break;\n\n case \"year\":\n case \"winPoints\":\n case \"drawPoints\":\n case \"losePoints\":\n statement.setInt((int) (i / 2) + 1, Integer.valueOf(conditions[i + 1]));\n break;\n\n case \"schedulingmethod\":\n statement.setBoolean((int) (i / 2) + 1, conditions[i + 1].equals(\"1\"));\n\n default:\n break;\n }\n i += 2;\n }\n }\n\n retrievedLeagues = statement.executeQuery();\n\n\n while (retrievedLeagues.next()) {\n String leagueName = retrievedLeagues.getString(1);\n int season = retrievedLeagues.getInt(2);\n boolean scheduling = retrievedLeagues.getBoolean(3);\n int winPoints = retrievedLeagues.getInt(4);\n int losePoints = retrievedLeagues.getInt(5);\n int drawPoints = retrievedLeagues.getInt(6);\n\n League league = new League(leagueName, season, scheduling, winPoints, drawPoints, losePoints);\n String seasonString = Integer.toString(season);\n ArrayList<League> leaguesList;\n\n if (leagues.containsKey(seasonString)) {\n leaguesList = leagues.get(seasonString);\n } else {\n leaguesList = new ArrayList<>();\n leagues.put(seasonString, leaguesList);\n }\n\n leaguesList.add(league);\n }\n } catch (SQLException e) {\n logger.error(e.getMessage());\n }\n\n return leagues;\n }", "public List<PlayerGame> findAllByGame(Long gameId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId))\n .collect(Collectors.toList());\n }", "List<Club> findByRaceOrderByPoints(Integer idRace) throws IOException;", "List<Subdivision> findByCriteria( SubdivisionVo subdivisionVo);", "public java.util.Enumeration findCarsByDivision(com.hps.july.persistence.DivisionKey arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n com.hps.july.persistence.CarHome localHome = ejbHome();\n java.util.Enumeration ejbs = localHome.findCarsByDivision(arg0);\n return (java.util.Enumeration) createAccessBeans(ejbs);\n }", "public List<Worker> getWorkersByDepartmentIdAndAvailabilityUsingCriteria(int departmentId, WorkerAvailability availability) {\n CriteriaBuilder builder = currentSession.getCriteriaBuilder();\n\n CriteriaQuery<Worker> criteria = builder.createQuery(Worker.class);\n Root<Worker> root = criteria.from(Worker.class);\n\n criteria.select(root).where(builder.and(builder.equal(root.get(\"department\").get(\"id\"), departmentId)),\n (builder.equal(root.get(\"availability\"), availability)));\n\n Query<Worker> q = currentSession.createQuery(criteria);\n\n return q.getResultList();\n\n }", "public List<TicketSite> getTicketSitesOfATeam(String teamId);", "public List<Game> getGamesForTable() throws ServiceException {\r\n\r\n List<Game> allNotPlayedGames = null;\r\n try {\r\n allNotPlayedGames = gameDao.findAllNotPlayedGames();\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n List<Game> gamesForTable = new ArrayList<>();\r\n\r\n for(Game game : allNotPlayedGames){\r\n\r\n buildGame(game);\r\n\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if (validHorseBets) {\r\n gamesForTable.add(game);\r\n }\r\n }\r\n\r\n return gamesForTable;\r\n }", "@GetMapping(\"/leaderboard\")\n @Timed\n @PermitAll\n public ResponseEntity<Leaderboard> getAllTeams() {\n log.debug(\"REST request to get a leaderboard\");\n\n return ResponseEntity.ok().body(this.leaderboardService.findAll());\n }", "public static List<String> getAllTeams() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n TeamsPojo pojo = objectMapper.readValue(response.getEntity().getContent(),TeamsPojo.class);\n List<String> willBeReturned = new ArrayList<>();\n List<Teams> teams = pojo.getTeams();\n for (int i =0 ; i<teams.size();i++){\n willBeReturned.add(teams.get(i).getName());\n }\n\n\n return willBeReturned;\n }", "public static List<String> getAttackerFromEngland() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> attackerName= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getPosition().equals(\"Attacker\")&&squad.get(i).getNationality().equals(\"England\")){\n\n attackerName.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n\n\n }\n }\n return attackerName;\n }", "public static Hashtag[] getByProjectId(long gameid) throws IOException {\r\n\t\treturn Api.executeCall(service.getByProjectId(gameid));\r\n\t}", "@Test\r\n\tpublic void findAllTeams() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: findAllTeams \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\tList<Team> response = null;\r\n\t\tresponse = service.findAllTeams(startResult, maxRows);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: findAllTeams\r\n\t}", "@Override\n public List<Competency> getAllAreaCompetencies(int id) {\n if (!areas.containsKey(id)) {\n return null;\n }\n\n Area area = areas.get(id);\n\n return area.getCompetencies();\n }", "public VwTeams get(int teamId)\n\t{\n\t\tVwTeams [] results = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tresults = dao.findWhereTeamIdEquals(teamId);\t\t\t\n\t\t}\n\t\tcatch (VwTeamsDaoException e)\n\t\t{\n\t\t\tlogger.error(e.getMessage());\n\t\t\t\n\t\t\terror.setCode(Errors.Codes.DB_DAO.getCode());\n\t\t\terror.setWindowTitle(Errors.Codes.DB_DAO.getWindowTitle());\n\t\t\terror.setMessage(Errors.Codes.DB_DAO.getMessage());\n\t\t\t\n\t\t\terror.setExceptionMessage(e.getMessage());\n\t\t\t\n\t\t\tpdr.setError(error);\n\t\t\t\n\t\t\tif (logger.isDebugEnabled())\n\t\t\t\te.printStackTrace();\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn results.length == 0 ? null : results[0];\n\t}", "@SuppressWarnings(\"unchecked\")\n private List createLeagueList() {\n ArrayList result = new ArrayList();\n for( int i = 0 ; i < leagues_array.size() ; ++i ) {\n HashMap m = new HashMap();\n m.put( \"League\", leagues_array.get(i)); // the key and it's value.\n result.add( m );\n }\n return (List)result;\n }", "public List<RPSGame> getGamesByPlayer(String playerId) {\n\t\tif (playerId == null) {\n\t\t\tthrow new RuntimeException(\"Player ID can't be null!\");\n\t\t}\n\t\treturn games.entrySet().stream().map(entry -> entry.getValue()).filter(game -> game.isPlayerGame(playerId))\n\t\t\t\t.collect(Collectors.toList());\n\n\t}", "private static void divideDeck(int numPlayers) {\n\t\tint i = 0;\n\t\tfor (Card card : deck)\n\t\t{\n\t\t\tplayers.get(i % numPlayers).addCardToDeck(card);\n\t\t\ti++;\n\t\t}\n\t}", "public LiveData<LeagueEntity> getLeague() {\n return observableLeague;\n }", "private Game getGameById(long idGame) {\n Game game;\n synchronized (this.games) {\n if (!this.games.containsKey(idGame)) {\n return null;\n }\n game = this.games.get(idGame);\n }\n return game;\n }", "public Game findGameById(int gameId, User user) throws ServiceException {\r\n\r\n Game game = null;\r\n try {\r\n game = gameDao.findByID(gameId);\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n\r\n if (game == null){\r\n return null;\r\n }\r\n\r\n if (user == null || !user.getRole().equals(Role.USER)){\r\n buildGame(game);\r\n return game;\r\n }\r\n\r\n buildGame(game);\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if(!validHorseBets){\r\n return null;\r\n }\r\n\r\n return game;\r\n }", "Set<OptionDTO> getDependentOptionTree(Integer optionId);", "public League getLeagueName() {\n return leagueName;\n }", "public CheckersGame getGameByID(Integer gameID){\n return games.get(gameID);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof League)) {\n return false;\n }\n League other = (League) object;\n if ((this.leagueId == null && other.leagueId != null) || (this.leagueId != null && !this.leagueId.equals(other.leagueId))) {\n return false;\n }\n return true;\n }", "TrackerGroups loadTrackerGroups(final Integer id);", "public League getLeagueDetails(String leagueName) {\n return League.getLeagueByName(leagueName);\n }", "@RequestMapping(value = \"/game/byStudio/{studio}\", method = RequestMethod.GET)\n @ResponseStatus(value = HttpStatus.OK)\n public List<Game> getGameByStudio(@PathVariable String studio) {\n return serviceLayer.getGameByStudio(studio);\n }", "public Set<Cdss4NsarLabor> getLabResults();", "@RequestMapping(value = \"/companies/{companyId}/fleets/{fleetId}/vehicles/{vehicleId\" +\n \"}/contracts\", method = RequestMethod.GET)\n @PreAuthorize(\"hasPermission(#vehicleId, 'vehicle', 'READ') && hasPermission(#companyId, 'company', 'READ') && hasPermission(#fleetId, 'fleet', 'READ')\")\n public ResponseEntity<?> getByCompanyFleetVehicleId(@PathVariable int companyId,@PathVariable int fleetId,@PathVariable int vehicleId,Pageable pagination, ContractFilter filter, BindingResult result) {\n filter.setClientCompany(companyId);\n filter.setFleet(fleetId);\n filter.setVehicle(vehicleId);\n return super.listAll(pagination,filter,result);\n }", "void getParticipants(@NonNull final String conversationId, @Nullable Callback<ComapiResult<List<Participant>>> callback);", "TeamResultWrapper findTeamsByMember(String personId,\n String partOfGroupname, int offset, int pageSize);", "List<Subdivision> findAll();", "private void getTeams() {\n if(progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n progressDialog = new ProgressDialog(getContext());\n progressDialog.setCancelable(true);\n if(getArguments()!=null) {\n progressDialog.setMessage(\"Fetching Match Schedules\");\n }\n else {\n progressDialog.setMessage(\"Processing\");\n }\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setProgress(0);\n progressDialog.show();\n db.collection(\"teams\").get().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 JSONObject object = new JSONObject(document.getData());\n try {\n teamsObject.put(document.getId(), object);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n if(getArguments()!=null) {\n if (dataBundle.getString(\"from\").equals(\"league Features\")) {\n getSchedules();\n }\n else if(dataBundle.getString(\"from\").equals(\"TM-matches\")){\n getTeamSchedules();\n }\n }\n else {\n getSchedules();\n }\n } else {\n Toast.makeText(context, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "default Set<UUID> getOpponents(UUID playerId, boolean excludeDeadPlayers) {\n Player player = getPlayer(playerId);\n if (player == null) {\n return new HashSet<>();\n }\n\n return player.getInRange().stream()\n .filter(opponentId -> !opponentId.equals(playerId))\n .filter(opponentId -> !excludeDeadPlayers || !getPlayer(opponentId).hasLost())\n .collect(Collectors.toSet());\n }", "public Team get(Long id);", "@GET\n @Path(\"Current/Team/{teamId}\")\n public Response getTeamByCurrentUser(@PathParam(\"teamId\") Long teamId) {\n Response r = Response.noContent().build();\n User currentUser = userFacade.getCurrentUser();\n final Collection<Game> playedGames = gameFacade.findRegisteredGames(currentUser.getId());\n for (Game g : playedGames) {\n Collection<Team> teams = g.getTeams();\n for (Team t : teams) {\n if (teamId.equals(t.getId())) {\n for (Player p : t.getPlayers()) {\n if (p.getUserId().equals(currentUser.getId())) {\n r = Response.ok().entity(t).build();\n }\n }\n }\n }\n }\n return r;\n }", "public ArrayList<CollegeFootballTeam> getTeamList();", "Response getGameDetails(String gameIdAsString);", "private List<Horse> parseHorses(String[] horsesId) throws ServiceException {\r\n\r\n List<Horse> horses = new ArrayList<>();\r\n for (String stringId : horsesId){\r\n int id = Integer.parseInt(stringId);\r\n Horse horse = null;\r\n try {\r\n horse = horseDao.findByID(id);\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n horses.add(horse);\r\n }\r\n\r\n return horses;\r\n }", "public Division getDivision() throws Exception {\n\tDivision bean = null;\n\tif (getGroupcode() != null)\n\t bean = (Division)getGroups();\n\telse if (getDepartmentcode() != null)\n\t bean = (Division)getDepartments();\n\telse if (getServicecode() != null)\n\t bean = (Division)getServices();\n\telse if (getDirectioncode() != null)\n\t bean = (Division)getDirections();\n\t \n\treturn bean;\n\n}", "public ModelGame findGameById () {\n Scanner input = new Scanner(System.in); // Create a Scanner object\n System.out.println(\"Enter the ID of the game you wish to return:\");\n int id = input.nextInt(); // Read user input of id\n for (ModelGame game : this.allGames) {\n if (game.getGameId() == id) {\n return game;\n }\n }\n return null;\n }" ]
[ "0.6936462", "0.6205245", "0.6128162", "0.58111566", "0.5664763", "0.5663375", "0.5659185", "0.5437285", "0.54101175", "0.53872997", "0.5315197", "0.5301925", "0.5209798", "0.52082556", "0.52043575", "0.51256275", "0.50868595", "0.5078035", "0.5030444", "0.50061524", "0.49799684", "0.4952633", "0.4913939", "0.48624468", "0.48337123", "0.48191997", "0.4773743", "0.47648442", "0.47541735", "0.475387", "0.47508523", "0.4725499", "0.47210458", "0.47114006", "0.47025275", "0.47009936", "0.4686679", "0.46576148", "0.46539837", "0.46377346", "0.46188468", "0.4617114", "0.46146765", "0.46087012", "0.45938355", "0.4583206", "0.45677096", "0.4567621", "0.45657423", "0.45552924", "0.45543465", "0.4551576", "0.454965", "0.45477858", "0.45422792", "0.45404792", "0.45380077", "0.45301884", "0.45047396", "0.44979057", "0.4495565", "0.44792044", "0.44783345", "0.44773862", "0.44732657", "0.44648778", "0.44632706", "0.44509637", "0.44426933", "0.44399774", "0.44362944", "0.4435941", "0.44348535", "0.44322908", "0.44249743", "0.4420153", "0.4416462", "0.4401322", "0.4397834", "0.43914592", "0.4389027", "0.43822432", "0.43767056", "0.43748924", "0.43714416", "0.43698", "0.43641865", "0.43594676", "0.4349576", "0.43473667", "0.43458825", "0.4340833", "0.43320996", "0.4329261", "0.4327094", "0.4326265", "0.43243012", "0.43174747", "0.43172407", "0.431227" ]
0.56155145
7
The getNews method gets all the news associated with the league
public static boolean getNews(String id, List<NewsBean> news, String lang, int offset, int maxRows) { boolean status = false; // query status Connection conn = null; // DB connection PreparedStatement getLeague = null; // SQL query PreparedStatement getNews = null; // SQL query ResultSet resultSet = null; // returned query result set ResultSet rs = null; // returned query result set String leagueName = null; // division name to be used in second query // Connect to Database and execute SELECT query try { conn = ConnectionManager.getConnection(); getLeague = conn.prepareStatement("select leagueName from league where leagueID = ?"); getLeague.setString(1, id); resultSet = getLeague.executeQuery(); status = resultSet.next(); //gets the leagueName in order to get the news associated with the division leagueName = resultSet.getString(1); //if there is a result then get the news if(status) { getNews = conn.prepareStatement("select concat_ws(' ', u.userFirstName, u.userLastName), n.newsTitle," + " n.newsTitle_fr, n.newsTime, n.newsContent, n.newsContent_fr from news n inner join users" + " u on u.userID = n.userID inner join newsxtags nt on nt.newsID = n.newsID" + " inner join tags t on nt.tagID = t.tagID where tagDescription = ? order by n.newsTime desc" + " LIMIT ?,?"); getNews.setString(1, leagueName); getNews.setInt(2, offset); getNews.setInt(3, maxRows); rs = getNews.executeQuery(); status = rs.next(); //return to the start of the result set rs.beforeFirst(); //Loop through and add the results of the query to a NewsBean then add it to the list while(rs.next()) { NewsBean nb = new NewsBean(); nb.setUserName(rs.getString(1)); nb.setTitle(rs.getString(2)); nb.setTitleFR(rs.getString(3)); nb.setPostedTime(rs.getTimestamp(4), lang); nb.setContent(rs.getString(5)); nb.setContentFR(rs.getString(6)); news.add(nb); } } // close all connections and handle all possible exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (getLeague != null) { try { getLeague.close(); } catch (SQLException e) { e.printStackTrace(); } } if (getNews != null) { try { getNews.close(); } catch (SQLException e) { e.printStackTrace(); } } if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { e.printStackTrace(); } } if (rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getNewsList() {\n // While the app fetched data we are displaying a progress dialog\n\n if (isOnline(mContext)) {\n showProgressDialog();\n\n ApiInterface apiService = ApiRequest.getClient().create(ApiInterface.class);\n\n Call<News> call = apiService.loadNewsList();\n call.enqueue(new Callback<News>() {\n @Override\n public void onResponse(Call<News> call, retrofit2.Response<News> response) {\n dismissProgressDialog();\n\n news.setTitle(response.body().getTitle());\n\n newsList.addAll(response.body().getRows());\n showList();\n ActionBar actionBar = getActionBar();\n actionBar.setDisplayHomeAsUpEnabled(true);\n actionBar.setDisplayShowHomeEnabled(false);\n actionBar.setDisplayShowTitleEnabled(true);\n actionBar.setTitle(news.getTitle());\n actionBar.setDisplayUseLogoEnabled(false);\n }\n\n @Override\n public void onFailure(Call<News> call, Throwable t) {\n dismissProgressDialog();\n displayMessage(t.getMessage());\n setTextMessage();\n\n }\n });\n } else {\n\n displayMessage(getString(R.string.no_network));\n setTextMessage();\n }\n\n }", "@Override\r\n\tpublic List<News> findAllNews() {\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<News> newsList = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tString sql = \"select * from news\";\r\n\t\t\tconn = SimpleDBUtil.getConnection();\r\n\t\t\tpstmt = conn.prepareStatement(sql);\r\n\t\t\trs = pstmt.executeQuery();\r\n\t\t\tnewsList = new ArrayList<>();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tNews aNews = new News();\r\n\t\t\t\taNews.setId(rs.getInt(1));\r\n\t\t\t\taNews.setTitle(rs.getString(2));\r\n\t\t\t\taNews.setContent(rs.getString(\"content\"));\r\n\t\t\t\taNews.setCreateTime(rs.getDate(\"createTime\"));\r\n\t\t\t\taNews.setFk_topic_id(rs.getInt(\"fk_topic_id\"));\r\n\t\t\t\t\r\n\t\t\t\tnewsList.add(aNews);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tSimpleDBUtil.closeAll(rs, pstmt, conn);\r\n\t\t}\r\n\t\t\r\n\t\treturn newsList;\r\n\t}", "private void fetchNews() {\n if (isOnline(mContext)) {\n // showing refresh animation before making http call\n swipeRefreshLayout.setRefreshing(true);\n\n // appending offset to url\n // String url = URL_TOP_250 + offSet;\n ApiInterface apiService = ApiRequest.getClient().create(ApiInterface.class);\n\n Call<News> call = apiService.loadNewsList();\n call.enqueue(new Callback<News>() {\n @Override\n public void onResponse(Call<News> call, retrofit2.Response<News> response) {\n\n if (response.body().getRows().size() > 0) {\n\n newsList.addAll(response.body().getRows());\n showList();\n // stopping swipe refresh\n swipeRefreshLayout.setRefreshing(false);\n }\n }\n\n @Override\n public void onFailure(Call<News> call, Throwable t) {\n displayMessage(t.getMessage());\n setTextMessage();\n // stopping swipe refresh\n swipeRefreshLayout.setRefreshing(false);\n\n }\n });\n } else {\n setTextMessage();\n }\n\n }", "@GET(\"user-news-article-content?expand=newsArticle,newsArticle.newsArticleType,newsArticle.translations,newsArticle.like,newsArticle.liked,newsArticle.comments_count&per-page=1000\")\n Call<UserNewsResponse>getUserNews();", "public List<News> getAll()\n {\n\n return newsRepository.findAllByOrderByIdAsc();\n }", "@Override\n\tpublic List<MovieNews> getMovieNews() {\n\t\treturn this.moviesNews;\n\t}", "@Override\n public List<News> loadInBackground() {\n if (mUrl == null) {\n return null;\n }\n // Perform the network request, parse the response, and extract a list of articles.\n List<News> news = QueryUtils.fetchNewsData(mUrl);\n return news;\n }", "@Override\r\n\tpublic List<Product> findNews() throws Exception {\n\t\treturn null;\r\n\t}", "String getNews();", "public void LoadNews()\n {\n String url = \"https://newsapi.org/v1/articles?source=the-next-web&apiKey=533af958594143758318137469b41ba9\";\n Load_News = new StringRequest(Request.Method.GET,url,Success,Error);\n rQueue = ApplicationSingleton.getInstance().getQueue();\n rQueue.add(Load_News);\n\n\n }", "@Override\n\tpublic List<NewsVO> getAll() {\n\t\tList<NewsVO> list = new ArrayList<NewsVO>();\n\t\tNewsVO newsVO = null;\n\n\t\tConnection con = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(driver);\n\t\t\tcon = DriverManager.getConnection(url, userid, passwd);\n\t\t\tpstmt = con.prepareStatement(GET_ALL_STMT);\n\t\t\trs = pstmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\t// empVO 也稱為 Domain objects\n\t\t\t\tnewsVO = new NewsVO();\n\t\t\t\tnewsVO.setNews_id(rs.getString(\"news_id\"));\n\t\t\t\tnewsVO.setNews_content(rs.getString(\"news_content\"));\n\t\t\t\tnewsVO.setNews_date(rs.getTimestamp(\"news_date\"));\n\t\t\t\tlist.add(newsVO); // Store the row in the list\n\t\t\t}\n\n\t\t\t// Handle any driver errors\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Couldn't load database driver. \"\n\t\t\t\t\t+ e.getMessage());\n\t\t\t// Handle any SQL errors\n\t\t} catch (SQLException se) {\n\t\t\tthrow new RuntimeException(\"A database error occured. \"\n\t\t\t\t\t+ se.getMessage());\n\t\t\t// Clean up JDBC resources\n\t\t} finally {\n\t\t\tif (rs != null) {\n\t\t\t\ttry {\n\t\t\t\t\trs.close();\n\t\t\t\t} catch (SQLException se) {\n\t\t\t\t\tse.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pstmt != null) {\n\t\t\t\ttry {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t} catch (SQLException se) {\n\t\t\t\t\tse.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (con != null) {\n\t\t\t\ttry {\n\t\t\t\t\tcon.close();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "@Override\n\tpublic List<News> getList() {\n\t\topenCurrentSession();\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<News> list = (List<News>)getCurrentSession().createQuery(\"FROM News\").list();\n\t\tcloseCurrentSession();\n\t\treturn list;\n\t}", "@Override\n\tpublic List<News> queryNewsList(News params) throws Exception {\n\t\treturn null;\n\t}", "private void LoadItems() {\n\n Call<NewsResponce> callNews = null;\n\n if (SourceId != null && DateTo != null && DateAt != null) {\n callNews = newsApiInterface.GetEverything(NewsClient.API_KEY, DateAt, DateTo, currentPage, SourceId);\n\n } else if (SourceId != null && DateAt != null) {\n callNews = newsApiInterface.GetEverything(NewsClient.API_KEY, DateAt, currentPage, SourceId);\n\n } else if (SourceId != null && DateTo != null) {\n callNews = newsApiInterface.GetEverythingDateTo(NewsClient.API_KEY, DateTo, currentPage, SourceId);\n\n } else {\n DialogAlert(R.string.dialog_title_no_criterias, R.string.dialog_message_no_criterias);\n }\n\n if (callNews != null)\n callNews.enqueue(new Callback<NewsResponce>() {\n @Override\n public void onResponse(Call<NewsResponce> call, final Response<NewsResponce> response) {\n if (response.body() != null) {\n if (response.body().getTotalResults() > articleList.size()) {\n articleList.addAll(response.body().getArticles());\n newsAdapter.notifyDataSetChanged();\n ++currentPage;\n }\n } else\n articleList.clear();\n\n Log.d(TAG, articleList.size() + \"\");\n }\n\n @Override\n public void onFailure(Call<NewsResponce> call, Throwable t) {\n Log.e(TAG, t.getMessage());\n }\n });\n }", "@Override\r\n\tpublic ENews findNewsById(int id) {\n\t\treturn new ENDaoImpl().findNewsById(id);\r\n\t}", "private void getSportsNews() {\n new SportsAsyncTask(this,MainActivity.this).execute(url);\n }", "@Override\n\tpublic News getNewsById(Integer id) throws Exception {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic News getNewsById(int id) {\n\t\tConnection conn =null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tNews aNews = null;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tString sql=\"select * from news where id = ?\";\r\n\t\t\tconn = SimpleDBUtil.getConnection();\r\n\t\t\tpstmt = conn.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, id);\r\n\t\t\trs = pstmt.executeQuery();\r\n\t\t\t\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\taNews = new News();\r\n\t\t\t\taNews.setId(rs.getInt(1));\r\n\t\t\t\taNews.setTitle(rs.getString(2));\r\n\t\t\t\taNews.setContent(rs.getString(\"content\"));\r\n\t\t\t\taNews.setCreateTime(rs.getDate(\"createTime\"));\r\n\t\t\t\taNews.setFk_topic_id(rs.getInt(\"fk_topic_id\"));\r\n\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}finally {\r\n\t\t\tSimpleDBUtil.closeAll(rs, pstmt, conn);\r\n\t\t}\r\n\t\treturn aNews;\r\n\t}", "public List<News> query(Route route);", "public List<NewsBaseInfo> getNewsListByDate(Date date) throws DataAccessException {\n return null;\n }", "@Override\n\tpublic void loadNews() {\n\t\tif(newsUrl.contains(\"xyz\")) {\n\t\t\tnewsUrl = \"abc\";\n\t\t}\n\t\t\n\t\tif(realNews==null) {\n\t\t\trealNews = new RealNews(newsUrl);\n\t\t}\n\t\trealNews.loadNews();\n\t}", "@Override\n public News getNewsById(int id) throws Exception {\n Connection conn = null;\n PreparedStatement statement = null;\n ResultSet result = null;\n String query = \"select * from news where id = ?\";\n try {\n conn = getConnection();\n statement = conn.prepareStatement(query);\n statement.setInt(1, id);\n result = statement.executeQuery();\n while (result.next()) {\n News news = new News(result.getInt(\"ID\"),\n result.getString(\"title\"),\n result.getString(\"description\"),\n result.getString(\"image\"),\n result.getString(\"author\"),\n result.getDate(\"timePost\"),\n result.getString(\"shortDes\"));\n return news;\n }\n } catch (ClassNotFoundException | SQLException e) {\n throw e;\n } finally {\n closeResultSet(result);\n closePreparedStatement(statement);\n closeConnection(conn);\n }\n return null;\n }", "@RequestMapping(value = \"/news\", method = RequestMethod.GET)\n\tpublic List<News> getListaAggregata() {\n\t\t\n\t\treturn newsWebService.getNewsList().parallelStream().sorted().collect(Collectors.toList());\n\n\t}", "public News getByid(News news);", "LiveData<List<MainEntity>> getAllNews() {\n\t\treturn mainListLiveData;\n\t}", "@SkipValidation\n public String getAllImportantNews() {\n impList = impService.getAllImportantNews();\n return SUCCESS;\n }", "public static ArrayList<NewsItem> loadNews(int descending) throws JSONException{\n \t\t\n \t\t//Get JSON string from server\n \t\tString result = getJSON(Constants.NEWSFEED + descending); \n \t\t\n \t\tList<NewsItem> posts = new ArrayList<NewsItem>();\n \t\t\n \t\t//Parse JSON string\n \t\t\tJSONObject json_obj = new JSONObject(result);\n \t\t\tJSONArray json_arr = json_obj.getJSONArray(\"data\");\n \t\t\t\n \t\t\tfor (int i = 0; i < json_arr.length(); i++){\n \t\t\t\t//Get post message\n \t\t\t\tString message = json_arr.getJSONObject(i).optString(\"message\");\n \t\t\t\t\n \t\t\t\t//Get date\n \t\t\t\tString[] date = json_arr.getJSONObject(i).optString(\"created_time\").split(\"T\");\n \t\t\t\t\n \t\t\t\t//Get image url\n \t\t\t\tString image = json_arr.getJSONObject(i).optString(\"picture\");\n \t\t\t\t\n \t\t\t\tif(!image.equals(\"\")){\n \t\t\t\t\timage = image.replace(\"s.jpg\", \"n.jpg\");\n\t\t\t\t\timage = image.replace(\"s.png\", \"n.png\");\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t//Add to posts if valid content\n \t\t\t\tif ((!message.equals(\"\")) && (!date.equals(\"\"))){\n \t\t\t\t\tposts.add(new NewsItem(message, date[0], image));\n \t\t\t\t}\n \t\t\t}\n \t\t\n \t\treturn (ArrayList<NewsItem>) posts;\n \t}", "private static List<News> extractFeaturesFromJsonResponse(String jsonResponse) {\n List<News> newsList = new ArrayList<>();\n\n try {\n JSONObject baseJsonObject = new JSONObject(jsonResponse);\n // If JSON object does not contain \"response\" return null object\n if (!baseJsonObject.has(Keys.JSON_NEWS_OBJECT_KEY)) {\n return null;\n }\n\n JSONObject response = baseJsonObject.getJSONObject(Keys.JSON_NEWS_OBJECT_KEY);\n JSONArray resultsArray = response.getJSONArray(Keys.JSON_NEWS_ARRAY_KEY);\n\n for (int i = 0; i < resultsArray.length(); i++) {\n JSONObject newsObject = resultsArray.getJSONObject(i);\n\n // Get section name\n String sectionName = newsObject.getString(Keys.JSON_NEWS_SECTION_KEY);\n // Get Headline\n String newsHeadline = newsObject.getString(Keys.JSON_NEWS_HEADLINE_KEY);\n // Get published time\n String publishedTime = newsObject.getString(Keys.JSON_NEWS_PUBLISHED_TIME_KEY);\n // Get web Url\n String webUrl = newsObject.getString(Keys.JSON_NEWS_URL_KEY);\n\n // Get thumbnail URL string\n String newsThumbnailUrlString = null;\n if (newsObject.has(Keys.JSON_NEWS_FIELDS_KEY)) {\n JSONObject field = newsObject.getJSONObject(Keys.JSON_NEWS_FIELDS_KEY);\n\n if (field.has(Keys.JSON_NEWS_THUMBNAIL_KEY)) {\n newsThumbnailUrlString = field.getString(Keys.JSON_NEWS_THUMBNAIL_KEY);\n }\n }\n\n // Get author name\n String authorName = null;\n if (newsObject.has(Keys.JSON_NEWS_TAGS_KEY)) {\n JSONArray tags = newsObject.getJSONArray(Keys.JSON_NEWS_TAGS_KEY);\n if (!tags.isNull(0)) {\n // If first element of array is not null then get the author name\n JSONObject tagsObject = tags.getJSONObject(0);\n if (tagsObject.has(Keys.JSON_NEWS_AUTHOR_NAME_KEY)) {\n authorName = tagsObject.getString(Keys.JSON_NEWS_AUTHOR_NAME_KEY);\n }\n }\n }\n newsList.add(new News(newsHeadline, sectionName, authorName, publishedTime, webUrl, newsThumbnailUrlString));\n }\n } catch (JSONException e) {\n Log.e(LOG_TAG, \"Error creating JSON object : extractFeaturesFromJsonResponse() method\", e);\n }\n return newsList;\n }", "private void getAllNewsFromDatabase() {\n new GetAllNewsAsyncTask(newsDao).execute(newsList);\n }", "public List<NewsNotifications> getNewsFeed(int limit);", "@Override\r\n\tpublic void getNewsList(Page page, String query) {\n\t\t\r\n\t}", "private void fetchEverything() {\n ApiNewsMethods newsEverything = retrofit.create(ApiNewsMethods.class);\n newsEverything.getEverything(\"bitcoin\"/*topic input by user*/, newsApiKey).enqueue(new Callback<NewsModelClass>() {\n @Override\n public void onResponse(Call<NewsModelClass> call, Response<NewsModelClass> response) {\n if(response.isSuccessful()) {\n newsModelBody = response.body();\n Log.d(\"myBODY\", newsModelBody.getStatus());\n //text to speech object of the response fetched\n newsUIChanges();\n } else {\n Log.d(\"mySTRING\", \"DID NOT OCCUR\");\n }\n }\n\n @Override\n public void onFailure(Call<NewsModelClass> call, Throwable t) {\n }\n\n });\n }", "@Override\n public void onRefresh() {\n fetchNews();\n }", "@Override\n\t\tprotected List<NewsBean> doInBackground(Void... params) {\n\t\t\tsynchronized (this) {\n\t\t\t\treturn new ParseXMLUtil().parseNewsXml(ls, url);\n\t\t\t}\n\t\t}", "public void fetchArticles(int page, boolean newSearch) {\n if(newSearch) { articles.clear(); }\n\n AsyncHttpClient client = new AsyncHttpClient();\n String url;\n RequestParams params = new RequestParams();\n params.put(\"api-key\", \"ed5753fe0329424883b2a07a7a7b4817\");\n params.put(\"page\", page);\n\n // If top stories, different parameters\n if(topStories) {\n url = \"https://api.nytimes.com/svc/topstories/v2/home.json\";\n } else {\n url = \"https://api.nytimes.com/svc/search/v2/articlesearch.json\";\n params.put(\"q\",filter.getQuery());\n if(filter.getSort() != null) {\n params.put(\"sort\",filter.getSort());\n }\n if(filter.getBegin_date() != null) {\n params.put(\"begin_date\",filter.getBegin_date());\n }\n if(filter.getNewsDeskOpts().size() > 0) {\n for(int i=0; i<filter.getNewsDeskOpts().size(); i++) {\n params.put(\"fq\",String.format(\"news_desk:(%s)\",filter.getNewsDeskOpts().get(i)));\n }\n }\n Log.d(\"DEBUG\",params.toString());\n }\n\n client.get(url, params, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n Log.d(\"DEBUG\",response.toString());\n JSONArray articleJsonResults = null;\n try {\n if(!topStories) {\n articleJsonResults = response.getJSONObject(\"response\").getJSONArray(\"docs\");\n } else {\n articleJsonResults = response.getJSONArray(\"results\");\n }\n\n // Every time data is changed, notify adapter; can also do by article.addAll and use adapter.notifyDataSetChanged\n articles.addAll(Article.fromJsonArray(articleJsonResults, topStories));\n adapter.notifyDataSetChanged();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n Log.d(\"DEBUG\",\"JSON response failed\");\n super.onFailure(statusCode, headers, throwable, errorResponse);\n }\n });\n }", "@Override\n public int getCount() {\n return news.size();\n }", "public static List<News> fetchNewsData(String requestedQueryURLString) {\n URL url;\n String JSONResponse = null;\n\n // If requested URL is null return null object\n if (requestedQueryURLString == null) {\n Log.i(LOG_TAG, \"Null url is passed\");\n return null;\n } else {\n url = generateUrl(requestedQueryURLString);\n }\n\n try {\n JSONResponse = makeHttpRequest(url);\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Exception occurred due to closing input Stream : fetchNewsData() gets from readFromStream() block\");\n }\n\n List<News> newsList;\n if (JSONResponse != null) {\n // If JSON response is not null return newsList List object\n newsList = extractFeaturesFromJsonResponse(JSONResponse);\n return newsList;\n } else {\n // If JSON response is null, return null\n return null;\n }\n }", "@Override\n public void loadNews(boolean forceUpdate) {\n if(forceUpdate) {\n newsRequestTask = new NewsRequestTask(this, context);\n newsRequestTask.execute(URL_NEWS);\n } else {\n List<News> newsList = dbDao.load();\n view.onRefreshList(newsList);\n }\n }", "@RequestMapping(value = \"/newsfeed/\", method = RequestMethod.GET)\r\n public ResponseEntity<List<NewsFeed>> listAllNewsFeed() {\r\n List<NewsFeed> newsFeeds = newsFeedService.findAllNewsFeeds();\r\n if(newsFeeds.isEmpty()){\r\n return new ResponseEntity<List<NewsFeed>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND\r\n }\r\n return new ResponseEntity<List<NewsFeed>>(newsFeeds, HttpStatus.OK);\r\n }", "@Override\n\t\tprotected List<NewsBean> doInBackground(Void... params) {\n\t\t\tsynchronized (this) {\t\t\t\n\t\t\t\treturn new ParseXMLUtil().parseNewsXml(ls,url);\n\t\t\t}\t\t\t\n\t\t}", "@Scheduled(cron=\"0 0 9 * * ? \")\r\n\t@Override\r\n\tpublic void getNewsFromIDataAPI() {\n\t\ttry {\r\n\t\t\t\r\n\t\t\tList<NewsType> newsTypeArray=newsTypeRepository.findAllByFlag(0);\r\n\t\t\t\r\n\t\t\tfor(NewsType n: newsTypeArray) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tString catId=n.getCatId();\r\n\t\t\t\t\tString url = \"http://api01.bitspaceman.com:8000/news/toutiao?apikey=np5SpQ7QGzm7HgvX8Aw8APA5NDq6Bpj5m4eo4hX5qJFLm0G0Oqt31xJzjIEeJFTv&catid=\"+n.getCatId();\r\n\t\t\t\t\tString json = IDataAPI.getRequestFromUrl(url);\r\n\t\t\t\t\tlog.info(json);\r\n\t\t\t\t\tGson gson=new Gson();\r\n\t\t\t\t\tToutiaoResponseDto toutiaoResponseDto=gson.fromJson(json, ToutiaoResponseDto.class);\r\n\t\t\t\t\t\r\n\t\t\t\t\tList<NewsInfo> newsInfoArray=new ArrayList<NewsInfo>();\r\n\t\t\t\t\tfor(ToutiaoDataResponseDto toutiao :toutiaoResponseDto.getData()) {\r\n\t\t\t\t\t\tnewsInfoArray.add(new NewsInfo(toutiao,catId));\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tList<NewsInfo> iter=(List<NewsInfo>) newsInfoRepository.saveAll(newsInfoArray);\r\n\t\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\tlog.info(e.getMessage());\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(\"true\".equals(toutiaoResponseDto.getHasNext())) {\r\n\t\t\t\t\t\tgetNewsFromIDataAPIByPageToken(toutiaoResponseDto.getPageToken(),catId);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(Exception e) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch(Exception e) {\r\n\t\t\tlog.info(e.getMessage());\r\n\t\t}\r\n\t}", "@RequestMapping(\"/news\")\n public List<NewsVO> getRelatedNewsVO(String code){\n return analyseService.getRelatedNewsVO(code);\n }", "@RequestMapping(value = \"/news\", method = RequestMethod.GET)\n public String viewNewsArticles(final HttpServletRequest request, final HttpServletResponse response, final Model model) {\n PagedListHolder<NewsArticle> pagedListHolder = populatePagedListHolder(request);\n\n request.getSession().setAttribute(ARTICLE_LIST, pagedListHolder);\n\n model.addAttribute(\"mostPopular\", getMostPopular());\n\n model.addAttribute(ARTICLE_LIST, pagedListHolder);\n\n return NEWS_PAGE;\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 }", "public ENews newsContent(String newsTitle) {\n\t\treturn new ENDaoImpl().newsContent(newsTitle);\r\n\t}", "@Override\r\n\tpublic List<ENews> newsTitle() {\n\t\treturn new ENDaoImpl().newsTitle();\r\n\t}", "private List<NewsArticle> getMostPopular() {\n LOGGER.log(Level.INFO, \"getMostPopular\");\n return newsService.getMostPopular();\n }", "public List<News> getNewsList(Integer id) {\n List<News> newsList = newsMapper.selectByAuthorId(id);\n newsList.sort((dt1,dt2) -> {\n if (dt1.getPubdate().getTime() < dt2.getPubdate().getTime()) {\n return 1;\n } else if (dt1.getPubdate().getTime() > dt2.getPubdate().getTime()) {\n return -1;\n } else {\n return 0;\n }\n });\n return newsList;\n }", "private void loadNews(String source, boolean isRefresh) {\n String url = Common.getApiUrl(source,sort_by,Common.Api_key); // get url of json data\n Call<News> call=mService.getNewestArticle(url); // get data as Call in News Model\n if (!isRefresh){// data is not load we have not refreshed\n dialog.show();\n\n call.enqueue(new Callback<News>() {\n @Override\n public void onResponse(Call<News> call, Response<News> response) {\n // response => contain data as News Model\n dialog.dismiss();\n Picasso.with(getBaseContext()).load(response.body().getArticles().get(0).getUrlToImage())\n .into(kbv);\n article_author.setText(response.body().getArticles().get(0).getAuthor());\n article_title.setText(response.body().getArticles().get(0).getTitle());\n webHotUrl=response.body().getArticles().get(0).getUrl(); // url of link in internet\n // load remain Articles\n List<Article> removeFirst=response.body().getArticles();\n // because we load first item in diagonal we remove first from list\n removeFirst.remove(0);\n // load data in recycler\n adapter=new ListNewsAdapter(getBaseContext(),removeFirst);\n adapter.notifyDataSetChanged(); // to load data if refresh\n recycler_list.setAdapter(adapter); // set up adapter\n }\n\n @Override\n public void onFailure(Call<News> call, Throwable t) {\n\n }\n });\n }\n else {\n dialog.show();\n call.enqueue(new Callback<News>() {\n @Override\n public void onResponse(Call<News> call, Response<News> response) {\n // response => contain data as News Model\n dialog.dismiss();\n Picasso.with(getBaseContext()).load(response.body().getArticles().get(0).getUrlToImage())\n .into(kbv);\n article_author.setText(response.body().getArticles().get(0).getAuthor());\n article_title.setText(response.body().getArticles().get(0).getTitle());\n webHotUrl=response.body().getArticles().get(0).getUrl();\n // load remain Articles\n List<Article> removeFirst=response.body().getArticles();\n // because we load first item in diagonal we remove first from list\n removeFirst.remove(0);\n // load data in recycler\n adapter=new ListNewsAdapter(getBaseContext(),removeFirst);\n adapter.notifyDataSetChanged(); // to load data if refresh\n recycler_list.setAdapter(adapter); // set up adapter\n }\n\n @Override\n public void onFailure(Call<News> call, Throwable t) {\n\n }\n });\n swipeRefreshLayout.setRefreshing(false);\n }\n }", "@PostMapping(\"/search\")\n public Object fetchNews(@RequestParam(\"id\") String id, @RequestParam(name = \"page\", required = false) Integer page) {\n return newsService.getNewsData(id, page);\n }", "@Secured({ \"ROLE_ADMIN\" })\r\n\t@RequestMapping(value = { \"/admin/comment/news/{id}\", \"/admin/komentar/vest/{id}\" }, method = RequestMethod.GET)\r\n\tpublic ResponseEntity<Iterable<Comment>> getAllCommentForGivenNews(@PathVariable(value = \"id\") Integer newsID) {\r\n\t\treturn new ResponseEntity(commentRepository.findByNewsID(newsID), HttpStatus.OK);\r\n\t}", "public static ArrayList<DigitalNewspapers> getDigitalNewsSources(){\n\n Uri builtUri = Uri.parse(BASE_NEWSAPI_SOURCES_EP).buildUpon()\n .build();\n\n URL url = null;\n\n try {\n url = new URL(builtUri.toString());\n return doCall(url);\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "@Override\r\n\tpublic void getNewsFromIDataAPIByCatId(String catId) {\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\t\tString url = \"http://api01.bitspaceman.com:8000/news/toutiao?apikey=np5SpQ7QGzm7HgvX8Aw8APA5NDq6Bpj5m4eo4hX5qJFLm0G0Oqt31xJzjIEeJFTv&catid=\"+catId;\r\n\t\t\t\t\tString json = IDataAPI.getRequestFromUrl(url);\r\n\t\t\t\t\tlog.info(json);\r\n\t\t\t\t\tGson gson=new Gson();\r\n\t\t\t\t\tToutiaoResponseDto toutiaoResponseDto=gson.fromJson(json, ToutiaoResponseDto.class);\r\n\t\t\t\t\t\r\n\t\t\t\t\tList<NewsInfo> newsInfoArray=new ArrayList<NewsInfo>();\r\n\t\t\t\t\tfor(ToutiaoDataResponseDto toutiao :toutiaoResponseDto.getData()) {\r\n\t\t\t\t\t\tnewsInfoArray.add(new NewsInfo(toutiao,catId));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tList<NewsInfo> iter=(List<NewsInfo>) newsInfoRepository.saveAll(newsInfoArray);\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}catch(Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tlog.info(e.getMessage());\r\n\t\t}\r\n\t}", "@Override\n\tpublic Result getNewsByPage(Page page) {\n\t\tList<News> newsList = indexMapper.selectAll();\n\t\tResult result = new Result(1,\"success\",newsList);\n//\t\tSystem.out.println(\"indexService\"+newsList);\n\t\treturn result;\n\t}", "private void fetchTopHeadlines() {\n ApiNewsMethods newsTopHeadlines = retrofit.create(ApiNewsMethods.class);\n newsTopHeadlines.getTopHeadlines(\"in\"/*country through voice command*/, newsApiKey).enqueue(new Callback<NewsModelClass>() {\n @Override\n public void onResponse(Call<NewsModelClass> call, Response<NewsModelClass> response) {\n if(response.isSuccessful()) {\n newsModelBody = response.body();\n //change UI\n newsUIChanges();\n //Prepare speech\n StringBuilder newsText = new StringBuilder();\n String[] numbers = {\"First\",\"Second\",\"Third\",\"Fourth\",\"Fifth\",\"Sixth\",\"Seventh\",\"Eighth\",\"Ninth\",\"Tenth\",};\n int i = 0,j=newsModelBody.getArticles().size()>10?10:newsModelBody.getArticles().size();\n newsText.append(\"Headlines fetched successfully\\n\\n\\n\");\n while(i<j){\n newsText.append(numbers[i]+\"\\n\"+newsModelBody.getArticles().get(i).getTitle()+\"\\n\\n\\n\");\n i++;\n }\n newsText.append(\"Swipe Right to go back\\n\\n\\n\");\n constants.speak(newsText.toString(),mTextToSpeechHelper);\n } else {\n Log.d(\"mySTRING\", \"DID NOT OCCUR\");\n }\n }\n\n @Override\n public void onFailure(Call<NewsModelClass> call, Throwable t) {\n }\n });\n }", "private void getArticles() throws Exception {\n\t\t\tHttpClient httpClient = new DefaultHttpClient();\n\n\t\t\tStringBuilder uriBuilder = new StringBuilder(BASE_URL);\n\t\t\turiBuilder.append(mURL);\n\n\t\t\tHttpGet request = new HttpGet(uriBuilder.toString());\n\t\t\tHttpResponse response = httpClient.execute(request);\n\n\t\t\tint status = response.getStatusLine().getStatusCode();\n\n\t\t\tif (status != HttpStatus.SC_OK) {\n\n\t\t\t\t// Log whatever the server returns in the response body.\n\t\t\t\tByteArrayOutputStream ostream = new ByteArrayOutputStream();\n\n\t\t\t\tresponse.getEntity().writeTo(ostream);\n\t\t\t\tmHandler.sendEmptyMessage(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tInputStream content = response.getEntity().getContent();\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(content));\n\t\t\tStringBuilder result = new StringBuilder();\n\n\t\t\tString line;\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tresult.append(line);\n\t\t\t}\n\n\t\t\t// Clean up and close connection.\n\t\t\tcontent.close();\n\n\t\t\tString html = result.toString();\n\t\t\t//This is our regex to match each article\n\t\t\t//This website's html is not xml compatible so regex is next best thing\n\t\t\tPattern p = Pattern.compile(\"<td class=\\\"title\\\"><a href=\\\"(.*?)\\\".*?>(.*?)<\\\\/a>(<span class=\\\"comhead\\\">(.*?)<\\\\/span>)?.*?<\\\\/td><\\\\/tr><tr><td colspan=2><\\\\/td><td class=\\\"subtext\\\">.*? by <a href=\\\"user\\\\?.*?\\\">(.*?)<\\\\/a>.*?<a href=\\\"item\\\\?id=(.*?)\\\">\");\n\t\t\tMatcher m = p.matcher(html);\n\t\t\tList<Article> articles = new ArrayList<Article>();\n\t\t\twhile(m.find()) {\n\t\t\t\tString url = m.group(1);\n\t\t\t\tString title = m.group(2);\n\t\t\t\tString domain = m.group(4);\n\t\t\t\tString author = m.group(5);\n\t\t\t\tString discussionID = m.group(6);\n\t\t\t\tArticle eachArticle = new Article(title, domain, url, author, discussionID);\n\t\t\t\tarticles.add(eachArticle); \n\t\t\t}\n\n\t\t\tMessage msg = mHandler.obtainMessage();\n\t\t\tBundle bundle = new Bundle();\n\t\t\tbundle.putParcelableArrayList(\"articles\", (ArrayList<? extends Parcelable>) articles);\n\t\t\tmsg.setData(bundle);\n\t\t\tmHandler.sendMessage(msg);\n\t\t}", "public static List<Article> fetchNewsArticles(String queryUrl) {\n List<Article> articlesList = new ArrayList<>();\n\n // Create a url form the queryUrl\n URL url = createURL(queryUrl);\n\n // Make empty json string\n String jsonResponse = \"\";\n\n try {\n // TRY to make a http request on url, set the returned json string to jsonResponse\n jsonResponse = makeHTTPRequest(url);\n\n // Parse through json string to get the article info needed, and create a list of articles\n articlesList = extractFeatureFromJson(jsonResponse);\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.v(LOG_TAG, \"Error calling makeHTTPRequest method: \" + e);\n }\n\n // Return list of articles\n return articlesList;\n }", "@Override\n\tpublic List<NewsCollection> findAllList(Map<String, Object> param) {\n\t\treturn newsCollectionMapper.findAllList(param);\n\t}", "@Override\n\tpublic void requestNews() {\n\t\tSystem.out.println(\"xiaoming-requestNews\");\n\t}", "private static List<News> extractFeatureFromJson(String newsJSON){\n if (TextUtils.isEmpty(newsJSON)) {\n return null;\n }\n\n // Create an empty ArrayList that we can start adding news to\n ArrayList<News> news = new ArrayList<>();\n\n // Try to parse the SAMPLE_JSON_RESPONSE. If there's a problem with the way the JSON\n // is formatted, a JSONException exception object will be thrown.\n // Catch the exception so the app doesn't crash, and print the error message to the logs.\n try {\n\n JSONObject baseJsonObject = new JSONObject(newsJSON);\n\n JSONArray articlesJsonArray = baseJsonObject.getJSONArray(\"articles\");\n\n for (int i=0;i<articlesJsonArray.length();i++){\n JSONObject currentNews = articlesJsonArray.getJSONObject(i);\n\n String title = currentNews.getString(\"title\");\n String description = currentNews.getString(\"description\");\n String url = currentNews.getString(\"url\");\n String urlImage = currentNews.getString(\"urlToImage\");\n\n News exactNews = new News(title,description,url,urlImage);\n news.add(exactNews);\n }\n\n } catch (JSONException e) {\n Log.e(\"QueryUtils\", \"Problem parsing the earthquake JSON results\", e);\n }\n return news;\n }", "WebBookNewsCateListResult listAllBookNewsCategories();", "@Override\n public Digital getNews(int id) throws Exception {\n Connection con = null;\n ResultSet rs = null;\n PreparedStatement ps = null;\n String s = \"select * from digital where id = ?\";\n // check connection of db if cannot connect, it will throw an object of Exception\n try {\n con = getConnection();\n ps = con.prepareCall(s);\n ps.setInt(1, id);\n rs = ps.executeQuery();\n while (rs.next()) {\n Digital d = new Digital(rs.getInt(\"id\"),\n rs.getString(\"title\"),\n rs.getString(\"description\"),\n rs.getString(\"images\"),\n rs.getString(\"author\"),\n rs.getTimestamp(\"timePost\"),\n rs.getString(\"shortDes\"));\n return d;\n }\n } catch (Exception e) {\n throw e;\n } finally {\n // close ResultSet, PrepareStatement, Connection\n closeResultSet(rs);\n closePrepareStateMent(ps);\n closeConnection(con);\n }\n return null;\n }", "@Override\n\tpublic Page<News> findNews(News searchModel, int pageNum, int pageSize) {\n\t\tList<News> allStudentList = getAllNews(searchModel);\n\t\tPage<News> page = new Page<News>(allStudentList, pageNum, pageSize);\n\t\treturn page;\n\t}", "public Cursor obtenirTotesLesNews() throws SQLException {\n return bd.query(BD_TAULA,\n new String[] {CLAU_ID,CLAU_TITOL,CLAU_URL, CLAU_AUTOR,\n CLAU_DESCRIPCIO,CLAU_DATA, CLAU_CATEGORIA, CLAU_URLIMG, CLAU_RSS},\n null, null, null, null, null);\n }", "private synchronized void processNews() throws ClientProtocolException,\n\t\t\t\tIOException, JSONException {\n\n\t\t\tlong lastTime = mAdapter.getItem(mCount - 1).date;\n\t\t\tlong startTime = lastTime - Utils.MONTH;\n\n\t\t\tsetNews(ApiHandler.getData(lastTime, startTime));\n\t\t\tmHandler.sendEmptyMessage(UPDATE_LIST);\n\t\t}", "@Override\n public int getItemCount() {\n return news.size();\n }", "public int getNewsId() {\n\t\treturn newsId;\n\t}", "public interface DataManager {\n List<String> fetchNews(NewsType newsType);\n}", "private boolean pull(String url) {\r\n\t\ttry {\r\n\t\t\tHttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();\r\n\t\t\tint respCode = con.getResponseCode();\r\n\t\t\tif (respCode != HttpURLConnection.HTTP_OK) {\r\n\t\t\t\tHaypiLog.d(TAG, respCode + \" \" + con.getResponseMessage());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tInputStream in = con.getInputStream();\r\n\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream(4096);\r\n\t\t\tbyte[] buf = new byte[2048];\r\n\t\t\tint n;\r\n\t\t\twhile ((n = in.read(buf)) > -1) {\r\n\t\t\t\tout.write(buf, 0, n);\r\n\t\t\t}\r\n\t\t\tString encoding = con.getContentEncoding();\r\n\t\t\tif (encoding == null) {\r\n\t\t\t\tencoding = \"UTF-8\";\r\n\t\t\t}\r\n\t\t\tString resp = out.toString(encoding);\r\n\t\t\tString[] ss = HaypiUtil.split(resp, \"\\r\\n\");\r\n\r\n\t\t\tif (ss.length >= 3 && ss[0].equals(\"0\") && ss[1].equals(\"0\")) {\r\n\t\t\t\tint index = 2;\r\n\t\t\t\tint count = Integer.parseInt(ss[index++]);\r\n\t\t\t\tif (count > 0) {\r\n\t\t\t\t\tArrayList<News> list = new ArrayList<News>();\r\n\t\t\t\t\tfor (; count > 0; count--) {\r\n\t\t\t\t\t\tint version = Integer.parseInt(ss[index++]);\r\n\t\t\t\t\t\tif (version <= News.lastNewsVersion)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tNews.lastNewsVersion = version;\r\n\t\t\t\t\t\tNews entity = new News();\r\n\t\t\t\t\t\tentity.setNew(true);\r\n\t\t\t\t\t\tentity.setVersion(version);\r\n\t\t\t\t\t\tentity.setStartTime(Integer.parseInt(ss[index++]));\r\n\t\t\t\t\t\tentity.setEndTime(Integer.parseInt(ss[index++]));\r\n\t\t\t\t\t\tentity.setSubject(ss[index++]);\r\n\t\t\t\t\t\tentity.setDescription(ss[index++]);\r\n\t\t\t\t\t\tentity.setContent(ss[index++]);\r\n\t\t\t\t\t\tentity.setToken(ss[index++]);\r\n\t\t\t\t\t\tentity.setButtonText(ss[index++]);\r\n\t\t\t\t\t\tentity.setNewsType(News.TYPE.values()[Integer.parseInt(ss[index++])]);\r\n\t\t\t\t\t\tentity.setTopNews(\"1\".equals(ss[index++]));\r\n\t\t\t\t\t\tentity.setParams1(ss[index++]);\r\n\t\t\t\t\t\tentity.setParams2(ss[index++]);\r\n\t\t\t\t\t\tentity.setParams3(ss[index++]);\r\n\t\t\t\t\t\tlist.add(entity);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (list.size() > 0) {\r\n\t\t\t\t\t\tNews.add(list);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcon.disconnect();\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\tHaypiLog.e(TAG, \"poll\", e);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Transactional\n public Map<Long, ArrayList<News>> getCalNewsForMonth(int month, int year) {\n return calendarDAO.getCalNewsForMonth(month, year);\n }", "List<String> showNewsAndMessages();", "public void getNewsFromIDataAPIByPageToken(String pageToken,String catId) {\n\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\tString url = \"http://api01.bitspaceman.com:8000/news/toutiao?apikey=np5SpQ7QGzm7HgvX8Aw8APA5NDq6Bpj5m4eo4hX5qJFLm0G0Oqt31xJzjIEeJFTv&catid=\"+catId+\"&pageToken=\"+pageToken;\r\n\t\t\t\t\t\tString json = IDataAPI.getRequestFromUrl(url);\r\n\t\t\t\t\t\tlog.info(json);\r\n\t\t\t\t\t\tGson gson=new Gson();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tToutiaoResponseDto toutiaoResponseDto=gson.fromJson(json, ToutiaoResponseDto.class);\r\n\t\t\t\t\t\tList<NewsInfo> newsInfoArray=new ArrayList<NewsInfo>();\r\n\t\t\t\t\t\tfor(ToutiaoDataResponseDto toutiao :toutiaoResponseDto.getData()) {\r\n\t\t\t\t\t\t\tnewsInfoArray.add(new NewsInfo(toutiao,catId));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tList<NewsInfo> iter=(List<NewsInfo>) newsInfoRepository.saveAll(newsInfoArray);\r\n\t\t\t\t\t\t}catch(Exception e) {\r\n\t\t\t\t\t\t\tlog.info(e.getMessage());\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(\"true\".equals(toutiaoResponseDto.getHasNext())) {\r\n\t\t\t\t\t\t\tgetNewsFromIDataAPIByPageToken2(toutiaoResponseDto.getPageToken(),catId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//不能批量添加还需要判断视频重复问题\r\n\t\t\t\t\t\t//videosInfoRepository.saveAll(videosInfoArray);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t}", "Collection<Lesson> getLessons() throws DataAccessException;", "public void getNewsFromIDataAPIByPageToken2(String pageToken,String catId) {\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tString url = \"http://api01.bitspaceman.com:8000/news/toutiao?apikey=np5SpQ7QGzm7HgvX8Aw8APA5NDq6Bpj5m4eo4hX5qJFLm0G0Oqt31xJzjIEeJFTv&catid=\"+catId+\"&pageToken=\"+pageToken;\r\n\t\t\t\t\tString json = IDataAPI.getRequestFromUrl(url);\r\n\t\t\t\t\tlog.info(json);\r\n\t\t\t\t\tGson gson=new Gson();\r\n\t\t\t\t\t\r\n\t\t\t\t\tToutiaoResponseDto toutiaoResponseDto=gson.fromJson(json, ToutiaoResponseDto.class);\r\n\t\t\t\t\tList<NewsInfo> newsInfoArray=new ArrayList<NewsInfo>();\r\n\t\t\t\t\tfor(ToutiaoDataResponseDto toutiao :toutiaoResponseDto.getData()) {\r\n\t\t\t\t\t\tnewsInfoArray.add(new NewsInfo(toutiao,catId));\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\tList<NewsInfo> iter=(List<NewsInfo>) newsInfoRepository.saveAll(newsInfoArray);\r\n\t\t\t\t\t}catch(Exception e) {\r\n\t\t\t\t\t\tlog.info(e.getMessage());\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(\"true\".equals(toutiaoResponseDto.getHasNext())) {\r\n\t\t\t\t\t\tgetNewsFromIDataAPIByPageToken(toutiaoResponseDto.getPageToken(),catId);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t}", "@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 }", "public void requestNews(int skip, int num){\n String tag_json = \"json_object_req\";\n\n String url = \"http://lighthauz.herokuapp.com/api/news/\";\n\n JsonObjectRequest req = new JsonObjectRequest(url + user.get(SessionManager.KEY_ID) + \"/\" + Integer.toString(skip) + \"/\" + Integer.toString(num),null,\n new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n\n JSONArray myArray;\n try{\n if (previousTotal==0){\n news.clear();\n }\n\n myArray = response.getJSONArray(\"news\");\n for(int i=0;i<myArray.length();i++){\n\n JSONObject author = myArray.getJSONObject(i).getJSONObject(\"author\");\n JSONObject idea = myArray.getJSONObject(i).getJSONObject(\"idea\");\n News newNews = new News(myArray.getJSONObject(i).getString(\"type\"),author.getString(\"id\"),idea.getString(\"id\"),author.getString(\"name\"),author.getString(\"pic\"),idea.getString(\"title\"),idea.getString(\"category\"),idea.getString(\"description\"),idea.getString(\"pic\"),myArray.getJSONObject(i).getLong(\"timestamp\"));\n news.add(newNews);\n\n }\n\n if(previousTotal==0){\n recView.setAdapter(adapter);\n } else {\n adapter.swap(news);\n }\n\n pb.setVisibility(View.GONE);\n recView.setVisibility(View.VISIBLE);\n\n }\n catch (JSONException e){\n Log.e(\"MYAPP\", \"unexpected JSON exception\", e);\n }\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.d(TAG, \"Error: \" + error.getMessage());\n }\n });\n\n// Adding request to request queue\n AppSingleton.getInstance(getContext()).addToRequestQueue(req, tag_json);\n }", "public static synchronized NewsDetail getNewsDetail(String newsId) throws NewsException {\n NewsDetail newsDetail;\n try {\n newsDetail = newsdetailHttpService.getNewsDetail(newsId).execute().body();\n } catch (IOException e) {\n throw new NewsException(NewsException.NEWS_ERROR, String.format(NewsException.CONVERT_FROM_STRING_TO_JSON_MESSAGE, \"getNewsDetail\", SERVICE_NAME));\n }\n newsDetail.setFavorite(CacheService.getFavorite(newsId));\n newsDetail.separateImageUrlString();\n newsDetail.injectHyperlink();\n CacheService.storeNewsDetail(newsDetail);\n return newsDetail;\n }", "List<TagDto> getByNewsId(Long newsId);", "public List<NewsItem> getNewsItemDataFromDB() throws SQLException;", "private List<FeedItemRO> getFeedFromGoogle() {\n\t\t// create RO list\n\t\tList<FeedItemRO> feedItemROs = new ArrayList<>();\n\t\t// parse the data with ROME library inside a try-catch so that if there is a connection problem it will throw an exception.\n\t\tURL feedUrl;\n\t\ttry {\n\t\t\tfeedUrl = new URL(\"https://news.google.com/gn/news/?ned=us&gl=US&hl=en&output=rss\");\n\t\t\tSyndFeedInput input = new SyndFeedInput();\n\t\t\tSyndFeed feed = input.build(new XmlReader(feedUrl));\n\t\t\t\n\t\t\t// every news story in the feed is an entry, for each one construct a RO with title, link, description and add it to the list. \n\t\t\tList<SyndEntry> entries = feed.getEntries();\n\t\t\tfor (SyndEntry syndEntry : entries) {\n\t\t\t\tfeedItemROs.add(new FeedItemRO(syndEntry.getTitle(),syndEntry.getLink(), syndEntry.getDescription().getValue()));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t//Should be logged properly\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// return RO list of news stories.\n\t\treturn feedItemROs;\n\t}", "@Override\n public void fetchNewsFail() {\n }", "@Override\n\tpublic NewsVO findByPrimaryKey(String news_id) {\n\t\tNewsVO newsVO = null;\n\t\tConnection con = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(driver);\n\t\t\tcon = DriverManager.getConnection(url, userid, passwd);\n\t\t\tpstmt = con.prepareStatement(GET_ONE_STMT);\n\n\t\t\tpstmt.setString(1, news_id);\n\n\t\t\trs = pstmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\t// empVo 也稱為 Domain objects\n\t\t\t\tnewsVO = new NewsVO();\n\t\t\t\tnewsVO.setNews_id(rs.getString(\"news_id\"));\n\t\t\t\tnewsVO.setNews_content(rs.getString(\"news_content\"));\n\t\t\t\tnewsVO.setNews_date(rs.getTimestamp(\"news_date\"));\n\t\t\t}\n\n\t\t\t// Handle any driver errors\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Couldn't load database driver. \"\n\t\t\t\t\t+ e.getMessage());\n\t\t\t// Handle any SQL errors\n\t\t} catch (SQLException se) {\n\t\t\tthrow new RuntimeException(\"A database error occured. \"\n\t\t\t\t\t+ se.getMessage());\n\t\t\t// Clean up JDBC resources\n\t\t} finally {\n\t\t\tif (rs != null) {\n\t\t\t\ttry {\n\t\t\t\t\trs.close();\n\t\t\t\t} catch (SQLException se) {\n\t\t\t\t\tse.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pstmt != null) {\n\t\t\t\ttry {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t} catch (SQLException se) {\n\t\t\t\t\tse.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (con != null) {\n\t\t\t\ttry {\n\t\t\t\t\tcon.close();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace(System.err);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn newsVO;\n\t}", "public static List<News> parseNewsInfo(String newsString)\n {\n List<News> newsList = new ArrayList<News>();\n try\n {\n JSONObject jsonObject = new JSONObject(newsString);\n Log.i(\"MY_TEST_JSON_OBJECT\", \"\" + jsonObject);\n JSONArray data = jsonObject.getJSONArray(\"T1348647853363\");\n Log.i(\"data_LENGTH\", data.length() + \"\");\n for(int i = 1; i < data.length(); i++){\n Log.i(\"data_LENGTH-------\", i + \"\");\n News tmp_news = new News();\n Log.i(\"data_LENGTH-------\", \"A\" + i);\n JSONObject tmp = data.getJSONObject(i);\n Log.i(\"data_LENGTH-------\", \"B\" + i);\n tmp_news.setTitle(tmp.getString(\"title\"));\n Log.i(\"data_LENGTH-------\", \"C\" + i);\n try {\n tmp_news.setUrl(tmp.getString(\"url_3w\"));\n }catch (Exception e){\n tmp_news.setUrl(\"\");\n }\n Log.i(\"data_LENGTH-------\", \"D\" + i);\n tmp_news.setSource(\"\");\n Log.i(\"data_LENGTH-------\", \"E\" + i);\n tmp_news.setLmodify(\"\");\n Log.i(\"data_LENGTH-------\", \"F\" + i);\n tmp_news.setImgSrc(\"\");\n Log.i(\"data_LENGTH-------\", \"G\" + i);\n tmp_news.setSubtitle(\"\");\n Log.i(\"data_LENGTH-------\", \"H\" + i);\n tmp_news.setPtime(tmp.getString(\"ptime\"));\n Log.i(\"data_LENGTH-------\", \"I\" + i);\n newsList.add(tmp_news);\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n return newsList;\n }", "@Override\n public void setNews(News object) {\n headerHolder.bindHolder(object);\n adapter.addList(object.getComments());\n }", "List<WxNews> selectByExample(WxNewsExample example);", "public LabelItem GetTestdataByNewsID(long news_id, String news_source){\n\t\tqueryString = \"SELECT * FROM test_data where news_id=\"+news_id+\" and news_source=\\\"\"+news_source+\"\\\"\";\n\t\tSystem.out.println(queryString);\n\t\ttry{\n\t\t\tList rows = jdbcTemplate.queryForList(queryString);\n\t\t\tint isEvent = 0;\n\t\t\tString newsSource;\n\t\t\tString newsID ;\n\t\t\tString newsTitle ;\n\t\t\tString labelID;\n\t\t\tif(rows.size()>0){\n\t\t\t\tMap line = (Map)rows.get(0);\n\t\t\t\tlabelID = Long.toString((long)line.get(\"label_id\"));\n\t\t\t\tnewsSource = (String)line.get(\"news_source\");\n\t\t\t\tnewsID \t= Long.toString((long)line.get(\"news_id\"));\n\t\t\t\tnewsTitle = (String)line.get(\"news_title\");\n\t\t\t\tisEvent = (boolean)line.get(\"if_event\")==true?1:0;\n\t\t\t\t\n\t\t\t\tif(newsSource == null||newsID == null || newsTitle == null)\n\t\t\t\t\tSystem.out.println(\"Something null from DB\");\n\t\t\t\tLabelItem label;\n\t\t\t\tif(isEvent == 0)\n\t\t\t\t\tlabel= new LabelItem(labelID,newsSource,newsID,newsTitle);\n\t\t\t\telse\n\t\t\t\t//\tpublic LabelItem(String labelID,String newsSource,String newsID,String newsTitle,int eventType,\n\t\t\t\t//\t\t\tString sourceActor,String targetActor,String triggerWord,\n\t\t\t\t//\t\t\tString eventTime,String eventLocation)\n\t\t\t\t{\n\t\t\t\t\tlabel = new LabelItem(labelID,newsSource,newsID, newsTitle, (int)line.get(\"event_type\"),\n\t\t\t\t\t\t\t(String)line.get(\"source_actor\"), (String)line.get(\"target_actor\"), (String)line.get(\"trigger_word\"),\n\t\t\t\t\t\t\t(String)line.get(\"source_actorPro\"), (String)line.get(\"target_actorPro\"),\n\t\t\t\t\t\t\t(String)line.get(\"event_date\"), (String)line.get(\"event_location\"),(String)line.get(\"actor_index\"),\n\t\t\t\t\t\t\t(String)line.get(\"actor_len\"),(String)line.get(\"actor_Pro\"),(String)line.get(\"actor\"));\n\t\t\t\t}\n\t\t\t\tint if_remark=(boolean)line.get(\"if_remark\")==true?1:0;\n\t\t\t\tlabel.if_remark = if_remark;\n\t\t\t\treturn label;\n\t\t\t}\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}", "@Override\n public TvShowDetailsBundle loadInBackground() {\n if (mUrl == null) {\n return null;\n }\n /* Perform the network request, parse the response, and extract a list of news. */\n TvShowDetailsBundle tvShows = TvShowDetailsQueryUtils.fetchTvShowData(mUrl);\n return tvShows;\n }", "@Override\r\n\tpublic List<Sharekicomment> getAllComments(String newsPK) {\n\t\tList<Sharekicomment> comments=new ArrayList<Sharekicomment>();\r\n\t\t\r\n\t\tif(newsPK==null || newsPK.equalsIgnoreCase(\"\"))\r\n\t\t\treturn comments;\r\n\t\t\r\n\t\tSession session=HibernateUtil.getSessionFactory().getCurrentSession();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tsession.beginTransaction();\r\n\t\r\n\t\t\tSharekinews news = (Sharekinews) session.load(\r\n\t\t\t\t\tSharekinews.class, newsPK);\r\n\t\t\t\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t\t//session.flush();\r\n\t\t\t//session.close();\r\n\t\t\tif(news!=null)\r\n\t\t\t\treturn news.getSharekicomments();\r\n\t\t}\r\n\t\tcatch(RuntimeException e)\r\n\t\t{\r\n\t\t\tsession.getTransaction().rollback();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@RequestMapping(value = \"/news/{id}\" , method = RequestMethod.GET)\n public Optional<News> findOneNews(@PathVariable String id){\n return newsService.findNewsDetails(id);\n }", "@Override\n public HashSet<News> getNewsFreeCriteria(String request) throws ServiceException {\n try {\n String [] parametersForTheSearch;\n parametersForTheSearch = RequestWorker.getSearchParametersInRequest(request);\n\n return dbWorker.searchNewsForFreeCriteria(parametersForTheSearch);\n\n } catch (DAOException e) {\n throw new ServiceException(e.getMessage(),e);\n }\n }", "@Override\r\n\tpublic List<News> getNewsList(String pId, String size, String query) {\n\t\tString hql=\" WHERE 1=1 AND o.lm.id=\"+pId+query;\r\n\t\treturn this.findAll(News.class, hql, 0, Integer.valueOf(size));\r\n\t}", "@Scheduled(cron = \"0 0 0/2 * * ?\")\n\tpublic void pullNewsFeedFromNewsApi() throws Exception {\n\t\tNewsApi newsApi = getNewsFromNewsApi();\n\t\tlogger.info(\"Completed fetching news from News Api at :\" + new java.util.Date());\n\t}", "@Override\r\n public Loader<List<NewsList>> onCreateLoader(int i, Bundle bundle) {\n SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n //here get the preferences\r\n String maxResults = sharedPrefs.getString(\r\n getString(R.string.settings_max_results_key),\r\n getString(R.string.settings_max_results_default));\r\n String orderBy = sharedPrefs.getString(\r\n getString(R.string.settings_order_by_key),\r\n getString(R.string.settings_order_by_default)\r\n );\r\n String section = sharedPrefs.getString(\r\n getString(R.string.settings_section_key),\r\n getString(R.string.settings_section_default)\r\n );\r\n //get the URL of the Guardian server\r\n Uri baseUri = Uri.parse(REQUEST_URL);\r\n //this is used to build the URL with the query parameters\r\n Uri.Builder uriBuilder = baseUri.buildUpon();\r\n if (query != null && !query.isEmpty()) {\r\n uriBuilder.appendQueryParameter(\"q\", query); //this adds the query in the search box\r\n }\r\n uriBuilder.appendQueryParameter(\"page-size\", maxResults); //this adds the max news listed\r\n uriBuilder.appendQueryParameter(\"order-by\", orderBy.toLowerCase()); //here defines the order of the list\r\n if (!section.equals(\"all\")) {\r\n uriBuilder.appendQueryParameter(\"section\", section.toLowerCase()); //this filter the results for section\r\n }\r\n return new NewsLoader(this, uriBuilder.toString());\r\n }", "@GET\n public List<Lehrer> getAllLehrer() {\n Log.d(\"Webservice Lehrer Get:\");\n Query query = em.createNamedQuery(\"findAllTeachers\");\n List<Lehrer> lehrer = query.getResultList();\n return lehrer;\n }", "@Override\n\tpublic int countNews() {\n\t\treturn comNewsMapper.selectCountNews();\n\t}", "private void fetchTeams() {\n String url = Teams.TEAMS_URL;\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(final JSONObject response) {\n Gson gson = new Gson();\n //Deserialize\n mTeams = gson.fromJson(response.toString(), Teams.class);\n for (Team team : mTeams.getTeams()) {\n //Add each team to the nav drawer with the appropriate icon\n mNavigationView.getMenu().add(team.getName()).setIcon(Utils.getDrawableForTeam(team));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(final VolleyError error) {\n error.printStackTrace();\n }\n });\n //Singleton instance of Volley as per the documentation\n RequestQueue.getInstance(this).addToRequestQueue(request);\n }", "@RequestMapping(value = { \"/comment/news/{id}\", \"/komentar/vest/{id}\" }, method = RequestMethod.GET)\r\n\tpublic ResponseEntity<Iterable<Comment>> getAllApprovedCommentsForGivenNews(\r\n\t\t\t@PathVariable(value = \"id\") Integer newsID) {\r\n\t\treturn new ResponseEntity(commentRepository.findByNewsIDAndCommentState(newsID, CommentState.APPROVED),\r\n\t\t\t\tHttpStatus.OK);\r\n\t}", "@Override\n public int getCount() {\n return newsArticleList.size();\n }", "public List<DBObject> getNews(List<ObjectId> userStories, int skip) \n throws InputException, MongoException;", "@SkipValidation\n public String importantNewsView() {\n if ((important != null) && (important.getImportantNewsId() != null)) {\n important = impService.getImportantNews(important.getImportantNewsId());\n }\n return SUCCESS;\n }" ]
[ "0.73160577", "0.7167209", "0.7092427", "0.6968486", "0.67955583", "0.65909344", "0.6447492", "0.6410521", "0.6404233", "0.6402209", "0.63924134", "0.6354023", "0.6301581", "0.62340474", "0.62097543", "0.61531025", "0.61130965", "0.6101681", "0.6100344", "0.6090759", "0.60515213", "0.6044925", "0.60295194", "0.60234946", "0.60128164", "0.5996167", "0.5982751", "0.5953274", "0.59376156", "0.59316194", "0.5921811", "0.5886814", "0.58749086", "0.5864204", "0.58418566", "0.5813618", "0.5803185", "0.57979465", "0.5795407", "0.5792131", "0.57902056", "0.57867247", "0.57791317", "0.57738", "0.57627046", "0.5761604", "0.5751948", "0.5748665", "0.573614", "0.5727513", "0.5716738", "0.5695131", "0.5686309", "0.5681277", "0.5617039", "0.5608974", "0.55762696", "0.5576158", "0.5566933", "0.55659926", "0.5555583", "0.55020934", "0.55006385", "0.5486478", "0.5458374", "0.54504204", "0.5426778", "0.5411213", "0.54009753", "0.537682", "0.53639597", "0.5361984", "0.5352067", "0.5351138", "0.5339173", "0.53367156", "0.5334066", "0.52985984", "0.5298025", "0.52832377", "0.5278215", "0.5277075", "0.5274048", "0.52739835", "0.5262182", "0.5260811", "0.5245378", "0.5234368", "0.5226728", "0.5225412", "0.52188236", "0.5216342", "0.51997", "0.51946396", "0.5191404", "0.5182629", "0.51812834", "0.5180247", "0.5179634", "0.51734364" ]
0.6552629
6
The createNewLeague method handles the insertion into the DB of a League
public static boolean createNewLeague(LeagueBean l) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement insertNewLeague = null; int result = 0; // Connect to Database try { conn = ConnectionManager.getConnection(); insertNewLeague = conn.prepareStatement("INSERT INTO league (leagueName, leaguePlayoffs, leaguePlayoffTeams, leagueStatus) VALUE (?,?,?,?)"); insertNewLeague.setString(1, l.getLeagueName()); insertNewLeague.setString(2, l.getLeaguePlayoffs()); insertNewLeague.setString(3, l.getLeaguePlayoffTeams()); insertNewLeague.setString(4, l.getLeagueStatus()); result = insertNewLeague.executeUpdate(); if(result == 1) { status = true; } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (insertNewLeague != null) { try { insertNewLeague.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void createNewLeague()\n\t{\n\t\t//put code to get input from end-user here.\n\t\t//generateFixtures(leagueName, teamAmount, homeAndAway, winPoints, drawPoints, lossPoints, teamNames);\n\t}", "@RequestMapping(value = \"/team/{league}\", method = POST, consumes = MEDIA_JSON)\n @ResponseStatus(CREATED)\n public LobbyTeam createTeamAndEnter(@AuthenticationPrincipal UserSimpleDetails user,\n @PathVariable(\"league\") LobbyLeagueEnum league)\n throws TeamFullException, TeamNotFoundException {\n log.info(\"user {} creates team\", user.getIdentity());\n LobbyTeam team = lobbyService.createTeam(user.getProfileId(), league);\n return lobbyService.enterIntoTeam(user.getProfileId(), team.getId().toString());\n }", "private void createLeague(){ \r\n FantasyUser maxUser = new FantasyUser();\r\n maxUser.setEmail(\"[email protected]\");\r\n maxUser.setPassword(\"password\");\r\n fUserBean.create(maxUser);\r\n \r\n FantasyUser adrianUser = new FantasyUser();\r\n adrianUser.setEmail(\"[email protected]\");\r\n adrianUser.setPassword(\"password\");\r\n fUserBean.create(adrianUser);\r\n \r\n FantasyUser ashayUser = new FantasyUser();\r\n ashayUser.setEmail(\"[email protected]\");\r\n ashayUser.setPassword(\"password\");\r\n fUserBean.create(ashayUser);\r\n \r\n FantasyUser jessUser = new FantasyUser();\r\n jessUser.setEmail(\"[email protected]\");\r\n jessUser.setPassword(\"password\");\r\n fUserBean.create(jessUser);\r\n \r\n //create league\r\n FantasyLeague league = new FantasyLeague();\r\n league.setDraftStarted(false);\r\n league.setFinishedDraft(false);\r\n league.setLeagueName(\"Mongeese Only\");\r\n league.setLeagueOwner(maxUser);\r\n flBean.create(league);\r\n \r\n //create teams\r\n FantasyTeam maxTeam = new FantasyTeam();\r\n maxTeam.setTeamName(\"Max's Team\");\r\n maxTeam.setTeamOwner(maxUser);\r\n maxTeam.setLeague(league);\r\n ftBean.create(maxTeam);\r\n \r\n FantasyTeam ashayTeam = new FantasyTeam();\r\n ashayTeam.setTeamName(\"Ashay's Team\");\r\n ashayTeam.setTeamOwner(ashayUser);\r\n ashayTeam.setLeague(league);\r\n ftBean.create(ashayTeam);\r\n \r\n FantasyTeam jessTeam = new FantasyTeam();\r\n jessTeam.setTeamName(\"Jess's team\");\r\n jessTeam.setTeamOwner(jessUser);\r\n jessTeam.setLeague(league);\r\n ftBean.create(jessTeam);\r\n \r\n FantasyTeam adrianTeam = new FantasyTeam();\r\n adrianTeam.setTeamName(\"Team Greasy Pizza\");\r\n adrianTeam.setTeamOwner(adrianUser);\r\n adrianTeam.setLeague(league); \r\n ftBean.create(adrianTeam);\r\n }", "public Team insert(League league, String teamName) {\n StandingDB sdb = new StandingDB();\n TeamDB tdb = new TeamDB();\n String teamID = generateTeamID();\n \n Standing standing = new Standing(teamID);\n \n Team team = new Team(teamID, teamName);\n team.setLeagueID(league);\n \n tdb.insert(team);\n sdb.insert(standing);\n return team;\n }", "Team createTeam();", "void create(Team team);", "@Override\n public void save(ArrayList<League> leagues) {\n\n }", "@PostMapping(\"/createNewGameRoom\")\n @ResponseStatus(HttpStatus.CREATED)\n public Game generateNewGameRoom() {\n String entrycode = service.generateEntryCode();\n currentGame.setEntrycode(entrycode);\n currentGame = gameDao.add(currentGame);\n return currentGame;\n }", "public void createTeam(ActionEvent actionEvent) throws IOException, SQLException {\n if (validCreateInput()) {\n user = DatabaseManager.createTeam(user, teamNameCreateField.getText(), abbrevationCreateField.getText(), chooseCityBoxCreate.getValue().toString(),\n chooseAgeGroupCreate.getValue(), chooseLeagueBoxCreate.getValue().toString(), chooseLeagueTeamBoxCreate.getValue().toString(), createTeamLogoFile);\n\n createPaneClose(actionEvent);\n displayMessage(messagePane, \"Team created\", false);\n }\n }", "int insert(SysTeam record);", "public void createNewUser(){\n Users user = new Users(winnerName);\n mDatabase.child(\"users\").child(winnerName).setValue(user);\n Log.d(\"DB\", \"Writing new user \" + winnerName + \" to the database\");\n\n Toast.makeText(this, \"Scoreboard has been updated!\", Toast.LENGTH_SHORT).show();\n\n endGame();\n\n\n\n }", "public void insertTeam(Team t) {\n\t\tEntityManager em = emfactory.createEntityManager();\n\t\tem.getTransaction().begin();\n\t\tem.persist(t);\n\t\tem.getTransaction().commit();\n\t\tem.close();\n\t}", "private void saveTournament(Tournament tournament) {\n System.out.println(\"Saving\");\n TournamentEntity entity = new TournamentEntity();\n entity.setId(tournament.getId());\n entity.setWinnerId(tournament.getFightersRemaining().get(0).getId());\n tournamentRepository.save(entity);\n }", "public void newTeam(Team team);", "void addMyTeam(Team team) throws HasTeamAlreadyException;", "@Test\r\n\tpublic void saveTeamLevel() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamLevel \r\n\t\tInteger teamId_8 = 0;\r\n\t\tLevel related_level = new wsdm.domain.Level();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamLevel(teamId_8, related_level);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamLevel\r\n\t}", "public static boolean saveChanges(LeagueBean l) {\r\n\t\t\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t Connection conn = null;\t\t\t\t\t// DB Connection\r\n\t PreparedStatement updateLeague = null;\r\n\t int result = 0;\r\n\t\r\n\t // Connect to Database \r\n\t try {\r\n\t conn = ConnectionManager.getConnection();\r\n\t updateLeague = conn.prepareStatement(\"UPDATE league SET leagueName=?, leaguePlayoffs=?, leaguePlayoffTeams=?, leagueStatus=? WHERE leagueID=?\");\r\n\t updateLeague.setString(1, l.getLeagueName());\r\n\t updateLeague.setString(2, l.getLeaguePlayoffs());\r\n\t updateLeague.setString(3, l.getLeaguePlayoffTeams());\r\n\t updateLeague.setString(4, l.getLeagueStatus());\r\n\t updateLeague.setString(5, l.getLeagueId());\r\n\t result = updateLeague.executeUpdate();\t \r\n\t if(result == 1) {\r\n\t \tstatus = true;\r\n\t }\r\n\t \r\n\t // Catch all possible Exceptions\r\n\t } catch (Exception e) {\r\n\t System.out.println(e);\r\n\t } finally {\r\n\t if (conn != null) {\r\n\t try {\r\n\t conn.close();\r\n\t } catch (SQLException e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t if (updateLeague != null) {\r\n\t try {\r\n\t \tupdateLeague.close();\r\n\t } catch (SQLException e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t }\t \r\n\t return status;\r\n\t}", "@Override\n\tpublic void createNewGame() \n\t{\n\t\t//Create new game\n\t\tboolean randomhexes = getNewGameView().getRandomlyPlaceHexes();\n\t\tboolean randomnumbers = getNewGameView().getRandomlyPlaceNumbers();\n\t\tboolean randomports = getNewGameView().getUseRandomPorts();\n\t\tString title = getNewGameView().getTitle();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tReference.GET_SINGLETON().proxy.createGame(title, randomhexes, randomnumbers, randomports);\n\t\t} \n\t\tcatch (JoinExceptions e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t//Refresh game list\n\t\tList<Game> gamelist = Reference.GET_SINGLETON().proxy.getGameList();\n\t\tGameInfo[] games = new GameInfo[gamelist.size()];\n\t\tint counter = 0;\n\t\tfor(Game game: gamelist)\n\t\t{\n\t\t\tGameInfo thisgame = new GameInfo();\n\t\t\tthisgame.setId(game.getId());\n\t\t\tthisgame.setTitle(game.getTitle());\n\t\t\tfor(Player player : game.getPlayers())\n\t\t\t{\n\t\t\t\tPlayerInfo player_info = new PlayerInfo(player);\n\t\t\t\tplayer_info.setColor(player.getColor());\n\t\t\t\tif(!(player.color == null))thisgame.addPlayer(player_info);\n\t\t\t}\n\t\t\tgames[counter] = thisgame;\n\t\t\tcounter++;\n\t\t}\n\t\t\n\t\tReference ref = Reference.GET_SINGLETON();\n\t\t\n\t\tPlayerInfo ourguy = new PlayerInfo();\n\t\t\n\t\tourguy.setId(ref.player_id);\n\t\tourguy.setName(ref.name);\n\t\tif(getNewGameView().isModalShowing())\n\t\t{\n\t\t\tgetNewGameView().closeModal();\n\t\t}\n\t\tif (getNewGameView().isModalShowing())\n\t\t{\n\t\t\tgetNewGameView().closeModal();\n\t\t}\n\n\t\tgetJoinGameView().setGames(games, ourguy);\n\t\t\n\t}", "public void onSelectionCreate(ActionEvent event) throws SQLException {\n //TODO think about creating league model class to get id easily\n if(chooseAgeGroupCreate.getValue() != null && chooseCityBoxCreate.getValue() != null){\n chooseLeagueBoxCreate.setDisable(false);\n chooseLeagueTeamBoxCreate.getItems().clear();\n chooseLeagueBoxCreate.getItems().clear();\n ObservableList<String> leagueList = DatabaseManager.getLeagues(user, chooseCityBoxCreate.getValue().toString(), chooseAgeGroupCreate.getValue());\n chooseLeagueBoxCreate.getSelectionModel().clearSelection();\n chooseLeagueBoxCreate .setButtonCell(new ListCell<String>() {\n @Override\n protected void updateItem(String item, boolean empty) {\n super.updateItem(item, empty) ;\n if (empty || item == null) {\n setText(\"Choose League\");\n } else {\n setText(item);\n }\n }\n });\n if(leagueList.size() != 0){\n chooseLeagueBoxCreate.getItems().addAll(leagueList);\n }\n }\n }", "@Override\n @Transactional\n public Team addTeam(Team team) {\n KeyHolder keyHolder = new GeneratedKeyHolder();\n String sql = \"INSERT INTO Team (teamname, userid) VALUES (?, ?)\";\n\n jdbc.update((Connection connection) -> {\n PreparedStatement prep = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n prep.setString(1, team.getName());\n prep.setInt(2, team.getUser().getId());\n return prep;\n }, keyHolder);\n team.setId(keyHolder.getKey().intValue());\n return team;\n }", "@Override @Transactional\n public Game createGame(LocalDate date, LocalTime time, String venue, String location, Set<UserAccount> users) {\n Game game = new Game(date, time, venue, location, users);\n gameDataAccess.save(game);\n return game;\n }", "@Test\r\n\tpublic void saveTeam() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeam \r\n\t\tTeam team = new wsdm.domain.Team();\r\n\t\tservice.saveTeam(team);\r\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.leagueeditor);\n \n //Set Widget Objects\n txtLeague = (EditText)findViewById(R.id.txtLeague);\n btnAddLeague = (Button)findViewById(R.id.btnAddLeague);\n lstLeagues = (ListView)findViewById(R.id.lstLeagues);\n \n btnAddLeague.setOnClickListener(new View.OnClickListener()\n {\n \t@Override\n\t\t\tpublic void onClick(View v)\n \t{\n \t\tif(txtLeague.getText().toString().length() == 0)\n \t\t{\n \t\t\tToast.makeText(LeagueEditor.this, \"League Must Have A Name\", Toast.LENGTH_SHORT).show();\n \t\t}\n \t\telse\n \t\t{\n \t\t\tContentValues values = new ContentValues(1);\n \t\tvalues.put(LeagueConn.Constants.BOWLING_LEAGUE_NAME, txtLeague.getText().toString());\n \t\tgetContentResolver().insert(LeagueConn.Constants.CONTENT_URI, values);\n \t\tBindGrid();\n \t\t\tToast.makeText(LeagueEditor.this, \"League Has Been Entered\", Toast.LENGTH_SHORT).show();\n \t\t}\n \t}\n\t\t});\n \n BindGrid();\n }", "public void insertTeam(Team team) {\n\t\ttry {\n\t\t\tStatement statement = null;\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\tjava.sql.Date tDate = new java.sql.Date(team.getDateFoundation().getTime());\n\t\t\tString insertTeam_sql = \"INSERT INTO \" + team_table + \" (id, name, coach, city, dateFoundation)\"\n\t\t\t\t\t+ \"VALUES (NULL, '\" + team.getName() + \"' , '\" + team.getCoach() + \"' , '\" + team.getCity()\n\t\t\t\t\t+ \"' , '\" + tDate + \"')\";\n\t\t\tstatement.executeUpdate(insertTeam_sql);\n\t\t} catch (SQLException e) {\n\t\t\tif (e.getErrorCode() == MYSQL_DUPLICATE_PK) {\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(\"Error\");\n\t\t\t\talert.setHeaderText(\"Duplicity Error\");\n\t\t\t\talert.setContentText(\"This team is already in our database\");\n\t\t\t\talert.showAndWait();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "int insert(WizardValuationHistoryEntity record);", "@Test\r\n\tpublic void saveTeamGamesForVisitorTeamFk() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamGamesForVisitorTeamFk \r\n\t\tInteger teamId_4 = 0;\r\n\t\tGame related_gamesforvisitorteamfk = new wsdm.domain.Game();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamGamesForVisitorTeamFk(teamId_4, related_gamesforvisitorteamfk);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamGamesForVisitorTeamFk\r\n\t}", "public void addNewPassenger() throws SQLException {\n\t\tScanner input = new Scanner(System.in);\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = connUtil.getConnection();\n\t\t\t// call needed DAOs here\n\t\t\tPassengerDAO pdao = new PassengerDAO(conn);\n\t\t\tFlightDAO fdao = new FlightDAO(conn);\n\t\t\tRouteDAO rdao = new RouteDAO(conn);\n\t\t\tAirportDAO apodao = new AirportDAO(conn);\n\t\t\tAirplaneDAO apldao = new AirplaneDAO(conn);\n\n\t\t\tPassenger passenger = new Passenger();\n\t\t\tpassenger.setId(pdao.nextAvailableId());\n\t\t\tpassenger.setBookingId(1);\n\n\t\t\t// Sets passenger name\n\t\t\tSystem.out.println(\"Enter the passenger given name\");\n\t\t\tpassenger.setGivenName(input.nextLine());\n\t\t\tSystem.out.println(\"Enter the passenger family name\");\n\t\t\tpassenger.setFamilyName(input.nextLine());\n\n\t\t\t// Sets birthday\n\t\t\tSystem.out.println(\"Enter DOB (yyyy-mm-dd)\");\n\t\t\tDate date = Date.valueOf(input.nextLine());\n\t\t\tpassenger.setDob(date);\n\n\t\t\t// Sets gender\n\t\t\tSystem.out.println(\"Enter gender (male/female/other)\");\n\t\t\tpassenger.setGender(input.nextLine());\n\n\t\t\t// Sets address\n\t\t\tSystem.out.println(\"Enter the address of the passenger\");\n\t\t\tpassenger.setAddress(input.nextLine());\n\n\t\t\t// Adds passenger to passenger table\n\t\t\tpdao.addPassenger(passenger);\n\n\t\t\tconn.commit();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tconn.rollback();\n\t\t} finally {\n\t\t\tconn.close();\n\t\t}\n\t}", "public void insertCourse(){\n \n }", "@Test\r\n\tpublic void testCreateMatchToMatchLeaguePlayGame() {\n\t\tassertTrue(\"New match to match league play game not created\", false);\r\n\t\tassertTrue(false);\r\n\t}", "void createNewGame() {\n _gameList.add(new GameObject());\n Log.i(\"createGame\", \"Created New Game\");\n }", "public abstract boolean createGame(int nbplayers, boolean status, String creator) throws SQLException;", "public void insertTournamentMatchesToDB(String res) throws JSONException {\n Matches match = new Matches();\n System.out.println(\"calling from socketServer ...\");\n //convert res json Array\n JSONArray jsonArray = new JSONArray(res);\n //iterate JSONobj in the array inserting the to DB..\n for (int i = 0; i < jsonArray.length(); i++) {\n //System.out.println(\"from for loop the OBJECT\");\n JsonParser parser = new JsonParser();\n JsonElement json = parser.parse(jsonArray.get(i).toString());\n JsonObject object = json.getAsJsonObject();\n object.toString();\n match.setId(object.get(\"id\").getAsString());\n match.setType(object.get(\"type\").getAsString());\n match.setDiscipline(object.get(\"discipline\").getAsString());\n match.setStatus(object.get(\"status\").getAsString());\n match.setTournamentId(object.get(\"tournament_id\").getAsString());\n match.setNumber(object.get(\"number\").getAsInt());\n match.setStageNumber(object.get(\"stage_number\").getAsInt());\n match.setGroupNumber(object.get(\"group_number\").getAsInt());\n match.setRoundNumber(object.get(\"round_number\").getAsInt());\n\n match.setTimezone(\"FI\");\n\n match.setMatchFormat(\"knockout\");\n match.setOpponents(object.get(\"opponents\").toString());\n \n dbs.insert(match);\n }\n }", "public Level create(Long id,String level){\n \n System.out.println(\"level\"+level);\n Level l=new Level(1,\"Beginner\");\n Level l2=new Level(2,\"Intermediate\");\n Level l3=new Level(3,\"professional\");\n levelRepository.save(l);\n levelRepository.save(l2);\n return levelRepository.save(l3);\n \n }", "@Override\r\n\t@Transactional(propagation=Propagation.REQUIRED)\r\n\tpublic void add(Team team) {\n\t\tentityManager.createQuery(\"insert into Team(id, name) values (team.id, team.name)\");\r\n\t}", "int insert(SmsEmployeeTeam record);", "public static boolean getLeagueForEdit(LeagueBean l) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement getLeague = null;\t\t// SQL query\r\n\t\tResultSet rs = null;\t\t\t\t\t// returned query result set\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tgetLeague = conn.prepareStatement(\"SELECT leagueName, leaguePlayoffs, leaguePlayoffTeams, leagueStatus from league WHERE leagueId=?\");\r\n\t\t\tgetLeague.setString(1, l.getLeagueId());\r\n\t\t\trs = getLeague.executeQuery();\r\n\r\n\t\t\tif(rs.next()) {\r\n\t\t\t\tl.setLeagueName(rs.getString(1));\r\n\t\t\t\tl.setLeaguePlayoffs(rs.getString(2));\r\n\t\t\t\tl.setLeaguePlayoffTeams(rs.getString(3));\r\n\t\t\t\tl.setStatus(rs.getString(4));\r\n\t\t\t\tstatus = true;\r\n\t\t\t}\r\n\r\n\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (getLeague != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tgetLeague.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public void onLeagueSelectionCreate(ActionEvent actionEvent) throws SQLException {\n if(chooseLeagueBoxCreate.getValue() != null){\n chooseLeagueTeamBoxCreate.setDisable(false);\n ObservableList<String> teamList = DatabaseManager.getLeagueTeams(user, chooseCityBoxCreate.getValue().toString(), chooseAgeGroupCreate.getValue().toString(), chooseLeagueBoxCreate.getValue().toString());\n chooseLeagueTeamBoxCreate.getSelectionModel().clearSelection();\n chooseLeagueTeamBoxCreate.setButtonCell(new ListCell<String>() {\n @Override\n protected void updateItem(String item, boolean empty) {\n super.updateItem(item, empty) ;\n if (empty || item == null) {\n setText(\"Choose Team\");\n } else {\n setText(item);\n }\n }\n });\n if(teamList.size() != 0){\n chooseLeagueTeamBoxCreate.getItems().addAll(teamList);\n }\n }\n }", "public Team create(TeamDTO teamForm);", "private static boolean transactionAddGame(Transaction tx, GameBean newGame) {\n HashMap<String, Object> parameters = new HashMap<>();\n parameters.put(\"name\", newGame.getName());\n if(!newGame.getCategory1().equals(\"\")) {\n parameters.put(\"category1\", newGame.getCategory1() );\n\n String checkGame = \"MATCH (g:Game{name:$name})\" +\n \" RETURN g\";\n\n Result result = tx.run(checkGame, parameters);\n\n if (result.hasNext()) {\n return false;\n }\n\n result = tx.run(\"CREATE (g:Game{name:$name, category1:$category1})\"\n , parameters);\n\n return true;\n }\n\n return false;\n }", "private void save() {\n Saver.saveTeam(team);\n }", "@ApiOperation(\"Creates a Team\")\n @PostMapping(\"/API/v1/team\")\n public ResponseEntity<TeamAPI> createTeam(@RequestParam String nombreEquipo){\n TeamString salida = teamService.crearTeam(nombreEquipo, false);\n\n if(salida.getSalida().equals(\"OK\")){\n return new ResponseEntity<>(salida.getTeam().toTeamAPI(), HttpStatus.OK);\n }\n else {\n return new ResponseEntity(salida.getSalida(), HttpStatus.NOT_FOUND);\n }\n\n }", "public void createTeamMemberEntity(String fName, String lname, String gamertag, int age,\n String gender, String position, String mainChampion) {\n LOGGER.fine(\"Creating TeamMember object\");\n\n TeamMember player = new TeamMember();\n player.setfName(fName);\n player.setlName(lname);\n player.setGamertag(gamertag);\n player.setAge(age);\n Gender genderEnum = Gender.valueOf(gender);\n player.setGender(genderEnum);\n Position positionEnum = Position.valueOf(position);\n player.setPosition(positionEnum);\n player.setMainChampion(mainChampion);\n\n LOGGER.fine(\"Persisting TeamMember object to DB\");\n this.entityManager.persist(player);\n\n }", "public void createTeam(){\n\n if(!(validation())){\n return;\n }\n\n final ProgressDialog progressDialog = new ProgressDialog(getActivity());\n progressDialog.setMessage(\"Loading...\");\n progressDialog.show();\n\n RequestQueue requestQueue = Volley.newRequestQueue(getActivity());\n StringRequest stringRequest = new StringRequest(Request.Method.POST, \"http://192.169.138.14:4000/api/teams/create\", new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.v(\"qwe\", response);\n progressDialog.dismiss();\n Gson gson = new Gson();\n TeamSucessWithId sucessResponse = gson.fromJson(response, TeamSucessWithId.class);\n String _message = sucessResponse.getMessage();\n int _status = sucessResponse.getStatus();\n int teamId = sucessResponse.getTeamId();\n //Toast.makeText(getActivity(), _status+\": \"+_message+\" \"+teamId, Toast.LENGTH_LONG).show();\n if(_status == 200){\n Toast.makeText(getActivity(), _status+\": \"+_message+\" \", Toast.LENGTH_LONG).show();\n Prefs.putString(getActivity(), Prefs.TEAM_LOGO, logoBitmap);\n Prefs.putString(getActivity(), Prefs.HOME_SHIRT, homeImgBitmap);\n Prefs.putString(getActivity(), Prefs.AWAY_SHIRT, awayShirtBitmap);\n Prefs.putString(getActivity(), Prefs.TEAM_NAME, teamName.getText().toString());\n Prefs.putString(getActivity(), Prefs.COACH, coachName.getText().toString());\n Prefs.putString(getActivity(), Prefs.COLOR, currentColor+\"\");\n Prefs.putString(getActivity(), Prefs.CITY_ID, mCity_Id+\"\");\n Prefs.putString(getActivity(), Prefs.FIELD_ID, \"\"+mField_Id);\n Prefs.putString(getActivity(), Prefs.TEAM_ID, teamId+\"\");\n startActivity(new Intent(getActivity(), InvitePlayerActivity.class));\n }else {\n\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Log.v(\"wsx\", \"======== \"+error+\"\");\n Toast.makeText(getActivity(), \"Unable to connect...\", Toast.LENGTH_LONG).show();\n }\n }){\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n HashMap<String, String> headers = new HashMap<>();\n headers.put(\"x-access-key\", Globels.ACCESS_KEY);\n headers.put(\"x-access-token\", Prefs.getString(getActivity(), Prefs.auth_key));\n headers.put(\"locale\", Globels.LOCAL);\n headers.put(\"Content-Type\", Globels.CONTENT_TYPE);\n return headers;\n }\n\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n //EditText teamName, colorName, coachName, groundName, teamCity;ss\n\n Log.v(\"kkk\", \"city====\"+mCity_Id);\n Log.v(\"jjj\", \"Field====\"+mField_Id);\n\n params.put(\"team_name\", teamName.getText().toString());\n params.put(\"color\", currentColor+\"\");\n params.put(\"coach\", coachName.getText().toString());\n// params.put(\"team_name\", \"dsfs\");\n// params.put(\"color\", \"\"+currentColor);\n// params.put(\"coach\", \"dsfs\");\n params.put(\"city\", \"\"+mCity_Id);\n params.put(\"shirt_home\", homeImgBitmap);\n params.put(\"shirt_away\", awayShirtBitmap);\n params.put(\"logo\", logoBitmap);\n params.put(\"found_date\", \"2017-05-15\");\n params.put(\"country\", \"1\");\n params.put(\"avg_age\", \"\");\n params.put(\"city_flexible\", \"0\");\n params.put(\"field_flexible\", \"0\");\n params.put(\"field_id\", \"\"+mField_Id);\n return params;\n }\n };;\n\n requestQueue.add(stringRequest);\n }", "public int getLeagueId() {\n return leagueId;\n }", "@Test\r\n\tpublic void saveTeamTeamplayerses() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamTeamplayerses \r\n\t\tInteger teamId_7 = 0;\r\n\t\tTeamplayers related_teamplayerses = new wsdm.domain.Teamplayers();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamTeamplayerses(teamId_7, related_teamplayerses);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamTeamplayerses\r\n\t}", "public static boolean deleteLeague(String lId) {\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t Connection conn = null;\t\t\t\t\t// DB Connection\r\n\t PreparedStatement deleteLXD = null;\r\n\t PreparedStatement deleteLeague = null;\r\n\t int result = 0;\r\n\t\r\n\t // Connect to Database \r\n\t try {\r\n\t conn = ConnectionManager.getConnection();\r\n\t deleteLXD = conn.prepareStatement(\"DELETE FROM leaguexdivision USING leaguexdivision, league WHERE `league`.`leagueID` = `leaguexdivision`.`leagueID` AND league.leagueID=?\");\r\n\t deleteLXD.setString(1, lId);\r\n\t result = deleteLXD.executeUpdate();\r\n\t if(result >= 0) {\r\n\t \tdeleteLeague = conn.prepareStatement(\"DELETE FROM league USING league WHERE league.leagueID=?\");\r\n\t \tdeleteLeague.setString(1, lId);\r\n\t\t result = deleteLeague.executeUpdate();\t \r\n\t\t if(result >= 0) {\t\t \t\r\n\t \t\tstatus = true;\t \t\t\r\n\t \t}\r\n\t }\r\n\t \r\n\t // Catch all possible Exceptions\r\n\t } catch (Exception e) {\r\n\t System.out.println(e);\r\n\t } finally {\r\n\t if (conn != null) {\r\n\t try {\r\n\t conn.close();\r\n\t } catch (SQLException e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t if (deleteLXD != null) {\r\n\t try {\r\n\t \tdeleteLXD.close();\r\n\t } catch (SQLException e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t if (deleteLeague != null) {\r\n\t try {\r\n\t \tdeleteLeague.close();\r\n\t } catch (SQLException e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t }\t \r\n\t return status;\r\n\t}", "public void addBestelling(Bestelling bestelling) {\n\r\n DatabaseConnection connection = new DatabaseConnection();\r\n if(connection.openConnection())\r\n {\r\n // If a connection was successfully setup, execute the INSERT statement\r\n\r\n connection.executeSQLInsertStatement(\"INSERT INTO bestelling (`bestelId`, `tafelId`) VALUES(\" + bestelling.getId() + \",\" + bestelling.getTafelId() + \");\");\r\n\r\n for(Drank d : bestelling.getDranken()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO drank_bestelling (`DrankID`, `BestelId`, `hoeveelheid`) VALUES (\" + d.getDrankId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n for(Gerecht g : bestelling.getGerechten()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO gerecht_bestelling (`GerechtID`, `BestelId`, `hoeveelheid`) VALUES (\" + g.getGerechtId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n\r\n //Close DB connection\r\n connection.closeConnection();\r\n }\r\n\r\n }", "@Test\n @Transactional\n public void createTeamWithExistingId() throws Exception {\n int databaseSizeBeforeCreate = teamRepository.findAll().size();\n\n // Create the Team with an existing ID\n team.setId(1L);\n TeamDTO teamDTO = teamMapper.toDto(team);\n\n // An entity with an existing ID cannot be created, so this API call\n // must fail\n restTeamMockMvc\n .perform(post(\"/api/teams\").contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(teamDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Team in the database\n List<Team> teamList = teamRepository.findAll();\n assertThat(teamList).hasSize(databaseSizeBeforeCreate);\n }", "int insertSelective(SysTeam record);", "@WebMethod public Team addTeam(String name) throws TeamAlreadyExists;", "private void initTableTeams(Connection db_connection) throws SQLException {\n //System.out.printf(\"Adding records to the table *teams*.%n\");\n /*\n * Use PreparedStatement as a template.\n */\n String sql = \"INSERT INTO teams VALUES (?, ?, ?, ?, ?, ?);\";\n PreparedStatement statement_prepared = db_connection.prepareStatement(sql);\n statement_prepared.setString(2, \"Atlanta Hawks\");\n statement_prepared.setString(3, \"East\");\n statement_prepared.setString(4, \"Southeast\");\n statement_prepared.setString(5, \"Philips Arena\");\n statement_prepared.setString(6, \"1\"); // Atlanta\n statement_prepared.addBatch();\n statement_prepared.setString(2, \"Boston Celtics\");\n statement_prepared.setString(3, \"East\");\n statement_prepared.setString(4, \"Atlantic\");\n statement_prepared.setString(5, \"TD Garden\");\n statement_prepared.setString(6, \"2\"); // Boston\n statement_prepared.addBatch();\n statement_prepared.setString(2, \"Los Angeles Clippers\");\n statement_prepared.setString(3, \"West\");\n statement_prepared.setString(4, \"Pacific\");\n statement_prepared.setString(5, \"Staples Center\");\n statement_prepared.setString(6, \"4\"); // Los Angeles\n statement_prepared.addBatch();\n statement_prepared.setString(2, \"Los Angeles Lakers\");\n statement_prepared.setString(3, \"West\");\n statement_prepared.setString(4, \"Pacific\");\n statement_prepared.setString(5, \"Staples Center\");\n statement_prepared.setString(6, \"4\"); // Los Angeles\n statement_prepared.addBatch();\n /*\n * Commit once the whole batch is executed.\n */\n db_connection.setAutoCommit(false);\n statement_prepared.executeBatch();\n db_connection.setAutoCommit(true);\n }", "public void createGame(View view) {\n EditText editText = (EditText) findViewById(R.id.enter_game_keyword);\n gameName = editText.getText().toString();\n\n if (!nameEntered(gameName)) {\n return;\n }\n GameNameHandler.createGameHandler(this,gameName, getPlayerName());\n saveInPreferences(gameName);\n }", "public static void addTeam(TeamForm tf) {\n Team team;\n\n long id = tf.id;\n\n if (!isTeam(id)) {\n team = new Team(tf.teamName, tf.location, tf.teamType, tf.skillLevel, tf.roster, tf.description, tf.imageUrl);\n team.save();\n }\n else {\n team = getTeam(id);\n team.setTeamName(tf.teamName);\n team.setLocation(tf.location);\n team.setTeamType(tf.teamType);\n team.setSkillLevel(tf.skillLevel);\n team.setRoster(tf.roster);\n team.setDescription(tf.description);\n team.setImageUrl(tf.imageUrl);\n team.setWins(tf.wins);\n team.setLosses(tf.losses);\n team.setPointsFor(tf.pointsFor);\n team.setPointsAgainst(tf.pointsAgainst);\n team.save();\n }\n }", "void createNewGame(Player player);", "public team(int teamID, String teamName, String mascot, int games, int wins, int loses) throws SQLException {\n\t\tthis.teamID = teamID;\n\t\tthis.teamName = teamName;\n\t\tthis.mascot = mascot;\n\t\tthis.games = games;\n\t\tthis.wins = wins;\n\t\tthis.loses = loses;\n\t\tconn = DriverManager.getConnection(DB_URL);\n\t\tStatement stmt = conn.createStatement();\n\t\t \n\t\t stmt.executeUpdate(\"INSERT INTO Team VALUES (\" +\n\t this.teamID + \", '\" +\n\t this.teamName + \"', '\" + \n\t this.mascot + \"', \" +\n\t this.games + \", \" +\n\t this.wins + \", \" +\n\t this.loses +\n\t \")\");\n\t\t \n\t\t conn.close();\n\t stmt.close();\n\t}", "public void createTeam(final Map<String, String> dataTable) {\n team.processInformation(dataTable);\n WebDriverHelper.waitUntil(inputTeamName);\n WebDriverHelper.setElement(inputTeamName, team.getName());\n WebDriverHelper.clickElement(dropDownTeamType);\n selectDropDownOptionByName(team.getType());\n WebDriverHelper.setElement(inputTeamDescription, team.getDescription());\n WebDriverHelper.clickElement(btnContinue);\n WebDriverHelper.waitUntil(btnThisLater);\n WebDriverHelper.clickElement(btnThisLater);\n }", "@Test\r\n\tpublic void addToDb() {\r\n\t\tservice.save(opinion);\r\n\t\tassertNotEquals(opinion.getId(), 0);\r\n\t\tassertTrue(service.exists(opinion.getId()));\r\n\t}", "public static void addTeamLeader(Scanner input, ArrayList<Employee> newEmployee){\n \n TeamLeader newTeamLeader = new TeamLeader();\n \n String empNumber, empHireDate, monthlyBonus, trainingHours, payRate, shift, requiredTrainingHours;\n int shiftNum;\n \n System.out.print(\"Please enter the employee's first and last name: \");\n newTeamLeader.setName(input.nextLine());\n System.out.print(\"Please enter the new employee's Employee Number.\\nThe Employee Number must match XXX-L including the dash where X is a digit and L is a letter A-M: \");\n empNumber = input.nextLine();\n newTeamLeader.setNumber(verifyEmpNum(input, empNumber));\n System.out.print(\"Please enter the new employee's hire date.\\nMake sure the date you enter matches IX/XX/XXXX including the slashes\\nwhere I is a 0 or 1 and X is a digit 0-9: \");\n empHireDate = input.nextLine();\n newTeamLeader.setDate(verifyHireDate(input, empHireDate));\n System.out.print(\"Please enter the Production Team Leader's shift, 1 for day shift and 2 for night shift: \");\n shift = input.nextLine();\n shiftNum = UtilityMethods.verifyInt(input, shift);\n newTeamLeader.setShift(verifyShift(input, shiftNum));\n System.out.print(\"Please enter the pay rate of the Production Team Leader as a double: \");\n payRate = input.nextLine();\n newTeamLeader.setPayRate(UtilityMethods.verifyDouble(input, payRate));\n System.out.print(\"Please enter the monthly bonus that the Team Leader could receive: \");\n monthlyBonus = input.nextLine();\n newTeamLeader.setMonthlyBonus(UtilityMethods.verifyDouble(input, monthlyBonus));\n System.out.print(\"Please enter the number of training hours that the Team Leader requires as an integer: \");\n requiredTrainingHours = input.nextLine();\n newTeamLeader.setRequiredTrainingHours(UtilityMethods.verifyInt(input, requiredTrainingHours));\n System.out.print(\"Please enter the number of hours that the Team Leader has already acquired: \");\n trainingHours = input.nextLine();\n newTeamLeader.setTrainingHours(UtilityMethods.verifyInt(input, trainingHours));\n \n newEmployee.add(newTeamLeader);\n }", "public void createNewTeam(ActionEvent actionEvent) throws IOException {\n createTeamPane.setDisable(false);\n createTeamPane.setVisible(true);\n darkPane.setDisable(false);\n darkPane.setVisible(true);\n\n teamNameCreateField.setText(\"\");\n abbrevationCreateField.setText(\"\");\n chooseCityBoxCreate.getSelectionModel().clearSelection();\n chooseLeagueBoxCreate.getSelectionModel().clearSelection();\n chooseAgeGroupCreate.getSelectionModel().clearSelection();\n chooseLeagueTeamBoxCreate.getSelectionModel().clearSelection();\n\n chooseLeagueBoxCreate.setDisable(true);\n chooseLeagueTeamBoxCreate.setDisable(true);\n }", "int insert(ExamRoom record);", "int insert(Tour record);", "@Test\r\n\tpublic void saveGame() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: saveGame \r\n\t\tGame game = new tsw.domain.Game();\r\n\t\tTswacct tswAcct = null;\r\n\t\tservice.saveGame(tswAcct, game, null);\r\n\t}", "static public void set_team_data(String league){\n\n\t\tEdit_row_window.attrs = new String[]{\"team name:\", \"rating:\", \"release year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_players p, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.player_id=p.id and pt.team_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_player desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\" from curr_\"+league+\"_players p \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"player name\", \"rating\", \"birth year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. birth year:\";\n\t\tEdit_row_window.linked_category_name = \"PLAYERS\";\n\t}", "private LeagueSeasonDBAccess() {\n\n }", "@Override\n public Room create(RoomResponseDTO roomResponseDTO) {\n return roomRepository.save(new Room(\n roomResponseDTO.getClassroomNumber()\n ));\n }", "public void create(Lobby lobby) {\n for (LobbyPlayer player : lobby.getPlayers()) Firebase.registerListener(\"lobbies/\" + player.getLobbyCode(), onLobbyChange);\n Firebase.setDocument(\"lobbies/\" + lobby.getGameCode(), LobbyDTO.fromModel(lobby));\n }", "private int createAndAddLobby(int maxPlayers, String lobbyName, int trackID){\n\n\t\tDebugOutputHandler.printDebug(\"A new Lobby has been created\");\n\t\tLobby newLobby = new Lobby(++lobbyIdCounter, maxPlayers, lobbyName, trackID, this);\n\t\tif(lobbyMap.get(lobbyIdCounter) == null){\n\t\t\tlobbyMap.put(lobbyIdCounter, newLobby);\n\t\t\treturn lobbyIdCounter;\n\t\t}else{\n\t\t\treturn -1;\n\t\t}\n\t}", "public void insertMatch(Match match) {\n\t\ttry {\n\t\t\tStatement statement = null;\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\tjava.sql.Date mDate = new java.sql.Date(match.getDate().getTime());\n\t\t\tString insertMatch_sql = \"INSERT INTO \" + match_table + \" (id, idHome, idAway, matchDate, referee)\"\n\t\t\t\t\t+ \"VALUES (NULL, '\" + getTeamId(match.getTeamHome()) + \"' , '\" + getTeamId(match.getTeamAway())\n\t\t\t\t\t+ \"' , '\" + mDate + \"' , '\" + match.getReferee() + \"')\";\n\t\t\tstatement.executeUpdate(insertMatch_sql);\n\t\t} catch (SQLException e) {\n\t\t\tif (e.getErrorCode() == MYSQL_DUPLICATE_PK) {\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(\"Error\");\n\t\t\t\talert.setHeaderText(\"Duplicity Error\");\n\t\t\t\talert.setContentText(\"This team is already in our database\");\n\t\t\t\talert.showAndWait();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "@PostMapping(\"/createNewUser/{gameId}\")\n public User addNewUser(@RequestBody User user, HttpServletResponse response) throws IOException {\n User addedUser = userDao.addUser(user);\n List<User> usersOfCurrentGame = currentGame.getUsers();\n usersOfCurrentGame.add(addedUser);\n currentGame.setUsers(usersOfCurrentGame);\n if (usersOfCurrentGame.size() > 2) {\n response.setStatus(200);\n } else {\n response.sendError(418, \"User Added to Game. Game is not ready to start\");\n }\n\n return new User();\n }", "int insert(TrainingCourse record);", "public Long createGame() {\n Game game;\n synchronized (this.games) {\n Long id = this.sessionService.incrementGameId();\n\n game = new Game(id,\n new ArrayList<>(), new ArrayList<>());\n\n this.games.put(id, game);\n }\n this.save(game);\n\n return game.getGameIdentifier();\n }", "private void saveVslaInformation() {\n if (!databaseHandler.checkIfGroupExists(vslaName)) { // Group Doesn't exist in the database\n\n VslaInfo vslaInfo = new VslaInfo();\n vslaInfo.setGroupName(vslaName);\n vslaInfo.setMemberName(representativeName);\n vslaInfo.setMemberPost(representativePost);\n vslaInfo.setMemberPhoneNumber(repPhoneNumber);\n vslaInfo.setGroupAccountNumber(grpBankAccount);\n vslaInfo.setPhysicalAddress(physAddress);\n vslaInfo.setRegionName(regionName);\n vslaInfo.setLocationCordinates(locCoordinates);\n vslaInfo.setIssuedPhoneNumber(grpPhoneNumber);\n vslaInfo.setSupportType(grpSupportType);\n vslaInfo.setIsDataSent(\"0\");\n vslaInfo.setNumberOfCycles(numberOfCycles);\n\n // get the Id of the Group just added to the database\n currentDatabaseId = databaseHandler.addGroupData(vslaInfo);\n flashMessage(\"Data Saved Successfully\");\n\n } else {\n flashMessage(\"Group Already Exists\");\n }\n }", "@RequestMapping(method=RequestMethod.POST)\n public ResponseEntity<Void> insert(@RequestBody TeamDTO objDto) {\n Team obj = this.teamService.fromDTO(objDto);\n this.teamService.insert(obj);\n URI uri = ServletUriComponentsBuilder.fromCurrentRequest()\n .path(\"/{id}\").buildAndExpand(obj.getId()).toUri();\n return ResponseEntity.created(uri).build();\n }", "public void createRoom(LoadingDialog load, String code, String nickname, DataSnapshot roomToHaveAccess) {\n DatabaseReference roomRef = firebaseDatabase.getReference(ROOMS_NODE + \"/\" + code);\n room = new Room(nickname,EMPTY_STRING,0,0,0,0,0,0,false,0,0,0,0,0,3);\n\n roomRef.setValue(room, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n ref.child(PLAYER2_NODE).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot fieldPlayer2) {\n if(fieldPlayer2.getValue() != null){\n if(! fieldPlayer2.getValue().equals(EMPTY_STRING)){\n // il giocatore accede alla stanza poichè passa tutti i controlli sulla disponibilità del posto in stanza\n load.dismissDialog();\n Intent intent = new Intent(MultiplayerActivity.this,ActualGameActivity.class);\n intent.putExtra(CODE_ROOM_EXTRA,code);\n intent.putExtra(CODE_PLAYER_EXTRA,ROLE_PLAYER1);\n ref.child(PLAYER2_NODE).removeEventListener(this);\n startActivity(intent);\n }\n } else {\n ref.child(PLAYER2_NODE).removeEventListener(this);\n }\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n OfflineFragment offlineFragment = new OfflineFragment();\n offlineFragment.show(getSupportFragmentManager(),\"Dialog\");\n }\n });\n\n }\n });\n\n\n\n }", "private RefereesInLeagueDBAccess() {\n\n }", "public void createNewTable(){\n Connection conn = null;\n Statement stmt = null;\n try{\n //STEP 2: Register JDBC driver\n System.out.println(\"Registered JDBC driver...\");\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n //STEP 3: Open a connection\n System.out.println(\"Connecting to database...\");\n conn = DriverManager.getConnection(DB_URL);//acceses the database specified by the url through entering in the username and password\n System.out.println(\"Creating statement...\");\n stmt = conn.createStatement(); //access the database server and manipulate data in database\n String sql = \"CREATE TABLE EXPERIENCE_\"+gameNumber+\n \" (Id INT PRIMARY KEY AUTO_INCREMENT,\"+\n \"player VARCHAR(255), \" +\n \" bigsquare INTEGER, \" + \n \" smallsquare INTEGER)\";\n System.out.println(\"SUCCCESSS!\"+gameNumber+ \" yayyyY!\");\n stmt.executeUpdate(sql);\n System.out.println(\"sweeeeeeeeeet....\");\n stmt.close();\n conn.close(); \n }catch(SQLException se){\n //Handle errors for JDBC\n se.printStackTrace();\n }catch(Exception e){\n //Handle errors for Class.forName\n e.printStackTrace();\n }finally{\n //finally block used to close resources\n try{\n if(stmt!=null)\n stmt.close();\n }catch(SQLException se2){\n }// nothing we can do\n try{\n if(conn!=null)\n conn.close();\n }catch(SQLException se){\n se.printStackTrace();\n }//end finally try\n }//end try\n \n \n }", "public void createNewHouseAndAddToList(){\n\t\t\tHouse newHouse = new House();\r\n\t\t\tString id = createAutomaticallyID().trim();\r\n\t\t\tnewHouse.setId(id);\r\n\t\t\tnewHouse.setPrice(Double.parseDouble(priceTextField.getText().trim()));\r\n\t\t\tnewHouse.setNumberOfBathrooms(Integer.parseInt(bathroomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setAirConditionerFeature(airConditionerComboBox.getSelectedItem().toString());\r\n\t\t\tnewHouse.setNumberOfRooms(Integer.parseInt(roomsTextField.getText().trim()));\r\n\t\t\tnewHouse.setSize(Double.parseDouble(sizeTextField.getText().trim()));\r\n\t\t\t\r\n\t\t\toriginalHouseList.add(newHouse);//first adding newHouse to arrayList\r\n\t\t\tcopyEstateAgent.setHouseList(originalHouseList);//then set new arrayList in copyEstateAgent\r\n\r\n\t\t}", "@Test\n\t@DatabaseSetup(value = \"classpath:databaseEntries.xml\", type = DatabaseOperation.CLEAN_INSERT)\n\tpublic void testCreateLecturer() {\n\t\t\n\t\t//Confirm table row count\n\t\tlecturerJdbcDaoSupport = (LecturerJdbcDaoSupport) autoWireContext.getBean(\"lecturerJdbcDaoSupport\");\n\t\tlecturerJdbcDaoSupport.createLecturer(\"L004\", \"Jim\", \"Murphy\", \"[email protected]\");\n\t\tint rowCount = lecturerJdbcDaoSupport.countRows();\n\t\tassertEquals(4, rowCount);\n\t}", "public void scheduleGamesInLeagues(String leagueName) {\n // Click this button after you have all the teams in league, Automatic scheduling\n // League league = get from DB by leagueName\n // league.scheduledGames();\n }", "@Override\n\tpublic void saveLane(Lane theLane) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\tcurrentSession.saveOrUpdate(theLane);\n\t}", "int insert(GirlInfo record);", "@Test\r\n\tpublic void saveTeamGamesForHomeTeamFk() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamGamesForHomeTeamFk \r\n\t\tInteger teamId_5 = 0;\r\n\t\tGame related_gamesforhometeamfk = new wsdm.domain.Game();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamGamesForHomeTeamFk(teamId_5, related_gamesforhometeamfk);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamGamesForHomeTeamFk\r\n\t}", "public void insertPlayer(Player player, int idTeam) {\n\t\ttry {\n\t\t\tStatement statement = null;\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\tjava.sql.Date pDate = new java.sql.Date(player.getDateOfBirth().getTime());\n\t\t\tString insertPlayer_sql = \"INSERT INTO \" + player_table\n\t\t\t\t\t+ \" (id, idTeam, name, lastname, dateOfBirth, height)\" + \"VALUES (NULL, \" + idTeam + \", '\"\n\t\t\t\t\t+ player.getName() + \"' , '\" + player.getLastname() + \"' , '\" + pDate + \"' , '\" + player.getHeight()\n\t\t\t\t\t+ \"')\";\n\t\t\tstatement.executeUpdate(insertPlayer_sql);\n\t\t} catch (SQLException e) {\n\t\t\tif (e.getErrorCode() == MYSQL_DUPLICATE_PK) {\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(\"Error\");\n\t\t\t\talert.setHeaderText(\"Duplicity Error\");\n\t\t\t\talert.setContentText(\"This player is already in our database\");\n\t\t\t\talert.showAndWait();\n\t\t\t} else {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void AddLid(LidPOJO lid) throws Exception {\n try {\n \tConnection connect = getConnection();\n\n\n preparedStatement = connect.prepareStatement(\"INSERT INTO Leden(Naam, Achternaam, Leeftijd, teamcode, password) VALUES(?, ?, ?, ?, ?)\");\n preparedStatement.setString(1, lid.getNaam());\n preparedStatement.setString(2, lid.getAchternaam());\n preparedStatement.setInt(3, lid.getLeeftijd());\n preparedStatement.setInt(4, lid.getTeamcode());\n preparedStatement.setString(5, lid.getPasw());\n\n\n\n\n preparedStatement.executeUpdate();\n connect.close();\n\n\n } catch (Exception e) {\n throw e;\n } finally {\n \tif (resultSet != null) {\n resultSet.close();\n }\n\n if (statement != null) {\n statement.close();\n } }\n\n }", "@Override\n\tpublic void add(Plane p) {\n\t\tString query = \"INSERT INTO fleet(model,planeid)\" + \"VALUES ('\" + p.getName() + \"',\" + p.getPlaneID() + \")\";\n\t\tDBManager.getInstance().addToDB(query);\n\t}", "public int createNewGame(boolean randomBoard, String username) {\n\n\t\t// To save the result that will be return by the query\n\t\tResultSet result;\n\t\tString randomBordBoolean;\n\t\tint newGameID = 0;\n\t\t// Convert boolean to String\n\t\tif (randomBoard) {\n\t\t\trandomBordBoolean = \"1\";\n\t\t} else {\n\t\t\trandomBordBoolean = \"0\";\n\t\t}\n\n\t\t// Get the new gameID\n\t\tnewGameID = this.getFirstEmptyID();\n\n\t\t// Save the new GameID\n\n\t\tString newGameIDString = Integer.toString(newGameID);\n\n\t\t// Execute create query\n\t\ttry {\n\t\t\tInvite iM = new Invite();\n\t\t\tint playerId = iM.getFirstFreeInteger();\n\t\t\tString playerToStart = Integer.toString(this.getPlayerToStart(newGameIDString));\n\n\t\t\t// Insert values\n\t\t\tString[] params1 = new String[THREE_PARAMETERS];\n\t\t\tparams1[0] = newGameIDString;\n\t\t\tparams1[1] = playerToStart;\n\t\t\tparams1[2] = randomBordBoolean;\n\n\t\t\tString[] params2 = new String[TWO_PARAMETERS];\n\t\t\tparams2[0] = newGameIDString;\n\t\t\tparams2[1] = randomBordBoolean;\n\n\t\t\tif (!playerToStart.equals(\"1\")) {\n\t\t\t\t// Execute query\n\t\t\t\tdC.updateInsertDelete(\n\n\t\t\t\t\t\t\"INSERT INTO spel (idspel, beurt_idspeler, israndomboard, eersteronde) VALUES (?, ?, ?, 1)\",\n\t\t\t\t\t\tparams1);\n\n\t\t\t} else {\n\t\t\t\t// Execute query\n\t\t\t\tdC.updateInsertDelete(\n\t\t\t\t\t\t\"INSERT INTO spel (idspel, beurt_idspeler, israndomboard, eersteronde) VALUES (?, null, ?, 1)\",\n\t\t\t\t\t\tparams2);\n\n\t\t\t}\n\t\t\tString[] params_speler = { Integer.toString(playerId), newGameIDString, username, \"rood\", \"uitdager\", \"0\",\n\t\t\t\t\t\"1\" };\n\n\t\t\tdC.updateInsertDelete(\n\t\t\t\t\t\"INSERT INTO speler (idspeler, idspel, username, kleur, speelstatus, shouldrefresh, volgnr) VALUES (?, ?, ?, ?, ?, ?, ?) \",\n\t\t\t\t\tparams_speler);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tthis.getPlayerToStart(Integer.toString(newGameID));\n\n\t\treturn newGameID;\n\n\t}", "public LeaguePrimaryKey() {\n }", "public static String newGame(final String token,\n final String teamA,\n final String teamB,\n final int gameType,\n final int ageCategory,\n final int court,\n final boolean mirrored) throws IOException {\n\n String NEW_GAME_URL = String.format(RestURI.CREATE_GAME.getValue(), Server.getIp(),\n URLEncoder.encode(teamA, \"UTF8\"),\n URLEncoder.encode(teamB, \"UTF8\"),\n gameType, ageCategory, court, mirrored, token);\n\n Request request = new Request.Builder()\n .url(NEW_GAME_URL)\n .post(emptyBody)\n .build();\n\n try (Response response = getHttpClient(30).newCall(request).execute()) {\n return getResponseMessage(response);\n }\n }", "int insert(AgentLevel record);", "public void generateDB() {\n\t\t// Database tables creation\n\t\tcreateTables();\n\n\t\t// Try catch estructure in case there is an exception during the data\n\t\t// insertion\n\t\ttry {\n\t\t\t// Create an admin user\n\t\t\tadminUser = new User(\"admin\", \"1234\", \"admin\", \"admin\", \"admin\", 1);\n\n\t\t\t// Create some default players\n\t\t\tString p1DateString = \"1988-05-12\";\n\t\t\tString p2DateString = \"1985-02-05\";\n\t\t\tString p3DateString = \"1987-06-24\";\n\t\t\tString p4DateString = \"1992-02-05\";\n\t\t\tDate p1Date = sdf.parse(p1DateString);\n\t\t\tDate p2Date = sdf.parse(p2DateString);\n\t\t\tDate p3Date = sdf.parse(p3DateString);\n\t\t\tDate p4Date = sdf.parse(p4DateString);\n\t\t\tp1 = new Player(\"Marcelo\", \"Vieira\", p1Date, 174);\n\t\t\tp2 = new Player(\"Cristiano\", \"Ronaldo\", p2Date, 185);\n\t\t\tp3 = new Player(\"Lionel\", \"Messi\", p3Date, 170);\n\t\t\tp4 = new Player(\"Neymar\", \"Silva\", p4Date, 175);\n\n\t\t\t// Create some default teams\n\t\t\tString t1DateString = \"1902-03-6\";\n\t\t\tString t2DateString = \"1985-02-05\";\n\t\t\tDate t1Date = sdf.parse(t1DateString);\n\t\t\tDate t2Date = sdf.parse(t2DateString);\n\t\t\tList<Player> t1Players = formatPlayers(getPlayersByTeamId(REAL_MADRID));\n\t\t\tList<Player> t2Players = formatPlayers(getPlayersByTeamId(BARCELONA));\n\t\t\tt1 = new Team(t1Players, \"Real Madrid C.F.\", \"Zinedine Zidane\", \"Madrid\", t1Date);\n\t\t\tt2 = new Team(t2Players, \"FC Barcelona\", \"Luis Enrique\", \"Barcelona\", t2Date);\n\n\t\t\t// Create some default stats\n\t\t\ts1 = new Stats(1, 1, 6, 15);\n\t\t\ts2 = new Stats(3, 1, 8, 18);\n\n\t\t\t// Create some default matches\n\t\t\tString m1DateString = \"2017-01-20\";\n\t\t\tString m2DateString = \"2017-03-06\";\n\t\t\tDate m1Date = sdf.parse(m1DateString);\n\t\t\tDate m2Date = sdf.parse(m2DateString);\n\t\t\tm1 = new Match(t2, t1, s1, m1Date, \"Alfonso Alvarez Izq\");\n\t\t\tm2 = new Match(t1, t2, s2, m2Date, \"Carlos Clos Gomez\");\n\n\t\t\t// Fill the database tables only if they are empty\n\t\t\tif (!usersFilled()) {\n\t\t\t\tinsertUser(adminUser);\n\t\t\t}\n\t\t\tif (!playersFilled()) {\n\t\t\t\tinsertPlayer(p1, REAL_MADRID);\n\t\t\t\tinsertPlayer(p2, REAL_MADRID);\n\t\t\t\tinsertPlayer(p3, BARCELONA);\n\t\t\t\tinsertPlayer(p4, BARCELONA);\n\t\t\t}\n\t\t\tif (!teamsFilled()) {\n\t\t\t\tinsertTeam(t1);\n\t\t\t\tinsertTeam(t2);\n\t\t\t}\n\t\t\tif (!matchesFilled() && !statsFilled()) {\n\t\t\t\tinsertStat(s1);\n\t\t\t\tinsertMatch(m1);\n\t\t\t\tinsertStat(s2);\n\t\t\t\tinsertMatch(m2);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public League setLeague(String leagueName) {\n logger.info(leagueName + \" was set\");\n return new League(leagueName);\n }", "@Override\n\tpublic void newGame(String level) {\n\t\tmanager.newGame(level);\n\t}", "int insert(HotelType record);", "int insert(UserCourseHistory record);", "public void insertMovesToDB(String gameType, Vector<Moves> allMovesForAGame) {\n int lastIndex = 0;\n try {\n\n DriverManager.registerDriver(new com.mysql.cj.jdbc.Driver());\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/xogames\", \"root\", \"Jrqr541&\");\n\n PreparedStatement pstmt = con.prepareStatement(\"INSERT INTO games(gameType) VALUE (?)\");\n pstmt.setString(1, gameType);\n int rowsAffected = pstmt.executeUpdate();\n pstmt.close();\n\n Statement stmt = con.createStatement();\n String queryString = new String(\"SELECT MAX(ID) FROM games\");\n ResultSet rs = stmt.executeQuery(queryString);\n\n while (rs.next()) {\n lastIndex = rs.getInt(1);\n }\n\n stmt.close();\n\n for (Moves move : allMovesForAGame) {\n\n PreparedStatement pstmt1 = con.prepareStatement(\"INSERT INTO steps(player,x,y,ID,step,finalState) VALUE (?,?,?,?,?,?)\");\n if (move.isPlayer()) {\n pstmt1.setInt(1, 1);\n } else {\n pstmt1.setInt(1, 0);\n }\n pstmt1.setInt(2, move.getX());\n pstmt1.setInt(3, move.getY());\n pstmt1.setInt(4, lastIndex);\n pstmt1.setInt(5, move.getStep());\n pstmt1.setInt(6, move.getFinalState());\n\n int rowsAffected1 = pstmt1.executeUpdate();\n pstmt1.close();\n\n }\n con.close();\n // System.out.println(\"elmafrood kda closed\");\n } catch (SQLException ex) {\n System.out.println(\"error in executing insert in toDB fn in SinglePlayerController 2 \" + ex);\n // ex.printStackTrace();\n }\n\n }", "int insert(Tourst record);", "@POST\n @Produces({\"application/json; charset=iso-8859-1\"})\n @Path(\"admin\")\n public Lehrer createLehrer(Lehrer l) {\n Log.d(\"Neuen Lehrer anlegen \" + l);\n em.persist(l);\n em.flush();\n return l;\n }", "public int addLead(String lead) {\n this.connect();\n String sql = \"INSERT INTO leads(name) VALUES(?)\";\n int id = 0;\n try (Connection conn = this.getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n pstmt.setString(1, lead);\n pstmt.executeUpdate();\n id = getLeadID(lead);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return id;\n }", "public synchronized void create(final Player valueObject) throws SQLException {\n\t\tString sql = \"\";\n\t\tPreparedStatement statement = null;\n\n\t\ttry {\n\t\t\tfinal Connection connection = _database.getConnection();\n\t\t\tsql = \"INSERT INTO \" + table_name + \" ( id, firstName, lastName, \" + \"emailAddress, gamerTag, birthDate) VALUES (?, ?, ?, ?, ?, ?) \";\n\t\t\tstatement = connection.prepareStatement(sql);\n\n\t\t\tstatement.setInt(STATEMENT_ONE, valueObject.getId());\n\t\t\tstatement.setString(STATEMENT_TWO, valueObject.getFirstName());\n\t\t\tstatement.setString(STATEMENT_THREE, valueObject.getLastName());\n\t\t\tstatement.setString(STATEMENT_FOUR, valueObject.getEmailAddress());\n\t\t\tstatement.setString(STATEMENT_FIVE, valueObject.getGamerTag());\n\t\t\tstatement.setDate(STATEMENT_SIX, new Date(valueObject.getBirthDate().getTime().getTime()));\n\n\t\t\tfinal int rowcount = update(statement);\n\t\t\tif (rowcount != ROW_COUNT_ONE) {\n\t\t\t\tthrow new SQLException(\"PrimaryKey Error when updating DB!\");\n\t\t\t}\n\t\t} finally {\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7339132", "0.6997958", "0.690974", "0.6814644", "0.6412496", "0.6251059", "0.6206461", "0.6155686", "0.61330205", "0.59283", "0.5871624", "0.5833373", "0.58259785", "0.58247626", "0.5662442", "0.56592786", "0.56428003", "0.56142956", "0.55852497", "0.5530802", "0.55037373", "0.550297", "0.5457445", "0.5451233", "0.5450808", "0.5450104", "0.54394996", "0.5423107", "0.54161763", "0.54063517", "0.540108", "0.5386512", "0.53863287", "0.5384738", "0.5366255", "0.53662306", "0.5365724", "0.53627205", "0.535137", "0.5328379", "0.5318962", "0.5313442", "0.53032154", "0.5302444", "0.5261309", "0.5258588", "0.5247421", "0.52458245", "0.52435553", "0.52400666", "0.52352357", "0.5232959", "0.52302897", "0.52274406", "0.5220127", "0.5206158", "0.5205926", "0.52040035", "0.5202488", "0.5197593", "0.5183842", "0.51782894", "0.5174471", "0.5174173", "0.5155851", "0.5150122", "0.5139982", "0.51355517", "0.51349217", "0.51281834", "0.51199275", "0.5118598", "0.51163876", "0.51036394", "0.50920707", "0.508697", "0.5086514", "0.5084909", "0.50806606", "0.50791734", "0.507558", "0.50678605", "0.50671846", "0.5061764", "0.50520605", "0.50514996", "0.5049033", "0.5038881", "0.5036116", "0.5035529", "0.5023758", "0.50172913", "0.5015468", "0.50024587", "0.5002436", "0.5001395", "0.49970797", "0.49965474", "0.49959937", "0.49897507" ]
0.68423885
3
The getLeagueForEdit method gets the league to be edited
public static boolean getLeagueForEdit(LeagueBean l) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement getLeague = null; // SQL query ResultSet rs = null; // returned query result set // Connect to Database try { conn = ConnectionManager.getConnection(); getLeague = conn.prepareStatement("SELECT leagueName, leaguePlayoffs, leaguePlayoffTeams, leagueStatus from league WHERE leagueId=?"); getLeague.setString(1, l.getLeagueId()); rs = getLeague.executeQuery(); if(rs.next()) { l.setLeagueName(rs.getString(1)); l.setLeaguePlayoffs(rs.getString(2)); l.setLeaguePlayoffTeams(rs.getString(3)); l.setStatus(rs.getString(4)); status = true; } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (getLeague != null) { try { getLeague.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public League getLeague()\n\t{\n\t\treturn league;\n\t}", "public int getLeagueId() {\n return leagueId;\n }", "static public void set_team_data(String league){\n\n\t\tEdit_row_window.attrs = new String[]{\"team name:\", \"rating:\", \"release year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_players p, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.player_id=p.id and pt.team_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_player desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\" from curr_\"+league+\"_players p \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"player name\", \"rating\", \"birth year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. birth year:\";\n\t\tEdit_row_window.linked_category_name = \"PLAYERS\";\n\t}", "public League getLeagueName() {\n return leagueName;\n }", "public Long getLeagueId() {\n return (this.leagueId);\n }", "public void editTeam(ActionEvent actionEvent) throws IOException, SQLException {\n teamNameEditField.setText(teamCombobox.getValue().getTeamName());\n abbrevationEditField.setText(teamCombobox.getValue().getAbbrevation());\n\n chooseAgeGroup.getSelectionModel().select(teamCombobox.getValue().getAgeGroup());\n chooseCityBox.getSelectionModel().select(teamCombobox.getValue().getCity());\n\n if (teamCombobox.getValue().getTeamLogo() != null) {\n logoChangeImage.setImage(teamCombobox.getValue().getTeamLogo().getImage());\n uploadTeamLogoButton.setText(\"Change Photo\");\n }\n\n editTeamPane.setDisable(false);\n editTeamPane.setVisible(true);\n darkPane.setDisable(false);\n darkPane.setVisible(true);\n\n chooseLeagueTeamBox.getItems().clear();\n chooseLeagueBox.getItems().clear();\n\n ObservableList<String> leagueList = DatabaseManager.getLeagues(user, chooseCityBox.getValue().toString(), chooseAgeGroup.getValue());\n chooseLeagueBox.getSelectionModel().clearSelection();\n chooseLeagueBox .setButtonCell(new ListCell<String>() {\n @Override\n protected void updateItem(String item, boolean empty) {\n super.updateItem(item, empty) ;\n if (empty || item == null) {\n setText(\"Choose League\");\n } else {\n setText(item);\n }\n }\n });\n if(leagueList.size() != 0){\n chooseLeagueBox.getItems().addAll(leagueList);\n }\n\n chooseLeagueBox.getSelectionModel().select(teamCombobox.getValue().getLeagueName());\n\n ObservableList<String> teamList = DatabaseManager.getLeagueTeams(user, chooseCityBox.getValue().toString(), chooseAgeGroup.getValue(), chooseLeagueBox.getValue().toString());\n chooseLeagueTeamBox.getSelectionModel().clearSelection();\n chooseLeagueTeamBox.setButtonCell(new ListCell<String>() {\n @Override\n protected void updateItem(String item, boolean empty) {\n super.updateItem(item, empty) ;\n if (empty || item == null) {\n setText(\"Choose Team\");\n } else {\n setText(item);\n }\n }\n });\n if(teamList.size() != 0){\n chooseLeagueTeamBox.getItems().addAll(teamList);\n }\n //chooseLeagueTeamBox.getSelectionModel().select();\n // TODO\n }", "public String getEditViewPath() {\n return \"games/edit\";\n }", "public LiveData<LeagueEntity> getLeague() {\n return observableLeague;\n }", "public void setLeagueId(int value) {\n this.leagueId = value;\n }", "static public void set_player_data(String league){\n\t\t\n\t\tEdit_row_window.attrs = new String[]{\"player name:\", \"rating:\", \"birth year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct t.id, t.name, t.links_to_team, t.creation_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_teams t, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt\" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.team_id=t.id and pt.player_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_team desc \";\n\t\t\n\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct t.id, t.name, t.links_to_team, t.creation_year \" +\n\t\t\t\t\" from curr_\"+league+\"_teams t \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"team name\", \"rating\", \"creation year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. creation year:\";\n\t\tEdit_row_window.linked_category_name = \"TEAMS\";\n\t}", "public ActionLocation enterEditTeam(ModuleMapping mapping, HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows Exception {\n\t\tString returnLabel = \"newTeamPage\";\n\t\tString type = (String) request.getParameter(\"type\");\n\t\tStaffVO currentStaff = (StaffVO) request.getSession().getAttribute(CommonName.CURRENT_STAFF_INFOR);\n\t\t// 获取其所有下级公司(包括本公司)\n\t\tString lowerOrgIds = currentStaff.getLowerCompanys(); // CompanyHelper.getInstance().getLowerCompany(currentStaff.getOrgId());\n\n\t\tif (type == null) {\n\t\t\ttype = \"new\";\n\t\t}\n\t\tIDBManager dbManager = null;\n\t\ttry {\n\t\t\tdbManager = DBManagerFactory.getDBManager();\n\t\t\tStaffDAO sdao = new StaffDAO(dbManager);\n\t\t\tTeamDAO dao = new TeamDAO(dbManager);\n\t\t\tif (!\"new\".equals(type)) {\n\t\t\t\t// 编辑type=\"edit\"\n\t\t\t\t// fetch\n\t\t\t\tString teamcode = request.getParameter(\"teamcode\");\n\t\t\t\tTeamVO eflowteamvo = dao.getTeamByTeamCode(teamcode);\n\t\t\t\trequest.setAttribute(\"eflowteam\", eflowteamvo);\n\n\t\t\t\t// for sub-team tree\n\t\t\t\trequest.setAttribute(eflowteamvo.getTeamName().trim() + eflowteamvo.getTeamCode().toString(), dao\n\t\t\t\t\t\t.getSubteamArr(teamcode));\n\t\t\t\tthis.treeNodes = \",\"+teamcode+\",\";//Init\n\t\t\t\tsetSubTeam(request, teamcode, dao);\n\t\t\t}\n\n\t\t\t// 获取所有Team列表\n\t\t\tCollection teamList = null;\n\t\t\t// if (\"new\".equals(type)){\n\t\t\t// TeamList = dao.getEflowTeamList();\n\t\t\t// TeamList = dao.getViewTeamList();\n\t\t\tif (CompanyHelper.getInstance().getEFlowCompany().equals(CompanyHelper.EFlow_AIA_CHINA)) {\n\t\t\t\tteamList = dao.getTeamList(null);\n\t\t\t} else {\n\t\t\t\tteamList = dao.getTeamList(lowerOrgIds);\n\t\t\t}\n\t\t\t// }\n\t\t\t/**\n\t\t\t * else{ //获取除当前被编辑Team以外的Team List String teamcode =\n\t\t\t * request.getParameter(\"teamcode\"); teamList =\n\t\t\t * dao.getEflowTeamListWithoutTeamCode(teamcode); }\n\t\t\t **/\n\t\t\trequest.setAttribute(\"teamList\", teamList);\n\n\t\t\t// 获取所有的EflowStaff列表\n\t\t\tCollection staffList = null;\n\t\t\t// staffList = sdao.getEflowAllStaff();\n\t\t\tstaffList = sdao.getStaffListByCompanyAndSubCompany(currentStaff.getLowerCompanys());\n\t\t\trequest.setAttribute(\"efusrlist\", staffList);\n\n\t\t\t// 获取所有PMA系统的teamleader\n\t\t\t// ApproverGroupMemberDAO approverdao = new\n\t\t\t// ApproverGroupMemberDAO(dbManager);\n\t\t\t// Collection teamLeaderList = approverdao.getMemberList(\"02\") ;\n\t\t\t// request.setAttribute(\"teamLeaderList\", teamLeaderList);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturnLabel = \"fail\";\n\t\t} finally {\n\t\t\tif (dbManager != null)\n\t\t\t\tdbManager.freeConnection();\n\t\t}\n\t\treturn mapping.findActionLocation(returnLabel);\n\t}", "public EditTeamPage pressEditButton() {\n controls.getEditButton().click();\n return new EditTeamPage();\n }", "public static void editStandings(League theLeague, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Edit Standings---\");\r\n\t\tfor (int x = 0; x < theLeague.getNumTeams(); x++) {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\ttheLeague.getTeam(x).teamManNameToString();\r\n\t\t\tSystem.out.println(\"Current record: \" + theLeague.getTeam(x).getRecord());\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"Enter a new record: (max 32 characters)\");\r\n\t\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\t\r\n\t\t\tString newRecord = Input.validString(32, keyboard);\r\n\t\t\tif (newRecord.equals(\"0\")) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ttheLeague.getTeam(x).setRecord(newRecord);\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"***Standings Updated***\");\r\n\t}", "public League getLeagueDetails(String leagueName) {\n return League.getLeagueByName(leagueName);\n }", "public static void editScores(League theLeague, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Edit Scores---\");\r\n\t\tfor (int x = 0; x < theLeague.getNumTeams(); x++) {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\ttheLeague.getTeam(x).teamManNameToString();\r\n\t\t\tSystem.out.println(\"Current score: \" + theLeague.getTeam(x).getScore());\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"Enter a score for \" + theLeague.getTeam(x).getTeamName() + \": (max 512)\");\r\n\t\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\t\r\n\t\t\tint newScore = Input.validInt(0, 512, keyboard);\r\n\t\t\tif (newScore == 0) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ttheLeague.getTeam(x).setScore(newScore);\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"***Scores Updated***\");\r\n\t}", "public void editaLivro(Livro livro) {\n itemLivroDAOBD.editarLivro(livro);\n }", "public League setLeague(String leagueName) {\n logger.info(leagueName + \" was set\");\n return new League(leagueName);\n }", "public void onEditParticipant() {\n Participant participant = outputParticipants.getSelectionModel().getSelectedItem();\n\n if (participant == null) {\n AlertHelper.showError(LanguageKey.ERROR_PARTICIPANT_NULL, null);\n return;\n }\n\n ParticipantDialog participantDialog = ParticipantDialog.getNewInstance(participant);\n if (participantDialog == null) {\n // Exception already handled\n return;\n }\n Optional<Participant> result = participantDialog.showAndWait();\n if (!result.isPresent()) {\n return;\n }\n\n if (controller.editParticipant(result.get())) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_PARTICIPANT_EDIT, null);\n }", "public final EObject entryRuleLeague() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject iv_ruleLeague = null;\r\n\r\n\r\n try {\r\n // InternalEsportDsl.g:804:47: (iv_ruleLeague= ruleLeague EOF )\r\n // InternalEsportDsl.g:805:2: iv_ruleLeague= ruleLeague EOF\r\n {\r\n newCompositeNode(grammarAccess.getLeagueRule()); \r\n pushFollow(FOLLOW_1);\r\n iv_ruleLeague=ruleLeague();\r\n\r\n state._fsp--;\r\n\r\n current =iv_ruleLeague; \r\n match(input,EOF,FOLLOW_2); \r\n\r\n }\r\n\r\n }\r\n\r\n catch (RecognitionException re) {\r\n recover(input,re);\r\n appendSkippedTokens();\r\n }\r\n finally {\r\n }\r\n return current;\r\n }", "String getEditore();", "public int getTeam() {\n return team;\n }", "public List<Team> getAllByLeague(League leagueID) {\n TeamDB tdb = new TeamDB();\n List<Team> teams = tdb.getAllByLeague(leagueID);\n for (Team t : teams) {\n String teamName = t.getTeamName();\n teamName = teamName.replace(\"'\", \"\\\\\\'\");\n t.setTeamName(teamName);\n System.out.println(t.getTeamName());\n }\n return teams;\n }", "public Team getTeam() {\n return team;\n }", "public java.lang.Boolean getEdit() {\n return edit;\n }", "int getTeam();", "@Override\n public String getTeam(){\n return this.team;\n }", "public LevelEditorView getLvle() {\r\n\t\treturn lvle;\r\n\t}", "@Override\n public void update(ArrayList<League> leagues) {\n\n }", "public String getTeam() {\n return team;\n }", "@Override\n public void onClick(View v) {\n getActivityDetails(view);\n\n String editDialogDistance = null;\n String editDialogAlt = null;\n String editDialogAvgHR = null;\n String editDialogMaxHR = null;\n\n long editDialogId = Long.parseLong(editId.getText().toString());\n String editDialogTime = editTime.getText().toString();\n String editDialogTotalTime = editTotalTime.getText().toString();\n String editDialogInfo = editInfo.getText().toString();\n String editDialogSport = editSport.getText().toString();\n try {\n editDialogDistance = editDistance.getText().toString();\n editDialogAlt = editAltitude.getText().toString();\n editDialogAvgHR = editAvgHR.getText().toString();\n editDialogMaxHR = editMaxHR.getText().toString();\n } catch (NullPointerException e) {\n\n }\n\n showEditDialog(editDialogId, editDialogTime, editDialogTotalTime, editDialogDistance,\n editDialogInfo, editDialogSport, editDialogAlt, editDialogAvgHR, editDialogMaxHR, _day, _month, _year);\n }", "@Override\n public void onClick(View v) {\n getActivityDetails(view);\n\n String editDialogDistance = null;\n String editDialogAlt = null;\n String editDialogAvgHR = null;\n String editDialogMaxHR = null;\n\n long editDialogId = Long.parseLong(editId.getText().toString());\n String editDialogTime = editTime.getText().toString();\n String editDialogTotalTime = editTotalTime.getText().toString();\n String editDialogInfo = editInfo.getText().toString();\n String editDialogSport = editSport.getText().toString();\n try {\n editDialogDistance = editDistance.getText().toString();\n editDialogAlt = editAltitude.getText().toString();\n editDialogAvgHR = editAvgHR.getText().toString();\n editDialogMaxHR = editMaxHR.getText().toString();\n } catch (NullPointerException e) {\n\n }\n\n showEditDialog(editDialogId, editDialogTime, editDialogTotalTime, editDialogDistance,\n editDialogInfo, editDialogSport, editDialogAlt, editDialogAvgHR, editDialogMaxHR, _day, _month, _year);\n }", "@Override\n public TournamentEntity getOldTournament(String id) {\n return tournamentRepository.findById(id)\n .orElseThrow(TournamentNotFoundException::new);\n }", "public int getTeamId() {\n return teamId;\n }", "public Editor getEditor(String idRevista){\n Editor editor = null;\n String id, nome;\n\n try{\n connection = con.connect();\n PreparedStatement stm = connection.prepareStatement(\"SELECT Editor.* FROM Editor \" +\n \"INNER JOIN Revista \" +\n \"ON Revista.Editor_ID = Editor.ID \" +\n \"WHERE Revista.ID = \" + idRevista);\n ResultSet rs = stm.executeQuery();\n if(rs.next()){\n id = rs.getString(\"ID\");\n nome = rs.getString(\"Nome\");\n editor = new Editor(id,nome);\n }\n }\n catch (Exception e){\n e.getMessage();\n }\n finally {\n con.close(connection);\n }\n return editor;\n }", "@Api(1.0)\n public HaloPreferencesStorageEditor edit() {\n if (mCurrentEditor == null) {\n mCurrentEditor = new HaloPreferencesStorageEditor(getSharedPreferences());\n }\n return mCurrentEditor;\n }", "Team getMyTeam();", "public final EObject ruleLeague() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n Token otherlv_3=null;\r\n Token otherlv_8=null;\r\n Token otherlv_10=null;\r\n Token otherlv_12=null;\r\n AntlrDatatypeRuleToken lv_name_2_0 = null;\r\n\r\n AntlrDatatypeRuleToken lv_size_4_0 = null;\r\n\r\n AntlrDatatypeRuleToken lv_year_5_0 = null;\r\n\r\n Enumerator lv_season_6_0 = null;\r\n\r\n EObject lv_groupstage_13_0 = null;\r\n\r\n\r\n\r\n \tenterRule();\r\n\r\n try {\r\n // InternalEsportDsl.g:817:2: ( ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? ) )\r\n // InternalEsportDsl.g:818:2: ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? )\r\n {\r\n // InternalEsportDsl.g:818:2: ( () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )? )\r\n // InternalEsportDsl.g:819:3: () otherlv_1= 'League' ( (lv_name_2_0= ruleEString ) ) otherlv_3= ':' ( (lv_size_4_0= ruleEInt ) ) ( (lv_year_5_0= ruleEInt ) ) ( (lv_season_6_0= ruleSeason ) ) ( ( ruleEString ) )? (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )? ( (lv_groupstage_13_0= ruleGroupStage ) )?\r\n {\r\n // InternalEsportDsl.g:819:3: ()\r\n // InternalEsportDsl.g:820:4: \r\n {\r\n\r\n \t\t\t\tcurrent = forceCreateModelElement(\r\n \t\t\t\t\tgrammarAccess.getLeagueAccess().getLeagueAction_0(),\r\n \t\t\t\t\tcurrent);\r\n \t\t\t\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,19,FOLLOW_4); \r\n\r\n \t\t\tnewLeafNode(otherlv_1, grammarAccess.getLeagueAccess().getLeagueKeyword_1());\r\n \t\t\r\n // InternalEsportDsl.g:830:3: ( (lv_name_2_0= ruleEString ) )\r\n // InternalEsportDsl.g:831:4: (lv_name_2_0= ruleEString )\r\n {\r\n // InternalEsportDsl.g:831:4: (lv_name_2_0= ruleEString )\r\n // InternalEsportDsl.g:832:5: lv_name_2_0= ruleEString\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getNameEStringParserRuleCall_2_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_5);\r\n lv_name_2_0=ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"name\",\r\n \t\t\t\t\t\tlv_name_2_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EString\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n otherlv_3=(Token)match(input,12,FOLLOW_11); \r\n\r\n \t\t\tnewLeafNode(otherlv_3, grammarAccess.getLeagueAccess().getColonKeyword_3());\r\n \t\t\r\n // InternalEsportDsl.g:853:3: ( (lv_size_4_0= ruleEInt ) )\r\n // InternalEsportDsl.g:854:4: (lv_size_4_0= ruleEInt )\r\n {\r\n // InternalEsportDsl.g:854:4: (lv_size_4_0= ruleEInt )\r\n // InternalEsportDsl.g:855:5: lv_size_4_0= ruleEInt\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getSizeEIntParserRuleCall_4_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_11);\r\n lv_size_4_0=ruleEInt();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"size\",\r\n \t\t\t\t\t\tlv_size_4_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EInt\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:872:3: ( (lv_year_5_0= ruleEInt ) )\r\n // InternalEsportDsl.g:873:4: (lv_year_5_0= ruleEInt )\r\n {\r\n // InternalEsportDsl.g:873:4: (lv_year_5_0= ruleEInt )\r\n // InternalEsportDsl.g:874:5: lv_year_5_0= ruleEInt\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getYearEIntParserRuleCall_5_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_17);\r\n lv_year_5_0=ruleEInt();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"year\",\r\n \t\t\t\t\t\tlv_year_5_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EInt\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:891:3: ( (lv_season_6_0= ruleSeason ) )\r\n // InternalEsportDsl.g:892:4: (lv_season_6_0= ruleSeason )\r\n {\r\n // InternalEsportDsl.g:892:4: (lv_season_6_0= ruleSeason )\r\n // InternalEsportDsl.g:893:5: lv_season_6_0= ruleSeason\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getSeasonSeasonEnumRuleCall_6_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_18);\r\n lv_season_6_0=ruleSeason();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"season\",\r\n \t\t\t\t\t\tlv_season_6_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.Season\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:910:3: ( ( ruleEString ) )?\r\n int alt16=2;\r\n int LA16_0 = input.LA(1);\r\n\r\n if ( ((LA16_0>=RULE_STRING && LA16_0<=RULE_ID)) ) {\r\n alt16=1;\r\n }\r\n switch (alt16) {\r\n case 1 :\r\n // InternalEsportDsl.g:911:4: ( ruleEString )\r\n {\r\n // InternalEsportDsl.g:911:4: ( ruleEString )\r\n // InternalEsportDsl.g:912:5: ruleEString\r\n {\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getZoneZoneCrossReference_7_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_19);\r\n ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:926:3: (otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')' )?\r\n int alt18=2;\r\n int LA18_0 = input.LA(1);\r\n\r\n if ( (LA18_0==13) ) {\r\n alt18=1;\r\n }\r\n switch (alt18) {\r\n case 1 :\r\n // InternalEsportDsl.g:927:4: otherlv_8= '(' ( ( ruleEString ) ) (otherlv_10= ',' ( ( ruleEString ) ) )* otherlv_12= ')'\r\n {\r\n otherlv_8=(Token)match(input,13,FOLLOW_4); \r\n\r\n \t\t\t\tnewLeafNode(otherlv_8, grammarAccess.getLeagueAccess().getLeftParenthesisKeyword_8_0());\r\n \t\t\t\r\n // InternalEsportDsl.g:931:4: ( ( ruleEString ) )\r\n // InternalEsportDsl.g:932:5: ( ruleEString )\r\n {\r\n // InternalEsportDsl.g:932:5: ( ruleEString )\r\n // InternalEsportDsl.g:933:6: ruleEString\r\n {\r\n\r\n \t\t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\r\n\r\n \t\t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getQualifiesForQualificationCrossReference_8_1_0());\r\n \t\t\t\t\t\r\n pushFollow(FOLLOW_8);\r\n ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:947:4: (otherlv_10= ',' ( ( ruleEString ) ) )*\r\n loop17:\r\n do {\r\n int alt17=2;\r\n int LA17_0 = input.LA(1);\r\n\r\n if ( (LA17_0==14) ) {\r\n alt17=1;\r\n }\r\n\r\n\r\n switch (alt17) {\r\n \tcase 1 :\r\n \t // InternalEsportDsl.g:948:5: otherlv_10= ',' ( ( ruleEString ) )\r\n \t {\r\n \t otherlv_10=(Token)match(input,14,FOLLOW_4); \r\n\r\n \t \t\t\t\t\tnewLeafNode(otherlv_10, grammarAccess.getLeagueAccess().getCommaKeyword_8_2_0());\r\n \t \t\t\t\t\r\n \t // InternalEsportDsl.g:952:5: ( ( ruleEString ) )\r\n \t // InternalEsportDsl.g:953:6: ( ruleEString )\r\n \t {\r\n \t // InternalEsportDsl.g:953:6: ( ruleEString )\r\n \t // InternalEsportDsl.g:954:7: ruleEString\r\n \t {\r\n\r\n \t \t\t\t\t\t\t\tif (current==null) {\r\n \t \t\t\t\t\t\t\t\tcurrent = createModelElement(grammarAccess.getLeagueRule());\r\n \t \t\t\t\t\t\t\t}\r\n \t \t\t\t\t\t\t\r\n\r\n \t \t\t\t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getQualifiesForQualificationCrossReference_8_2_1_0());\r\n \t \t\t\t\t\t\t\r\n \t pushFollow(FOLLOW_8);\r\n \t ruleEString();\r\n\r\n \t state._fsp--;\r\n\r\n\r\n \t \t\t\t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t \t\t\t\t\t\t\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop17;\r\n }\r\n } while (true);\r\n\r\n otherlv_12=(Token)match(input,15,FOLLOW_20); \r\n\r\n \t\t\t\tnewLeafNode(otherlv_12, grammarAccess.getLeagueAccess().getRightParenthesisKeyword_8_3());\r\n \t\t\t\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n // InternalEsportDsl.g:974:3: ( (lv_groupstage_13_0= ruleGroupStage ) )?\r\n int alt19=2;\r\n int LA19_0 = input.LA(1);\r\n\r\n if ( (LA19_0==26) ) {\r\n alt19=1;\r\n }\r\n switch (alt19) {\r\n case 1 :\r\n // InternalEsportDsl.g:975:4: (lv_groupstage_13_0= ruleGroupStage )\r\n {\r\n // InternalEsportDsl.g:975:4: (lv_groupstage_13_0= ruleGroupStage )\r\n // InternalEsportDsl.g:976:5: lv_groupstage_13_0= ruleGroupStage\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getLeagueAccess().getGroupstageGroupStageParserRuleCall_9_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_2);\r\n lv_groupstage_13_0=ruleGroupStage();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getLeagueRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"groupstage\",\r\n \t\t\t\t\t\tlv_groupstage_13_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.GroupStage\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n \tleaveRule();\r\n\r\n }\r\n\r\n catch (RecognitionException re) {\r\n recover(input,re);\r\n appendSkippedTokens();\r\n }\r\n finally {\r\n }\r\n return current;\r\n }", "public String getAwayTeam();", "public Boolean getEditar() {\r\n\t\treturn editar;\r\n\t}", "public int getTeam() {\n return team_;\n }", "public void editAss() throws IOException {\r\n\t\tif (listview.getSelectionModel().getSelectedItem() != null) {\r\n\t\t\tassToChoose = listview.getSelectionModel().getSelectedItem();\r\n\t\t\tfor (int i = 0; i < b.size(); i++) {\r\n\t\t\t\tif (b.get(i).getAssname().equals(assToChoose)) {\r\n\t\t\t\t\tassId = b.get(i).getAssId();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tconnectionmain.showTeacherEditAssGUI();\r\n\t\t}\r\n\t}", "public OsmDataLayer getEditLayer() {\n\t\treturn null;\n\t}", "@Override\n public ArrayList<League> select(String id) {\n return null;\n }", "public Team update(TeamDTO teamForm) throws TeamNotFoundException;", "public Team getTeam() {\r\n\t\treturn team;\r\n\t}", "public TournamentEditorConstraints getTournamentEditorConstraints();", "public String getTeam(int id){\r\n\t\treturn teamList.get(id);\r\n\t}", "public String editar()\r\n/* 59: */ {\r\n/* 60: 74 */ if ((getMotivoLlamadoAtencion() != null) && (getMotivoLlamadoAtencion().getIdMotivoLlamadoAtencion() != 0)) {\r\n/* 61: 75 */ setEditado(true);\r\n/* 62: */ } else {\r\n/* 63: 77 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 64: */ }\r\n/* 65: 79 */ return \"\";\r\n/* 66: */ }", "public Boolean getEditFlag() {\n return editFlag;\n }", "Menu getMenuEdit();", "@RequestMapping(value = \"/team/{league}\", method = POST, consumes = MEDIA_JSON)\n @ResponseStatus(CREATED)\n public LobbyTeam createTeamAndEnter(@AuthenticationPrincipal UserSimpleDetails user,\n @PathVariable(\"league\") LobbyLeagueEnum league)\n throws TeamFullException, TeamNotFoundException {\n log.info(\"user {} creates team\", user.getIdentity());\n LobbyTeam team = lobbyService.createTeam(user.getProfileId(), league);\n return lobbyService.enterIntoTeam(user.getProfileId(), team.getId().toString());\n }", "public DivisionDataEdit asEditable() {\n return new DivisionDataEdit(this);\n }", "public Team selectTeam() {\r\n \r\n String[] list = new String[controller.getTeams().size()];\r\n for (int i = 0; i < controller.getTeams().size(); i++) {\r\n list[i] = controller.getTeams().get(i).getName();\r\n }\r\n\r\n JComboBox cmbOption = new JComboBox(list);\r\n int input = JOptionPane.showOptionDialog(null, cmbOption, \"Select Team that your like Delete\",JOptionPane.DEFAULT_OPTION,JOptionPane.QUESTION_MESSAGE, null, null, null);\r\n if(input==-1){\r\n return null;\r\n }\r\n Team teamAux = controller.searchTeam((String) cmbOption.getSelectedItem());\r\n return teamAux;\r\n }", "@Override\r\n\tpublic String getTeam() {\n\t\treturn team;\r\n\t}", "private void launchEditVolPage(View view, Volunteer thisGuy){\n final Intent launchEdit = new Intent(manageVolunteers.this,ManagerEditVolunteer.class);\n\n Bundle bundle = new Bundle();\n bundle.putSerializable(\"thisGuy\", thisGuy);\n launchEdit.putExtra(\"bundle\", bundle);\n startActivity(launchEdit);\n }", "public int getTeam() {\n return team_;\n }", "public Team get(Long id);", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n String projID = this.getComms().request.getParameter(PROJ_ID);\n Project project = null;\n\n System.out.println(\" trying to edit a project \"+ projID);\n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(projID);\n\t System.out.println(\" trying to edit a project 2\"+ projID);\n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(PROJECT_ADMIN_PAGE);\n } catch(Exception ex) {\n return showEditPage(\"You must fill out all fields to edit this project\");\n } \n }", "private void edit() {\n\n\t}", "private View.OnClickListener HandleEdit() {\n return v -> {\n //Change the application state to edit mode\n mMainActivityState.ChangeActivityMode(Mode.EDIT);\n //Close the current dialog\n mCurrentDialog.dismiss();\n };\n }", "public static void editLineup(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Edit Lineup---\");\r\n\t\tSystem.out.println(\"\");\r\n\t\ttheTeam.teamToStringNum();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Select a player to move from the bench to starting or vice versa:\");\r\n\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\tSystem.out.println(\"1-\" + theTeam.getRoster().size() + \" - Select a player to be dropped\");\r\n\t\t\r\n\t\tint lineupChoice = Input.validInt(0, theTeam.getRoster().size(), keyboard);\r\n\t\tif (lineupChoice == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tPlayer thePlayer = theTeam.getTeamPlayer(lineupChoice - 1);\r\n\t\t\r\n\t\tif (thePlayer.getIsStarting()) {\r\n\t\t\tthePlayer.setBench();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString position = thePlayer.getPosition();\r\n\t\tif (theTeam.starterCount(position) < theLeague.getPositionMax(position)) {\r\n\t\t\tthePlayer.setStarting();\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"***You have the maximum number of starters at the \" + position + \" position***\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic int edit(Zongjie zongjie) {\n\t\treturn zongjieDao.edit(zongjie);\n\t}", "public List<Hero> getTeam() {\r\n return team;\r\n }", "public static void editTeamName(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Edit Team Name---\");\r\n\t\tSystem.out.println(\"Enter your new team name: (max 32 characters)\");\r\n\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\r\n\t\tString teamName;\r\n\t\tdo {\r\n\t\t\tteamName = Input.validString(32, keyboard);\r\n\t\t\tif (teamName.equals(\"0\")) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tfor (int y = 0; y < theLeague.getNumTeams(); y++) {\r\n\t\t\t\tif (teamName.equalsIgnoreCase(theLeague.getTeam(y).getTeamName())) {\r\n\t\t\t\t\tSystem.out.println(\"That team name is already being used.\");\r\n\t\t\t\t\tteamName = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} while (teamName.isEmpty());\r\n\t\ttheTeam.setTeamName(teamName);\r\n\t}", "@Override\n\tpublic EditLogic getEditLogic() {\n\t\treturn null;\n\t}", "public Team getTeam() {\n Team team = new Team();\n team.setTeamName(this.getTeamNameDataLabel().getText());\n team.setCaptain(this.getCaptainDataLabel().getText());\n if (this.getCoachDataLabel().equals(\"\")) {\n team.setCoach(null);\n } else {\n team.setCoach(this.getCoachDataLabel().getText());\n }\n if (this.getAchievementsDataLabel().equals(\"\")) {\n team.setAchievements(null);\n } else {\n team.setAchievements(this.getAchievementsDataLabel().getText());\n }\n return team;\n }", "public ArrayList<Team> getTeamList(){\n\t\treturn this.teamList;\n\t}", "public abstract void edit();", "public String getTeam() {\n\t\treturn team;\n\t}", "public java.lang.String getEditInfoResult() {\r\n return localEditInfoResult;\r\n }", "@Override\n public void save(ArrayList<League> leagues) {\n\n }", "public book edit(book editedbook) {\n\t\t\n\t\treturn repository.save(editedbook);\n\t}", "public PetalEditor getEditor() {\n return petal_editor;\n }", "private person getEditPerson(person selected_person) {\n\n selected_person.setName(textView_name.getText().toString());\n selected_person.setDate(textView_date.getText().toString());\n selected_person.setNeck(textView_neck.getText().toString());\n selected_person.setBust(textView_bust.getText().toString());\n selected_person.setChest(textView_chest.getText().toString());\n selected_person.setWaist(textView_waist.getText().toString());\n selected_person.setHip(textView_hip.getText().toString());\n selected_person.setInseam(textView_inseam.getText().toString());\n selected_person.setComment(textView_comment.getText().toString());\n\n return selected_person;\n }", "public String getTeam() {\r\n\t\treturn Team;\r\n\t}", "@Override\n public void editDescription() {\n final String[] desc = new String[1];\n desc[0] = null;\n\n\n AlertDialog.Builder builder = new AlertDialog.Builder(Overview.this);\n //inflate the layout\n View mView = getLayoutInflater().inflate(R.layout.description_dialog, null);\n\n final EditText description = (EditText) mView.findViewById(R.id.write);\n Button save = (Button) mView.findViewById(R.id.save);\n Button cancel = (Button) mView.findViewById(R.id.cancel);\n\n\n builder.setView(mView);\n final AlertDialog dialog = builder.create();\n dialog.show();\n\n cancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // desc = description.getText().toString();\n Toast.makeText(Overview.this, \"Description Canceled\", Toast.LENGTH_SHORT).show();\n\n dialog.dismiss();\n }\n });\n\n save.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (!description.getText().toString().isEmpty()) {\n // desc = description.getText().toString();\n Toast.makeText(Overview.this, \"Saved Description\", Toast.LENGTH_SHORT).show();\n ai_frag.setReturnedDescription(description.getText().toString());\n\n } else {\n Toast.makeText(Overview.this, \"No Description changed\", Toast.LENGTH_SHORT).show();\n }\n dialog.dismiss();\n\n }\n });\n\n\n }", "Team findById(Long id);", "private void editComic() {\n mainActivity.ISSUE_ID = comic.getComicID();\n\n //Load the edit fragment\n mainActivity.loadEditComicFragment();\n }", "public Livraison ModifierLivraison(Plan plan, Livraison liv, Date DPH, Date FPH) {\r\n\r\n\t\tif (this.getListeLivraison().contains(liv)) {\r\n\t\t\tint i = this.getListeLivraison().indexOf(liv);\r\n\t\t\tif (DPH == null || FPH == null) {\r\n\t\t\t\tliv = new Livraison(liv.getDuree(), liv.getDestination());\r\n\t\t\t} else {\r\n\t\t\t\tliv.setDebutPlageHoraire(DPH);\r\n\t\t\t\tliv.setFinPlageHoraire(FPH);\r\n\t\t\t}\r\n\t\t\tthis.getListeLivraison().set(i, liv);\r\n\r\n\t\t} else {\r\n\t\t\tSystem.err.println(\"ERREUR ! La livraison ne fait pas partie de la tournee actuelle\");\r\n\t\t\treturn liv;\r\n\t\t}\r\n\t\tthis.initTempsPassage();\r\n\t\treturn liv;\r\n\t}", "public static void addPlayer(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Add Player---\");\r\n\t\ttheTeam.teamToString();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"--Top 20 Free Agents--\");\r\n\t\ttheLeague.getFreeAgents(20);\r\n\r\n\t\tint playerChoice;\r\n\t\tdo {\r\n\t\t\tdo {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\" 0 - Filter Free Agents by Position\");\r\n\t\t\t\tSystem.out.println(\" -1 - View All Free Agents\");\r\n\t\t\t\tSystem.out.println(\"1-\" + theLeague.playerList().size() + \" - Select a Player\");\r\n\t\t\t\tplayerChoice = Input.validInt(-1, theLeague.playerList().size(), keyboard);\r\n\t\t\t\t\r\n\t\t\t\tif (playerChoice == -1) {\r\n\t\t\t\t\ttheLeague.getFreeAgents();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (playerChoice == 0) {\r\n\t\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\t\tSystem.out.println(\"Which position would you like to view?\");\r\n\t\t\t\t\tSystem.out.println(\"1 - QB\");\r\n\t\t\t\t\tSystem.out.println(\"2 - WR\");\r\n\t\t\t\t\tSystem.out.println(\"3 - RB\");\r\n\t\t\t\t\tSystem.out.println(\"4 - TE\");\r\n\t\t\t\t\tswitch (Input.validInt(1, 4, keyboard)) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent QBs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"QB\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent WRs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"WR\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent RBs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"RB\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent TEs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"TE\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} while (playerChoice < 1);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (theLeague.playerList().get(playerChoice - 1).getIsOwned()) {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(theLeague.playerList().get(playerChoice - 1).playerToString() + \" is not available\");\r\n\t\t\t}\r\n\t\t} while (theLeague.playerList().get(playerChoice - 1).getIsOwned());\r\n\r\n\t\tPlayer thePlayer = theLeague.playerList().get(playerChoice - 1);\r\n\t\tthePlayer.setIsOwned();\r\n\t\ttheTeam.getRoster().add(thePlayer);\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"***\" + theTeam.getManagerName() + \" has added \" + thePlayer.playerToString() + \"***\");\r\n\t}", "void update(Team team);", "protected void editClicked(View view){\n FragmentManager fm = getSupportFragmentManager();\n ЕditDialog editDialogFragment = new ЕditDialog(2);\n Bundle args = new Bundle();\n args.putInt(\"position\", this.position);\n args.putString(\"itemName\", this.itm.getItem(this.position).getName());\n args.putString(\"itemUrl\", this.itm.getItem(this.position).getUrl());\n editDialogFragment.setArguments(args);\n editDialogFragment.show(fm, \"edit_item\");\n }", "public String edit() {\r\n\t\tuserEdit = (User) users.getRowData();\r\n\t\treturn \"edit\";\r\n\t}", "Match getTeam1LooserOfMatch();", "@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}", "public Team getTeam1 () {\n return team1;\n }", "public String handleEdit()\n throws webschedulePresentationException, HttpPresentationException\n {\t\t \n \n Project project = null;\n\n \n \n // Try to get the proj by its ID\n try {\n\t project = ProjectFactory.findProjectByID(this.getProjectID());\n\t \n\t String title = project.getProj_name();\n\t System.out.println(\"project title: \"+title);\n\t\n } catch(Exception ex) {\n this.getSessionData().setUserMessage(\"Please choose a valid PROJECT to edit\");\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n }\n \n // If we got a valid project then try to save it\n // If any fields were missing then redisplay the edit page, \n // otherwise redirect to the project catalog page\n try {\n saveProject(project);\n throw new ClientPageRedirectException(UCSDPROJECTSEDIT_PAGE);\n } catch(Exception ex) {\n return showPage(\"You must fill out all fields to edit this project\");\n } \n }", "@GetMapping(value = \"/edit-form\", name = \"editForm\")\n public ModelAndView editForm(@ModelAttribute Game game, Model model) {\n populateForm(model);\n model.addAttribute(\"game\", game);\n return new ModelAndView(\"games/edit\");\n }", "public String edit() {\n return \"edit\";\n }", "public int getTeamId() {\n\t\treturn teamId;\n\t}", "public void edit() {\n\t\tlogger.debug(\"Entering IVR dtmf edit method...\");\n\t\tif (selectedDtmfId != null && selectedDtmfId.intValue() != -1) {\n\t\t\ttry {\n\t\t\t\tIvrDtmf entry = ivrDtmfDao.findById(selectedDtmfId);\n\t\t\t\tdtmfId = entry.getDtmfId();\n\t\t\t\tdtmfName = entry.getDtmfName();\n\t\t\t\tdtmfDigit = entry.getDtmfDigit();\n\t\t\t\tdtmfDescription = entry.getDtmfDescription();\n\t\t\t\tdtmfCreateDate = entry.getDtmfCreateDate();\n\t\t\t\tdtmfUpdateDate = entry.getDtmfUpdateDate();\n\t\t\t\tselectedDtmfId = -1;\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlogger.error(\"Failed to fetch the element data from db, Cause: \"+ex.getMessage(), ex);\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Failed to fetch the element data from db, Cause: \"+ex.getMessage()));\n\t\t\t}\n\t\t} else {\n\t\t\treset();\n\t\t}\n\t}", "public Resolution displayEdit() throws Exception {\r\n List<Organization> list = myIsern.getOrganizationsList();\r\n Organization editOrganization = new Organization();\r\n boolean found = false;\r\n for (Organization organization : list) {\r\n if (organization.getName().equals(this.name.replace('_', ' '))) {\r\n editOrganization = organization;\r\n found = true;\r\n }\r\n }\r\n\r\n if (found) {\r\n this.type = editOrganization.getType();\r\n this.contact = editOrganization.getContact();\r\n this.affiliatedResearchers = this.converter.listToString(editOrganization\r\n .getAffiliatedResearchers().getAffiliatedResearcher());\r\n this.country = editOrganization.getCountry();\r\n this.researchKeywords = this.converter.listToString(editOrganization.getResearchKeywords()\r\n .getResearchKeyword());\r\n this.researchDescription = editOrganization.getResearchDescription();\r\n this.homePage = editOrganization.getHomePage();\r\n\r\n this.editing = true;\r\n }\r\n return new ForwardResolution(EDIT_ORG_PAGE);\r\n }", "public VoodooControl getEditField(String fieldName) throws Exception {\n\t\treturn ((RecordsModule)parentModule).getField(fieldName).editControl;\n\t}", "public EditableBoard getBoard() {\n\treturn board;\n }", "public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}", "public void newTeam(Team team);", "public EditPanel getEditPanel() { return ep; }", "public Editor getEditor() { return editor; }", "@Override\r\n\tpublic Loja editar(String nomeResponsavel, int telefoneEmpresa, String rua, String cidade, String estado, String pais,\r\n\t\t\tint cep, int cnpj, String razaoSocial, String email, String nomeEmpresa, String senha) {\n\t\treturn null;\r\n\t}", "String getWonTeam() {\r\n return this.teamName;\r\n }" ]
[ "0.63544625", "0.63413733", "0.61661017", "0.6019421", "0.59788156", "0.5929746", "0.5887628", "0.588747", "0.57818615", "0.5679831", "0.55647534", "0.5447861", "0.5343721", "0.5301794", "0.5234194", "0.52222574", "0.5212383", "0.5166858", "0.51531816", "0.5148953", "0.5134484", "0.51325023", "0.5127623", "0.51265013", "0.50919956", "0.50911415", "0.5073507", "0.5046309", "0.5035977", "0.5029169", "0.5029169", "0.5024135", "0.49974927", "0.49521834", "0.49295235", "0.49177277", "0.4912677", "0.49059513", "0.49053472", "0.488723", "0.4883326", "0.4880097", "0.48791766", "0.48592627", "0.48582613", "0.4858183", "0.48576826", "0.4855774", "0.48431244", "0.48416942", "0.48389193", "0.4837866", "0.48372006", "0.48346546", "0.48300204", "0.48286885", "0.481825", "0.48159036", "0.48126104", "0.47925758", "0.47794676", "0.47751525", "0.47660893", "0.47608286", "0.4736325", "0.47253436", "0.47192895", "0.47183704", "0.4709843", "0.47091103", "0.4703523", "0.46891245", "0.46873692", "0.46855676", "0.46786073", "0.46779996", "0.46768254", "0.46696442", "0.4662123", "0.4660102", "0.46520033", "0.4650318", "0.46471387", "0.46446887", "0.4644061", "0.46416974", "0.46326897", "0.46303496", "0.46276808", "0.4626623", "0.46252033", "0.46249536", "0.46231425", "0.4622187", "0.46194956", "0.46090394", "0.46048072", "0.46016735", "0.4601485", "0.4594267" ]
0.6666189
0
The saveChanges method saves the changes for one league into the db
public static boolean saveChanges(LeagueBean l) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement updateLeague = null; int result = 0; // Connect to Database try { conn = ConnectionManager.getConnection(); updateLeague = conn.prepareStatement("UPDATE league SET leagueName=?, leaguePlayoffs=?, leaguePlayoffTeams=?, leagueStatus=? WHERE leagueID=?"); updateLeague.setString(1, l.getLeagueName()); updateLeague.setString(2, l.getLeaguePlayoffs()); updateLeague.setString(3, l.getLeaguePlayoffTeams()); updateLeague.setString(4, l.getLeagueStatus()); updateLeague.setString(5, l.getLeagueId()); result = updateLeague.executeUpdate(); if(result == 1) { status = true; } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (updateLeague != null) { try { updateLeague.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void save(ArrayList<League> leagues) {\n\n }", "private void save() {\n Saver.saveTeam(team);\n }", "private void saveTournament(Tournament tournament) {\n System.out.println(\"Saving\");\n TournamentEntity entity = new TournamentEntity();\n entity.setId(tournament.getId());\n entity.setWinnerId(tournament.getFightersRemaining().get(0).getId());\n tournamentRepository.save(entity);\n }", "@Override\n\tpublic void saveLane(Lane theLane) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\tcurrentSession.saveOrUpdate(theLane);\n\t}", "@Test\r\n\tpublic void saveTeamLevel() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamLevel \r\n\t\tInteger teamId_8 = 0;\r\n\t\tLevel related_level = new wsdm.domain.Level();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamLevel(teamId_8, related_level);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamLevel\r\n\t}", "public void saveGoal(Goal goal);", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public void saveGame() {\n\t\tmanager.saveGame();\n\t}", "@Test\r\n\tpublic void saveTeam() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeam \r\n\t\tTeam team = new wsdm.domain.Team();\r\n\t\tservice.saveTeam(team);\r\n\t}", "@Test\r\n\tpublic void saveTeamGamesForVisitorTeamFk() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamGamesForVisitorTeamFk \r\n\t\tInteger teamId_4 = 0;\r\n\t\tGame related_gamesforvisitorteamfk = new wsdm.domain.Game();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamGamesForVisitorTeamFk(teamId_4, related_gamesforvisitorteamfk);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamGamesForVisitorTeamFk\r\n\t}", "@Override\r\n\tpublic void save(Score obj) {\n\t\tiscoreDAO.save(obj);\r\n\t}", "@Test\r\n\tpublic void saveTeamTeamplayerses() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamTeamplayerses \r\n\t\tInteger teamId_7 = 0;\r\n\t\tTeamplayers related_teamplayerses = new wsdm.domain.Teamplayers();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamTeamplayerses(teamId_7, related_teamplayerses);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamTeamplayerses\r\n\t}", "Hotel saveHotel(Hotel hotel);", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "private void saveData(){\n databaseReference.setValue(new Teacher(0, \"\", 0.0));\n }", "@Override\n\tpublic void save(Oglas oglas) {\n\t\trepository.save(oglas);\n\t}", "void save() {\n gameModelPoDao.saveToFile(file.getAbsolutePath(), gameModelPo);\n }", "public void save(){\n\t\tlowresModelManager.save();\n\t}", "@Test\r\n\tpublic void saveGame() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: saveGame \r\n\t\tGame game = new tsw.domain.Game();\r\n\t\tTswacct tswAcct = null;\r\n\t\tservice.saveGame(tswAcct, game, null);\r\n\t}", "private void save(JTour jTour){\n if(jTour.save()>0){\n for(JPlace jPlace : jTour.getPlaces()){\n if(jPlace.save() > 0){\n //u principu bi trebala biti samo jedna lokacija u placu\n jPlace.getLocations().get(0).save();\n }\n }\n }\n\n }", "@Test\r\n\tpublic void saveGameGamestatses() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: saveGameGamestatses \r\n\t\tInteger gameId_2 = 0;\r\n\t\tGamestats related_gamestatses = new tsw.domain.Gamestats();\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tGame response = null;\r\n\t\tresponse = service.saveGameGamestatses(gameId_2, related_gamestatses, null, null);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: saveGameGamestatses\r\n\t}", "@Test\r\n\tpublic void saveTeamGamesForHomeTeamFk() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamGamesForHomeTeamFk \r\n\t\tInteger teamId_5 = 0;\r\n\t\tGame related_gamesforhometeamfk = new wsdm.domain.Game();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamGamesForHomeTeamFk(teamId_5, related_gamesforhometeamfk);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamGamesForHomeTeamFk\r\n\t}", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "public void saveChanges ()\n\t{\n\t\n\t\tAppContext.cartogramWizard.setAdvancedOptionsEnabled(\n\t\t\tmAdvancedOptionsCheckBox.isSelected());\n\t\n\t\tAppContext.cartogramWizard.setCreateGridLayer(\n\t\t\tmGridLayerCheckBox.isSelected());\n\t\t\n\t\ttry\n\t\t{\n\t\t\tString gridSizeString = mGridSizeTextField.getText();\n\t\t\tInteger gridSizeInt = new Integer(gridSizeString);\n\t\t\tAppContext.cartogramWizard.setDeformationGridSize(\n\t\t\t\tgridSizeInt.intValue());\n\t\t}\n\t\tcatch (NumberFormatException e1)\n\t\t{\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\ttry\n\t\t{\n\t\t\tString gridSizeString = mCartogramGridSizeTextField.getText();\n\t\t\tInteger gridSizeInt = new Integer(gridSizeString);\n\t\t\tAppContext.cartogramWizard.setCartogramGridSizeInX(\n\t\t\t\tgridSizeInt.intValue());\n\t\t\tAppContext.cartogramWizard.setCartogramGridSizeInY(\n\t\t\t\tgridSizeInt.intValue());\n\t\t}\n\t\tcatch (NumberFormatException e2)\n\t\t{\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\ttry\n\t\t{\n\t\t\tString diffusionGridSizeString = \n\t\t\t\t(String)mDiffusionGridMenu.getSelectedItem();\n\t\t\t\n\t\t\tInteger diffusionGridSizeInt = new Integer(diffusionGridSizeString);\n\t\t\t\n\t\t\tAppContext.cartogramWizard.setDiffusionGridSize(\n\t\t\t\tdiffusionGridSizeInt);\n\t\t}\n\t\tcatch (NumberFormatException e3)\n\t\t{\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\ttry\n\t\t{\n\t\t\tString iterationsString = mDiffusionIterationsTextField.getText();\n\t\t\tInteger iterationsInt = new Integer(iterationsString);\n\t\t\tAppContext.cartogramWizard.setDiffusionIteratations(\n\t\t\t\titerationsInt.intValue());\n\t\t}\n\t\tcatch (NumberFormatException e4)\n\t\t{\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\n\t}", "@Override\n\tpublic void save(Score score) {\n\t\tSystem.out.println(\"Service中的save方法执行了...\");\n\t\t\n\n\t\tscoreDao.save(score);\n\t\t\n\t\t\n\t}", "public void save();", "public void save();", "public void save();", "public void save();", "private void savePlayers() {\r\n this.passive_players.stream()\r\n .filter(E -> E.isChanged())\r\n .forEach(e -> {\r\n e.save();\r\n });\r\n }", "public void save() {\n\t\tSystem.out.println(\"-----------from PersonDao.save()\");\n\t}", "void save(Teacher teacher);", "public void saveChanges(ActionEvent actionEvent) throws SQLException, IOException {\n if (validEditInput()) {\n teamCombobox.getValue().setTeamName(teamNameEditField.getText());\n teamCombobox.getValue().setCity(chooseCityBox.getValue().toString());\n teamCombobox.getValue().setAbbrevation(abbrevationEditField.getText());\n teamCombobox.getValue().setLeagueName(chooseLeagueBox.getValue().toString());\n if (logoChangeImage != null) {\n teamCombobox.getValue().setTeamLogo(logoChangeImage);\n teamPhoto.setImage(teamCombobox.getValue().getTeamLogo().getImage());\n }\n DatabaseManager.updateTeam(teamCombobox.getValue(), user.getDatabaseConnection(), editTeamLogoFile);\n displayMessage(messagePane,\"Changes are saved\", false);\n\n teamCombobox.getItems().clear();\n teamCombobox.getItems().addAll(user.getUserTeams());\n teamCombobox.getSelectionModel().selectFirst();\n\n closeButtonPushed(actionEvent);\n }\n }", "public void save() {\t\n\t\n\t\n\t}", "@Override\n\tpublic void saveScore() {\n\n\t}", "@Override\n public void save(Game game) {\n }", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "@Override\n\tpublic void save(ConScore it) {\n\t\tthis.getHibernateTemplate().save(it);\n\t}", "@Override\n public void save(String[] params) throws SQLException {\n String query = \"INSERT INTO coach(user_name,team,pageID,training,job,name)\" + \"values(?,?,?,?,?,?);\";\n Connection conn = dBconnector.getConnection();\n if (conn != null) {\n PreparedStatement stmt = null;\n try {\n conn.setCatalog(\"manageteams\");\n stmt = conn.prepareStatement(query);\n stmt.setString(1, params[0]);\n stmt.setString(2, params[1]);\n stmt.setInt(3, Integer.valueOf(params[2]));\n stmt.setString(4, params[3]);\n stmt.setString(5, params[4]);\n stmt.setString(6, params[5]);\n stmt.execute();\n stmt.close();\n conn.close();\n logger.info(\"coach \" + params[0] + \"successfuly saved\");\n }\n catch (SQLException e)\n {\n logger.error(e.getMessage());\n throw new SQLException(DaoSql.getException(e.getMessage()));\n }\n }\n }", "@Override\n\tpublic void saveScore() {\n\t\t\n\t}", "private void updateDB() {\r\n //if(!m_state.isEndingGame()) return;\r\n if(m_connectionName == null || m_connectionName.length() == 0 || !m_botAction.SQLisOperational()) {\r\n m_botAction.sendChatMessage(\"Database not connected. Not updating scores.\");\r\n return;\r\n }\r\n\r\n for(KimPlayer kp : m_allPlayers.values()) {\r\n try {\r\n m_botAction.SQLQueryAndClose(m_connectionName\r\n , \"INSERT INTO tblJavelim (fcName,fnGames,fnKills,fnDeaths) \"\r\n + \"VALUES ('\" + Tools.addSlashes(kp.m_name) + \"',1,\" + kp.m_kills + \",\" + kp.m_deaths + \") \"\r\n + \"ON DUPLICATE KEY UPDATE fnGames = fnGames + 1, fnKills = fnKills + VALUES(fnKills), fnDeaths = fnDeaths + VALUES(fnDeaths)\");\r\n } catch(SQLException e) {\r\n Tools.printStackTrace(e);\r\n }\r\n }\r\n\r\n if(m_mvp != null) {\r\n try {\r\n m_botAction.SQLQueryAndClose(m_connectionName\r\n , \"UPDATE tblJavelim SET fnMVPs = fnMVPs + 1 WHERE fcName='\" + Tools.addSlashes(m_mvp.m_name) + \"'\");\r\n } catch(SQLException e) {\r\n Tools.printStackTrace(e);\r\n }\r\n }\r\n\r\n if(m_winner != null && m_winner.size() != 0) {\r\n for(KimPlayer kp : m_winner) {\r\n try {\r\n m_botAction.SQLQueryAndClose(m_connectionName\r\n , \"UPDATE tblJavelim SET fnWins= fnWins + 1 WHERE fcName='\" + Tools.addSlashes(kp.m_name) + \"'\");\r\n } catch(SQLException e) {\r\n Tools.printStackTrace(e);\r\n }\r\n }\r\n }\r\n }", "void save(Employee employee);", "public void update(String teamID, String teamName, League league, List<Player> playerList, List<Game> gameList, List<Game> gameList1) {\n TeamDB tdb = new TeamDB();\n Team team = get(teamID);\n \n League oldLeague = team.getLeagueID();\n if (!oldLeague.getLeagueID().equals(league.getLeagueID())) {\n oldLeague.getTeamList().remove(team);\n LeagueDB ldb = new LeagueDB();\n ldb.update(oldLeague);\n }\n \n team.setTeamName(teamName);\n team.setPlayerList(playerList);\n team.setLeagueID(league);\n tdb.update(team);\n }", "@Override\n public void update(ArrayList<League> leagues) {\n\n }", "private void saveGame(){\n\t\t\n\t}", "public void save(){\r\n\t\tmanager.save(this);\r\n\t}", "public void save() {\n MainActivity.db.updateWord(this);\n }", "public void saveTournament() throws IOException{\r\n\t\tBuzzardTournamentFileChooser fileChooser = new BuzzardTournamentFileChooser();\r\n\t\tfileChooser.saveTournament(dealer.getTournament());\r\n\t}", "void commit( boolean onSave );", "@Override\r\n\tpublic void saveEmployee(Employee employee) {\n\t\t\r\n\t}", "public void save() {\r\n\t\ttry {\r\n\t\t\tthis.iniObjects();\r\n\t\t\tGxyService currentService = getGxyService();\r\n\t\t\tCompassSession session = new CobooCompass().getCompass().openSession();\r\n\t\t\tCompassTransaction tx = session.beginLocalTransaction();\r\n\t\t\tPerson person = null;\r\n\t\t\tCompassHits hits = session.find(\"ResidentpersonId:\" + this.personId.getHValue());\r\n\t\t\tif (hits.length() > 0) {\r\n\t\t\t\tCompassHit hit = hits.hit(0);\r\n\t\t\t\tperson = (Person) hit.getData();\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\tcal.setTime(this.visitTime[visitNo]);\r\n\t\t\tString StrYear = String.valueOf(cal.get(Calendar.YEAR));\r\n\r\n\t\t\tInfo gxyInfo = person.getGxyInfo();\r\n\t\t\tList<YearService> servicesOfYear = new ArrayList<YearService>();\r\n\t\t\tif (gxyInfo == null) {\r\n\t\t\t\tInfo Info = new GxyInfo();\r\n\t\t\t\tInfo.setIf_gxy(true);\r\n\t\t\t\tInfo.setDiagTime(new Date());\r\n\t\t\t\tperson.setGxyInfo(Info);\r\n\t\t\t\tgxyInfo = Info;\r\n\t\t\t} // else {\r\n\t\t\t\r\n\t\t\tservicesOfYear = gxyInfo.getYearServices();\r\n\t\t\tboolean found = false;\r\n\t\t\tfor (YearService ys : servicesOfYear) {\r\n\t\t\t\tif (ys.getYear().equals(StrYear)) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\tGxyService[] gxyServices = ys.getServicesOfYear();\r\n\t\t\t\t\tgxyServices[visitNo] = currentService;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (!found) {\r\n\t\t\t\tYearService newYs = new YearService();\r\n\t\t\t\tnewYs.setYear(StrYear);\r\n\t\t\t\tGxyService[] gxyServices = newYs.getServicesOfYear();\r\n\t\t\t\tfor (int i = 0; i < gxyServices.length; i++) {\r\n\t\t\t\t\tgxyServices[i] = new GxyService();\r\n\t\t\t\t\tgxyServices[i].setId(System.nanoTime());\r\n\t\t\t\t}\r\n\t\t\t\tgxyServices[visitNo] = currentService;\r\n\t\t\t\tservicesOfYear.add(newYs);\r\n\r\n\t\t\t}\r\n\t\t\t// }\r\n\t\t\tgxyInfo.setYearServices(servicesOfYear);\r\n\t\t\tperson.setGxyInfo(gxyInfo);\r\n\r\n\t\t\t// session.save(this.doctors[this.visitNo]);\r\n\t\t\t// gxyInfo.setId(System.nanoTime());\r\n\r\n\t\t\tsession.save(currentService);\r\n\t\t\tsession.save(person);\r\n\t\t\ttx.commit();\r\n\t\t\tsession.close();\r\n\t\t\tsuper.saveFile(this);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void save(RaceSituation raceSituation);", "@Override\n public void save(final Score score) {\n Preconditions.checkNotNull(score, \"Score must not be null.\");\n\n LOG.info(\"Saving {} to database.\", score.toString());\n\n Session session = FACTORY.openSession();\n\n session.beginTransaction();\n session.save(score);\n session.getTransaction().commit();\n\n session.close();\n }", "public void save() {\n settingService.saveMaxScore(score);\r\n// powerUpCount = 0;\r\n// powerDownCount = 0;\r\n// purplePowerCount = 0;\r\n// yellowMadnessCount = 0;\r\n// shapeCount = 0;\r\n }", "public static void save() {\n if (instance != null) {\n // -> SyncedDatabases.syncAll();\n instance.markDirty();\n }\n }", "public void save() {\n }", "public static boolean createNewLeague(LeagueBean l) {\r\n\t\t\r\n\t\tboolean status = false;\t\t\t\t\t// Status of createNewUser\r\n\t\tConnection conn = null;\t\t\t\t\t// DB Connection\r\n\t\tPreparedStatement insertNewLeague = null;\r\n\t\tint result = 0;\r\n\r\n\t\t// Connect to Database \r\n\t\ttry {\r\n\t\t\tconn = ConnectionManager.getConnection();\r\n\t\t\tinsertNewLeague = conn.prepareStatement(\"INSERT INTO league (leagueName, leaguePlayoffs, leaguePlayoffTeams, leagueStatus) VALUE (?,?,?,?)\");\r\n\t\t\tinsertNewLeague.setString(1, l.getLeagueName());\r\n\t\t\tinsertNewLeague.setString(2, l.getLeaguePlayoffs());\r\n\t\t\tinsertNewLeague.setString(3, l.getLeaguePlayoffTeams());\r\n\t\t\tinsertNewLeague.setString(4, l.getLeagueStatus());\r\n\t\t\t\r\n\t\t\tresult = insertNewLeague.executeUpdate();\r\n\t\t\tif(result == 1) {\r\n\t\t\t\tstatus = true;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\r\n\t\t// Catch all possible Exceptions\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} finally {\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (insertNewLeague != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinsertNewLeague.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t \r\n\t\treturn status;\r\n\t}", "public final Long save() {\n\t\tid = Ollie.save(this);\n\t\tOllie.putEntity(this);\n\t\tnotifyChange();\n\t\treturn id;\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Test\r\n\tpublic void saveTeamProgram() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeamProgram \r\n\t\tInteger teamId_1 = 0;\r\n\t\tProgram related_program = new wsdm.domain.Program();\r\n\t\tTeam response = null;\r\n\t\tresponse = service.saveTeamProgram(teamId_1, related_program);\r\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveTeamProgram\r\n\t}", "private void saveLocations(){\n\n final LocationsDialog frame = this;\n WorkletContext context = WorkletContext.getInstance();\n\n LocationsTableModel model = (LocationsTableModel) locationsTable.getModel();\n final HashMap<Integer, Location> dirty = model.getDirty();\n\n\n for(Integer id : dirty.keySet()) {\n Location location = dirty.get(id);\n\n\n if (!Helper.insert(location, \"Locations\", context)) {\n System.out.print(\"insert failed!\");\n }\n\n }// end for\n\n model.refresh();\n\n }", "protected void saveEarningHistory(EarningHistory earningHistory){\n }", "private static void updateRecords() {\n for (Team t: Main.getTeams()){\n //If the team already exists\n if (SqlUtil.doesTeamRecordExist(c,TABLE_NAME,t.getIntValue(Team.NUMBER_KEY))){\n //Update team record\n updateTeamRecord(t);\n } else {\n //Create a new row in database\n addNewTeam(t);\n\n }\n }\n\n }", "public boolean save();", "public void updateGameInDatabase(@Nullable Game game, @Nullable OnCompleteListener listener) {\n if (game == null) throw new IllegalArgumentException();\n if (!game.getHasBeenAdded()) {\n putGame(game);\n }\n if (listener != null) {\n gamesRef.child(game.getId()).setValue(game.getGameDbData()).addOnCompleteListener(listener);\n } else {\n gamesRef.child(game.getId()).setValue(game.getGameDbData());\n }\n }", "public void save() {\n\t\ttry {\n\t\t\t// use buffering\n\t\t\tOutputStream file = new FileOutputStream(\"games.txt\");\n\t\t\tOutputStream buffer = new BufferedOutputStream(file);\n\t\t\tObjectOutput output = new ObjectOutputStream(buffer);\n\t\t\ttry {\n\t\t\t\tif (gameOver) {\n\t\t\t\t\t//notify no need to save completed game\n\t\t\t\t} else {\n\t\t\t\t\tgames.add(this);\n\t\t\t\t\toutput.writeObject(games);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\toutput.close();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Save not successful\");\n\t\t}\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "@Override\n\tpublic void saveCoach(Coach coach) {\n\t\tthis.getHibernateTemplate().save(coach);\n\t}", "public void addBestelling(Bestelling bestelling) {\n\r\n DatabaseConnection connection = new DatabaseConnection();\r\n if(connection.openConnection())\r\n {\r\n // If a connection was successfully setup, execute the INSERT statement\r\n\r\n connection.executeSQLInsertStatement(\"INSERT INTO bestelling (`bestelId`, `tafelId`) VALUES(\" + bestelling.getId() + \",\" + bestelling.getTafelId() + \");\");\r\n\r\n for(Drank d : bestelling.getDranken()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO drank_bestelling (`DrankID`, `BestelId`, `hoeveelheid`) VALUES (\" + d.getDrankId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n for(Gerecht g : bestelling.getGerechten()) {\r\n connection.executeSQLInsertStatement(\"INSERT INTO gerecht_bestelling (`GerechtID`, `BestelId`, `hoeveelheid`) VALUES (\" + g.getGerechtId() + \",\" + bestelling.getId() + \", `1`\");\r\n }\r\n\r\n\r\n //Close DB connection\r\n connection.closeConnection();\r\n }\r\n\r\n }", "@Override\r\n\tpublic void save() {\n\t\tif (section != null && !section.isEmpty()) {\r\n\t\t\tif (gradeLevel == null || gradeLevel.isEmpty()) {\r\n\t\t\t\tSection sec = (Section) Section.extractObject(Section.class.getSimpleName(), section);\r\n\t\t\t\tgradeLevel = sec.gradeLevel;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (course == null && gradeLevel != null && !gradeLevel.isEmpty()) {\r\n\t\t\tGradeLevel lvl = (GradeLevel) GradeLevel.extractObject(GradeLevel.class.getSimpleName(), gradeLevel);\r\n\t\t\tcollege = lvl.college;\r\n\t\t\tcourse = lvl.course;\r\n\t\t}\r\n\t\tif (course!=null && course.startsWith(\"B\")) {\r\n\t\t\tcollege = true;\r\n\t\t}\r\n\t\tif (!isEmptyKey()) {\r\n//\t\t\twe can get the latest enrollment schoolyear\r\n\t\t\ttry {\r\n\t\t\t\tif (\"ENROLLED\".equals(status)) {\r\n\t\t\t\t\tString sc = DBClient.getSingleColumn(BeanUtil.concat(\"SELECT a.schoolYear FROM Enrollment a WHERE a.studentId=\",personId,\" ORDER BY a.schoolYear DESC\")).toString();\r\n\t\t\t\t\tlatestSchoolYear = sc;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (schoolYear==null || schoolYear.isEmpty()) {\r\n\t\t\tschoolYear = AppConfig.getSchoolYear();\r\n\t\t}\r\n\t\tpersonType = \"STUDENT\";\r\n\t\tif (isEmptyKey()) {\r\n\t\t\tsuper.save();\r\n new springbean.SchoolDefaultProcess().createAllSubjects(this);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsuper.save();\r\n\t\t}\r\n\t}", "@Override\n public void save(JavaStudyClub javaStudyClub) {\n entityManager.persist(javaStudyClub);\n }", "@Override\n\tpublic void saveMall(Mall newMall) {\n\t\t\n\t}", "public void saveGame();", "public void save()\n\t{\n\t\tfor(PlayerData pd : dataMap.values())\n\t\t\tpd.save();\n\t}", "public Team insert(League league, String teamName) {\n StandingDB sdb = new StandingDB();\n TeamDB tdb = new TeamDB();\n String teamID = generateTeamID();\n \n Standing standing = new Standing(teamID);\n \n Team team = new Team(teamID, teamName);\n team.setLeagueID(league);\n \n tdb.insert(team);\n sdb.insert(standing);\n return team;\n }", "@Override\n\tpublic Integer saveRoad(Road road) {\n\t\treturn this.roadDao.saveRoad(road);\n\t}", "@Override\n\tpublic void save(Employee theEmployee) {\n\t\t\n\t}", "Skill saveSkill(Skill skill);", "public void saveFightsystem( Fightsystem fightsystem )\r\n {\n\r\n }", "public Game saveGame(Game game) {\n return gameRepository.save(game);\n }", "public Flight save(Flight flight);", "public void testSave() {\r\n\r\n\t\ttry {\r\n\t\t\tLevelOfCourt levelOfCourt = new LevelOfCourt();\r\n\r\n\t\t\ttry {\r\n\r\n\t\t\t\tlevelOfCourt.setName(\"alpha\");\r\n\r\n\t\t\t\tTestDataFactory jurisdictionTestDataFactory = (TestDataFactory) BeanHelper\r\n\t\t\t\t\t\t.getBean(\"jurisdictionTestDataFactory\");\r\n\r\n\t\t\t\tlevelOfCourt\r\n\t\t\t\t\t\t.setJurisdiction((com.cc.civlit.domain.courtdivisions.Jurisdiction) jurisdictionTestDataFactory\r\n\t\t\t\t\t\t\t\t.loadOneRecord());\r\n\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\tlevelOfCourtService.save(levelOfCourt);\r\n\t\t\tassertNotNull(levelOfCourt.getId());\r\n\t\t} catch (Exception e) {\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "private void saveVslaInformation() {\n if (!databaseHandler.checkIfGroupExists(vslaName)) { // Group Doesn't exist in the database\n\n VslaInfo vslaInfo = new VslaInfo();\n vslaInfo.setGroupName(vslaName);\n vslaInfo.setMemberName(representativeName);\n vslaInfo.setMemberPost(representativePost);\n vslaInfo.setMemberPhoneNumber(repPhoneNumber);\n vslaInfo.setGroupAccountNumber(grpBankAccount);\n vslaInfo.setPhysicalAddress(physAddress);\n vslaInfo.setRegionName(regionName);\n vslaInfo.setLocationCordinates(locCoordinates);\n vslaInfo.setIssuedPhoneNumber(grpPhoneNumber);\n vslaInfo.setSupportType(grpSupportType);\n vslaInfo.setIsDataSent(\"0\");\n vslaInfo.setNumberOfCycles(numberOfCycles);\n\n // get the Id of the Group just added to the database\n currentDatabaseId = databaseHandler.addGroupData(vslaInfo);\n flashMessage(\"Data Saved Successfully\");\n\n } else {\n flashMessage(\"Group Already Exists\");\n }\n }", "@Override\n public void save() {\n \n }", "@Override\n public void saveGame() {\n\n }", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "public void insertTeam(Team t) {\n\t\tEntityManager em = emfactory.createEntityManager();\n\t\tem.getTransaction().begin();\n\t\tem.persist(t);\n\t\tem.getTransaction().commit();\n\t\tem.close();\n\t}", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "public void save() {\n\t\tthis.setState(Constants.CWorld.STATE_SAVING);\n\t\tthis.getWorld().saveAll();\n\t\tthis.setState(Constants.CWorld.STATE_ONLINE);\n\t}", "@Override\n public void save()\n {\n \n }", "private void saveToDb() {\r\n ContentValues values = new ContentValues();\r\n values.put(DbAdapter.KEY_DATE, mTime);\r\n if (mPayeeText != null && mPayeeText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_PAYEE, mPayeeText.getText().toString());\r\n if (mAmountText != null && mAmountText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_AMOUNT, mAmountText.getText().toString());\r\n if (mCategoryText != null && mCategoryText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_CATEGORY, mCategoryText.getText().toString());\r\n if (mMemoText != null && mMemoText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_MEMO, mMemoText.getText().toString());\r\n if (mTagText != null && mTagText.getText() != null)\r\n \tvalues.put(DbAdapter.KEY_TAG, mTagText.getText().toString());\r\n\r\n \tif (Utils.validate(values)) {\r\n \t\tmDbHelper.open();\r\n \t\tif (mRowId == null) {\r\n \t\t\tlong id = mDbHelper.create(values);\r\n \t\t\tif (id > 0) {\r\n \t\t\t\tmRowId = id;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tmDbHelper.update(mRowId, values);\r\n \t\t}\r\n \t\tmDbHelper.close();\r\n \t}\r\n\t}", "public void saveStudyLanguage(StudyLanguage studyLanguage) {\r\n\t\tQuery query = getSession()\r\n\t\t\t\t.createSQLQuery(\"INSERT INTO study_language (id_project, id_language) VALUES (:valor1, :valor2)\");\r\n\t\tquery.setParameter(\"valor1\", studyLanguage.getProject().getIdProject());\r\n\t\tquery.setParameter(\"valor2\", studyLanguage.getLanguage().getIdLanguage());\r\n\t\tquery.executeUpdate();\r\n\r\n\t}", "@Test\r\n public void testSave() {\r\n System.out.println(\"save\");\r\n Festivity object = new Festivity();\r\n object.setStart(Calendar.getInstance().getTime());\r\n object.setEnd(Calendar.getInstance().getTime());\r\n object.setName(\"Test Fest\"+System.currentTimeMillis());\r\n object.setPlace(\"Narnia\");\r\n boolean expResult = true;\r\n boolean result = Database.save(object);\r\n assertEquals(expResult, result);\r\n }", "void saveGame();", "private void saveGoal() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String descriptionString = mDescriptionEditText.getText().toString().trim();\n\n\n // Check if this is supposed to be a new product\n // and check if all the fields in the editor are blank\n if (mCurrentGoalUri == null && (TextUtils.isEmpty(descriptionString) )) {\n Toast.makeText(this, \"Please add info to all the fields\",\n Toast.LENGTH_SHORT).show();\n // Since no fields were modified, we can return early without creating a new goal.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and goal attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(GoalandTaskMatcherContract.GoalEntry.COLUMN_GOAL_DESCRIPTION, descriptionString);\n\n // Determine if this is a new or existing goal by checking if mCurrentGoalUri is null or not\n if (mCurrentGoalUri == null) {\n // This is a NEW goal, so insert a new goal into the provider,\n // returning the content URI for the new goal.\n Uri newUri = getContentResolver().insert(GoalandTaskMatcherContract.GoalEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_goal_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_goal_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING goal, so update the goal with content URI: mCurrentGoalUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentGoalUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentGoalUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_goal_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_goal_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public void commitChanges()\n {\n }", "Lembretes persistir(Lembretes lembretes);", "@RequestMapping(value = \"/team/{league}\", method = POST, consumes = MEDIA_JSON)\n @ResponseStatus(CREATED)\n public LobbyTeam createTeamAndEnter(@AuthenticationPrincipal UserSimpleDetails user,\n @PathVariable(\"league\") LobbyLeagueEnum league)\n throws TeamFullException, TeamNotFoundException {\n log.info(\"user {} creates team\", user.getIdentity());\n LobbyTeam team = lobbyService.createTeam(user.getProfileId(), league);\n return lobbyService.enterIntoTeam(user.getProfileId(), team.getId().toString());\n }" ]
[ "0.72519296", "0.6845025", "0.64635473", "0.63607484", "0.6079611", "0.59807324", "0.596506", "0.59600794", "0.58404857", "0.580571", "0.5797275", "0.57958734", "0.5715071", "0.57024527", "0.5698951", "0.56821686", "0.5663532", "0.5654768", "0.56533253", "0.56466454", "0.561898", "0.5601668", "0.55886734", "0.55876213", "0.55836743", "0.5561963", "0.5561963", "0.5561963", "0.5561963", "0.5534241", "0.5523365", "0.55224806", "0.55222833", "0.5517512", "0.5511353", "0.5501964", "0.54959685", "0.5491772", "0.54802454", "0.5474433", "0.54587275", "0.54566294", "0.5430345", "0.5426845", "0.54088545", "0.5403146", "0.54012716", "0.5386301", "0.53702706", "0.5367844", "0.5356533", "0.5356362", "0.53440064", "0.53435314", "0.5336716", "0.53326625", "0.5330278", "0.5328865", "0.53224885", "0.53224885", "0.5321582", "0.53191847", "0.53165674", "0.53070706", "0.5299602", "0.5292802", "0.52897936", "0.52777797", "0.52692246", "0.5263071", "0.52571493", "0.5254096", "0.52533436", "0.5249389", "0.52461267", "0.52449566", "0.5234567", "0.5226937", "0.52241665", "0.5223272", "0.5223038", "0.5218714", "0.52179855", "0.52133137", "0.52112585", "0.52071226", "0.520465", "0.520465", "0.52016574", "0.5197991", "0.5197041", "0.5196617", "0.51742303", "0.5172714", "0.5172144", "0.51707536", "0.51705074", "0.516917", "0.5169003", "0.5164146" ]
0.64899176
2
The deleteDivision method deletes the division recursively
public static boolean deleteLeague(String lId) { boolean status = false; // Status of createNewUser Connection conn = null; // DB Connection PreparedStatement deleteLXD = null; PreparedStatement deleteLeague = null; int result = 0; // Connect to Database try { conn = ConnectionManager.getConnection(); deleteLXD = conn.prepareStatement("DELETE FROM leaguexdivision USING leaguexdivision, league WHERE `league`.`leagueID` = `leaguexdivision`.`leagueID` AND league.leagueID=?"); deleteLXD.setString(1, lId); result = deleteLXD.executeUpdate(); if(result >= 0) { deleteLeague = conn.prepareStatement("DELETE FROM league USING league WHERE league.leagueID=?"); deleteLeague.setString(1, lId); result = deleteLeague.executeUpdate(); if(result >= 0) { status = true; } } // Catch all possible Exceptions } catch (Exception e) { System.out.println(e); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } if (deleteLXD != null) { try { deleteLXD.close(); } catch (SQLException e) { e.printStackTrace(); } } if (deleteLeague != null) { try { deleteLeague.close(); } catch (SQLException e) { e.printStackTrace(); } } } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int delete(Subdivision subdivision);", "public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }", "@Test\n public void normal_recursive_delete_WebDAV_collection() {\n String collectionName = \"deleteDavCollection\";\n String davFileName = \"davFile.txt\";\n\n try {\n // Create collection.\n DavResourceUtils.createWebDAVCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName,\n Setup.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED);\n // Create dav file.\n DavResourceUtils.createWebDAVFile(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName + \"/\" + davFileName,\n \"text/html\", TOKEN, \"foobar\", HttpStatus.SC_CREATED);\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "@Override\r\n\tpublic int deleteExcursion(Excursion excu) {\n\t\tSession s = sf.getCurrentSession();\r\n\t\t\r\n\t\t//retrouver l'objet excursion par son nom\r\n\t\texcu=this.getExcu(excu);\r\n\t\t\r\n\t\ttry{\r\n\t\t\ts.delete(excu);\r\n\t\t\treturn 1;\r\n\t\t\t\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "public final void rule__PredicateDivision__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4605:1: ( ( '/' ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4606:1: ( '/' )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4606:1: ( '/' )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4607:1: '/'\n {\n before(grammarAccess.getPredicateDivisionAccess().getSolidusKeyword_1_1()); \n match(input,31,FOLLOW_31_in_rule__PredicateDivision__Group_1__1__Impl9056); \n after(grammarAccess.getPredicateDivisionAccess().getSolidusKeyword_1_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void division(){\n ObjEmp obj1 = this.depile();\n ObjEmp obj2 = this.depile();\n try{\n obj2.division(obj1);\n this.empile(obj2);\n }\n catch(NullPointerException nullPE){\n try{\n writer.write(\"Impossible to divide : either obj1=\"+obj1+\" or obj2=\"+obj2+ \" is null\\n\");\n writer.flush();\n }\n catch(IOException e){\n printStream.println(\"I/O exception!!!\");\n }\n if(obj2 != null)\n this.empile(obj2);\n if(obj1 != null)\n this.empile(obj1);\n }\n catch(ArithmeticException zeroE){\n try{\n writer.write(\"Impossible to divide : obj1=\"+obj1+ \" is 0\\n\");\n writer.flush();\n }\n catch(IOException e){\n printStream.println(\"I/O exception!!!\");\n }\n this.empile(obj2);\n this.empile(obj1);\n }\n }", "public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }", "@Test\n public void normal_recursive_delete_OData_collection() {\n String collectionName = \"deleteOdata\";\n String entityType = \"deleteEntType\";\n String accept = \"application/xml\";\n String complexTypeName = \"deleteComplexType\";\n String complexTypePropertyName = \"deleteComplexTypeProperty\";\n\n try {\n // Create collection.\n DavResourceUtils.createODataCollection(TOKEN, HttpStatus.SC_CREATED, Setup.TEST_CELL1, Setup.TEST_BOX1,\n collectionName);\n // Create entity type.\n Http.request(\"box/entitySet-post.txt\")\n .with(\"cellPath\", Setup.TEST_CELL1)\n .with(\"boxPath\", Setup.TEST_BOX1)\n .with(\"odataSvcPath\", collectionName)\n .with(\"token\", \"Bearer \" + TOKEN)\n .with(\"accept\", accept)\n .with(\"Name\", entityType)\n .returns()\n .statusCode(HttpStatus.SC_CREATED);\n // Create complex type.\n ComplexTypeUtils.create(Setup.TEST_CELL1, Setup.TEST_BOX1,\n collectionName, complexTypeName, HttpStatus.SC_CREATED);\n // Create complex type property.\n ComplexTypePropertyUtils.create(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName, complexTypePropertyName,\n complexTypeName, \"Edm.String\", HttpStatus.SC_CREATED);\n\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "@Override\n public void deletePartida(String idPartida) {\n template.opsForHash().delete(idPartida, \"jugador1\");\n template.opsForHash().delete(idPartida, \"jugador2\");\n template.opsForSet().remove(\"partidas\",idPartida);\n }", "private void subDivideNode() {\n setOriginNode();\n _subdivided = true;\n _northWest = new QuadTree<Point>(getView(), _transitionSize);\n _northEast = new QuadTree<Point>(getView(), _transitionSize);\n _southWest = new QuadTree<Point>(getView(), _transitionSize);\n _southEast = new QuadTree<Point>(getView(), _transitionSize);\n Iterator<Point> it = _elements.iterator();\n while (it.hasNext()) {\n Point p = it.next();\n QuadTree<Point> qt = quadrant(p);\n qt.add(p);\n }\n _elements = null;\n _elementsSize = 0;\n }", "Division createDivision();", "void deleteTreeRef(Node nodeRef) {\n\t\tSystem.out.println(\"\\nSize of given Tree before delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t\tdeleteTree(nodeRef);\n\t\tnodeRef = null;\n\n\t\tSystem.out.println(\"\\nSize of given Tree after delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t}", "@Test\n public void normal_recursive_delete_EngineService_collection() {\n String collectionName = \"deleteEngineSvcCollection\";\n String srcFileName = \"srcFile.js\";\n\n try {\n // Create collection.\n DavResourceUtils.createServiceCollection(Setup.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED,\n Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName);\n // Create dav file.\n DavResourceUtils.createServiceCollectionSource(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName,\n srcFileName, \"text/javascript\", TOKEN, \"foobar\", HttpStatus.SC_CREATED);\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "public void delete() {\n this.root = null;\n }", "private String doDivision(String answer)\n\t{\n\t\tint signSpot;\n\t\tString stringToDelete;\n\t\tdouble number1;\n\t\tdouble number2;\n\t\tint minValue = 0;\n\t\tint maxValue = 0;\n\n\t\twhile (answer.contains(\"/\"))\n\t\t{\n\t\t\tsignSpot = answer.indexOf(\"/\");\n\n\t\t\t// start\n\t\t\tfor (int count = signSpot - 1; count >= 0; count -= 1)\n\t\t\t{\n\t\t\t\tif (isNumeric(answer.substring(count, count + 1)) == true\n\t\t\t\t\t\t|| answer.substring(count, count + 1).equals(\".\"))\n\t\t\t\t{\n\t\t\t\t\tminValue = count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// finish\n\t\t\tfor (int count = signSpot + 2; count <= answer.length(); count += 1)\n\t\t\t{\n\t\t\t\tif (isNumeric(answer.substring(count - 1, count)) == true\n\t\t\t\t\t\t|| answer.substring(count - 1, count).equals(\".\"))\n\t\t\t\t{\n\t\t\t\t\tmaxValue = count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstringToDelete = answer.substring(minValue, maxValue);\n\t\t\tString myString = answer.substring(minValue, signSpot);\n\t\t\tnumber1 = Double.parseDouble(myString);\n\t\t\tmyString = answer.substring(signSpot + 1, maxValue);\n\t\t\tnumber2 = Double.parseDouble(myString);\n\t\t\tDouble numberAnswer1 = number1 / number2;\n\t\t\tanswer = answer.replace(stringToDelete, \"\" + numberAnswer1);\n\t\t\tSystem.out.println(answer);\n\t\t}\n\t\treturn answer;\n\t}", "public void doDeleteAlbum(AlbumDTO dto)\n/* */ {\n/* 64 */ this.galleryManager.deleteAlbum(dto);\n/* 65 */ this.albumList.remove(dto);\n/* */ }", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "@AfterClass(groups ={\"All\"})\n\tpublic void deleteFolder() {\n\t\ttry {\n\t\t\tUserAccount account = dciFunctions.getUserAccount(suiteData);\n\t\t\tUniversalApi universalApi = dciFunctions.getUniversalApi(suiteData, account);\n\t\t\tif(suiteData.getSaasApp().equalsIgnoreCase(\"Salesforce\")){\n\t\t\t\tfor(String id:uploadId){\n\t\t\t\t\tMap<String,String> fileInfo = new HashMap<String,String> ();\n\t\t\t\t\tfileInfo.put(\"fileId\", id);\n\t\t\t\t\tdciFunctions.deleteFile(universalApi, suiteData, fileInfo);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tdciFunctions.deleteFolder(universalApi, suiteData, folderInfo);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tLogger.info(\"Issue with Delete Folder Operation \" + ex.getLocalizedMessage());\n\t\t}\n\t}", "public final void rule__PredicateDivision__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4574:1: ( ( () ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4575:1: ( () )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4575:1: ( () )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4576:1: ()\n {\n before(grammarAccess.getPredicateDivisionAccess().getPredicateDivLeftAction_1_0()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4577:1: ()\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4579:1: \n {\n }\n\n after(grammarAccess.getPredicateDivisionAccess().getPredicateDivLeftAction_1_0()); \n\n }\n\n\n }\n\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "private void deleteHierarchyData(TreePath[] selRows) {\r\n SponsorHierarchyBean delBean;\r\n CoeusVector delData = new CoeusVector();\r\n TreePath treePath=selRows[selRows.length-1];\r\n DefaultMutableTreeNode selNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();\r\n int selRow=sponsorHierarchyTree.getRowForPath(treePath);\r\n String optionPaneMsg=EMPTY_STRING;\r\n if(selNode.isRoot()) return;\r\n if(!selNode.getAllowsChildren()) {\r\n if(selRows.length > 1) {\r\n optionPaneMsg = coeusMessageResources.parseMessageKey(\"maintainSponsorHierarchy_exceptionCode.1252\");\r\n }else {\r\n optionPaneMsg = \"Do you want to remove the sponsor \"+selNode.toString()+\" from the hierarchy?\";\r\n }\r\n int optionSelected = CoeusOptionPane.showQuestionDialog(optionPaneMsg,CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n if(optionSelected == CoeusOptionPane.SELECTION_YES) {\r\n for (int index=selRows.length-1; index>=0; index--) {\r\n treePath = selRows[index];\r\n selRow = sponsorHierarchyTree.getRowForPath(treePath);\r\n selNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();\r\n int endIndex = selNode.toString().indexOf(\":\");\r\n Equals getRowData = new Equals(\"sponsorCode\",selNode.toString().substring(0,endIndex == -1 ? selNode.toString().length():endIndex));\r\n CoeusVector cvFilteredData = getDeleteData(cvHierarchyData.filter(getRowData));\r\n delBean = (SponsorHierarchyBean)cvFilteredData.get(0);\r\n delBean.setAcType(TypeConstants.DELETE_RECORD);\r\n flushBean(delBean);//Added for bug fix Start #1830\r\n model.removeNodeFromParent(selNode);\r\n delData.addAll(cvFilteredData);\r\n saveRequired = true;\r\n }\r\n }\r\n } else {\r\n \r\n// int optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the Group \"+selNode.toString()+\" all its children from the hierarchy.\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_YES);\r\n int optionSelected = -1;\r\n try{\r\n if(selNode != null && selNode.getLevel() == 1 && isPrintingHierarchy && isFormsExistInGroup(selNode.toString())){\r\n optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the group \"+selNode.toString()+\" , all its children and associated sponsor forms from the hierarchy?\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n }else{\r\n optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the Group \"+selNode.toString()+\" , all its children from the hierarchy.\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n }\r\n }catch(CoeusUIException coeusUIException){\r\n CoeusOptionPane.showDialog(coeusUIException);\r\n return ;\r\n }\r\n if(optionSelected == CoeusOptionPane.SELECTION_YES) {\r\n //Case#2445 - proposal development print forms linked to indiv sponsor, should link to sponsor hierarchy - Start\r\n if(isPrintingHierarchy && selectedNode.getLevel() == 1){\r\n TreeNode root = (TreeNode)sponsorHierarchyTree.getModel().getRoot();\r\n TreePath result = findEmptyGroup(sponsorHierarchyTree, new TreePath(root));\r\n if( result == null){\r\n try{\r\n deleteForms(selNode.toString());\r\n }catch(CoeusUIException coeusUIException){\r\n CoeusOptionPane.showDialog(coeusUIException);\r\n return ;\r\n }\r\n }\r\n }\r\n Equals getRowData = new Equals(fieldName[selNode.getLevel()],selNode.toString());\r\n CoeusVector cvFilteredData = getDeleteData(cvHierarchyData.filter(getRowData));//Modified for bug fix Start #1830\r\n model.removeNodeFromParent(selNode);\r\n for (int i=0; i<cvFilteredData.size(); i++) {\r\n delBean = (SponsorHierarchyBean)cvFilteredData.get(i);\r\n delBean.setAcType(TypeConstants.DELETE_RECORD);\r\n flushBean(delBean);//Added for bug fix Start #1830\r\n saveRequired = true;\r\n }\r\n delData.addAll(cvFilteredData);\r\n }\r\n }\r\n if(selRow < sponsorHierarchyTree.getRowCount() && \r\n ((DefaultMutableTreeNode)sponsorHierarchyTree.getPathForRow(selRow).getLastPathComponent()).getAllowsChildren() && !selNode.getAllowsChildren())\r\n sponsorHierarchyTree.setSelectionPath(treePath.getParentPath());\r\n else\r\n if(selRow >= sponsorHierarchyTree.getRowCount())\r\n selRow = 0;\r\n sponsorHierarchyTree.setSelectionRow(selRow);\r\n \r\n groupsController.refreshTableData(delData);\r\n }", "public void delete(E data){\n \t// Preform a regular delete\n \t// Check to make sure the tree remains an RBT tree\n\tNode<E> z = search(data);\n\tNode<E> x = sentinel;\n\tNode<E> y = z;\n\tCharacter y_original_color = y.getColor();\n\tif (z.getLeftChild() == sentinel) {\n\t\tx = z.getRightChild();\n\t\ttransplant(z, z.getRightChild());\n\t} else if (z.getRightChild() == sentinel) {\n\t\tx = z.getLeftChild();\n\t\ttransplant(z, z.getLeftChild());\n\t} else {\n\t\ty = getMin(z.getRightChild());\n\t\ty_original_color = y.getColor();\n\t\tx = y.getRightChild();\n\t\tif (y.getParent() == z) {\n\t\t\tx.setParent(y);\n\t\t} else {\n\t\t\ttransplant(y, y.getRightChild());\n\t\t\ty.setRightChild(z.getRightChild());\n\t\t\ty.getRightChild().setParent(y);\n\t\t}\n\t\t\n\t\ttransplant(z, y);\n\t\ty.setLeftChild(z.getLeftChild());\n\t\ty.getLeftChild().setParent(y);\n\t\ty.setColor(z.getColor());\n\t}\n\t\n\tif (y_original_color == 'B') {\n\t\tfixDelete(x);\n\t}\n\t\t\n \n }", "@Override\r\n public void deleteFolder(long id) {\n this.folderRepository.deleteById(id);; \r\n }", "public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }", "public void completeMultDivExpr_Op(EObject model, Assignment assignment, ContentAssistContext context,\n\t\t\tICompletionProposalAcceptor acceptor) {\n\t\t// subclasses may override\n\t\t// subclasses may override\n\t\t// subclasses may override\n\t}", "public Resolution delete() {\r\n log.debug(\"delete() excursion={}\", excursion);\r\n //only id is filled by the form\r\n excursion = facade.getExcursion(excursion.getId());\r\n facade.deleteExcursion(excursion);\r\n getContext().getMessages().add(new LocalizableMessage(\"excursion.delete.message\",escapeHTML(excursion.getDescription())));\r\n return new RedirectResolution(this.getClass(), \"list\");\r\n }", "public final void rule__PredicateDivision__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4530:1: ( rule__PredicateDivision__Group__1__Impl )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4531:2: rule__PredicateDivision__Group__1__Impl\n {\n pushFollow(FOLLOW_rule__PredicateDivision__Group__1__Impl_in_rule__PredicateDivision__Group__18902);\n rule__PredicateDivision__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__PredicateDivision__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4501:1: ( rule__PredicateDivision__Group__0__Impl rule__PredicateDivision__Group__1 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4502:2: rule__PredicateDivision__Group__0__Impl rule__PredicateDivision__Group__1\n {\n pushFollow(FOLLOW_rule__PredicateDivision__Group__0__Impl_in_rule__PredicateDivision__Group__08843);\n rule__PredicateDivision__Group__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__PredicateDivision__Group__1_in_rule__PredicateDivision__Group__08846);\n rule__PredicateDivision__Group__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "void deleteSub();", "public final void rulePredicateDivision() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_ML_COMMENT\", \"RULE_SL_COMMENT\", \"RULE_WS\");\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:656:2: ( ( ( rule__PredicateDivision__Group__0 ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:657:1: ( ( rule__PredicateDivision__Group__0 ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:657:1: ( ( rule__PredicateDivision__Group__0 ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:658:1: ( rule__PredicateDivision__Group__0 )\n {\n before(grammarAccess.getPredicateDivisionAccess().getGroup()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:659:1: ( rule__PredicateDivision__Group__0 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:659:2: rule__PredicateDivision__Group__0\n {\n pushFollow(FOLLOW_rule__PredicateDivision__Group__0_in_rulePredicateDivision1206);\n rule__PredicateDivision__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getPredicateDivisionAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }", "private void deleteOperacion(Operacion op){\r\n\t\t\r\n\t\tfor(Categoria cat:op.getLstCategorias())\r\n\t\t\tcat.getLstOperaciones().remove(op);\r\n\t\t\r\n\t\toperacionDao.delete(op.getIdOperacion());\r\n\t}", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}", "@objid (\"808c0839-1dec-11e2-8cad-001ec947c8cc\")\n @Override\n public void delete() {\n // List children from the end to avoid reordering of the other GMs\n for (int i = this.children.size() - 1; i >= 0; i--) {\n GmNodeModel child = this.children.get(i);\n child.delete();\n \n // When several elements have been deleted consecutively, fix the next index\n if (i > this.children.size()) {\n i = this.children.size();\n }\n }\n \n assert (this.children.isEmpty()) : \"All children should have been deleted:\" + this.children;\n \n super.delete();\n }", "public void divide(int dirOp1, int dirOp2, int dirRes) {\n //traduce casos de direccionamiento indirecto\n dirOp1 = traduceDirIndirecto(dirOp1);\n dirOp2 = traduceDirIndirecto(dirOp2);\n if (ManejadorMemoria.isConstante(dirOp1)) { // OPERANDO 1 CTE\n String valor1 = this.directorioProcedimientos.getConstantes().get(dirOp1).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { //RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else if (ManejadorMemoria.isGlobal(dirOp1)) { // OPERANDO 1 GLOBAL\n String valor1 = this.registroGlobal.getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else { // OPERANDO 1 LOCAL\n String valor1 = this.pilaRegistros.peek().getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES 2 LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { //OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n }\n }", "public void divide()\r\n {\r\n if (fractionDisplay)\r\n {\r\n result = Operations.fractionFormat(leftOperand, rightOperand);\r\n resultDoubles = Operations.divide(leftOperand, rightOperand);\r\n divisionFormatResult = true;\r\n }\r\n else \r\n {\r\n resultDoubles = Operations.divide(leftOperand, rightOperand);\r\n }\r\n resultResetHelper();\r\n }", "public void setDivision(java.lang.String division) {\n this.division = division;\n }", "@Override\n public void markChildrenDeleted() throws DtoStatusException {\n if (polymorphismSite != null) {\n for (com.poesys.db.dto.IDbDto dto : polymorphismSite) {\n dto.cascadeDelete();\n }\n }\n }", "public void doDelete ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\tParameterParser params = data.getParameters ();\n\n\t\tList Items = (List) state.getAttribute(STATE_DELETE_ITEMS);\n\n\t\t// Vector deleteIds = (Vector) state.getAttribute (STATE_DELETE_IDS);\n\n\t\t// delete the lowest item in the hireachy first\n\t\tHashtable deleteItems = new Hashtable();\n\t\t// String collectionId = (String) state.getAttribute (STATE_COLLECTION_ID);\n\t\tint maxDepth = 0;\n\t\tint depth = 0;\n\n\t\tIterator it = Items.iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tBrowseItem item = (BrowseItem) it.next();\n\t\t\tdepth = ContentHostingService.getDepth(item.getId(), item.getRoot());\n\t\t\tif (depth > maxDepth)\n\t\t\t{\n\t\t\t\tmaxDepth = depth;\n\t\t\t}\n\t\t\tList v = (List) deleteItems.get(new Integer(depth));\n\t\t\tif(v == null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tv.add(item);\n\t\t\tdeleteItems.put(new Integer(depth), v);\n\t\t}\n\n\t\tboolean isCollection = false;\n\t\tfor (int j=maxDepth; j>0; j--)\n\t\t{\n\t\t\tList v = (List) deleteItems.get(new Integer(j));\n\t\t\tif (v==null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tIterator itemIt = v.iterator();\n\t\t\twhile(itemIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem item = (BrowseItem) itemIt.next();\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (item.isFolder())\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeCollection(item.getId());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeResource(item.getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (PermissionException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"notpermis6\") + \" \" + item.getName() + \". \");\n\t\t\t\t}\n\t\t\t\tcatch (IdUnusedException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t}\n\t\t\t\tcatch (TypeException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"wrongtype\"));\n\t\t\t\t}\n\t\t\t\tcatch (ServerOverloadException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t\tcatch (InUseException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"locked\"));\n\t\t\t\t}// try - catch\n\t\t\t\tcatch(RuntimeException e)\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\"ResourcesAction.doDelete ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t}\t// for\n\n\t\t}\t// for\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\t// delete sucessful\n\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\n\t\t\tif (((String) state.getAttribute (STATE_SELECT_ALL_FLAG)).equals (Boolean.TRUE.toString()))\n\t\t\t{\n\t\t\t\tstate.setAttribute (STATE_SELECT_ALL_FLAG, Boolean.FALSE.toString());\n\t\t\t}\n\n\t\t}\t// if-else\n\n\t}", "public void delete() {\r\n\t\t\tif (!isDeleted && handles.remove(this)) {\r\n\t\t\t\telementsUsed -= count;\r\n\t\t\t\tisDeleted = true;\r\n\t\t\t\tif (elementsUsed < numElements / 4) {\r\n\t\t\t\t\tcompact();\r\n\t\t\t\t\tnumElements = Math.max(10, elementsUsed * 2);\r\n\t\t\t\t}\r\n\t\t\t\tshapePeer.vboHandle = null;\r\n\t\t\t}\r\n\t\t}", "public void delete(E e) {\n\t\tNode node = getNode(root, e);\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tif (parentOfLast.right != null) {\n\t\t\tnode.data = parentOfLast.right.data;\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tnode.data = parentOfLast.left.data;\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t\tsize--;\n\t}", "public Fraccion division() {\r\n Fraccion division = new Fraccion(operador1.getNumerador()*operador2.getDenominador() , operador1.getDenominador()*operador2.getNumerador());\r\n return simplify(division);\r\n }", "public int getDivisionId() {\n return divisionId;\n }", "private void subdivide() {\n if (!hasChildren) {\n hasChildren = true;\n this.children = new QuadtreeNodeChildren(this);\n } else {\n return;\n }\n }", "public void divide() {\n\t\t\n\t}", "public int devision(int a, int b) {\n\t\tSystem.out.println(\"Division Method is Called\");\n\t\tint c=a/b;\n\t\treturn c;\n\t}", "public final void rule__PredicateDivision__Group_1__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4562:1: ( rule__PredicateDivision__Group_1__0__Impl rule__PredicateDivision__Group_1__1 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4563:2: rule__PredicateDivision__Group_1__0__Impl rule__PredicateDivision__Group_1__1\n {\n pushFollow(FOLLOW_rule__PredicateDivision__Group_1__0__Impl_in_rule__PredicateDivision__Group_1__08964);\n rule__PredicateDivision__Group_1__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__PredicateDivision__Group_1__1_in_rule__PredicateDivision__Group_1__08967);\n rule__PredicateDivision__Group_1__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}", "private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "public abstract void del(Field.RadioData radioData);", "public void subdivide() {\n\t\tif (!divided) {\n\t\t\tdivided = true;\n\t\t\t\n\t\t\t// Calculate the width and height of the sub nodes\n\t\t\tint width = (int) Math.ceil(boundary.width/2.0) + 1;\n\t\t\tint height = (int) Math.ceil(boundary.height/2.0) + 1;\n\t\t\t\n\t\t\t// Create ArrayList for the nodes and insert them\n\t\t\tnodes = new ArrayList<QuadTreeNode<E>>();\n\t\t\t\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x, boundary.y + height, height, width));\n\t\t\tnodes.add(new QuadTreeNode<E>(boundary.x + width, boundary.y + height, height, width));\n\t\t\t\n\t\t\t// Take all the points and insert them into the best sub node\n\t\t\tfor (Point p : points.keySet()) {\n\t\t\t\tQuadTreeNode<E> q = this.getBestQuad(p);\n\t\t\t\tq.add(p, points.get(p));\n\t\t\t}\n\t\t\t\n\t\t\tpoints = null;\n\t\t}\n\t}", "public void deleteParticipacao(Integer id) {\n participacaoRepository.deleteById(id);\n //listClient();\n \n}", "public void deleteGroup(Group group);", "void deleteTree(TreeNode node) \n {\n root = null; \n }", "public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "private Node<E> delete(Node<E> localRoot, E item) {\r\n\t\tif(localRoot == null) {\r\n\t\t\t// item is not in the tree.\r\n\t\t\tdeleteReturn = null;\r\n\t\t\treturn localRoot;\r\n\t\t}\t\r\n\t\t// Search for item to delete\r\n\t\tint compResult = item.compareTo(localRoot.data);\r\n\t\tif(compResult < 0) {\r\n\t\t\t// item is smaller than localRoot.data\r\n\t\t\tlocalRoot.left = delete(localRoot.left, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse if(compResult > 0) {\r\n\t\t\t// item is larger than localRoot.data\r\n\t\t\tlocalRoot.right = delete(localRoot.right, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// item is at the local root\r\n\t\t\tdeleteReturn = localRoot.data;\r\n\t\t\tif(localRoot.left == null) {\r\n\t\t\t\t// if there is no left child, return the right child which can also be null\r\n\t\t\t\treturn localRoot.right;\r\n\t\t\t}\r\n\t\t\telse if(localRoot.right == null) {\r\n\t\t\t\t// if theres no right child, return the left child\r\n\t\t\t\treturn localRoot.left;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//Node being deleted has two children, replace the data with inorder predecessor\r\n\t\t\t\tif(localRoot.left.right == null) {\r\n\t\t\t\t\t// the left child has no right child\r\n\t\t\t\t\t//replace the data with the data in the left child\r\n\t\t\t\t\tlocalRoot.data = localRoot.left.data;\r\n\t\t\t\t\t// replace the left child with its left child\r\n\t\t\t\t\tlocalRoot.left = localRoot.left.left;\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t//Search for in order predecessor(IP) and replace deleted nodes data with IP\r\n\t\t\t\t\tlocalRoot.data = findLargestChild(localRoot.left);\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:5: ( '/' )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:7: '/'\n {\n match('/'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void deleteNode(int val) {\n\n Node nodeToDelete = find(val);\n\n if (nodeToDelete != null) {\n\n if (nodeToDelete.leftChild == null && nodeToDelete.rightChild == null) {\n\n //case1 - node has no child\n deleteCase1(nodeToDelete);\n } else if (nodeToDelete.leftChild != null && nodeToDelete.rightChild != null) {\n // case 3- node has both left and right child\n deleteCase3(nodeToDelete);\n } else {\n // Case 2 - node has left or right child not both\n deleteCase2(nodeToDelete);\n }\n\n }\n\n\n }", "public final EObject ruleDivisionOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4860:28: ( ( () otherlv_1= '/' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4861:1: ( () otherlv_1= '/' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4861:1: ( () otherlv_1= '/' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4861:2: () otherlv_1= '/'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4861:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4862:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getDivisionOperatorAccess().getDivisionOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,66,FOLLOW_66_in_ruleDivisionOperator10933); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getDivisionOperatorAccess().getSolidusKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public final void rule__UpdateDivision__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7784:1: ( ( '/' ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7785:1: ( '/' )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7785:1: ( '/' )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7786:1: '/'\n {\n before(grammarAccess.getUpdateDivisionAccess().getSolidusKeyword_1_1()); \n match(input,31,FOLLOW_31_in_rule__UpdateDivision__Group_1__1__Impl15269); \n after(grammarAccess.getUpdateDivisionAccess().getSolidusKeyword_1_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void deleteFurniture(List<HomePieceOfFurniture> deletedFurniture) {\n final boolean basePlanLocked = this.home.isBasePlanLocked();\n final boolean allLevelsSelection = this.home.isAllLevelsSelection();\n final List<Selectable> oldSelection = this.home.getSelectedItems(); \n List<HomePieceOfFurniture> homeFurniture = this.home.getFurniture(); \n\n // Replace pieces by their group when they have to be all deleted\n deletedFurniture = new ArrayList<HomePieceOfFurniture>(deletedFurniture);\n List<HomeFurnitureGroup> homeGroups = new ArrayList<HomeFurnitureGroup>(); \n searchGroups(homeFurniture, homeGroups);\n boolean updated;\n do {\n updated = false;\n for (HomeFurnitureGroup group : homeGroups) {\n List<HomePieceOfFurniture> groupFurniture = group.getFurniture();\n if (deletedFurniture.containsAll(groupFurniture)) {\n deletedFurniture.removeAll(groupFurniture);\n deletedFurniture.add(group);\n updated = true;\n }\n }\n } while (updated);\n \n // Sort the deletable furniture in the ascending order of their index in home or their group\n Map<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> deletedFurnitureMap =\n new HashMap<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>>();\n int deletedFurnitureCount = 0;\n for (HomePieceOfFurniture piece : deletedFurniture) {\n // Check piece is deletable and doesn't belong to a group\n if (isPieceOfFurnitureDeletable(piece)) {\n HomeFurnitureGroup group = getPieceOfFurnitureGroup(piece, null, homeFurniture);\n Map<Integer, HomePieceOfFurniture> sortedMap = deletedFurnitureMap.get(group);\n if (sortedMap == null) {\n sortedMap = new TreeMap<Integer, HomePieceOfFurniture>();\n deletedFurnitureMap.put(group, sortedMap);\n }\n if (group == null) {\n sortedMap.put(homeFurniture.indexOf(piece), piece);\n } else {\n sortedMap.put(group.getFurniture().indexOf(piece), piece);\n }\n deletedFurnitureCount++;\n }\n }\n final HomePieceOfFurniture [] furniture = new HomePieceOfFurniture [deletedFurnitureCount]; \n final int [] furnitureIndex = new int [furniture.length];\n final Level [] furnitureLevels = new Level [furniture.length];\n final HomeFurnitureGroup [] furnitureGroups = new HomeFurnitureGroup [furniture.length];\n int i = 0;\n for (Map.Entry<HomeFurnitureGroup, Map<Integer, HomePieceOfFurniture>> sortedMapEntry : deletedFurnitureMap.entrySet()) {\n for (Map.Entry<Integer, HomePieceOfFurniture> pieceEntry : sortedMapEntry.getValue().entrySet()) {\n furniture [i] = pieceEntry.getValue();\n furnitureIndex [i] = pieceEntry.getKey(); \n furnitureLevels [i] = furniture [i].getLevel();\n furnitureGroups [i++] = sortedMapEntry.getKey();\n }\n } \n doDeleteFurniture(furniture, basePlanLocked, false); \n if (this.undoSupport != null) {\n UndoableEdit undoableEdit = new AbstractUndoableEdit() {\n @Override\n public void undo() throws CannotUndoException {\n super.undo();\n doAddFurniture(furniture, furnitureGroups, furnitureIndex, null, furnitureLevels, basePlanLocked, allLevelsSelection); \n home.setSelectedItems(oldSelection);\n }\n \n @Override\n public void redo() throws CannotRedoException {\n super.redo();\n home.setSelectedItems(Arrays.asList(furniture));\n doDeleteFurniture(furniture, basePlanLocked, false); \n }\n \n @Override\n public String getPresentationName() {\n return preferences.getLocalizedString(FurnitureController.class, \"undoDeleteSelectionName\");\n }\n };\n this.undoSupport.postEdit(undoableEdit);\n }\n }", "public Fraction divide( Fraction divisor ) {\n // Division ist genau wie multiplication aber in Kreuz\n // also, wir tauschen den numerator und den denomitanor aus, und\n // multiplizieren wie üblich\n Fraction upsideDown = new Fraction( divisor.denominator, divisor.numerator );\n Fraction result = this.multiply( upsideDown );\n\n return result;\n }", "@Test\n\tpublic void deleteFolderAsAuditorTest() {\n\t\tauthenticate(\"polyglot1\");\n\t\tint principalId = actorService.findByPrincipal().getId();\n\t\tFolderForm folderFormAux = new FolderForm();\n\t\tfolderFormAux.setName(\"New Polyglot1 Folder for testing its deletion\");\n\t\tFolder folder = folderService.reconstruct(folderFormAux,0);\n\t\tfolderService.save(folder);\n\t\tint numFoldersNow = folderService.findFoldersOfActor(principalId).size();\n\t\tFolder folderToDelete = folderService.nonSystemFoldersOfActor(principalId).iterator().next();\n\t\tfolderService.delete(folderToDelete);\n\t\tint numFoldersExpected = folderService.findFoldersOfActor(principalId).size();\n\t\tunauthenticate();\t\n\t\tAssert.isTrue(numFoldersNow - 1 == numFoldersExpected);\n\t}", "private void deleteNode(Node<K> p) {\n // If strictly internal, copy successor's element to p and then make p\n // point to successor.\n if (p.left != null && p.right != null) {\n Node<K> s = successor(p); // 节点有 2 个子节点时,找到实际删除的后继节点\n p.key = s.key; // 将后继节点的值复制到原来节点上,原来的节点只是值被删除,节点本身不删除\n p = s; // 将实际要删除的节点位置指向后继节点位置\n } // p has 2 children //\n // //////////////////////////////////////////////////////////////////\n // Start fixup at replacement node, if it exists. //\n Node<K> replacement = (p.left != null ? p.left : p.right); // 实际删除的节点最多只有一个子节点,并且一定是红色子节点\n if (replacement != null) { // 如果有一个红色子节点\n // Link replacement to parent //\n replacement.parent = p.parent; // 将此节点上移\n if (p.parent == null) //\n root = replacement; //\n else if (p == p.parent.left) // 实际被删除的节点 p 为左子\n p.parent.left = replacement; //\n else // 实际被删除的节点 p 为右子\n p.parent.right = replacement; //\n // //\n // Null out links so they are OK to use by fixAfterDeletion. //\n p.left = p.right = p.parent = null; //\n // //\n // Fix replacement //////////////////////////////////////////////////////////////////\n if (p.color == BLACK) // 删除情形 5. 因为 replacement 是红节点,所以这里 p 的颜色一定是黑色的\n fixAfterDeletion(replacement); // 修复只要将此红节点上移并置黑就完成了\n } else if (p.parent == null) { // return if we are the only node. //////////////////////////////////////////////////////////////////\n root = null; // 根节点被删除\n } else { // No children. Use self as phantom replacement and unlink. // 被删除的节点没有子节点时\n if (p.color == BLACK) // 如果是红色的节点,直接删除就完成\n fixAfterDeletion(p); // 如果被删除的是黑色节点,则会破坏红黑树性质 5,需要修复红黑树\n\n if (p.parent != null) {\n if (p == p.parent.left)\n p.parent.left = null;\n else if (p == p.parent.right)\n p.parent.right = null;\n p.parent = null;\n }\n }\n }", "@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }", "public final void rule__UpdateDivision__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7753:1: ( ( () ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7754:1: ( () )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7754:1: ( () )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7755:1: ()\n {\n before(grammarAccess.getUpdateDivisionAccess().getUpdateDivLeftAction_1_0()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7756:1: ()\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:7758:1: \n {\n }\n\n after(grammarAccess.getUpdateDivisionAccess().getUpdateDivLeftAction_1_0()); \n\n }\n\n\n }\n\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "@Override\n protected void rebalanceDelete(Position<Entry<K, V>> p) {\n if (isRed(p)) {\n makeBlack(p);\n } else if (!isRoot(p)) {\n Position<Entry<K, V>> sib = sibling(p);\n if (isInternal(sib) & (isBlack(sib) || isInternal(left(sib)))) {\n remedyDoubleBlack(p);\n }\n }\n }", "public void setDivisionID(int divisionID) {\n this.divisionID = divisionID;\n }", "public void divide(Object divValue) {\r\n\r\n\t\tNumberOperation operator = new NumberOperation(this.value, divValue) {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Number doAnOperation() {\r\n\t\t\t\tTypeEnum typeOfResult = getFinalType();\r\n\t\t\t\tif(typeOfResult == TypeEnum.TYPE_INTEGER) {\r\n\t\t\t\t\treturn getO1().intValue() / getO2().intValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn getO1().doubleValue() / getO2().doubleValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.value = operator.doAnOperation();\r\n\t}", "public void delete(Comparable<T> item)\r\n {\r\n root = delete(root,item);\r\n }", "public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }", "private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }", "public void operationDelete() {\n\r\n\t\tstatusFeldDelete();\r\n\t}", "@Override\n\tpublic void visit(Division arg0) {\n\n\t}", "public void divide(Object divValue) {\n\t\tvalue = operate(\n\t\t\t\ttransform(value),\n\t\t\t\ttransform(divValue),\n\t\t\t\t(v1, v2) -> v1 / v2,\n\t\t\t\t(v1, v2) -> v1 / v2 //integer division, cannot divide by zero\n\t\t);\n\t}", "public String getDivision() {\n return division;\n }", "@Override\n\tpublic void visit(Division arg0) {\n\t\t\n\t}", "private void deleteWorkingRoot(WorkUnit workUnit, boolean copy) {\n\n // Construct folder name (will be copy or not)\n String folderToDelete = format(\"%s%s\", workUnit.root, (copy ? \"_copy\" : \"\"));\n\n // 7. Clean work directory\n MigrationHistory history = historyMgr.startStep(workUnit.migration,\n StepEnum.CLEANING, format(\"Remove %s\", folderToDelete));\n\n // Sanity check\n if (!StringUtils.isBlank(folderToDelete) && folderToDelete.contains(\"20\") && folderToDelete.contains(\"_\")) {\n\n try {\n\n if (isWindows) {\n // FileUtils.deleteDirectory(new File(folderToDelete));\n // JBU : Fails occassionally on windows with file lock issue\n // FileUtils.deleteDirectory(new File(folderToDelete));\n // JBU : Fails on windows not able to delete a large number of files?..\n String gitCommand = format(\"rd /s /q %s\", folderToDelete);\n execCommand(workUnit.commandManager, Shell.formatDirectory(applicationProperties.work.directory), gitCommand);\n\n } else {\n // Seems to work ok on linux. Keeping Java command for the moment\n FileSystemUtils.deleteRecursively(new File(folderToDelete));\n }\n\n historyMgr.endStep(history, StatusEnum.DONE, null);\n } catch (Exception exc) {\n LOG.error(\"Failed deleteDirectory: \", exc);\n historyMgr.endStep(history, StatusEnum.FAILED, exc.getMessage());\n }\n\n } else {\n LOG.error(\"Failed deleteDirectory: Badly formed delete path\");\n historyMgr.endStep(history, StatusEnum.FAILED, \"Badly formed delete path\");\n }\n }", "public static void main(String[] args){\nFile filez = new File(\"d:/prac/sub1\");\r\ndeleteFolder(filez);\r\n}", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void Delete(int data)\r\n\t{\r\n\t\troot=DeleteData(root,data);\r\n\t}", "public void deleteSelected() {\r\n \t\tObject cells[] = graph.getSelectionCells();\r\n \t\tGraphModel graphmodel = graph.getModel();\r\n \r\n \t\t// If a cell is a blocking region avoid removing its edges and\r\n \t\t// select its element at the end of the removal process\r\n \t\tSet edges = new HashSet();\r\n \t\tSet<Object> select = new HashSet<Object>();\r\n \r\n \t\t// Set with all regions that can be deleted as its child were removed\r\n \t\tSet<Object> regions = new HashSet<Object>();\r\n \t\t// Set with all JmtCells that we are removing\r\n \t\tSet<Object> jmtCells = new HashSet<Object>();\r\n \r\n \t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t// for(int k=0; k<cells.length; k++){\r\n \t\t// if(cells[k] instanceof JmtEdge){\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)cells[k])))).SubOut();\r\n \t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)cells[k])))).SubIn();\r\n \t\t// }\r\n \t\t//\r\n \t\t// }\r\n \t\tfor (int i = 0; i < cells.length; i++) {\r\n \t\t\tif (!(cells[i] instanceof BlockingRegion)) {\r\n \t\t\t\t// Adds edge for removal\r\n \t\t\t\tedges.addAll(DefaultGraphModel.getEdges(graphmodel, new Object[] { cells[i] }));\r\n \t\t\t\t// Giuseppe De Cicco & Fabio Granara\r\n \t\t\t\t// quando vado a eliminare un nodo, a cui collegato un arco,\r\n \t\t\t\t// vado ad incrementare o diminuire il contatore per il\r\n \t\t\t\t// pulsanteAGGIUSTATUTTO\r\n \t\t\t\t// Iterator iter = edges.iterator();\r\n \t\t\t\t// while (iter.hasNext()) {\r\n \t\t\t\t// Object next = iter.next();\r\n \t\t\t\t// if (next instanceof JmtEdge){\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getSource((JmtEdge)next)))).SubOut();\r\n \t\t\t\t// ((JmtCell)(graphmodel.getParent(graphmodel.getTarget((JmtEdge)next)))).SubIn();\r\n \t\t\t\t// }\r\n \t\t\t\t//\r\n \t\t\t\t// }\r\n \t\t\t\t// Stores parents information and cell\r\n \t\t\t\tif (cells[i] instanceof JmtCell) {\r\n \t\t\t\t\tif (((JmtCell) cells[i]).getParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t\tregions.add(((JmtCell) cells[i]).getParent());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tjmtCells.add(cells[i]);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t// Adds node for selection\r\n \t\t\t\tObject[] nodes = graph.getDescendants(new Object[] { cells[i] });\r\n \t\t\t\tfor (Object node : nodes) {\r\n \t\t\t\t\tif (node instanceof JmtCell || node instanceof JmtEdge) {\r\n \t\t\t\t\t\tselect.add(node);\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\t// Removes blocking region from data structure\r\n \t\t\t\tmodel.deleteBlockingRegion(((BlockingRegion) cells[i]).getKey());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tif (!edges.isEmpty()) {\r\n \t\t\tgraphmodel.remove(edges.toArray());\r\n \t\t}\r\n \t\t// removes cells from graph\r\n \t\tgraphmodel.remove(cells);\r\n \r\n \t\t// Checks if all children of a blocking region have been removed\r\n \t\tIterator<Object> it = regions.iterator();\r\n \t\twhile (it.hasNext()) {\r\n \t\t\tjmtCells.add(null);\r\n \t\t\tBlockingRegion region = (BlockingRegion) it.next();\r\n \t\t\tList child = region.getChildren();\r\n \t\t\tboolean empty = true;\r\n \t\t\tfor (int i = 0; i < child.size(); i++) {\r\n \t\t\t\tif (child.get(i) instanceof JmtCell && !jmtCells.contains(child.get(i))) {\r\n \t\t\t\t\tempty = false;\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tif (empty) {\r\n \t\t\t\tmodel.deleteBlockingRegion(region.getKey());\r\n \t\t\t\tgraphmodel.remove(new Object[] { region });\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Removes cells from data structure\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tmodel.deleteStation(((CellComponent) ((JmtCell) cell).getUserObject()).getKey());\r\n \t\t\t} else if (cell instanceof JmtEdge) {\r\n \t\t\t\tJmtEdge link = (JmtEdge) cell;\r\n \t\t\t\tmodel.setConnected(link.getSourceKey(), link.getTargetKey(), false);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// If no stations remains gray select and link buttons\r\n \t\tif (graph.getModel().getRootCount() == 0) {\r\n \t\t\tcomponentBar.clearButtonGroupSelection(0);\r\n \t\t\tsetConnect.setEnabled(false);\r\n \t\t\tsetSelect.setEnabled(false);\r\n \t\t}\r\n \r\n \t\t// Selects components from removed blocking regions\r\n \t\tif (select.size() > 0) {\r\n \t\t\tgraph.setSelectionCells(select.toArray());\r\n \t\t\t// Resets parent information of cells that changed parent\r\n \t\t\tit = select.iterator();\r\n \t\t\twhile (it.hasNext()) {\r\n \t\t\t\tObject next = it.next();\r\n \t\t\t\tif (next instanceof JmtCell) {\r\n \t\t\t\t\t((JmtCell) next).resetParent();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "@Test\n public void testDeleteNodeIfNoChildren_hasChildrenShouldNotDelete() throws Exception {\n final String basePath = \"/testDeleteNodeIfNoChildren_hasChildrenShouldNotDelete\";\n final String childPath = basePath + \"/childNode\";\n\n try (final CuratorFramework curator = createCurator()) {\n // Create basePath\n curator\n .create()\n .creatingParentsIfNeeded()\n .forPath(basePath);\n\n // Create some child nodes\n curator\n .create()\n .forPath(childPath);\n\n // Now create our helper\n final CuratorHelper curatorHelper = new CuratorHelper(curator, new HashMap<>());\n\n // Call our method\n curatorHelper.deleteNodeIfNoChildren(basePath);\n\n // Validate child nodes still exist\n Stat result = curator\n .checkExists()\n .forPath(childPath);\n assertNotNull(result, \"Child path should exist\");\n\n // Validate base exists\n result = curator\n .checkExists()\n .forPath(basePath);\n assertNotNull(result, \"base path should exist\");\n assertEquals(1, result.getNumChildren(), \"Should have 1 child\");\n\n // Cleanup\n curator\n .delete()\n .deletingChildrenIfNeeded()\n .forPath(basePath);\n\n // Validate is gone, sanity check.\n result = curator\n .checkExists()\n .forPath(basePath);\n assertNull(result, \"base path should be removed\");\n }\n }", "public void delete(int data) {\n root = delete(root, data);\n size--;\n }", "public void delete(SplayNode n) {\n\t\t this.splay(n);\n\n\t\t SplayTree leftSubtree = new SplayTree();\n\t\t leftSubtree.root = this.root.left;\n\t\t if(leftSubtree.root != null)\n\t\t leftSubtree.root.parent = null;\n\n\t\t SplayTree rightSubtree = new SplayTree();\n\t\t rightSubtree.root = this.root.right;\n\t\t if(rightSubtree.root != null)\n\t\t rightSubtree.root.parent = null;\n\n\t\t if(leftSubtree.root != null) {\n\t\t \tSplayNode m = leftSubtree.maximum(leftSubtree.root);\n\t\t leftSubtree.splay(m);\n\t\t leftSubtree.root.right = rightSubtree.root;\n\t\t this.root = leftSubtree.root;\n\t\t }\n\t\t else {\n\t\t this.root = rightSubtree.root;\n\t\t }\n\t\t }", "private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}", "public void rebuild() {\n\t\tif (!divided) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint totalChildren = 0;\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\t// If there is a divided child then we cant do anything\n\t\t\tif (q.isDivided()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\ttotalChildren += q.numPoints();\n\t\t}\n\t\t\n\t\t// If the sum of all the children contained in the sub nodes\n\t\t// is greater than allowed then we cant do anything\n\t\tif (totalChildren > QUADTREE_NODE_CAPACITY) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Add all the nodes from the children to this node then remvoe the nodes\n\t\tpoints = new HashMap<Point, E>();\n\t\tfor (QuadTreeNode<E> q : nodes) {\n\t\t\tpoints.putAll(q.points);\n\t\t}\n\t\t\n\t\tnodes.clear();\n\t\tdivided = false;\n\t}", "public final void rule__PredicateDivision__Group_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4593:1: ( rule__PredicateDivision__Group_1__1__Impl rule__PredicateDivision__Group_1__2 )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4594:2: rule__PredicateDivision__Group_1__1__Impl rule__PredicateDivision__Group_1__2\n {\n pushFollow(FOLLOW_rule__PredicateDivision__Group_1__1__Impl_in_rule__PredicateDivision__Group_1__19025);\n rule__PredicateDivision__Group_1__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__PredicateDivision__Group_1__2_in_rule__PredicateDivision__Group_1__19028);\n rule__PredicateDivision__Group_1__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n // /Users/benjamincoe/HackWars/C.g:212:12: ( '/' )\n // /Users/benjamincoe/HackWars/C.g:212:14: '/'\n {\n match('/'); \n\n }\n\n this.type = _type;\n }\n finally {\n }\n }", "private boolean recursiveDelete(int number, Node position, Node parent) {\r\n\t\t//check middle child, or at value\r\n\t\tif (number == position.getValue()) {\r\n\t\t\tif (position.getMiddleChild() != null) {\r\n\t\t\t\treturn recursiveDelete(number, position.getMiddleChild(), position);\r\n\t\t\t}\r\n\t\t\t// we are at value, so delete -- note no middle children for current position at this point\r\n\t\t\telse {\r\n\t\t\t\tNode replacement = null;\r\n\t\t\t\tRandom rnd = new Random();\r\n\t\t\t\t//this boolean variable determine whether we choose inorder predecessor or inorder successor\r\n\t\t\t\tboolean successor = rnd.nextBoolean();\r\n\t\t\t\t\r\n\t\t\t\t// if there in only a left node, delete current item, replace with left node\r\n\t\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//if there is only a right node, delete current item, replace with right node\r\n\t\t\t\telse if (position.getLeftChild() == null) {\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//if right child has no left child, delete current item, replace with right node, change left pointer\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() == null && successor) {\r\n\t\t\t\t\tposition.getRightChild().setLeftChild(position.getLeftChild());\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//right child has a left child, replace current item with inorder successor, delete inorder successor\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() != null && successor) {\r\n\t\t\t\t\tNode successorParent = position;\r\n\t\t\t\t\tNode successorPosition = position.getRightChild();\r\n\t\t\t\t\twhile (successorPosition.getLeftChild() != null) {\r\n\t\t\t\t\t\tsuccessorParent = successorPosition;\r\n\t\t\t\t\t\tsuccessorPosition = successorPosition.getLeftChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderSuccessor\r\n\t\t\t\t\tNode successorRightNode = successorPosition.getRightChild();\r\n\t\t\t\t\treplacement = successorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderSuccessor\r\n\t\t\t\t\treadjustTree(successorParent, successorPosition, successorRightNode);\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//if left child has no right child, delete current item, replace with left child, change right pointer\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() == null && !successor) {\r\n\t\t\t\t\tposition.getLeftChild().setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//left child has a right child, replace current item with inorder predecessor, delete inorder predecessor\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() != null && !successor) {\r\n\t\t\t\t\tNode predecessorParent = position;\r\n\t\t\t\t\tNode predecessorPosition = position.getLeftChild();\r\n\t\t\t\t\twhile (predecessorPosition.getRightChild() != null) {\r\n\t\t\t\t\t\tpredecessorParent = predecessorPosition;\r\n\t\t\t\t\t\tpredecessorPosition = predecessorPosition.getRightChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderPredecessor\r\n\t\t\t\t\tNode predecessorLeftNode = predecessorPosition.getLeftChild();\r\n\t\t\t\t\treplacement = predecessorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderPredecessor\r\n\t\t\t\t\treadjustTree(predecessorParent, predecessorPosition, predecessorLeftNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.err.println(\"ERROR - should never get here, right and left children nodes exhausted in delete\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t// replace current position with replacement node\r\n\t\t\t\tif (parent == null) {\r\n\t\t\t\t\troot = replacement;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn readjustTree(parent, position, replacement);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check left child\r\n\t\telse if (number < position.getValue()) {\r\n\t\t\tif (position.getLeftChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getLeftChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check right child\r\n\t\telse if (number > position.getValue()) {\r\n\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getRightChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.err.println(\"Error: should never get here, number !comparable to position.getValue in delete\");\r\n\t\t\treturn false;\r\n\t\t} \r\n\t}", "private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}", "@Test\n\tpublic void divisionTest() {\n\t\tMathOperation division = new Division();\n\n\t\tassertEquals(0, division.operator(ZERO, FIVE).intValue());\n\t\tassertEquals(4, division.operator(TWENTY, FIVE).intValue());\n\t}", "public abstract void eliminarSubproducto(EntityManager sesion, Subproducto subproducto);", "public void delete(String key) {\n key = key.toLowerCase();\n BTreeNode leftChild = root.getChild(0);\n BTreeNode rightChild = root.getChild(1);\n\n if (!root.isLeaf() && root.getN() == 1 && leftChild.getN() < T_VAR && rightChild.getN() < T_VAR) {\n root = mergeSingleKeyRoot();\n }\n if (root.keyExist(key)) {\n if (root.isLeaf()) {\n root.deleteKey(key);\n }\n else {\n root.handleCase2(key);\n }\n }\n else {\n root.handleCase4(key);\n }\n }", "public void delete(String id) {\n log.debug(\"Request to delete Hierarchy : {}\", id);\n hierarchyRepository.deleteById(id);\n hierarchySearchRepository.deleteById(id);\n }", "public final void rule__PredicateDivision__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4541:1: ( ( ( rule__PredicateDivision__Group_1__0 )* ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4542:1: ( ( rule__PredicateDivision__Group_1__0 )* )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4542:1: ( ( rule__PredicateDivision__Group_1__0 )* )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4543:1: ( rule__PredicateDivision__Group_1__0 )*\n {\n before(grammarAccess.getPredicateDivisionAccess().getGroup_1()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4544:1: ( rule__PredicateDivision__Group_1__0 )*\n loop28:\n do {\n int alt28=2;\n int LA28_0 = input.LA(1);\n\n if ( (LA28_0==31) ) {\n alt28=1;\n }\n\n\n switch (alt28) {\n \tcase 1 :\n \t // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:4544:2: rule__PredicateDivision__Group_1__0\n \t {\n \t pushFollow(FOLLOW_rule__PredicateDivision__Group_1__0_in_rule__PredicateDivision__Group__1__Impl8929);\n \t rule__PredicateDivision__Group_1__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop28;\n }\n } while (true);\n\n after(grammarAccess.getPredicateDivisionAccess().getGroup_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "void deleteTreeRef(TreeNode nodeRef) \n { \n \tif(nodeRef == null) return;\n \t\n \t\n \tdeleteTreeRef(nodeRef.left);\n\n \tdeleteTreeRef(nodeRef.right);\n \t\n \t\n \t System.out.println(\"Deleting node:\" + nodeRef.val);\n \t deleteTree(nodeRef); \n \n nodeRef=null; \n }", "void deleteDirectories() {\n\n if (story_directory != null && !newStoryReady) {\n deleteStoryDirectory();\n }\n\n if (tag_directory != null && !newStoryReady) {\n deleteTagDirectory();\n }\n\n if (cover_directory != null && !newStoryReady) {\n deleteCoverDirectory();\n }\n }", "@Test\n public void testDeleteNodeIfNoChildren_hasNoChildrenShouldDelete() throws Exception {\n final String basePath = \"/testDeleteNodeIfNoChildren_hasNoChildrenShouldDelete\";\n\n try (final CuratorFramework curator = createCurator()) {\n // Create basePath\n curator\n .create()\n .creatingParentsIfNeeded()\n .forPath(basePath);\n\n // Now create our helper\n final CuratorHelper curatorHelper = new CuratorHelper(curator, new HashMap<>());\n\n // Call our method\n curatorHelper.deleteNodeIfNoChildren(basePath);\n\n // Validate is gone\n final Stat result = curator\n .checkExists()\n .forPath(basePath);\n assertNull(result, \"base path should be removed\");\n }\n }" ]
[ "0.69886523", "0.5691911", "0.55394894", "0.5472134", "0.54627", "0.543222", "0.5346503", "0.5342852", "0.53320426", "0.53176695", "0.52843994", "0.52785754", "0.5265618", "0.52653956", "0.5262923", "0.5256962", "0.5253626", "0.52500063", "0.5203357", "0.5188924", "0.5151514", "0.5147419", "0.51471037", "0.5135571", "0.5121143", "0.51210123", "0.51158637", "0.5103844", "0.51015294", "0.5100131", "0.50834876", "0.5078421", "0.5068208", "0.5065811", "0.50589705", "0.50403136", "0.5039408", "0.50380033", "0.503626", "0.50195855", "0.5017113", "0.5008824", "0.5008627", "0.5004645", "0.50005347", "0.4961541", "0.49600706", "0.49587622", "0.49552915", "0.4948848", "0.49473208", "0.49429306", "0.49385133", "0.49315816", "0.49293396", "0.49278033", "0.4926112", "0.4913547", "0.49121487", "0.49104345", "0.48846278", "0.48749524", "0.48721614", "0.4870041", "0.48688132", "0.48613715", "0.48562324", "0.48490003", "0.48444808", "0.48394683", "0.48330098", "0.4832847", "0.48293912", "0.48186505", "0.48184264", "0.48135793", "0.48129967", "0.4804257", "0.48038507", "0.48005453", "0.47996646", "0.47967052", "0.47963873", "0.47962525", "0.4786823", "0.47864118", "0.47862512", "0.47820002", "0.47742882", "0.47732872", "0.47722667", "0.47686717", "0.47680137", "0.4766101", "0.476024", "0.47590634", "0.47575012", "0.47572288", "0.47558448", "0.47552046", "0.47492918" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean onException(Exception arg0, T arg1, Target<GlideDrawable> arg2, boolean arg3) { 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 boolean onResourceReady(GlideDrawable arg0, T arg1, Target<GlideDrawable> arg2, boolean arg3, boolean arg4) { 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
create the evaluation page for the checklist
protected EvaluationPage(Checklist checklist, Controller controller) { super(Resources.getMessage("RiskWizard.9")); this.checklist = checklist; this.controller = controller; this.setTitle(Resources.getMessage("RiskWizard.10")); this.setDescription(Resources.getMessage("RiskWizard.11")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test \n\tpublic void generateListsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'lists' radio button \n\t\thomePage.selectContentType(\"lists\");\n\n\t\t// enter '9' in the count field \n\t\thomePage.inputCount(\"9\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of lists generated \n\t\tint listCount = generatedPage.getActualGeneratedCount(\"lists\");\n\t\tAssert.assertTrue(\"Incorrect list count\",listCount == 9);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\" \n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport()); \n\n\t}", "public void createDeatilsPage(String deatils, ITestResult r) {\n\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\twriter = createHTMLWriter(folderToSave + \"\\\\support\", r.getName() + \"_\" + r.getStartMillis() + \".html\");\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"unable to create \" + r.getName() + \"_\" + r.getEndMillis());\n\t\t\treturn;\n\t\t}\n\t\twriter.println(\n\t\t\t\t\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\\\">\");\n\t\twriter.println(\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\");\n\t\twriter.println(\n\t\t\t\t\"<head><style>.class-green{background-color:green;} .class-blue{background-color:blue;}</style><script> \"\n\t\t\t\t\t\t+ \"function goBack() \" + \"{ \" + \"window.history.back() } </script></head> \");\n\t\twriter.println(\"<body><table border=\\\"1\\\" CELLPADDING=\\\"1\\\" CELLSPACING=\\\"1\\\">\");\n\t\twriter.println(\"<thead><tr><th COLSPAN=\\\"2\\\"><h4>Execution Steps for \" + r.getName() + \"</h4></th></tr>\"\n\t\t\t\t+ \"<tr><th>Step No</th> <th>Action Details</th></tr>\" + \"</thead>\");\n\t\twriter.println(deatils);\t\t\n\t\twriter.println(\"</tbody></table> \");\n\t\tif (r.getAttribute(\"LOGSRC\") != null) {\n\t\t\twriter.println(\n\t\t\t\t\t\"</br><br/><a href='\" + r.getName() + \"_\" + r.getStartMillis() + \".png'>Reference Screen</a>\");\n\t\t}\n\t\t// writer.println(\"</br><br/><input type=\\\"button\\\" value=\\\"Back To Test\n\t\t// Cases\\\" onclick=\\\"goBack()\\\"/> </body>\");\n\t\twriter.println(\"</body>\");\n\t\twriter.println(\"</html>\");\n\t\twriter.flush();\n\t\twriter.close();\n\t}", "private void handleEval(HttpExchange exchange, Context context) throws IOException {\n // page response is HTML text in UTF-8\n exchange.getResponseHeaders().add(\"Content-Type\", \"text/html; charset=utf-8\");\n\n // if you want to know the requested path:\n final String path = exchange.getRequestURI().getPath();\n\n // it will always start with the base path from server.createContext():\n final String base = exchange.getHttpContext().getPath();\n assert path.startsWith(base);\n\n final String data = path.substring(base.length());\n\n final String response;\n final ListExpression expr;\n // write the response to the output stream using UTF-8 character encoding\n OutputStream body = exchange.getResponseBody();\n PrintWriter out = new PrintWriter(new OutputStreamWriter(body, UTF_8), true);\n try {\n expr = ListExpression.parse(data);\n response = Util.setToOrderedString(context.evaluate(expr));\n exchange.sendResponseHeaders(SUCCESS_CODE, 0);\n } catch (EvaluationException e) {\n exchange.sendResponseHeaders(ERROR_CODE, 0);\n out.print(e.getMessage());\n out.flush();\n exchange.close();\n return;\n }\n final VisualizerTree tree = new VisualizerTree(\"Expression structure\");\n tree.addChild(expr.getVisualizerTree());\n StringBuilder sb = new StringBuilder(tree.asHTML());\n if (!expr.getAllListNames().isEmpty()) {\n final VisualizerTree definedNames = new VisualizerTree(\"Used listnames\");\n for (ListName listName : expr.getAllListNames()) {\n try {\n final Set<String> set = listName.evaluate(context);\n final VisualizerTree nameTree = new VisualizerTree(listName.toString());\n nameTree.addChild(new VisualizerTree(Util.setToOrderedString(set)));\n definedNames.addChild(nameTree);\n } catch (EvaluationException e) {\n throw new AssertionError(\"ListName should never throw exception\");\n }\n }\n sb.append(definedNames.asHTML());\n }\n String templated = String.format(getTemplate(), data, response, sb.toString());\n out.print(templated);\n out.flush();\n // if you do not close the exchange, the response will not be sent!\n exchange.close();\n }", "@SuppressWarnings(\"unused\")\n\tprivate void CreateVerificationPage(final Composite wizPanel,\n\t\t\tfinal StackLayout wizLayout) {\n\t\tif(wizPages.size() > wizpagenum + 1)\n\t\t{\n\t\t\twizPages.remove(wizpagenum + 1);\n\t\t}\n\t\tfinal Composite verific = new Composite(wizPanel, SWT.NONE);\n\t\tLabel wiz14Label = new Label(verific, SWT.NONE);\n\t\twiz14Label.setText(\"Name: \" + spellname +\"\\nComponent: \"+ spellcomp\n\t\t\t\t+\"\\nSchool: \" + spellschool + \"\\nRange: \" + spellrange + \n\t\t\t\t\"\\nEffect: \" + spelleffect + \"\\nCasting Time: \" +\n\t\t\t\tspellcastime + \"\\nMaterial Component: \" + spellmaterial + \n\t\t\t\t\"\\nSaving Throw: \" + spellsaving +\"\\nFocus: \" + spellfocus + \n\t\t\t\t\"\\nDuration: \" + spellduration + \"\\nLevel: \" + spelllevel + \n\t\t\t\t\"\\nSpell Resistance: \" + spellresistance + \"\\nDescription: \" + spellscript);\n\t\twiz14Label.pack();\n\t\tButton confirm = new Button(verific, SWT.PUSH);\n\t\tcreateBackButton(verific, wizPanel, wizLayout);\n\t\tcreateCancelButton(verific, wizPanel, wizLayout);\n\t\tconfirm.setText(\"Confirm\");\n\t\tconfirm.setBounds(WIDTH-117, HEIGHT - 90, 100, 50);\n\t\tconfirm.addListener(SWT.Selection, new Listener()\n\t\t{\n\t\t\tpublic void handleEvent(Event event)\n\t\t\t{\n\t\t\t\t//TODO save the item\n\t\t\t\tshell.close();\n\t\t\t}\n\t\t});\n\t\twizPages.add(verific);\n\t\t\n\t}", "private void generateTestExecution(ITestResult result) throws IOException{\r\n\t\t//create the html file with current running class and test name\r\n\t\tfout = createRequiredFile(result.getName());\r\n\t\t\r\n\t\t//Write initial html codes neccessary for report\r\n\t\tstartHtmlPage(fout,result);\r\n\t\t\r\n\t\t//get all the attributes set during the test execution\r\n\t\tObject[] array = result.getAttributeNames().toArray();\r\n\t\t\r\n\t\t//Above got values are not in sort. So, Sorting that based on time\r\n\t\tArrays.sort(array);\r\n\t\t\r\n\t\t//Iterating the array value to generate report\r\n \tfor(Object name : array){\r\n \t\t\t\r\n \t\t\t//Each and every array value contains, All the info about the particular action\r\n \t\t\t//And Values combined using deliminator. So, split using deliminator\r\n\t \t\tString temp[] = result.getAttribute((String) name).toString().split(\"####\");\r\n\t \t\t\r\n\t \t\t//After split up, If the third array value contains 'Fail' means that step failed \r\n\t \t\tif(temp[3].toLowerCase().contains(\"fail\")){\r\n\t \t\t\t//If Fail create '<tr>' tag with 'status_failed' class(Which is used for create 'red' background color for failed cases)\r\n\t \t\t\tfout.println(\"<tr class=\\\"status_failed\\\" title=\\\"\\\" alt=\\\"\\\">\");\r\n\t \t\t\t\r\n\t \t\t\t//create the screenshot path\r\n\t \t\t\tString pathToScreenshot = \"../Failure_Screenshot/\"+temp[5]+\".jpg\";\r\n\t \t\t\t\r\n\t \t\t\t//creating mapping for failed step(Link to screen shot and embed the screenshot in that step)\r\n\t \t\t\ttemp[4] = \"<a href=\\'\" + pathToScreenshot + \"\\'> <img src=\\'\" + pathToScreenshot + \"\\' height=\\\"100\\\" width=\\\"100\\\"> </a>\";\r\n\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\t//After split up, If the third array value contains 'title' means that is title\r\n\t \t\telse if(temp[3].toLowerCase().contains(\"title\")){\r\n\t \t\t\t//So, If it is a title then create '<tr>' tag with class name 'title'\r\n\t \t\t\tfout.println(\"<tr class=\\\"title\\\" title=\\\"\\\" alt=\\\"\\\">\");\r\n\t \t\t\tfout.println(\"<td colspan=\\\"6\\\">\"+ temp[0] + \"</td>\");\r\n\t \t\t\tfout.println(\"</tr>\");\r\n\t \t\t\tcontinue;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\t//Else status is passed\r\n\t \t\telse{\r\n\t \t\t\tfout.println(\"<tr class=\\\"status_passed\\\" title=\\\"\\\" alt=\\\"\\\">\");\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\t//this will create separate '<td>' for messages inside the action\r\n\t \t\tfor(String temp1 : temp){\r\n\t \t\t\t\tfout.println(\"<td>\"+ temp1 + \"</td>\");\r\n\r\n\t \t\t}\r\n\t \t//end up '<tr>' tag\t\r\n\t \tfout.println(\"</tr>\");\r\n \t}\r\n \t\r\n \t//this used for write some end up html tags\r\n \tonFinish();\r\n \t\r\n\t}", "public void setEvaluationList(List<EntityAndArguments> evaluationList) {\r\n\t\t\tthis.evaluationList = evaluationList;\r\n\t\t\tif (this.evaluationList != null) {\r\n\t\t\t\tif (this.evaluationList.size() > 0) {\r\n\t\t\t\t\tthis.currentEvaluationIndex = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// isKnownValue = true indicates that expression as value \"false\" no matter when, where or how it is evaluated\r\n\t\t\t\tthis.isKnownValue = true; // we assume if set to null, then false immediately\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void checkPage() {\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 add(Evaluation evaluation){\r\n evaluations.add(evaluation);\r\n }", "@Then(\"I land on checkboxradio page\")\n public void i_land_on_checkboxradio_page() {\n System.out.println(\"checkbox landing page\");\n }", "private void generateReport( Locale locale, LinkcheckModel linkcheckModel )\n {\n getSink().head();\n getSink().text( i18n.getString( \"linkcheck-report\", locale, \"report.linkcheck.name\" ) );\n getSink().head_();\n \n getSink().body();\n \n if ( linkcheckModel == null )\n {\n getSink().section1();\n getSink().sectionTitle1();\n getSink().text( getName( locale ) );\n getSink().sectionTitle1_();\n \n getSink().paragraph();\n getSink().rawText( i18n.getString( \"linkcheck-report\", locale, \"report.linkcheck.empty\" ) );\n getSink().paragraph_();\n \n getSink().section1_();\n \n getSink().body_();\n getSink().flush();\n getSink().close();\n \n return;\n }\n \n // Overview\n getSink().section1();\n getSink().sectionTitle1();\n getSink().text( getName( locale ) );\n getSink().sectionTitle1_();\n \n getSink().paragraph();\n getSink().rawText( i18n.getString( \"linkcheck-report\", locale, \"report.linkcheck.overview\" ) );\n getSink().paragraph_();\n \n getSink().section1_();\n \n //Statistics\n generateSummarySection( locale, linkcheckModel );\n \n //Details\n generateDetailsSection( locale, linkcheckModel );\n \n getSink().body_();\n getSink().flush();\n getSink().close();\n }", "private void evaluationFrame(){\r\n\t\tm_EvaluationBut.setEnabled(false);\r\n\t \t\r\n\t \tJPanel all = new JPanel();\r\n\t \tall.setLayout(new BorderLayout());\t\r\n\t \t\r\n\t \tJButton oK = new JButton(\"OK\");\r\n\t \tJPanel okP = new JPanel();\r\n\t \tokP.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n\t \tokP.setLayout(new GridLayout(1,1,5,5));\r\n\t \tokP.add(oK);\r\n\r\n \tint dim = m_Instances.numAttributes();\r\n \tif(m_EnableClassesToClusters.isSelected()) dim--;\r\n\t \tm_evaluationPanel.updateEvaluationSelectPanel(dim);\r\n\t \tall.add(m_evaluationPanel, BorderLayout.CENTER);\r\n\t \tall.add(okP, BorderLayout.SOUTH);\r\n\t \t\r\n\t \t//Eval Frame\r\n\t \tfinal javax.swing.JFrame jf = \r\n\t \t new javax.swing.JFrame(\"Calculate Ouality Measures\");\r\n\t \tjf.getContentPane().setLayout(new BorderLayout());\r\n\t \tjf.getContentPane().add(all, BorderLayout.CENTER);\r\n\t \tjf.addWindowListener(new java.awt.event.WindowAdapter() {\r\n\t \t public void windowClosing(java.awt.event.WindowEvent w) {\r\n\t \t jf.dispose();\r\n\t \t m_EvaluationBut.setEnabled(true);\r\n\t \t }\r\n\t \t});\r\n\t \toK.addActionListener(new ActionListener() {\r\n\t \t public void actionPerformed(ActionEvent a) {\r\n\t \t\tm_EvaluationBut.setEnabled(true);\r\n\t \t jf.dispose();\r\n\t \t \r\n\t \t }\r\n\t \t});\r\n\t \tjf.pack();\r\n\t \tjf.setLocation(m_BracketingBut.getLocationOnScreen());\r\n\t \tjf.setVisible(true);\r\n\t}", "private void startEvaluation(IPartialPageRequestHandler aTarget, MarkupContainer aForm )\n {\n chartPanel = new ChartPanel(MID_CHART_CONTAINER, \n LoadableDetachableModel.of(this::renderChart));\n chartPanel.setOutputMarkupPlaceholderTag(true);\n chartPanel.setOutputMarkupId(true);\n \n aForm.addOrReplace(chartPanel);\n aTarget.add(chartPanel);\n }", "public void report(List<Page> result) {\n\n\t\t// Print Pages out ranked by highest authority\n\t\tsortAuthority(result);\n\t\tSystem.out.println(\"AUTHORITY RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.authority);\n\t\tSystem.out.println();\n\t\t// Print Pages out ranked by highest hub\n\t\tsortHub(result);\n\t\tSystem.out.println(\"HUB RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.hub);\n\t\tSystem.out.println();\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Authority score: \" + getMaxAuthority(result).getLocation());\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Hub score: \" + getMaxAuthority(result).getLocation());\n\t}", "@Test\n\tpublic void test04_CreateNewPageUsingExistingTemplate() {\n\t\tinfo(\"Test 4: Create new page using existing template\");\n\t\tString template1 = wTempData.getWikiTemplate(0);\n\t\tString title1 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tSystem.out.println(template1);\n\t\tString template2 = wTempData.getWikiTemplate(1);\n\t\tString title2 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tSystem.out.println(template2);\n\t\tString template3 = wTempData.getWikiTemplate(2);\n\t\tString title3 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tSystem.out.println(template3);\n\t\tString template4 = wTempData.getWikiTemplate(3);\n\t\tString title4 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tSystem.out.println(template4);\n\t\tString template5 = wTempData.getWikiTemplate(4);\n\t\tString title5 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tSystem.out.println(template5);\n\t\t\n\t\t/*Step Number: 1\n\t\t*Step Name: Step 1: Open form to create new page\n\t\t*Step Description: \n\t\t\t- Choose path to add new page\n\t\t\t- Click [Add Page] --> [From Template...]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\t- By default, the [Create Wiki page] is displayed in the [Rich Text] mode */\n\t\thp.goToWiki();\n\t\twHome.goToAddTemplateWikiPage();\n\t \n\t /*Step Number: 2\n\t\t*Step Name: Step 2: Create new page with Two Column layout\n\t\t*Step Description: \n\t\t\t- Choose template [Two Column layout] in list and click [Select]\n\t\t\t- Click [Preview] if you want to see how your page looks like\n\t\t\t- Select [Source Editor] to switch to [Source Editor] mode\n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\t\t\t- Click [Save]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tNew page is created successfully with two column layout*/\n\t\twikiMg.addSimpleWikiPageByTemplate(template1,title1);\n\t\tUtils.pause(2000);\n\t\tinfo(\"Page is add/edited successfully\");\n\t\twValidate.verifyTitleWikiPage(title1);\n\t\tarrayPage.add(title1);\n\t \n\t\t /*Step Number: 3\n\t\t*Step Name: Step 3: Create new page with Three Column layout\n\t\t*Step Description: \n\t\t\t- Choose template [Three Column layout] in list and click [Select]\n\t\t\t- Click [Preview] if you want to see how your page looks like.\n\t\t\t- Select [Source Editor] to switch to [Source Editor] mode\n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\t\t\t- Click [Save]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tNew page is created successfully with three column layout*/\n\t\thp.goToWiki();\n\t\twHome.goToAddTemplateWikiPage();\n\t\twikiMg.addSimpleWikiPageByTemplate(template2,title2);\n\t\tUtils.pause(2000);\n\t\tinfo(\"Page is add/edited successfully\");\n\t\twValidate.verifyTitleWikiPage(title2);\n\t\tarrayPage.add(title2);\n\t\t\n\t\t /*Step Number: 4\n\t\t*Step Name: Step 4: Create new page with Status Meeting layout\n\t\t*Step Description: \n\t\t\t- Choose template \"Status Meeting\" in list and click [Select]\n\t\t\t- Click [Preview] if you want to see how your page looks like.\n\t\t\t- Select [Source Editor] to switch to [Source Editor] mode\n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\t\t\t- Click [Save]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tNew page is created successfully with Status Meeting layout*/\n\t\thp.goToWiki();\n\t\twHome.goToAddTemplateWikiPage();\n\t\twikiMg.addSimpleWikiPageByTemplate(template3,title3);\n\t\tUtils.pause(2000);\n\t\tinfo(\"Page is add/edited successfully\");\n\t\twValidate.verifyTitleWikiPage(title3);\n\t\tarrayPage.add(title3);\n\t\t\n\t\t /*Step Number: 5\n\t\t*Step Name: Step 5: Create new page with HOW-TO Guide layout\n\t\t*Step Description: \n\t\t\t- Choose template [HOW-TO Guide] layout in list and click [Select]\n\t\t\t- Click [Preview] if you want to see how your page looks like\n\t\t\t- Select [Source Editor] to switch to [Source Editor] mode\n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\t\t\t- Click [Save]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tNew page is created successfully with HOW-TO Guide layout*/\n\t\thp.goToWiki();\n\t\twHome.goToAddTemplateWikiPage();\n\t\twikiMg.addSimpleWikiPageByTemplate(template4,title4);\n\t\tUtils.pause(2000);\n\t\tinfo(\"Page is add/edited successfully\");\n\t\twValidate.verifyTitleWikiPage(title4);\n\t\tarrayPage.add(title4);\n\t\t\n\t\t/*Step Number: 6\n\t\t*Step Name: Step 6: Create new page with Leave Planning layout\n\t\t*Step Description: \n\t\t\t- Choose template [Leave Planning] layout in list and click [Select]\n\t\t\t- Click [Preview] if you want to see how your page looks like\n\t\t\t- Select [Source Editor] to switch to [Source Editor] mode\n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\t\t\t- Click [Save]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tNew page is created successfully with Leave Planning layout*/\n\t\thp.goToWiki();\n\t\twHome.goToAddTemplateWikiPage();\n\t\twikiMg.addSimpleWikiPageByTemplate(template5,title5);\n\t\tUtils.pause(2000);\n\t\tinfo(\"Page is add/edited successfully\");\n\t\twValidate.verifyTitleWikiPage(title5);\n\t\tarrayPage.add(title5);\n \t}", "@Test \n\tpublic void generateParagraphsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'paragraphs' radio button \n\t\thomePage.selectContentType(\"paragraphs\");\n\n\t\t// enter '10' in the count field \n\t\thomePage.inputCount(\"10\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of text paragraphs generated \n\t\tint paragraphCount = generatedPage.getActualGeneratedCount(\"paragraphs\");\n\t\tAssert.assertTrue(paragraphCount == 10);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\"\n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport());\n\t}", "@Test\n\tpublic void test02_PreviewAPage() {\n\t\tinfo(\"Test 2: Preview a page\");\n\t\t/*Step Number: 1\n\t\t*Step Name: Step 1: Open form to create new page\n\t\t*Step Description: \n\t\t\t- Choose path to add new page\n\t\t\t- Click [Add Page] --> [Blank Page]/[From Template...]\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tForm to create new page is shown and in the [Rich Text] editor*/\n\t\tinfo(\"Go to Add a Wiki page\");\n\t\tString title = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\tString content = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\thp.goToWiki();\n\t\twHome.goToAddBlankPage();\n\t\t\n\t\t/*Step Number: 2\n\t\t*Step Name: Step 2: Create new page\n\t\t*Step Description: \n\t\t\t- Put the title for this page\n\t\t\t- Put the content of page\n\n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tAll fields are inputed with values*/\n\t\trichEditor.addSimplePage(title, content);\n\t\t\n\t\t/*Step Number: 3\n\t\t*Step Name: Step 3: Preview a page\n\t\t*Step Description: \n\t\t\t- Click on Preview \n\t\t*Input Data: \n\t\t\t\n\t\t*Expected Outcome: \n\t\t\tContent of page is shown*/\n\t\t\n\t\twikiMg.PreviewASimplePage(title, content);\n \t}", "public void generarReporteEvaluacionProveedors(String sAccionBusqueda,List<EvaluacionProveedor> evaluacionproveedorsParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"EvaluacionProveedor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"EvaluacionProveedorMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"EvaluacionProveedorMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"EvaluacionProveedor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Evaluacion Proveedores\");\t\t\r\n\t\tparameters.put(\"busquedapor\", EvaluacionProveedorConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(DetalleEvaluacionProveedor.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tEvaluacionProveedorLogic evaluacionproveedorLogicAuxiliar=new EvaluacionProveedorLogic();\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.setDatosCliente(evaluacionproveedorLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.setEvaluacionProveedors(evaluacionproveedorsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.cargarRelacionesLoteForeignKeyEvaluacionProveedorWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorsParaReportes=evaluacionproveedorLogicAuxiliar.getEvaluacionProveedors();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//evaluacionproveedorLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (EvaluacionProveedor evaluacionproveedor:evaluacionproveedorsParaReportes) {\r\n\t\t\t\t\t//\tevaluacionproveedorLogic.deepLoad(evaluacionproveedor, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//evaluacionproveedorLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//evaluacionproveedorLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDetalleEvaluacionProveedor = AuxiliarReportes.class.getResourceAsStream(\"DetalleEvaluacionProveedorDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detalleevaluacionproveedor\", reportFileDetalleEvaluacionProveedor);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceEvaluacionProveedor=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tEvaluacionProveedorConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tEvaluacionProveedorConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceEvaluacionProveedor=new JRBeanArrayDataSource(EvaluacionProveedorJInternalFrame.TraerEvaluacionProveedorBeans(evaluacionproveedorsParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceEvaluacionProveedor);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+EvaluacionProveedorConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+EvaluacionProveedorConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(EvaluacionProveedorBean.TraerEvaluacionProveedorBeans(evaluacionproveedorsParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoEvaluacionProveedorActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "Page createPage();", "@Test \n\tpublic void generateListsTest_NegativeTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'lists' radio button \n\t\thomePage.selectContentType(\"lists\");\n\n\t\t// enter 'abcd' in the count field \n\t\thomePage.inputCount(\"abcd\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of lists generated \n\t\tint listCount = generatedPage.getActualGeneratedCount(\"lists\");\n\t\tAssert.assertTrue(\"Incorrect list count with abcd input\",listCount == 0);\n\t}", "public static void xmlclassgeneration_parallel_web(Integer noOfBrowsers, String executionType) {\n\t\tSystem.out.println(noOfBrowsers);\r\n\t\tSystem.out.println(executionType);\r\n\r\n\t\t/**\r\n\t\t * Add Listener Classes\r\n\t\t */\r\n\t\t// Thread count need to be provided for running scripts sequential\r\n\t\tif (listner_count < count) {\r\n\t\t\t// add pdf listener\r\n\t\t\tsuite.addListener(\"com.vil.web.reports.MyExtentListners\");\r\n\t\t\t// suite.addListener(\"com.utteshappend.pdfngreport.PDFReportListener\");\r\n\t\t\tlistner_count = listner_count + 1;\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Add Parameters for suite level\r\n\t\t */\r\n\r\n\t\tHashMap<String, String> testParameters1 = new HashMap<String, String>();\r\n\t\ttestParameters1.put(\"pdfngreport-properties\", \"pdfngreport.properties\");\r\n\t\tsuite.setParameters(testParameters1);\r\n\t\tsuite.setGroupByInstances(false);\r\n\t\tsuite.setThreadCount(noOfBrowsers);\r\n\t\tsuite.setParallel(\"tests\");\r\n\r\n\t\t// find total module count from ModuleExecutionControl\r\n\t\t// sheet config.xlsx file\r\n\t\tArrayList<String> moduleNames = new ArrayList<String>();\r\n\t\tint totalModuleRowCount = ExcelLibrary.getExcelRowCount(\"./config/config.xlsx\", \"ModuleExecutionControl\");\r\n\t\tfor (int i = 1; i <= totalModuleRowCount; i++) {\r\n\t\t\tif (ExcelLibrary\r\n\t\t\t\t\t.getExcelData(\"./config/config.xlsx\", \"ModuleExecutionControl\", i, GenericLib\r\n\t\t\t\t\t\t\t.getHeaderColumnIndex(\"./config/config.xlsx\", \"ModuleExecutionControl\", \"Execution_Status\"))\r\n\t\t\t\t\t.trim().equals(\"Yes\")) {\r\n\t\t\t\tmoduleNames\r\n\t\t\t\t\t\t.add(ExcelLibrary.getExcelData(\"./config/config.xlsx\", \"ModuleExecutionControl\", i, GenericLib\r\n\t\t\t\t\t\t\t\t.getHeaderColumnIndex(\"./config/config.xlsx\", \"ModuleExecutionControl\", \"ModuleName\")));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Iterate loop based number of browsers to parameters to <test> in <suite>\r\n\t\tArrayList<String> browserNames = new ArrayList<String>();\r\n\t\tfor (int i = 1; i <= noOfBrowsers; i++) {\r\n\t\t\tbrowserNames.add(ExcelLibrary.getExcelData(\"./config/config.xlsx\", \"config\", i,\r\n\t\t\t\t\tGenericLib.getHeaderColumnIndex(\"./config/config.xlsx\", \"config\", \"Browser Name\")));\r\n\t\t}\r\n\r\n\t\tif (noOfBrowsers > 1) {\r\n\t\t\tif (moduleNames.size() != 0) {\r\n\r\n\t\t\t\tfor (int i = 1; i <= noOfBrowsers; i++) {\r\n\t\t\t\t\tXmlTest test = new XmlTest(suite);\r\n\t\t\t\t\tHashMap<String, String> testCases = new HashMap<String, String>();\r\n\r\n\t\t\t\t\tfor (int l = 0; l < moduleNames.size(); l++) {\r\n\t\t\t\t\t\tString modulenames[] = GenericLib.testConfigutration(\"./config/config.xlsx\",\r\n\t\t\t\t\t\t\t\tmoduleNames.get(l));\r\n\t\t\t\t\t\ttestCases.put(moduleNames.get(l),\r\n\t\t\t\t\t\t\t\tArrays.toString(modulenames).replace(\"[\", \"\").replace(\"]\", \"\"));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.out.println(\"loop\" + i);\r\n\t\t\t\t\tSystem.out.println(testCases.size());\r\n\t\t\t\t\tSet<String> keys = testCases.keySet();\r\n\t\t\t\t\tArrayList<String> testNames = new ArrayList<String>();\r\n\t\t\t\t\tfor (String key : keys) {\r\n\t\t\t\t\t\ttestNames.add(key);\r\n\t\t\t\t\t\tSystem.out.println(key);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tHashMap<String, String> testParameters = new HashMap<String, String>();\r\n\r\n\t\t\t\t\ttestParameters.put(\r\n\t\t\t\t\t\t\tExcelLibrary.getExcelData(\"./config/config.xlsx\", \"config\", 0,\r\n\t\t\t\t\t\t\t\t\tGenericLib.getHeaderColumnIndex(\"./config/config.xlsx\", \"config\", \"Browser Name\")),\r\n\t\t\t\t\t\t\tExcelLibrary.getExcelData(\"./config/config.xlsx\", \"config\", i,\r\n\t\t\t\t\t\t\t\t\tGenericLib.getHeaderColumnIndex(\"./config/config.xlsx\", \"config\", \"Browser Name\")));\r\n\t\t\t\t\tfor (Map.Entry entry : testParameters.entrySet()) {\r\n\t\t\t\t\t\tSystem.out.println(entry.getKey() + \" : \" + entry.getValue());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tString testname = Arrays.toString(testNames.toArray());\r\n\t\t\t\t\t// System.out.println(testname);\r\n\r\n\t\t\t\t\ttest.setName(\"Regression_Test_\" + browserNames.get(i - 1) + \"_\" + i);\r\n\t\t\t\t\t// test.setPreserveOrder(\"true\");\r\n\t\t\t\t\ttest.setPreserveOrder(true);\r\n\t\t\t\t\ttest.setParameters(testParameters);\r\n\t\t\t\t\t// testParameters.clear();\r\n\t\t\t\t\ttest.setThreadCount(noOfBrowsers);\r\n\t\t\t\t\tArrayList<XmlClass> classes = new ArrayList<XmlClass>();\r\n\t\t\t\t\tIterator it = testCases.entrySet().iterator();\r\n\t\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\tSystem.out.println(\"inside\");\r\n\t\t\t\t\t\tMap.Entry pair = (Map.Entry) it.next();\r\n\t\t\t\t\t\tSystem.out.println(pair.getKey() + \" = \" + pair.getValue());\r\n\t\t\t\t\t\tString[] testcases = pair.getValue().toString().replace(\",\", \"\").split(\" \");\r\n\t\t\t\t\t\tSystem.out.println(\"Test cases length \" + testcases.length);\r\n\r\n\t\t\t\t\t\t// Add all test cases in before creating xml file\r\n\t\t\t\t\t\tfor (int k = 0; k < testcases.length; k++) {\r\n\t\t\t\t\t\t\tString className = \"com.vil.web.tests.\" + pair.getKey() + \".\"\r\n\t\t\t\t\t\t\t\t\t+ testcases[k].replace(\"]\", \"\");\r\n\t\t\t\t\t\t\tSystem.out.println(className);\r\n\t\t\t\t\t\t\tclasses.add(new XmlClass(className));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ttest.setXmlClasses(classes);\r\n\t\t\t\t\t\tit.remove();\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t} else if (moduleNames.size() == 0) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Please select modules which you wan execute in under config_execution --> Test Execution Control\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Please configure > 1 browser in config.xlsx--> config for Parallel execution\");\r\n\t\t}\r\n\r\n\t\tsuites.add(suite);\r\n\t\tsuite.setName(\"Suite\");\r\n\t\ttry {\r\n\t\t\tFileWriter writer = new FileWriter(\"testng_\" + \"web_parallel\" + \".xml\");\r\n\t\t\twriter.write(suite.toXml());\r\n\t\t\twriter.flush();\r\n\t\t\twriter.close();\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tThread.sleep(2000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Test(description = \"Verify that task is created and visual editor is visible\")\n public void verifyIfHighPriority() {\n\n LoginPage loginPage = new LoginPage();\n TaskPage taskPage = new TaskPage();\n loginPage.login(\"[email protected]\", \"UserUser\");\n\n test = report.createTest(\"Task tab is visible!\");\n Assert.assertEquals(taskPage.taskTab(\"Demo Meeting!\"), \"TASK\");\n test.pass(\"Task tab is visible\");\n\n\n test = report.createTest(\"High Priority checkbox is clicked\");\n Assert.assertEquals(taskPage.highPriorityLabel(), \"High Priority\");\n taskPage.highPriorityCheckBox();\n test.pass(\"High Priority checkbox visible and clickable\");\n\n\n test = report.createTest(\"Visual editor is visible and the bar is displayed\");\n taskPage.visualEditor();\n taskPage.visualEditorBarIsDisplayed();\n Assert.assertTrue(taskPage.visualEditorBarIsDisplayed());\n test.pass(\"Visual editor is clicked and the bar is displayed\");\n\n }", "@Override\r\n\tpublic void createPages() {\r\n\t\t// Creates the model from the editor input\r\n\t\t//\r\n\t\t\r\n\t\tcreateModel();\r\n\r\n\t\t// Only creates the other pages if there is something that can be edited\r\n\t\t//\r\n\t\t// if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {\r\n\t\tif (editorModel != null) {\r\n\t\t\t// Create a page for the selection tree view.\r\n\t\t\t//\r\n\r\n\t\t\t/*\r\n\t\t\t * Tree tree = new Tree(getContainer(), SWT.MULTI); selectionViewer\r\n\t\t\t * = new TreeViewer(tree); setCurrentViewer(selectionViewer);\r\n\t\t\t * \r\n\t\t\t * selectionViewer.setContentProvider(new\r\n\t\t\t * AdapterFactoryContentProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setLabelProvider(new\r\n\t\t\t * AdapterFactoryLabelProvider(adapterFactory));\r\n\t\t\t * selectionViewer.setInput(editingDomain.getResourceSet());\r\n\t\t\t * selectionViewer.setSelection(new\r\n\t\t\t * StructuredSelection(editingDomain\r\n\t\t\t * .getResourceSet().getResources().get(0)), true);\r\n\t\t\t * \r\n\t\t\t * new AdapterFactoryTreeEditor(selectionViewer.getTree(),\r\n\t\t\t * adapterFactory);\r\n\t\t\t * \r\n\t\t\t * createContextMenuFor(selectionViewer);\r\n\t\t\t */\r\n\t\t\tComposite parent = getContainer();\r\n\t\t\tformToolkit = new FormToolkit(parent.getDisplay());\r\n\t\t\tform = formToolkit.createForm(parent);\r\n//\t\t\tform.setText(\"SETTINGS - View and modify setting values in \"\r\n//\t\t\t\t\t+ editorModel.getName() + \".\");\r\n\t\t\tComposite client = form.getBody();\r\n\t\t\t// client.setBackground(Display.getCurrent().getSystemColor(\r\n\t\t\t// SWT.COLOR_WHITE));\r\n\t\t\tclient.setLayout(new FillLayout());\r\n\t\t\tfeatureViewer = new FeatureViewer(client);\r\n\r\n\t\t\tfeatureViewer.setContentProvider(new FeatureViewerContentProvider(\r\n\t\t\t\t\teditingDomain.getCommandStack(), this));\r\n\t\t\tfeatureViewer.setInput(editorModel);\r\n\t\t\tfeatureViewer.setLabelProvider(new FeatureViewerLabelProvider(CrmlBuilder.getResourceModelRoot()));\r\n\t\t\t// featureViewer.refresh();\r\n\r\n\t\t\tfeatureViewer.addSelectionChangedListener(new ISelectionChangedListener(){\r\n\t\t\t\t\r\n\t\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\t\tIStructuredSelection selection = (IStructuredSelection) event\r\n\t\t\t\t\t.getSelection();\r\n\r\n\t\t\t\t\tsetSelection(selection);\r\n\t\t\t\t\t\r\n\t\t\t\t/*\tISelection convertSelection = convertSelectionToMainModel(selection);\r\n\t\t\t\t\tSelectionChangedEvent newEvent = new SelectionChangedEvent(\r\n\t\t\t\t\t\t\tConfmlEditor.this, convertSelection);\r\n\t\t\t\t\tfireSelection(newEvent);*/\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tgetSite().setSelectionProvider(featureViewer);\r\n\t\t\t// create pop up menu actions\r\n\t\t\tresetToDefaults = new ResetToDefaultAction(featureViewer);\r\n\t\t\tmoveUpAction = new MoveUpAction(featureViewer,this);\r\n\t\t\tmoveDownAction = new MoveDownAction(featureViewer,this);\r\n\t\t\tduplicateAction = new DuplicateSequencesAction(featureViewer,this);\r\n\t\t\topenDataConfmlAction = new OpenDataConfmlAction(featureViewer);\r\n\t\t\topenConfmlAction = new OpenConfmlAction(featureViewer);\r\n\t\t\topenImplAction = new OpenImplementationAction(featureViewer);\r\n\t\t\t\r\n\t\t\tIWorkbenchWindow window = getSite().getWorkbenchWindow();\r\n\t\t\tresetToDefaults.init(window);\r\n\t\t\tmoveUpAction.init(window);\r\n\t\t\tmoveDownAction.init(window);\r\n\t\t\tduplicateAction.init(window);\r\n\t\t\topenDataConfmlAction.init(window);\r\n\t\t\topenConfmlAction.init(window);\r\n\t\t\topenImplAction.init(window);\r\n\t\t\tdisableActions();\r\n\t\t\t\r\n\t\t\t// create pop up menu with actions\r\n\t\t\tcontextMenuListener = contextMenuListener(form);\r\n\t\t\tmenuManager = new MenuManager();\r\n\t\t\tmenuManager.addMenuListener(contextMenuListener);\r\n\t\t\tmenuManager.setRemoveAllWhenShown(true);\r\n\t\t\tMenu menu = menuManager.createContextMenu(form);\r\n\t\t\tform.setMenu(menu);\r\n\t\t\t\r\n\t\t\tint pageIndex = addPage(form);\r\n\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));\r\n\r\n\t\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tsetActivePage(0);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// featureViewer.addDirtyButtonListener(new MouseListener() {\r\n\t\t//\r\n\t\t// public void mouseDoubleClick(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseDown(MouseEvent e) {\r\n\t\t// LeafGroup selectedGroup = getSelectedGroup();\r\n\t\t// if (selectedGroup != null\r\n\t\t// && !(selectedGroup instanceof SummaryLeafGroup)) {\r\n\t\t// UIGroup group = createDirtyForGroup(selectedGroup);\r\n\t\t// settingsViewer.setInput(group);\r\n\t\t// refreshAndHandleWidgetState();\r\n\t\t// // settingsViewer.refresh();\r\n\t\t// dirtySorting = true;\r\n\t\t// errorSorting = false;\r\n\t\t// notesSorting = false;\r\n\t\t// }\r\n\t\t// }\r\n\t\t//\r\n\t\t// public void mouseUp(MouseEvent e) {\r\n\t\t//\r\n\t\t// }\r\n\t\t//\r\n\t\t// });\r\n\r\n\t\t// Ensures that this editor will only display the page's tab\r\n\t\t// area if there are more than one page\r\n\t\t//\r\n\t\tgetContainer().addControlListener(new ControlAdapter() {\r\n\t\t\tboolean guard = false;\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void controlResized(ControlEvent event) {\r\n\t\t\t\tif (!guard) {\r\n\t\t\t\t\tguard = true;\r\n\t\t\t\t\thideTabs();\r\n\t\t\t\t\tguard = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n//\t\tgetSite().getShell().getDisplay().asyncExec(new Runnable() {\r\n//\t\t\tpublic void run() {\r\n//\t\t\t\tupdateProblemIndication();\r\n//\t\t\t}\r\n//\t\t});\r\n\t\t\r\n\t\tupdateErrors();\r\n\t}", "@Step\n\tpublic void verify_the_DP_Topic_of_retire_status(String Page)throws Exception {\n\n\t\tLong dpKey=Serenity.sessionVariableCalled(\"DPkey\"); \n\n\t\tswitch(Page){\n\t\tcase \"AWB\": \n\t\t\tMongoDBUtils.getDPAndTopicRetire(\"No Disposition\");\n\t\t\tString medicalPolicy=Serenity.sessionVariableCalled(\"Medicalpolicy\");\n\t\t\tString MedPolicyXpath = StringUtils.replace(oCPWPage.MedPolicyAfterSearch, \"MedPolicyValue\", medicalPolicy);\n\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.PolicySelectionDrawerButton);\n\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_10_Seconds);\n\t\t\tobjSeleniumUtils.Enter_given_Text_Element(oCPWPage.MedPolicySearchBox, medicalPolicy);\n\n\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.MedPolicySearchButton);\n\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_3_Seconds);\n\t\t\tobjSeleniumUtils.clickGivenXpath(MedPolicyXpath); \n\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.ApplyToOpportunityGridBtn);\n\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_6_Seconds);\n\t\t\tboolean statusValue=oGenericUtils.isElementExist(oCPWPage.nonRecordsOfMedicalPolicies);\n\t\t\tif(statusValue)\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Non Medical Policy / Topic \"+oCPWPage.nonRecordsOfMedicalPolicies+\"Status\",statusValue);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\tobjSeleniumUtils.Enter_given_Text_Element(oCPWPage.SearchFileldXpath, String.valueOf(dpKey));\n\t\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.SearchButtonXpath);\n\t\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_6_Seconds);\n\t\t\t\tAssert.assertTrue(\"Non Records Opportunities \"+oCPWPage.nonRecordsOfOpportunities+\"Status\",oGenericUtils.isElementExist(oCPWPage.nonRecordsOfOpportunities));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"RWO\":\n\t\t\tMongoDBUtils.getDPAndTopicRetire(\"No Disposition\");\n\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.reviewWorkedOpportunities);\n\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_6_Seconds);\n\t\t\tobjSeleniumUtils.Enter_given_Text_Element(oCPWPage.SearchFileldXpath, String.valueOf(dpKey));\n\t\t\tobjSeleniumUtils.clickGivenXpath(oCPWPage.SearchButtonXpath);\n\t\t\tobjSeleniumUtils.defaultWait(ProjectVariables.TImeout_6_Seconds);\n\t\t\tAssert.assertTrue(\"Non Records Opportunities \"+oCPWPage.nonRecordsOfOpportunities+\"Status\",oGenericUtils.isElementExist(oCPWPage.nonRecordsOfOpportunities));\n\t\t\tbreak;\n\t\tcase \"PM\":\n\t\t\tMongoDBUtils.getDPAndTopicRetire(\"Present\"); \n\t\t\tThread.sleep(2000);\n\t\t\t//Click on 'Reset' button\n\t\t\tobjSeleniumUtils.highlightElement(oFilterDrawer.sReset);\n\t\t\toGenericUtils.clickButton(By.xpath(oFilterDrawer.sReset));\n\t\t\tThread.sleep(2000);\n\t\t\tboolean bstatus=oCPWPage.Enter_the_given_MP_Topic_in_filter_Drawer(Serenity.sessionVariableCalled(\"Medicalpolicy\"));\n\n\t\t\tif(bstatus)\n\t\t\t{\n\t\t\t\tobjSeleniumUtils.clickGivenXpath(StringUtils.replace(oFilterDrawer.Medicalpolicy_Checkbox, \"value\", Serenity.sessionVariableCalled(\"Medicalpolicy\")));\n\t\t\t\toFilterDrawer.user_filters_by_clicking_on_Apply_for_Medical_Policy_Topic();\n\t\t\t\toOppurtunityDeck.validatethegivenDatainOpportunityDeck(Serenity.sessionVariableCalled(\"DPkey\").toString(), \"Updated DPkey\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"DPKey not displayed as its retired\"+Serenity.sessionVariableCalled(\"DPkey\"), true);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t}", "protected void firstStep() {\n if (!condition.equals(\"fm\") && !condition.equals(\"cfs\")) throw new RuntimeException(\"Unknown condition: \"\r\n + condition);\r\n if (rating.condition == null || rating.condition.length() == 0) ratingUpdateString(\"condition\", condition);\r\n\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(new InlineHTML(\"Web site:\"));\r\n panel.add(textInput(\"webSite\"));\r\n panel.add(new HTML(\"If you know the web site of the \" + rating._doctor.firstName + \" \"\r\n + rating._doctor.lastName + \", please enter it here.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(new HTML(\"TYPE OF HEALTH PROFESSIONAL\"));\r\n panel.add(ratingBox(\"type\", \"Family Physician / Internist\",\r\n \"Family Physician / General Internal Medicine\"));\r\n// for (String title : Arrays.asList(\"Family Physician\", \"General Internal Medicine\")) {\r\n// panel.add(ratingBox(\"type\", title, null));\r\n// panel.add(new InlineHTML(\"<br/>\"));\r\n// }\r\n panel.add(h2(new HTML(\r\n \"<b>SPECIALISTS</b>: These doctors often require a physician's recommendation to be seen.\")));\r\n for (String title : Arrays.asList(\"Allergist\", \"Cardiologist\", \"Dentist\", \"Endocrinologist\",\r\n \"Gastroenterologist\", \"Gynecologist\", \"Immunologist\", \"Infectious Disease Specialist\", \"Neurologist\",\r\n \"Orthopedist\", \"Ear, Nose and Throat Physician\", \"Pain Management Specialist\", \"Pediatrician\",\r\n \"Physical Therapist and Rehabilitation Specialist\",\r\n \"Psychological Counselor (psychiatrist, psychologist, social worker, etc.)\", \"Rheumatologist\",\r\n \"Sleep Specialist\", \"Sports Medicine Doctor\", \"Not Sure\")) {\r\n panel.add(ratingBox(\"type\", title, null));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n }\r\n\r\n panel.add(new InlineHTML(\"Other \"));\r\n panel.add(textInput(\"typeSpecialistOther\"));\r\n\r\n panel.add(h2(new HTML(\"<b>ALTERNATIVE HEALTH PRACTITIONERS</b>\")));\r\n for (String title : Arrays.asList(\"MD with an Alternative Focus\", \"Acupressurist\", \"Acupuncturist\",\r\n \"Alexander Technique Practitioner\", \"Amygdala Retrainer\", \"Aromatherapist\", \"Aryuveda practitioner\",\r\n \"Bach Flower\", \"Chinese Medicine Specialist\", \"Chiropracter\", \"Colon/Hydrotherapist\",\r\n \"Cranio-sacral Therapist\", \"Emotional Freedom Technique (EFT) Practitioner\",\r\n \"Energy Healing Practitioner\", \"Environmental Medicine\", \"Feldenkrais Practitioner\", \"Herbalist\",\r\n \"Homeopathist\", \"Hypnotherapist\", \"Kinesiologist\", \"Lightning Process Practitioner\",\r\n \"Macrobiotic Practitioner\", \"Massage Therapist\",\r\n \"Mindfulness Based Stress Reduction (MBSR) Practitioner\", \"Naturopathist\",\r\n \"Nambudripad Allergy Technique (NAET) Practitioner\", \"Neuro-linguistic Programmer\", \"Nutritionist\",\r\n \"Orthomolecular Medicine\", \"Osteopath\", \"Qigong Practitioner\", \"Reiki Practitioner\", \"Reflexologist\",\r\n \"Spiritual Healer\", \"Rolfer\")) {\r\n panel.add(ratingBox(\"type\", title, null));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n }\r\n\r\n panel.add(new InlineHTML(\"Other \"));\r\n panel.add(textInput(\"typeAlternativeOther\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(wizardNavigation(null));\r\n }", "public void doAction(\r\n\t\t\tAction_To_Choose action,\r\n\t\t\tGuideline_Action_Choices currentDecision,\r\n\t\t\tGuidelineInterpreter interpreter ){\r\n\n\t\tif (getrule_in_conditionValue() != null) {\n\t\t\tCriteria_Evaluation evaluation = HelperFunctions.dummyCriteriaEvaluation();\n\t\t\ttry {\n\t\t\t\tevaluation = (Criteria_Evaluation) ((Criterion)getrule_in_conditionValue()).evaluate(interpreter, false);\n\t\t\t\tif (!(PCAInterfaceUtil.mapTruthValue(evaluation.truth_value))) { // rule-in condition does not hold\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t} catch (PCA_Session_Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\r\n\t\t// each item in alternatives is a Drug Usage.\r\n\t\t// each item in addEvaluation is an Add_Evaluation structure\n\t\tCollection<Slot> recommendationBais = getrecommendation_basisValue();\r\n\t\tCollection alternatives = getalternativesValue();\r\n\t\tList addEvaluations = new ArrayList();\r\n\t\t// addEvaluations is a collection of Choice_Evaluation instances\r\n\t\tfor (Iterator i = alternatives.iterator();i.hasNext();) {\r\n\t\t\tDrug_Usage activity = (Drug_Usage) i.next();\r\n\t\t\tChoice_Evaluation choiceEvaluation = new Choice_Evaluation();\r\n\t\t\ttry {\r\n\t\t\t\tAdd_Evaluation addEval = activity.evaluateAdd(interpreter, \n\t\t\t\t\t\tthis.getfine_grain_priorityValue(), null, recommendationBais);\r\n\t\t\t\tif (addEval != null) {\r\n\t\t\t\t\tchoiceEvaluation.add_eval(addEval);\r\n\t\t\t\t\taddEvaluations.add(choiceEvaluation);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(activity.getlabelValue()+\" got evaluated\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(activity.getlabelValue()+\" cannot be evaluated; \"+e.getClass());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tCollections.sort(addEvaluations, new CompareEvals());\r\n\r\n\t\tinterpreter.addEvaluatedChoice(\r\n\t\t\t\tnew Guideline_Activity_Evaluations(\r\n\t\t\t\t\t\tthis.makeGuideline_Entity(interpreter.getCurrentGuidelineID()),\r\n\t\t\t\t\t\tEvaluation_Type.add,\r\n\t\t\t\t\t\t(Choice_Evaluation[])addEvaluations.toArray(new Choice_Evaluation[0]),\r\n\t\t\t\t\t\tinterpreter.getCurrentGuidelineID())\r\n\t\t\t\t);\r\n\r\n\t}", "public boolean create(List loads, Faculties instructor, Integer overload){\n try {\n /* User home directory location */\n String userHomeDirectory = System.getProperty(\"user.home\");\n /* Output file location */\n Date date = new Date();\n\n // *** same for the format String below\n SimpleDateFormat dt1 = new SimpleDateFormat(\"yyyy_MM_dd\");\n String f = dt1.format(date)+\"_\"+date.getTime();\n String outputFile = userHomeDirectory + File.separatorChar + f+\"_FacultyLoadReport.pdf\";\n List<LoadItem> loadData = new ArrayList<LoadItem>();\n \n for(int i = 0 ; i < loads.size(); i++){\n TeachersLoadings load = (TeachersLoadings) loads.get(i);\n LoadItem item = new LoadItem();\n Subjects subject = load.getSubjects();\n Integer unitLoad = subject.getLabHours() + ( subject.getLecHours() /3);\n unitLoad = unitLoad * load.getTimes();\n item.setLabHrs(subject.getLabHours() * load.getTimes());\n item.setLecHrs(subject.getLecHours() * load.getTimes());\n item.setLoad(unitLoad);\n item.setSubject(subject.getCode());\n loadData.add(item);\n \n }\n \n \n \n\n \n /* Convert List to JRBeanCollectionDataSource */\n JRBeanCollectionDataSource itemsJRBean = new JRBeanCollectionDataSource(loadData);\n\n /* Map to hold Jasper report Parameters */\n Map<String, Object> parameters = new HashMap<String, Object>();\n parameters.put(\"LoadDataList\", itemsJRBean);\n parameters.put(\"Instructor\", \"\" + instructor.getFullname());\n parameters.put(\"Overload\", \"\"+overload);\n parameters.put(\"RegularLoad\", \"\"+instructor.getRegularLoad());\n\n\n\n /* Using compiled version(.jasper) of Jasper report to generate PDF */\n JasperPrint jasperPrint = JasperFillManager.fillReport(\"C:\\\\Users\\\\ANGGIE\\\\Documents\\\\NetBeansProjects\\\\scheduler\\\\scheduler\\\\src\\\\main\\\\java\\\\com\\\\bisu\\\\report\\\\FacultyLoad.jasper\", parameters, new JREmptyDataSource());\n\n /* outputStream to create PDF */\n OutputStream outputStream = new FileOutputStream(new File(outputFile));\n /* Write content to PDF file */\n JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);\n\n if (Desktop.isDesktopSupported()) {\n File myFile = new File(outputFile);\n Desktop.getDesktop().open(myFile);\n\n }\n } catch (JRException ex) {\n ex.printStackTrace();\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n } catch (IOException ex) {\n // no application registered for PDFs\n }\n return true;\n\n \n }", "private void printEvaList(){\n\t\tEvaluatedlistModel = new DefaultListModel();\n\t\tEvaluatedList.setModel(EvaluatedlistModel);\n\t\t\n\t}", "private void startHtmlPage(PrintWriter out,ITestResult result)\r\n\t{\r\n\t\tout.println(\"<html>\");\r\n\t\tout.println(\"<head>\");\r\n\t\tout.println(\"<meta content=\\\"text/html; charset=UTF-8\\\" http-equiv=\\\"content-type\\\"/><meta content=\\\"cache-control\\\" http-equiv=\\\"no-cache\\\"/><meta content=\\\"pragma\\\" http-equiv=\\\"no-cache\\\"/>\");\r\n\t\tout.println(\"<style type=\\\"text/css\\\">\");\r\n\t\tout.println(\"body, table {\");\r\n\t\tout.println(\"font-family: Verdana, Arial, sans-serif;\");\r\n\t\tout.println(\"font-size: 12;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\"table {\");\r\n\t\tout.println(\"border-collapse: collapse;\");\r\n\t\tout.println(\"border: 1px solid #ccc;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\"th, td {\");\r\n\t\tout.println(\"padding-left: 0.3em;\");\r\n\t\tout.println(\"padding-right: 0.3em;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\"a {\");\r\n\t\tout.println(\"text-decoration: none;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\".title {\");\r\n\t\tout.println(\"font-style: italic;\");\r\n\t\tout.println(\"background-color: #B2ACAC;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\".selected {\");\r\n\t\tout.println(\"background-color: #ffffcc;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t\tout.println(\".status_done {\");\r\n\t\tout.println(\"background-color: #eeffee;\");\r\n\t\tout.println(\"}\");\r\n\t\t\r\n\t out.println(\".status_passed {\");\r\n\t out.println(\"background-color: #ccffcc;\");\r\n\t out.println(\"}\");\r\n\t\t\r\n\t out.println(\".status_failed {\");\r\n\t out.println(\"background-color: #ffcccc;\");\r\n\t out.println(\"}\");\r\n\t\t\r\n\t out.println(\".status_maybefailed {\");\r\n\t out.println(\"background-color: #ffffcc;\");\r\n\t out.println(\"}\");\r\n\t\t\r\n\t out.println(\".breakpoint {\");\r\n\t out.println(\"background-color: #cccccc;\");\r\n\t out.println(\"border: 1px solid black;\");\r\n\t out.println(\"}\");\r\n\t out.println(\"</style>\");\r\n\t out.println(\"<title>Test results</title>\");\r\n\t out.println(\"</head>\");\r\n\t out.println(\"<body>\");\r\n\t out.println(\"<h1>Test results </h1>\");\r\n\t out.println(\"<h2>Test Name: \"+className+\".\"+result.getName()+\"</h2>\");\r\n\t \r\n\t out.println(\"<table border=\\\"1\\\">\");\r\n\t out.println(\"<tbody>\");\r\n\t out.println(\"<tr>\");\r\n\t out.println(\"<td><b>Selenium-Command</b></td>\");\r\n\t out.println(\"<td><b>Parameter-1</b></td>\");\r\n\t\tout.println(\"<td><b>Parameter-2</b></td>\");\r\n\t\tout.println(\"<td><b>Status</b></td>\");\r\n\t\tout.println(\"<td><b>Screenshot</b></td>\");\r\n\t\tout.println(\"<td><b>Calling-Class with Linenumber</b></td>\");\r\n\t\tout.println(\"</tr>\");\r\n\t\t\r\n\t}", "public void generateReport(List<XmlSuite> xmlSuites, List<ISuite>suites, \r\n\t\tString outputDirectory){//creating a method that takes three arguments,\r\n\t//to generate a report, arguments list requirements, \r\n\t//using a mechanism called List, which gets the array input\r\n\t//script will go back to xml suites, and look for \"suites\" which are the classes we created\r\n\t//we will create an xml file to contain all the classes within our test cases\r\n\t//PASS, FAIL, or SKIP will be string outputs; String outputDirectory\r\n\t//XML Suite: big time testing based on testing type\r\n\t//ISuite: pages we are working on; classes created to perform action; under test folder\r\n\t\r\n\textent = new ExtentReports(outputDirectory + File.separator\r\n\t\t\t+ \"Extent.html\", true);\r\n\t//creating an object for extent report, creating a virtual object to save all output to save all results\r\n\t//as a string, file seperator is not needed, it doesn't matter how u received the result\r\n\t//seperate them and consolidate the results\r\n\t//telling you how to save the file name, html is easy to open on any device and lightweight\r\n\t//outputDirectory: SKIP, PASS, FAIL\r\n\t//the reason for boolean option: if yu receive results, generate report//if yu dont then dont generate\r\n\tfor(ISuite suite : suites){//for loop is created\r\n\t\t//map obtains a key value, not duplicate, and then maps it to one location, which is the\r\n\t\t//extent report\r\n\t\t//an interface in java, between key value and location (between status and extent report)\r\n\t\t//will make sure how to map and seperate results under each class\r\n\t\tMap<String, ISuiteResult>result = suite.getResults();\r\n\t\r\n\tfor(ISuiteResult r : result.values()){\r\n\t\tITestContext context =r.getTestContext();//for each of the classes, create log status\r\n\t\t//test context: script that we are running, results from it\r\n\t\t//: is a conditional operator, which lists the conditions, which lists out the conditions\r\n\t\t//script should be able to run \r\n\t\t//one suite, or multiple suites in one shot\r\n\t\t//making context\r\n\t\t\r\n\t\t\r\n\t\tbuildTestNo(context.getPassedTests(), LogStatus.PASS);\r\n\t\tbuildTestNo(context.getFailedTests(), LogStatus.FAIL);\r\n\t\t//retrieving status using results/context\r\n\t\tbuildTestNo(context.getSkippedTests(), LogStatus.SKIP);\r\n\t\t\t\r\n\t}\r\n}\r\nextent.flush();//take results and place on html file\r\nextent.close();\r\n\r\n}", "public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}", "public void foreachResultCreateHTML(ParameterHelper _aParam)\n {\n // TODO: auslagern in eine function, die ein Interface annimmt.\n String sInputPath = _aParam.getInputPath();\n File aInputPath = new File(sInputPath);\n// if (!aInputPath.exists())\n// {\n// GlobalLogWriter.println(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\");\n// assure(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\", false);\n// }\n\n // call for a single ini file\n if (sInputPath.toLowerCase().endsWith(\".ini\") )\n {\n callEntry(sInputPath, _aParam);\n }\n else\n {\n // check if there exists an ini file\n String sPath = FileHelper.getPath(sInputPath); \n String sBasename = FileHelper.getBasename(sInputPath);\n\n runThroughEveryReportInIndex(sPath, sBasename, _aParam);\n \n // Create a HTML page which shows locally to all files in .odb\n if (sInputPath.toLowerCase().endsWith(\".odb\"))\n {\n String sIndexFile = FileHelper.appendPath(sPath, \"index.ini\");\n File aIndexFile = new File(sIndexFile);\n if (aIndexFile.exists())\n { \n IniFile aIniFile = new IniFile(sIndexFile);\n\n if (aIniFile.hasSection(sBasename))\n {\n // special case for odb files\n int nFileCount = aIniFile.getIntValue(sBasename, \"reportcount\", 0);\n ArrayList<String> aList = new ArrayList<String>();\n for (int i=0;i<nFileCount;i++)\n {\n String sValue = aIniFile.getValue(sBasename, \"report\" + i);\n\n String sPSorPDFName = getPSorPDFNameFromIniFile(aIniFile, sValue);\n if (sPSorPDFName.length() > 0)\n {\n aList.add(sPSorPDFName);\n }\n }\n if (aList.size() > 0)\n {\n // HTML output for the odb file, shows only all other documents.\n HTMLResult aOutputter = new HTMLResult(sPath, sBasename + \".ps.html\" );\n aOutputter.header(\"content of DB file: \" + sBasename);\n aOutputter.indexSection(sBasename);\n \n for (int i=0;i<aList.size();i++)\n {\n String sPSFile = aList.get(i);\n\n // Read information out of the ini files\n String sIndexFile2 = FileHelper.appendPath(sPath, sPSFile + \".ini\");\n IniFile aIniFile2 = new IniFile(sIndexFile2);\n String sStatusRunThrough = aIniFile2.getValue(\"global\", \"state\");\n String sStatusMessage = \"\"; // aIniFile2.getValue(\"global\", \"info\");\n aIniFile2.close();\n\n\n String sHTMLFile = sPSFile + \".html\";\n aOutputter.indexLine(sHTMLFile, sPSFile, sStatusRunThrough, sStatusMessage);\n }\n aOutputter.close();\n\n// String sHTMLFile = FileHelper.appendPath(sPath, sBasename + \".ps.html\");\n// try\n// {\n//\n// FileOutputStream out2 = new FileOutputStream(sHTMLFile);\n// PrintStream out = new PrintStream(out2);\n//\n// out.println(\"<HTML>\");\n// out.println(\"<BODY>\");\n// for (int i=0;i<aList.size();i++)\n// {\n// // <A href=\"link\">blah</A>\n// String sPSFile = (String)aList.get(i);\n// out.print(\"<A href=\\\"\");\n// out.print(sPSFile + \".html\");\n// out.print(\"\\\">\");\n// out.print(sPSFile);\n// out.println(\"</A>\");\n// out.println(\"<BR>\");\n// }\n// out.println(\"</BODY></HTML>\");\n// out.close();\n// out2.close();\n// }\n// catch (java.io.IOException e)\n// {\n// \n// }\n }\n }\n aIniFile.close();\n }\n\n }\n }\n }", "public ManagePropertiesPage reviewProrty(Hashtable<String, String> testData) throws Exception {\n\ttry{\n\t\tcheckElementExistence(driver,By.xpath(\"lblPptyAddressvalue\"),5);\n\t\t/*COC.webAdaptor(Actions.waitForObjectToLoad, \"lblPptyAddressvalue\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblPptybillinfo\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblPptyName\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblPptyNameValue\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblPptyAddress\");\n\t\tCOC.webAdaptor(Actions.waitForText, \"lblPptyAddressvalue\");\n\t\n\t\t\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblMasterAccntno\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblMasterAccntnoValue\");\n\t\tCOC.webAdaptor(Actions.waitForText, \"lblAcntBillgName\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblAcntBillgNameValue\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblAccntMailingadd\");\n\t\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblAccntMailingaddvalue\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblUnit\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblAddress\");\n\n\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblTermsAgg\");\n\t\t*/COC.webAdaptor(Actions.click, \"chkTermsAgg\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblName\");\n\t\tcheckElementExistence(driver,By.xpath(\"inputName\"),5);\n\t\tCOC.webAdaptor(Actions.setText, \"inputName\",testData.get(\"Name\"));\n\t\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblTitle\");\n\t\tcheckElementExistence(driver,By.xpath(\"inputTitle\"),5);\n\t\tCOC.webAdaptor(Actions.setText, \"inputTitle\", testData.get(\"Title\"));\n\t\t\n\t\t/*COC.webAdaptor(Actions.waitForObjectToLoad, \"lblEmail\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lblEmailValue\");\n\t\tCOC.webAdaptor(Actions.waitForObjectToLoad, \"lnkBack\");\n\t\n\t*/\t\n\t\tcheckElementExistence(driver,By.xpath(\"btnSubmit\"),5);\n\t\t//COC.webAdaptor(Actions.waitForObjectToLoad, \"btnSubmit\");\n\t\tCOC.webAdaptor(Actions.click, \"btnSubmit\");\n\t\tThread.sleep(5000);\n\t\t\n\t/*\tFile scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(scrFile, new File(\"Screenshots//\" + this.getClass().getSimpleName() + \"_\" +System.currentTimeMillis() +\".png\"));\n\t\tCOCDriverScript.logMessage(\"testStepPass\", \"Selected New Property\");\n\t*/ }catch(Exception e){\n\t\tCOCDriverScript.logMessage(\"testStepFail\", \"Element not found\");\n\t\tSystem.out.println(e.getMessage());\n\t\te.printStackTrace();\n\t\tFile scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(scrFile, new File(\"Screenshots//\" + this.getClass().getSimpleName() + \"_\" +System.currentTimeMillis() +\".png\"));\n\t }\n\treturn new ManagePropertiesPage(driver, localData);\n}", "@Test \n\tpublic void generateWordsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'words' radio button \n\t\thomePage.selectContentType(\"words\");\n\n\t\t// enter '100' in the count field \n\t\thomePage.inputCount(\"1000\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of words generated \n\t\tint wordCount = generatedPage.getActualGeneratedCount(\"words\");\n\t\tAssert.assertTrue(wordCount == 1000);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\" \n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport());\n\n\t}", "public AddPage(SplashPage parent) {\n\n initComponents();\n this.parent = parent;\n\n File file = new File(\"marks.xml\");\n\n if (file.exists()) {\n Builder builder = new Builder();\n try {\n doc = builder.build(file);\n root = doc.getRootElement();\n } catch (IOException | ParsingException ex) {\n Logger.getLogger(AddPage.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n root = new Element(\"year\");\n doc = new Document(root);\n\n Element semester;\n\n semester = new Element(\"semester\");\n root.appendChild(semester);\n\n Element subject = new Element(\"computerScience\");\n Element subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Computer Science\");\n semester.appendChild(subject);\n\n subject = new Element(\"chemistry\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Chemistry\");\n semester.appendChild(subject);\n\n subject = new Element(\"functions\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Functions\");\n semester.appendChild(subject);\n\n subject = new Element(\"accounting\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Accounting\");\n semester.appendChild(subject);\n\n semester = new Element(\"semester\");\n root.appendChild(semester);\n\n subject = new Element(\"english\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"English\");\n semester.appendChild(subject);\n\n subject = new Element(\"manufacturing\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Manufacturing\");\n semester.appendChild(subject);\n\n subject = new Element(\"physics\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Physics\");\n semester.appendChild(subject);\n\n subject = new Element(\"computerEngineering\");\n subjectName = new Element(\"subjectName\");\n organizeSubject(subject);\n subject.appendChild(subjectName);\n subjectName.appendChild(\"Computer Engineering\");\n semester.appendChild(subject);\n }\n setUpComboBox();\n setUpComboBox2();\n }", "@RequestMapping(value = UrlConstant.PRODUCT_RISK_CONTROL_PROJECT_EVALUATE_URL)\n @RequiresPermissions(value = { Permissions.PRODUCT_FINANCING_PLATFORM_RATING })\n public String renderProductListForEvaluate(HttpServletRequest request, HttpSession session, Model model) {\n EProductActionType actionType = EProductActionType.EVALUATE;\n model.addAttribute(\"actionType\", actionType);\n this.addAllBasicOptionsToModel(model, actionType);\n return \"product/financeproduct_list\";\n }", "@Test(priority=1,dataProvider=\"practoPage\") \n\t\tpublic void practoPage(String hometitle,String pharmacytitle,String paintitle) throws IOException {\n\t\t\tlogger=extent.startTest(\"Load the Url and Navigate to the PainRelief Page\");\n\t\t\tProperties prop=propread.property(FileConstants.config_file);\n\t\t\tProperties prop1=propread.property(FileConstants.practopage_file);\n\t\t\tdriver.get(prop.getProperty(\"url\"));\n\t\t\tlogger.log(LogStatus.INFO, \"Url is loaded\");\n\t\t\tlog.logReport(\"User landed the practo home page Successfully\");\t\n\t\t\tvalidateTitle(driver,hometitle);\n\t\t\tpractopage.practoHome(driver, prop1,pharmacytitle,paintitle);\n\t\t\tlog.logReport(\"Successfully navigated to pain relief Page\");\n\t\t}", "@Test(priority = 1, groups= {\"regression\",\"smoke\"})\r\n\tpublic void PrintHospitals()\r\n\t{\r\n\t\tlogger= report.createTest(\"Printing Hospitals as per requirement\");\r\n\t\tDisplayHospitalNames hp=Base.nextPage1();\r\n\t\thp.selectLocation();\r\n\t\thp.selectHospital();\r\n\t\thp.applyFilters();\r\n\t\thp.hospitals();\r\n\t\thp.Back();\r\n\t}", "public ExportResults()\n\t{\n\t\tthis.evalNaiveBayesList = new ArrayList<Evaluation>();\n\t\tthis.evalSMOList = new ArrayList<Evaluation>();\n\t}", "@Test(description = \"Test to validate the EMI feature with different tenure and interest rate\", priority = 0)\n\tpublic void UserStory2() throws HeadlessException, AWTException, IOException, InterruptedException\n\t{\n\t\tLoanCalculatorPage loan_cal = new LoanCalculatorPage();\n\t\tloan_cal.validateCalHomePage();\n\t\t//testLog.log(Status.INFO, \"Loan calculator page launched\");\n\n\t\t\n\t\tint testCaseID = 3;\n\t\t\n\t\t//Enter the values in calculator and validate output\n\t\tloan_cal.ValidateDetails(loan_cal.GetEMI(testCaseID));\n\t\t\n\t}", "@RequestMapping(value={\"/checklist\"}, method={RequestMethod.GET})\n \tpublic ModelAndView handleChecklist(HttpServletRequest request){\n \t\t\n \t\tMap<String,Object> model = new HashMap<String,Object>();\n \t\t\n \t\tmodel.put(\"data\", checklistService.retrieveChecklistData(request.getParameterMap()));\n \t\tmodel.put(\"pageQuery\",StringUtils.defaultString(request.getQueryString()));\n \t\t\n \t\treturn new ModelAndView(\"checklist\", model);\n \t}", "public String showAddPage(String errorMsg) \n throws HttpPresentationException, webschedulePresentationException\n { \n\n String proj_name = this.getComms().request.getParameter(PROJ_NAME);\n String password = this.getComms().request.getParameter(PASSWORD);\n String discrib = this.getComms().request.getParameter(DISCRIB);\n String indexnum = this.getComms().request.getParameter(INDEXNUM);\n String thours = this.getComms().request.getParameter(THOURS);\n String dhours = this.getComms().request.getParameter(DHOURS);\n String projectID = this.getComms().request.getParameter(PROJ_ID);\n String codeofpay = this.getComms().request.getParameter(CODEOFPAY);\n\tString contactname = this.getComms().request.getParameter(CONTACTNAME);\n\tString contactphone = this.getComms().request.getParameter(CONTACTPHONE);\n\tString billaddr1 = this.getComms().request.getParameter(BILLADDR1);\n\tString billaddr2 = this.getComms().request.getParameter(BILLADDR2);\n\tString billaddr3 = this.getComms().request.getParameter(BILLADDR3);\n\tString city = this.getComms().request.getParameter(CITY);\n\tString state = this.getComms().request.getParameter(STATE);\n\tString zip = this.getComms().request.getParameter(ZIP);\n\tString accountid = this.getComms().request.getParameter(ACCOUNTID);\n\tString isoutside = this.getComms().request.getParameter(OUTSIDE);\n\tString exp = this.getComms().request.getParameter(EXP);\n\tString expday = this.getComms().request.getParameter(EXPDAY);\n\tString expmonth = this.getComms().request.getParameter(EXPMONTH);\n\tString expyear = this.getComms().request.getParameter(EXPYEAR);\n\tString notifycontact = this.getComms().request.getParameter(NOTIFYCONTACT);\n\n\n\t // Instantiate the page object\n\t EditHTML page = new EditHTML();\n\n\tHTMLOptionElement templateOption = page.getElementTemplateOption();\n Node PersonSelect = templateOption.getParentNode();\n templateOption.removeAttribute(\"id\");\n templateOption.removeChild(templateOption.getFirstChild());\n\n if(null != this.getComms().request.getParameter(PROJ_NAME)) {\n page.getElementProj_name().setValue(this.getComms().request.getParameter(PROJ_NAME));\n }\n\n try {\n \tPerson[] PersonList = PersonFactory.getPersonsList();\n \tfor (int numPersons = 0; numPersons < PersonList.length; numPersons++) {\n \t Person currentPerson = PersonList[numPersons] ;\n \t HTMLOptionElement clonedOption = (HTMLOptionElement) templateOption.cloneNode(true);\n clonedOption.setValue(currentPerson.getHandle());\n Node optionTextNode = clonedOption.getOwnerDocument().\n createTextNode(currentPerson.getFirstname() + \" \" +\n currentPerson.getLastname());\n clonedOption.appendChild(optionTextNode);\n // Do only a shallow copy of the option as we don't want the text child\n // of the node option\n PersonSelect.appendChild(clonedOption);\n // Alternative way to insert nodes below\n // insertBefore(newNode, oldNode);\n // ProjSelect.insertBefore(clonedOption, templateOption);\n\t }\n\t } catch(Exception ex) {\n\t this.writeDebugMsg(\"Error populating Persons List: \" + ex);\n throw new webschedulePresentationException(\"Error getting Persons List: \", ex);\n\t }\n\t\n templateOption.getParentNode().removeChild(templateOption);\n\n if(null != this.getComms().request.getParameter(PASSWORD)) {\n page.getElementPassword().setValue(this.getComms().request.getParameter(PASSWORD));\n }\n\n if(null != this.getComms().request.getParameter(DISCRIB)) {\n page.getElementDiscrib().setValue(this.getComms().request.getParameter(DISCRIB));\n }\n if(null != this.getComms().request.getParameter(INDEXNUM)) {\n page.getElementIndexnum().setValue(this.getComms().request.getParameter(INDEXNUM));\n }\n\n if(null != this.getComms().request.getParameter(THOURS)) {\n page.getElementThours().setValue(this.getComms().request.getParameter(THOURS));\n }\n\n if(null != this.getComms().request.getParameter(DHOURS)) {\n page.getElementDhours().setValue(this.getComms().request.getParameter(DHOURS));\n }\n\n if(null != this.getComms().request.getParameter(CODEOFPAY)) {\n page.getElementCodeofpay().setValue(this.getComms().request.getParameter(CODEOFPAY));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTNAME)) {\n page.getElementContactname().setValue(this.getComms().request.getParameter(CONTACTNAME));\n }\n\n if(null != this.getComms().request.getParameter(CONTACTPHONE)) {\n \npage.getElementContactphone().setValue(this.getComms().request.getParameter(CONTACTPHONE));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR1)) {\n \npage.getElementBilladdr1().setValue(this.getComms().request.getParameter(BILLADDR1));\n }\n\n\n\nif(null != this.getComms().request.getParameter(BILLADDR2)) {\n \npage.getElementBilladdr2().setValue(this.getComms().request.getParameter(BILLADDR2));\n }\n\n\nif(null != this.getComms().request.getParameter(BILLADDR3)) {\n \npage.getElementBilladdr3().setValue(this.getComms().request.getParameter(BILLADDR3));\n }\n\nif(null != this.getComms().request.getParameter(STATE)) {\n \npage.getElementState().setValue(this.getComms().request.getParameter(STATE));\n }\n\nif(null != this.getComms().request.getParameter(ZIP)) {\n \npage.getElementZip().setValue(this.getComms().request.getParameter(ZIP));\n }\n\n if(null != this.getComms().request.getParameter(OUTSIDE)) {\n page.getElementOutsideBox().setChecked(true);\n } else {\n page.getElementOutsideBox().setChecked(false);\n }\n\t\nif(null != this.getComms().request.getParameter(EXP)) {\n page.getElementExpBox().setChecked(true);\n } else {\n page.getElementExpBox().setChecked(false);\n }\t\n\t\nif(null != this.getComms().request.getParameter(ACCOUNTID)) {\n \npage.getElementAccountid().setValue(this.getComms().request.getParameter(ACCOUNTID));\n }\n\t\n\t\nif(null != this.getComms().request.getParameter(EXPDAY)) {\n \npage.getElementExpday().setValue(this.getComms().request.getParameter(EXPDAY));\n }\n\n\nif(null != this.getComms().request.getParameter(EXPMONTH)) {\n \npage.getElementExpmonth().setValue(this.getComms().request.getParameter(EXPMONTH));\n }\nif(null != this.getComms().request.getParameter(EXPYEAR)) {\n \npage.getElementExpyear().setValue(this.getComms().request.getParameter(EXPYEAR));\n }\n\n if(null != this.getComms().request.getParameter(NOTIFYCONTACT)) {\n page.getElementNotifycontact().setValue(this.getComms().request.getParameter(NOTIFYCONTACT));\n }\n\n if(null == errorMsg) { \n\t page.getElementErrorText().getParentNode().removeChild(page.getElementErrorText());\n } else {\n page.setTextErrorText(errorMsg);\n }\n \n\t return page.toDocument();\n }", "public static void viewPage(WebDriver driver, String sTestCaseName) throws Exception{\r\n\t\r\n\t\t//Check that all of the elements of that are expected are displayed\r\n\t\tObjects_Job_Completion_Summary_Page.lbl_Summary(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Summary label displayed as expected\");\r\n\t\t}\r\n\r\n\t\tif (\"Exchange_1_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"INST_14_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_19_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t||\"Exchange_1_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\telse if (\"Exchange_2_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_15_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_20_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_11_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_2_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_5_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_8_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"NMEX_5_End_To_End_Spark_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t}\r\n\t\telse if (\"Exchange_3_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_3_Gas_SMeter_Post_Installation_Pressure_Drop_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Elec_HAN_WAN_Checks_Page_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Initial_Risk_Assessment_Gas_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Post_Installation_Gas_Tightness_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Failed_Test_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Meter_Pre_Installation_Gas_Tightness_Test_Low_Pressure_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Low_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Risk_Assessment_Gas_Abort_Med_Pressure_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_Gas_Suitable_For_Smart_Installation_Abort_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_21_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_16_End_To_End_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"Exchange_9_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"FLTY_17_End_To_End_Spark_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Polarity_Check_At_Meter_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Initial_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Risk_Assessment_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_Elec_Suitable_For_Smart_Installation_Page_Abort_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_12_End_To_End_Found_Meter_ECOT_Chrome\".equals(sTestCaseName)\r\n\t\t\t\t|| \"INST_3_Elec_HAN_WAN_Checks_Page_Abort_ECOT_Chrome\".equals(sTestCaseName))\r\n\t\t{ \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Electricity_Meter_Mpan(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Electricity Meter MPAN label displayed as expected\");\r\n\t\t\t}\r\n\t\t \r\n\t\t\tObjects_Job_Completion_Summary_Page.lbl_Gas_Meter_Mprn(driver).isDisplayed();{\r\n\t\t\tLog.info(sTestCaseName + \" | Gas Meter MPRN label displayed as expected\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Doing the elseif\"); \r\n\t\t} \r\n\t\telse \t\t\r\n\t\t{ \r\n\t\t\tSystem.out.println(\"Doing the else \"); \r\n\t\t}\t\t\t\t\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Potential_Customer_Vulnerability_Identified_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Potential Customer Vulnerability Identified - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.txt_Additional_Notes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Additional notes textbox displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_Yes(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - Yes radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\tObjects_Job_Completion_Summary_Page.btn_Customer_Agreement_No(driver).isDisplayed();{\r\n\t\tLog.info(sTestCaseName + \" | Customer Agreement - No radio button displayed as expected\");\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t//Take a screenshot to show what we've done\r\n\t\tUtils.takeScreenshot(driver, sTestCaseName + \"-viewPage\");\r\n\t\t\r\n\t//END OF VIEW PAGE METHOD\r\n\t}", "private String[] evaluate()\n {\n //there must be some recommender selected by the user on the UI\n if (selectedRecommenderPanel.getObject() == null\n || selectedRecommenderPanel.getObject().getTool() == null) {\n LOG.error(\"Please select a recommender from the list\");\n return null;\n }\n\n //get all the source documents related to the project\n Map<SourceDocument, AnnotationDocument> listAllDocuments = documentService\n .listAllDocuments(project, userDao.getCurrentUser());\n\n //create a list of CAS from the pre-annotated documents of the project\n List<CAS> casList = new ArrayList<>();\n listAllDocuments.forEach((source, annotation) -> {\n try {\n CAS cas = documentService.createOrReadInitialCas(source);\n casList.add(cas);\n }\n catch (IOException e1) {\n LOG.error(\"Unable to render chart\", e1);\n return;\n }\n });\n \n IncrementalSplitter splitStrategy = new IncrementalSplitter(TRAIN_PERCENTAGE,\n INCREMENT, LOW_SAMPLE_THRESHOLD);\n\n @SuppressWarnings(\"rawtypes\")\n RecommendationEngineFactory factory = recommenderRegistry\n .getFactory(selectedRecommenderPanel.getObject().getTool());\n RecommendationEngine recommender = factory.build(selectedRecommenderPanel.getObject());\n \n if (recommender == null) {\n LOG.warn(\"Unknown Recommender selected\");\n return null;\n }\n \n if (!evaluate) {\n return getEvaluationScore(evaluationResults);\n }\n\n evaluationResults = new ArrayList<EvaluationResult>();\n \n // create a list of comma separated string of scores from every iteration of\n // evaluation.\n while (splitStrategy.hasNext()) {\n splitStrategy.next();\n\n try {\n EvaluationResult evaluationResult = recommender.evaluate(casList, splitStrategy);\n \n if (evaluationResult.isEvaluationSkipped()) {\n LOG.warn(\"Evaluation skipped. Chart cannot to be shown\");\n continue;\n }\n\n evaluationResults.add(evaluationResult);\n }\n catch (RecommendationException e) {\n LOG.error(e.toString(),e);\n continue;\n }\n }\n\n return getEvaluationScore(evaluationResults);\n }", "private final void createAppPages() {\r\n\t\t//Instantiate Page objects that have no associated test properties\r\n\t\t//Note that if a test DOES need to specify test properties for one of these pages\r\n\t\t// (e.g., search terms), it can create its own local version of the page, and pass\r\n\t\t// the pagePropertiesFilenameKey argument, OR create it here, by calling createPage\r\n\t\t// instead of createStaticPage\r\n\r\n\t\t//Can also instantiate regular (i.e., with associated test properties) DD-specific\r\n\t\t// Page objects here, but typically it is best for the test or utility methods to do that;\r\n\t\t// if we do it here we may end up creating Page objects that never get used.\r\n }", "private static void createTopStoriesPage(XMLTree xml, SimpleWriter out)\n {\n \tout.println(\"<!DOCTYPE html>\");\n \tout.println(\"<html>\");\n \tout.println(\"<head>\");\n \tout.println(\"<title>\" + xml.attributeValue(\"title\") + \"</title>\");\n \tout.println(\"</head>\");\n \tout.println(\"<h1>\" + xml.attributeValue(\"title\") + \"</h1>\");\n \tout.println(\"<ul>\");\n \t\n \t// for each child (each feed) create the file, process the feed, and display the list item)\n \tfor(int i = 0; i < xml.numberOfChildren(); i++)\n \t{\n \t\tSimpleWriter newOut = new SimpleWriter1L(\"src/\" + xml.child(i).attributeValue(\"file\"));\n \t\tprocessFeed(xml.child(i).attributeValue(\"url\"), xml.child(i).attributeValue(\"file\"), newOut);\n \t\tout.println(\"<li><a href=\\\"\" + xml.child(i).attributeValue(\"file\") + \"\\\">\" + xml.child(i).attributeValue(\"name\") + \"</a></li>\");\n \t\tnewOut.close();\n \t}\n \t\n \tout.println(\"</ul>\");\n \tout.println(\"</html>\");\n }", "public static void main(String[] args) {\n for (int pageNumber =1; pageNumber<=51; pageNumber++){\n try {\n //System.out.println(\"Page number: \" + pageNumber);\n String pageContent = getPageContent(\"https://powerlist.talint.co.uk/talint-powerlist/search-companies/?sf_paged=\" + pageNumber);\n String [] linkSections = pageContent.split(\"</a></h2>\");\n for (String linkSection: linkSections) {\n if(linkSection.contains(\"<h2><a href=\\\"\")){\n String companyLink = linkSection.substring(linkSection.indexOf(\"<h2><a href=\\\"\")+13,\n linkSection.lastIndexOf(\"/\\\">\"));\n String companyDetailsContent = getPageContent(companyLink);\n processCompanyDetails(companyLink, companyDetailsContent);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@Test\n\tpublic void generateGreen4LoyaltyReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t//Generate Batch report\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Green4 Loyalty Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "private ShowCreateAnswerPage() {\n this.service = UserService.retrieve();\n this.validator = Validator.retrieve();\n }", "@Override\n\tpublic void addPages() {\n\t\t_fileWizard = new NewPlotFilenameWizardPage(selection);\n\t\t_scaleWizard = new ScaleWizardPage(selection);\n\t\t_coastWizard = new CoastWizardPage(selection);\n\t\t_gridWizard = new GridWizardPage(selection);\n\n\t\t// check there's ETOPO data before we add the page\n\t\t_etopoWizard = new ETOPOWizardPage(selection);\n\n\t\taddPage(_fileWizard);\n\t\taddPage(_scaleWizard);\n\t\taddPage(_coastWizard);\n\t\taddPage(_gridWizard);\n\t\tif (_etopoWizard.isAvailable())\n\t\t\taddPage(_etopoWizard);\n\t}", "public static void main(String[] args) {\n\t\tWebDriver driver = new FirefoxDriver();\r\n\r\n\t\t// Opening browser\r\n\t\tdriver.get(\"https://training-support.net/selenium/dynamic-controls\");\r\n\r\n\t\t// Get the title of page\r\n\t\tString title = driver.getTitle();\r\n\t\tSystem.out.println(\"Title of the page is: \" + title);\r\n\r\n\t\t// find checkbox\r\n\t\tWebElement checkbox = driver.findElement(By.xpath(\"//input[@type='checkbox']\"));\r\n\r\n\t\t// Print checkbox is selected or not\r\n\t\tSystem.out.println(\"Checkbox is selected: \" + checkbox.isSelected());\r\n\r\n\t\t// Clcik on checkbox\r\n\t\tcheckbox.click();\r\n\r\n\t\t// Print checkbox is selected or not\r\n\t\tSystem.out.println(\"Checkbox is selected: \" + checkbox.isSelected());\r\n\r\n\t\t// closing browser\r\n\t\tdriver.close();\r\n\t}", "public void ExperimentResults() {\n\t\t/*\n\t\t * Creating a ScreenPresenter. To create other ResultsPresenter, the\n\t\t * better idea is to create a Factory.\n\t\t */\n\t\tResultPresenter presenter = new ScreenPresenter();\n\t\tpresenter.setText(evaluator.evalResults.resultsInText());\n\n\t}", "public void page()\n {\n com.jayway.restassured.response.Response response= given().relaxedHTTPSValidation().when().get(\"http://18.222.188.206:3333/accounts?_page=3\");\n response.then().assertThat().statusCode(200);\n System.out.println(\"The list of accounts in the page 3 is displayed below:\");\n response.prettyPrint();\n }", "public List<String> iterateProgramPageList();", "public static void main(String[] args) {\n\t\tString url=\"http://www.zhihu.com/explore/recommendations\";\n\t\tDraw draw=new Draw();\n\t\tSpider spider=new Spider();\n\t\t//获取地址集\n\t\tArrayList<WebEntity> retList=new ArrayList<WebEntity>();\n\t\tretList.addAll(spider.getWebList(url));\n\t\t\n\t\tint len=retList.size();\n\t\t\n\t\tPageRankEntity page=new PageRankEntity(len+1);\n\t\t\n\t\t//生成对应矩阵\n\t\tint j=0;\n\t\tfor(int i=0;i<len;i++){\n\t\t\tSystem.out.println(retList.get(i).Url);\n\t\t\tfor(String s:retList.get(i).outUrl){\n\t\t\t\tj=spider.webUrlContain(retList, s);\n\t\t\t\tif(j!=-1){\n\t\t\t\t\t//System.out.println(\"get page\");\n\t\t\t\t\tpage.num[i][j]=(double)1;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tpage.PageRank();\n\t\tdraw.drawPic(len, page);\n\t\tpage.show_V(retList);\n\t\t\n\t\tSystem.out.println(\"PROGRAM END\");\n\n\t}", "@Override\n void execute(RolapEvaluator evaluator) {\n }", "@RequestMapping(value = \"/figureAssignment\", method = RequestMethod.GET)\n public ModelAndView getFigureAssignment(@RequestParam(\"ctype\") String ctype, HttpServletRequest req, HttpServletResponse resp) {\n\n List<CourseEntity> courses = userDao.findAllCourse();\n List<AssignmentEntity> assignments = new ArrayList<>();\n if (ctype == null) {\n// System.out.println(\"ctype now is : \" + ctype);\n ctype = courses.get(0).getCtype();\n assignments = userDao.findAllAssignment(ctype);\n } else {\n// System.out.println(\"ctype now is : \" + ctype);\n assignments = userDao.findAllAssignment(ctype);\n }\n List<AssignmentEntity> assignmentsPublished = new ArrayList<>();\n List<AssignmentEntity> assignmentsEnd = new ArrayList<>();\n List<AssignmentEntity> assignmentsFinished = new ArrayList<>();\n List<AssignmentEntity> assignmentsScoring = new ArrayList<>();\n List<AssignmentEntity> assignmentsScored = new ArrayList<>();\n for (int i = 0; i < assignments.size(); i++) {\n switch (assignments.get(i).getState()) {\n case \"Published\":\n assignmentsPublished.add(assignments.get(i));\n break;\n case \"End\":\n assignmentsEnd.add(assignments.get(i));\n break;\n case \"Finished\":\n assignmentsFinished.add(assignments.get(i));\n break;\n case \"Scoring\":\n assignmentsScoring.add(assignments.get(i));\n break;\n case \"Scored\":\n assignmentsScored.add(assignments.get(i));\n break;\n }\n }\n\n ModelAndView mv = new ModelAndView(\"/root/figureAssignment\");\n mv.addObject(\"sid\", \"root\");\n mv.addObject(\"courses\", courses);\n mv.addObject(\"ctype\", ctype);\n mv.addObject(\"assignments\", assignments);\n mv.addObject(\"assignmentsPublished\", assignmentsPublished);\n mv.addObject(\"assignmentsEnd\", assignmentsEnd);\n mv.addObject(\"assignmentsFinished\", assignmentsFinished);\n mv.addObject(\"assignmentsScoring\", assignmentsScoring);\n mv.addObject(\"assignmentsScored\", assignmentsScored);\n\n\n System.out.println(\"TEST*******************\");\n\n return mv;\n }", "@Override\r\n\tprotected void initPage() {\n\t\t\r\n\t\t\r\n\t\tJPanel paneLabel = new JPanel();\r\n\t\t//JPanel panelTabs = new JPanel();\r\n\t\t\r\n\t\t\r\n\t\t//pack.setVisible(false);\r\n\r\n\t\t//setlay out\r\n\t\t//panelTabs.setLayout(new GridLayout(1, 1));\r\n\t\t\r\n\t\t//add label to label panel\r\n\t\tpaneLabel.add(new JLabel(\"Please select Objects To export\"));\r\n\t\t//tabs.setLayout(new GridLayout(1, 1));\r\n\t\t\r\n\t\t//add tabs\r\n\t\ttabs.addTab(\"Packages\", null, pack, \"Packages\");\r\n\t\ttabs.addTab(\"Functions\", null, fun, \"Functions\");\r\n\t\ttabs.addTab(\"Procedures\", null, proc, \"Procedures\");\r\n\t\ttabs.addTab(\"Schemas\", null, sch, \"Schemas\");\r\n\t\t\r\n\t\t\r\n\t\ttabs.setTabPlacement(JTabbedPane.TOP);\r\n\t\t\r\n\t\t//add tabs to tabpanel panel\r\n\t\t//panelTabs.add(tabs);\r\n\t\t\r\n\t\t//add data tables to panels\r\n\t\tpackTbl = new JObjectTable(pack);\r\n\t\tfunTbl = new JObjectTable(fun);\r\n\t\tschTbl = new JObjectTable(sch);\r\n\t\tprocTbl = new JObjectTable(proc);\r\n\t\t\r\n\t\t//set layout\r\n\t\tsetLayout(new GridLayout(1,1));\r\n\t\t\r\n\t\t//add label & tabs to page panel\r\n\t\t//add(paneLabel, BorderLayout.NORTH);\r\n\t\t//add(panelTabs,BorderLayout.CENTER);\r\n\t\tadd(tabs);\r\n\t\t\r\n\t\t//init select all check boxes\r\n\t\tinitChecks();\r\n\t\t\r\n\t\t//add checks to panel\r\n\t\tpack.add(ckPack);\r\n\t\tfun.add(ckFun);\r\n\t\tsch.add(ckSchema);\r\n\t\tproc.add(ckProc);\r\n\t\t\r\n\t}", "@Override\n public void make(@NonNull List<GenericPaint> genericPaintList) {\n PdfDocument.Page page = this.document.startPage(this.pageInfo);\n Canvas c = page.getCanvas();\n\n this.paintTitle(c);\n this.printCustomerInformation(c);\n this.paintSubtitle(c);\n this.paintPrintInformation(c);\n this.paintTableHeader(c);\n this.paintTableSum(c);\n this.paintFooter(c);\n\n this.document.finishPage(page);\n\n this.write();\n }", "protected void secondStep() {\r\n panel.add(h3(new InlineHTML(\"EXPERIENCE:\")));\r\n panel.add(new InlineHTML(\"Please provide your assessment\"\r\n + \" of your health professional's experience level at treating this disease.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"experience\", null, \"<br/>\",//\r\n \"Specialist\", \"<b>Specialist</b> - This person specializes in treating ME/CFS;\"\r\n + \" most of her/his patients have chronic fatigue syndrome.\",//\r\n \"Knowledgeable\", \"<b>Knowledgeable</b> - The 'Knowledgeable' may not specialize\"\r\n + \" in chronic fatigue syndrome (ME/CFS)\"\r\n + \" but these patients make up a significant portion of her/his practice.\",//\r\n \"Informed\", \"<b>Informed</b> - Chronic fatigue syndrome (ME/CFS)\"\r\n + \" is not a major part of this person's practice\"\r\n + \" but they appear to be knowledgeable about the disease and its treatment options.\",//\r\n \"Learner\", \"<b>Learner</b> - The 'Learner' does not treat\"\r\n + \" many chronic fatigue syndrome (ME/CFS) patients\"\r\n + \" but is willing to learn and listen to and review patient suggestions.\",//\r\n \"Uninformed\", \"<b>Uninformed</b> - The 'Uninformed' practitioner\"\r\n + \" doesn't know much about the disease and is not interested.\",//\r\n \"Skeptic\", \"<b>Skeptic</b> - The 'Skeptic' practitioner\" + \" does not believe ME/CFS exists\"\r\n + \" and appears to take its existence as a personal affront.\",//\r\n \"-\", \"<b>I don't know</b>\"));\r\n\r\n panel.add(h3(new InlineHTML(\"INITIAL COST:\")));\r\n panel.add(new InlineHTML(\r\n \"Since costs can vary greatly even for patients seeing the same health professional\"\r\n + \" - depending on the treatment regimen -\"\r\n + \" we'd like to know the approximate initial costs of seeing your health professional.\"\r\n + \" This includes the approximate fees for the first two visits;\"\r\n + \" the costs of the laboratory workup and whatever medications were prescribed.\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"initialCost\", null, \"<br/>\", \"<$100\", \"Less than $100\", \"$100-$500\", \"$100-$500\",\r\n \"$500-$1000\", \"$500-$1,000\", \"$1000-$2000\", \"$1.000-$2.000\", \"$2000-$5000\", \"$2,000-$5,000\",\r\n \">$5000\", \"&gt;$5,000\", \"NotSure\", \"Not Sure\"));\r\n\r\n panel.add(h3(new InlineHTML(\"COST:\")));\r\n panel\r\n .add(new InlineHTML(\"Average 6 months cost\"\r\n + \" - please include doctor's visits, tests and treatment program.\"\r\n + \" Please do not include travel\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"averageCost\", null, \"<br/>\", //\r\n \"<600\", \"Less than $600 (>$100/month)\", //\r\n \"600-1200\", \"$600-$1200 ($100-$200/month)\", //\r\n \"1200-2400\", \"$1200-$2400 ($200-400/month)\", //\r\n \"2400-4800\", \"$2400-$4800 ($400-$800/month)\", //\r\n \">4800\", \">$4800 (>$800/month)\"));\r\n\r\n panel.add(h3(new InlineHTML(\"ACCEPTS INSURANCE?\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"insurance\", \"-\", \"<br/>\", \"Yes\", \"Yes\", \"No\", \"No\", \"-\", \"Don't Know\"));\r\n\r\n panel.add(h3(new InlineHTML(\"AVERAGE LENGTH OF VISIT (not including the first two sessions):\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"visitLength\", null, \"<br/>\", \"<15m\", \"Less than 15 minutes\", \"15m-30m\",\r\n \"15 to 30 minutes\", \"30m-1h\", \"30 minutes to an hour\", \">1h\", \"Greater than an hour\"));\r\n\r\n panel.add(h3(new InlineHTML(\"About how many times do you physically see this practitioner a year?\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"visitFrequency\", null, \"<br/>\", //\r\n \"1\", \"1\", //\r\n \"2\", \"2\", //\r\n \"3-7\", \"3-7\", //\r\n \"7-12\", \"7-12\", //\r\n \">12\", \">12 times a year\"));\r\n\r\n panel.add(h3(new InlineHTML(\"TREATMENT BREADTH -\")));\r\n panel.add(new InlineHTML(\"This practitioner provides <b>significant</b> information on:\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"drugs\", \"Pharmaceutical Drugs\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"alternativeTreatments\",\r\n \"Alternative Treatments (vitamins, neutraceuticals, etc.)\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(ratingBox(\"treatmentBreadth\", \"lifestyle\",\r\n \"Lifestyle Management (envelope therapy, pacing, sleep hygiene, behavioral therapies, etc.)\"));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n\r\n panel.add(h3(new InlineHTML(\"MEDICATION PURCHASING\")));\r\n panel.add(new InlineHTML(\"<br/>\"));\r\n panel.add(radioInput(\"ripoff\", \"No\", \"<br/>\", \"Yes\",\r\n \"Practitioner requires that patients buy alternative medications/neutraceuticals from her/him\", \"No\",\r\n \"Practitioner allows patients to buy alternative medications/neutraceuticals from outside sources\"));\r\n\r\n panel.add(h3(new InlineHTML(\"OFFICE MANAGEMENT AND ORGANIZATION\")));\r\n panel.add(new HTML(\"Please rate on scale from 1-5 how well organized this practitioners office was\"\r\n + \" (1 = chaotic, 5 = humming like a well-oiled machine).\"\r\n + \" This applies to such things as scheduling, receiving test results on time,\"\r\n + \" getting documents to and from the practitioner, etc.\"));\r\n panel.add(radioNumeric(\"organization\", 1, 5));\r\n\r\n panel.add(h3(new InlineHTML(\"AVAILABILITY\")));\r\n panel\r\n .add(new HTML(\r\n \"Please rate on a scale from 1-5 how available was the practitioner to you\"\r\n + \" (1= not available outside of office visits, 5= quick response)?\"\r\n + \" Did they respond in a timely manner to request and questions or did you have to wait, wait, wait....?\"));\r\n panel.add(radioNumeric(\"availability\", 1, 5));\r\n\r\n final Command verifier = new Command() {\r\n @Override public void execute() {\r\n if (rating.getField(\"experience\") == null) {\r\n final HTML html = new HTML(\r\n \"<span style='color: red; font-size: larger'>Please assess the experience level! Thanks.</span>\");\r\n panel.add(html);\r\n Document.get().setScrollTop(\r\n html.getAbsoluteTop() + html.getOffsetHeight() - Window.getClientHeight());\r\n throw new CommandCanceledException(this);\r\n }\r\n }\r\n };\r\n panel.add(wizardNavigation(verifier));\r\n }", "@Test\n\tpublic void generateSpecialInstructionsReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\t\n\t\t\t\tWebElement select_report = driver.findElement(By.id(\"report_type_chooser\"));\n\t\t\t\tselect_report.sendKeys(\"Special Instructions Report\");\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "@Test\r\n\tpublic void questionTest() throws Throwable {\n\t\tString category=eUtil.getExcelData(\"smoke\", 1, 2);\r\n\t\tString subcategory=eUtil.getExcelData(\"smoke\", 1, 3);\r\n\t\tString question_title=eUtil.getExcelData(\"smoke\", 1, 4);\r\n\t\tString description=eUtil.getExcelData(\"smoke\", 1, 5);\r\n\t\tString expectedresult=eUtil.getExcelData(\"smoke\", 1, 6);\r\n\r\n\t\t//Navigate to QuestionPage\r\n\t\tQuestionsPage questionpage=new QuestionsPage(driver);\r\n\t\tquestionpage.questionPage(category, subcategory, question_title, description);\r\n\t\t\r\n\t\t//Verification\r\n\t\tString actual = questionpage.questionsLink();\r\n\t\tAssert.assertTrue(actual.contains(expectedresult));\r\n\t}", "private String renderCreatePage(Model model) {\n\t\tmodel.addAttribute(\"availableProviders\", providerService.getAllProviders());\n\t\treturn \"vm/create\";\n\t}", "public void createRuleOverview() {\n\t\tmainBox.setBorder(BorderFactory.createLineBorder(Color.black));\n\t\tmainBox.add(nameBox);\n\t\tmainBox.add(inputBox);\n\t\tmainBox.add(outputBox);\n\t}", "public void testCreateNewSet() {\n // browser.maximizeWindow();\n\n ListSetsPage listSetsPage = new ListSetsPage(browser);\n EditSetPage editSetPage = new EditSetPage(browser);\n String name = \"My First Set\";\n String description = \"This is the first set that I have built!\";\n List<Long> routineList = new ArrayList<Long>();\n // TO-DO: This needs to be refactored to populate its own routines (1 and 3 below)\n //routineList.add(1L);\n //routineList.add(3L);\n //editSetPage.createSet(name, description, routineList);\n browser.goTo(listSetsPage);\n listSetsPage.isAt();\n listSetsPage.hasSet(name);\n // TO-DO: Add tests to ensure the routines that should be in here are in here\n }", "public EvaluationStep() {\n ApplicationSession.setEvaluationStepInstance(this);\n }", "private void generateOutputHTML() {\n\n\t\t\n\t\ttry {\n\t\t\tScanner in = new Scanner(new File(\"data/web/template.html\"));\n\t\t\tPrintStream out = new PrintStream(\"data/web/output\"+count+\".html\");\n\t\t\tSystem.setOut(out);\n\t\t\t\n\t\t\twhile (in.hasNext()) {\n\t\t\t\tString line = in.nextLine();\n\t\t\t\tSystem.out.print(line);\n\t\t\t\t\n\t\t\t\tif (line.equals(\"<title>\")) System.out.println(\"Path #\" +count);\n\t\t\t\t\n\t\t\t\n\t\t\t\tif (line.equals(\"<body>\")) { \t\t\t\t// this is where all the good stuff goes..\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"<div class='bodyHeader'>\");\n\t\t\t\t\tSystem.out.println(\"<p><strong>in order path for driver #\" +count+ \" \" + \"</strong></p>\");\n\t\t\t\t\tSystem.out.println(\"</div>\");\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"<br><br><hr class='hrStyle'/>\");\n\t\t\t\t\t\n\t\t\t\t\t// Creating info about the path in a table format\n\t\t\t\t\tSystem.out.println(\"<div class='pathInfo'>\");\n\t\t\t\t\tSystem.out.println(\"<table class='infoTable' cellpadding='3' cellspacing='10'>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>City: </td><td> \" + list.get(0).getCity()+ \" - \" + list.get(0).getState() + \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>Number of stops: </td><td> \" + (list.size()-1) + \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"<tr><td>Store: </td><td> \" + list.get(1).getName().toUpperCase()+ \"</td></tr>\");\n\t\t\t\t\tSystem.out.println(\"</table>\");\n\t\t\t\t\t\n//TODO: get starting address --- System.out.println(\"Starting address: \" + list.get(0).getAddress());\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"</div>\");\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tlist.remove(0);\n\t\t\t\t\t\n\t\t\t\t\t//create ordered table/list of path\n\t\t\t\t\tSystem.out.println(\"<div class='pathList'>\");\t\n\t\t\t\t\tSystem.out.println(\"<table class='pathTable' cellspacing='15'>\");\n\t\t\t\t\tSystem.out.println(\"<tr><th>Order</th><th>Address</th><th></th><th>Latitude , Longitude</th></tr>\");\n\t\t\t\t\tint i = 1;\n\t\t\t\t\tfor (Location c: list) {\n\t\t\t\t\t// creating table row for each stop in route\n\t\t\t\t\t\tSystem.out.println(\"<tr>\" + \"<td>\"+(i++)+\"</td>\" + c.toHTMLString() +\"</tr>\");\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"</ol>\");\n\t\t\t\t\tSystem.out.println(\"<br>\");\n\t\t\t\t\tSystem.out.println(\"</div>\");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tin.close();\n\t\t\tout.close();\n\t\t\t\n\t\t\t//opening html file to the default browser in the system\n\t\t\tFile htmlFile = new File(\"data/web/output\"+count+\".html\");\n\t\t\tDesktop.getDesktop().browse(htmlFile.toURI());\n\t\t}\n\t\t\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(e.getLocalizedMessage());\n\t\t} \n\t}", "private void createPageContent() \n\t{\n\t\tGridLayout gl = new GridLayout(4, true);\n gl.verticalSpacing = 10;\n\t\t\n\t\tGridData gd;\n\t\tfinal Label wiz1Label = new Label(shell, SWT.NONE);\n\t\twiz1Label.setText(\"Enter Fields\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 4;\n\t\twiz1Label.setLayoutData(gd);\n\t\twiz1Label.pack();\n\t\tText nameInput = new Text(shell, SWT.BORDER);\n\t\tnameInput.setMessage(\"Name\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 2;\n\t\tnameInput.setLayoutData(gd);\n\t\tnameInput.pack();\n\t\t//Component\n\t\tText componentInput = new Text(shell, SWT.BORDER);\n\t\tcomponentInput.setMessage(\"Component\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 2;\n\t\tcomponentInput.setLayoutData(gd);\n\t\tcomponentInput.pack();\n\t\t//school\n\t\tText schoolInput = new Text(shell, SWT.BORDER);\n\t\tschoolInput.setMessage(\"School\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 2;\n\t\tschoolInput.setLayoutData(gd);\n\t\tschoolInput.pack();\n\t\t//range\n\t\tText rangeInput = new Text(shell, SWT.BORDER);\n\t\trangeInput.setMessage(\"Range\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 2;\n\t\trangeInput.setLayoutData(gd);\n\t\trangeInput.pack();\n\t\t//Effect\n\t\tText effectInput = new Text(shell, SWT.BORDER);\n\t\teffectInput.setMessage(\"Effect\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 4;\n\t\teffectInput.setLayoutData(gd);\n\t\teffectInput.pack();\n\t\t//castingtime\n\t\tText castimeInput = new Text(shell, SWT.BORDER);\n\t\tcastimeInput.setMessage(\"Casting Time\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 2;\n\t\tcastimeInput.setLayoutData(gd);\n\t\tcastimeInput.pack();\n\t\t//materialcomponent\n\t\tText materialInput = new Text(shell, SWT.BORDER);\n\t\tmaterialInput.setMessage(\"Material Component\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 2;\n\t\tmaterialInput.setLayoutData(gd);\n\t\tmaterialInput.pack();\n\t\t//Savingthrow\n\t\tText savthrowInput = new Text(shell, SWT.BORDER);\n\t\tsavthrowInput.setMessage(\"Saving Throw\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 2;\n\t\tsavthrowInput.setLayoutData(gd);\n\t\tsavthrowInput.pack();\n\t\t//Focus\n\t\tText focusInput = new Text(shell, SWT.BORDER);\n\t\tfocusInput.setMessage(\"Focus\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 2;\n\t\tfocusInput.setLayoutData(gd);\n\t\tfocusInput.pack();\n\t\t//Duration\n\t\tText durationInput = new Text(shell, SWT.BORDER);\n\t\tdurationInput.setMessage(\"Duration\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 2;\n\t\tdurationInput.setLayoutData(gd);\n\t\tdurationInput.pack();\n\t\t//spellresistance\n\t\tLabel resistanceLabel = new Label(shell, SWT.NONE);\n\t\tresistanceLabel.setText(\"Can Spell Be Resisted\");\n\t\tgd = new GridData(GridData.CENTER, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 1;\n\t\tresistanceLabel.setLayoutData(gd);\n\t\tresistanceLabel.pack();\n\t\tButton resistanceInput = new Button(shell, SWT.CHECK);\n\t\tgd = new GridData(GridData.CENTER, GridData.FILL, false, false);\n\t\tgd.horizontalSpan = 1;\n\t\tresistanceInput.setLayoutData(gd);\n\t\tresistanceInput.pack();\n\t\t//level\n\t\tText levelInput = new Text(shell, SWT.BORDER);\n\t\tlevelInput.setMessage(\"Level\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, false, false);\n\t\tlevelInput.setLayoutData(gd);\n\t\tlevelInput.pack();\n\t\t//Damage\n\t\tText damageInput = new Text(shell, SWT.BORDER);\n\t\tdamageInput.setMessage(\"Damage\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 1;\n\t\tdamageInput.setLayoutData(gd);\n\t\tdamageInput.pack();\n\t\t//DamageAlternative\n\t\tText damagealterInput = new Text(shell, SWT.BORDER);\n\t\tdamagealterInput.setMessage(\"Damage Alternative\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 2;\n\t\tdamagealterInput.setLayoutData(gd);\n\t\tdamagealterInput.pack();\n\t\n\t\t//description\n\t\t\n\t\tText descriptionInput = new Text(shell, SWT.WRAP | SWT.V_SCROLL);\n\t\tdescriptionInput.setText(\"Description (Optional)\");\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, false);\n\t\tgd.horizontalSpan = 4;\n\t\tgd.verticalSpan = 15;\n\t\tdescriptionInput.setLayoutData(gd);\n\t\tdescriptionInput.pack();\n\t\tLabel blank = new Label(shell, SWT.NONE);\n\t\tgd = new GridData(GridData.FILL, GridData.FILL, true, true);\n\t\tgd.horizontalSpan = 4;\n\t\tblank.setLayoutData(gd);\n\t\tblank.pack();\n\t\tButton save = new Button(shell, SWT.PUSH);\n\n\t\tsave.setText(\"Save\");\n\t\tsave.addListener(SWT.Selection, new Listener()\n\t\t{\n\t\t\tpublic void handleEvent(Event event)\n\t\t\t{\n\t\t\t\tBoolean checkfault = false;\n\t\t\t\tLinkedHashMap<String, String> a = new LinkedHashMap<String, String>();\n\t\t\t\tif(nameInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcheckfault = true;\n\t\t\t\t\tnameInput.setBackground(display.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t}\n\t\t\t\tif(componentInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcheckfault = true;\n\t\t\t\t\tcomponentInput.setBackground(display.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t}\n\t\t\t\tif(schoolInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcheckfault = true;\n\t\t\t\t\tschoolInput.setBackground(display.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(castimeInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcheckfault = true;\n\t\t\t\t\tcastimeInput.setBackground(display.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(levelInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcheckfault = true;\n\t\t\t\t\tlevelInput.setBackground(display.getSystemColor(SWT.COLOR_RED));\n\t\t\t\t}\n\t\t\t\tif(checkfault)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ta.put(\"NAME\", nameInput.getText());\n\t\t\t\ta.put(\"COMPONENTS\", componentInput.getText());\n\t\t\t\ta.put(\"SCHOOL\", schoolInput.getText());\n\t\t\t\ta.put(\"CASTINGTIME\", castimeInput.getText());\n\t\t\t\ta.put(\"LEVEL\", levelInput.getText());\n\t\t\t\tif(resistanceInput.getSelection())\n\t\t\t\t{\n\t\t\t\t\ta.put(\"SPELLRESISTANCE\", \"YES\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ta.put(\"SPELLRESISTANCE\", \"NO\");\n\t\t\t\t}\n\t\t\t\tif(!materialInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"MATERIALCOMPONENT\", materialInput.getText());\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!savthrowInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"SAVINGTHROW\", savthrowInput.getText());\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!focusInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"FOCUS\", focusInput.getText());\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!durationInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"DURATION\", durationInput.getText());\n\t\t\t\t}\n\t\t\t\tif(!damageInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"DAMAGE\", damageInput.getText());\n\t\t\t\t}\n\t\t\t\tif(!damagealterInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"DAMAGEALTERNATE\", damagealterInput.getText());\n\t\t\t\t}\n\t\t\t\tif(!rangeInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"RANGE\", rangeInput.getText());\n\t\t\t\t}\n\t\t\t\tif(!effectInput.getText().equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\ta.put(\"EFFECT\", effectInput.getText());\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ta.put(\"DESCRIPTION\", descriptionInput.getText());\n\t\t\t\tnewspell = new SpellEntity(a);\n\t\t\t\tMain.gameState.abilities.put(newspell.getName(), newspell);\n\t\t\t\tMain.gameState.customContent.put(newspell.getName(), newspell);\n\t\t\t\tshell.close();\n\t\t\t}\n\t\t}\n\t\t);\n\t\tgd = new GridData(GridData.FILL, GridData.CENTER, false, false);\n\t\tgd.horizontalSpan = 1;\n\t\tsave.setLayoutData(gd);\n\t\tsave.pack();\n\t\tshell.setLayout(gl);\n\t\tshell.layout();\n\t\tshell.pack();\n//\t\t//wizard\n//\t\t\t\tfinal Composite wizPanel = new Composite(shell, SWT.BORDER);\n//\t\t\t\twizPanel.setBounds(0,0,WIDTH, HEIGHT);\n//\t\t\t\tfinal StackLayout wizLayout = new StackLayout();\n//\t\t\t\twizPanel.setLayout(wizLayout);\n//\t\t\t\t\n//\t\t\t\t//Page1 -- Name\n//\t\t\t\tfinal Composite wizpage1 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\twizpage1.setBounds(0,0,WIDTH,HEIGHT);\n//\t\t\t\t\n//\t\t\t\tfinal Label wiz1Label = new Label(wizpage1, SWT.NONE);\n//\t\t\t\twiz1Label.setText(\"Enter Name (required)\");\n//\t\t\t\twiz1Label.pack();\n//\t\t\t\tfinal Text wizpage1text = new Text(wizpage1, SWT.BORDER);\n//\t\t\t\twizpage1text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage1text.setText(\"FireBall\");\n//\t\t\t\tButton next1 = createNextButton(wizpage1);//TODO cancel and previous button\n//\t\t\t\tcreateBackButton(wizpage1, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage1, wizPanel, wizLayout);\n//\t\t\t\tnext1.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage1text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspellname = wizpage1text.getText();\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tSystem.out.println(\"PANIC: ITEM WIZARD PAGE 1 OUT\");\n//\t\t\t\t\t\t\t\tshell.close();\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\twiz1Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\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\t\n//\t\t\t\twizPages.add(wizpage1);\n//\t\t\t\t//Page2 -- component\n//\t\t\t\tfinal Composite wizpage2 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz2Label = new Label(wizpage2, SWT.NONE);\n//\t\t\t\twiz2Label.setText(\"Enter Component: (required)\");\n//\t\t\t\twiz2Label.pack();\n//\t\t\t\tfinal Text wizpage2text = new Text(wizpage2, SWT.BORDER);\n//\t\t\t\twizpage2text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage2text.setText(\"Fire\");\n//\t\t\t\tButton next2 = createNextButton(wizpage2);\n//\t\t\t\tcreateBackButton(wizpage2, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage2, wizPanel, wizLayout);\n//\t\t\t\tnext2.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage2text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellcomp = wizpage2text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz2Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage2);\n//\t\t\t\t//Page3 -- School\n//\t\t\t\tfinal Composite wizpage3 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz3Label = new Label(wizpage3, SWT.NONE);\n//\t\t\t\twiz3Label.setText(\"Enter School: (required)\");\n//\t\t\t\twiz3Label.pack();\n//\t\t\t\tfinal Text wizpage3text = new Text(wizpage3, SWT.BORDER);\n//\t\t\t\twizpage3text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage3text.setText(\"Descruction\");\n//\t\t\t\tButton next3 = createNextButton(wizpage3);\n//\t\t\t\tcreateBackButton(wizpage3, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage3, wizPanel, wizLayout);\n//\t\t\t\tnext3.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage3text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspellschool = wizpage3text.getText();\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tshell.close();\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\twiz3Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage3);\n//\t\t\t\t//Page4 -- Range\n//\t\t\t\tfinal Composite wizpage4 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz4Label = new Label(wizpage4, SWT.NONE);\n//\t\t\t\twiz4Label.setText(\"Enter Range: (required)\");\n//\t\t\t\twiz4Label.pack();\n//\t\t\t\tfinal Text wizpage4text = new Text(wizpage4, SWT.BORDER);\n//\t\t\t\twizpage4text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage4text.setText(\"50 feet\");\n//\t\t\t\tButton next4 = createNextButton(wizpage4);\n//\t\t\t\tcreateBackButton(wizpage4, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage4, wizPanel, wizLayout);\n//\t\t\t\tnext4.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage4text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspellrange = wizpage4text.getText();\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tshell.close();\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\twiz4Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage4);\n//\t\t\t\t//Page5 -- effect\n//\t\t\t\tfinal Composite wizpage5 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz5Label = new Label(wizpage5, SWT.NONE);\n//\t\t\t\twiz5Label.setText(\"Enter Effect: (required)\");\n//\t\t\t\twiz5Label.pack();\n//\t\t\t\tfinal Text wizpage5text = new Text(wizpage5, SWT.BORDER);\n//\t\t\t\twizpage5text.setBounds(50, 50, 250, 150);\n//\t\t\t\twizpage5text.setText(\"No effect\");\n//\t\t\t\tButton next5 = createNextButton(wizpage5);\n//\t\t\t\tcreateBackButton(wizpage5, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage5, wizPanel, wizLayout);\n//\t\t\t\tnext5.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage5text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspelleffect = wizpage5text.getText();\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tshell.close();\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\twiz5Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage5);\n//\t\t\t\t//Page6 -- casting time\n//\t\t\t\tfinal Composite wizpage6 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz6Label = new Label(wizpage6, SWT.NONE);\n//\t\t\t\twiz6Label.setText(\"Enter Casting Time: (required)\");\n//\t\t\t\twiz6Label.pack();\n//\t\t\t\tfinal Text wizpage6text = new Text(wizpage6, SWT.BORDER);\n//\t\t\t\twizpage6text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage6text.setText(\"1 turn\");\n//\t\t\t\tButton next6 = createNextButton(wizpage6);\n//\t\t\t\tcreateBackButton(wizpage6, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage6, wizPanel, wizLayout);\n//\t\t\t\tnext6.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage5text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspellcastime = wizpage6text.getText();\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tshell.close();\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\twiz6Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage6);\n//\t\t\t\t//Page7 -- Material Component\n//\t\t\t\tfinal Composite wizpage7 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz7Label = new Label(wizpage7, SWT.NONE);\n//\t\t\t\twiz7Label.setText(\"Enter Material Component: (required)\");\n//\t\t\t\twiz7Label.pack();\n//\t\t\t\tfinal Text wizpage7text = new Text(wizpage7, SWT.BORDER);\n//\t\t\t\twizpage7text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage7text.setText(\"None\");\n//\t\t\t\tButton next7 = createNextButton(wizpage7);\n//\t\t\t\tcreateBackButton(wizpage7, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage7, wizPanel, wizLayout);\n//\t\t\t\tnext7.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage7text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellmaterial = wizpage7text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz7Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage7);\n//\t\t\t\t//Page8 -- saving throw\n//\t\t\t\tfinal Composite wizpage8 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz8Label = new Label(wizpage8, SWT.NONE);\n//\t\t\t\twiz8Label.setText(\"Enter Saving Throw: (required)\");\n//\t\t\t\twiz8Label.pack();\n//\t\t\t\tfinal Text wizpage8text = new Text(wizpage8, SWT.BORDER);\n//\t\t\t\twizpage8text.setBounds(50, 50, 200, 100);\n//\t\t\t\twizpage8text.setText(\"Will negate XX\");\n//\t\t\t\tButton next8 = createNextButton(wizpage8);\n//\t\t\t\tcreateBackButton(wizpage8, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage8, wizPanel, wizLayout);\n//\t\t\t\tnext8.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage8text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellsaving = wizpage8text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz8Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage8);\n//\t\t\t\t//Page9 -- Focus\n//\t\t\t\tfinal Composite wizpage9 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz9Label = new Label(wizpage9, SWT.NONE);\n//\t\t\t\twiz9Label.setText(\"Enter Focus: (required)\");\n//\t\t\t\twiz9Label.pack();\n//\t\t\t\tfinal Text wizpage9text = new Text(wizpage9, SWT.BORDER);\n//\t\t\t\twizpage9text.setBounds(50, 50, 200, 100);\n//\t\t\t\twizpage9text.setText(\"A dart\");\n//\t\t\t\tButton next9 = createNextButton(wizpage9);\n//\t\t\t\tcreateBackButton(wizpage9, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage9, wizPanel, wizLayout);\n//\t\t\t\tnext9.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage9text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellfocus = wizpage9text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz9Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage9);\n//\t\t\t\t//Page10 -- Duration\n//\t\t\t\tfinal Composite wizpage10 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz10Label = new Label(wizpage10, SWT.NONE);\n//\t\t\t\twiz10Label.setText(\"Enter Duration: (required)\");\n//\t\t\t\twiz10Label.pack();\n//\t\t\t\tfinal Text wizpage10text = new Text(wizpage10, SWT.BORDER);\n//\t\t\t\twizpage10text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage10text.setText(\"5 Turns\");\n//\t\t\t\tButton next10 = createNextButton(wizpage10);\n//\t\t\t\tcreateBackButton(wizpage10, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage10, wizPanel, wizLayout);\n//\t\t\t\tnext10.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage10text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellduration = wizpage10text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz10Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage10);\n//\t\t\t\t//Page11 -- Level\n//\t\t\t\tfinal Composite wizpage11 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz11Label = new Label(wizpage11, SWT.NONE);\n//\t\t\t\twiz11Label.setText(\"Enter Level (required)\");\n//\t\t\t\twiz11Label.pack();\n//\t\t\t\tfinal Text wizpage11text = new Text(wizpage11, SWT.BORDER);\n//\t\t\t\twizpage11text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage11text.setText(\"1\");\n//\t\t\t\tButton next11 = createNextButton(wizpage11);\n//\t\t\t\tcreateBackButton(wizpage11, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage11, wizPanel, wizLayout);\n//\t\t\t\tnext11.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage11text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\ttry\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tif(Integer.parseInt(wizpage11text.getText()) >= 0)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspelllevel = String.valueOf(Integer.parseInt(wizpage11text.getText()));\n//\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tshell.close();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twiz11Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tcatch(NumberFormatException a)\n//\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\twiz11Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\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\twiz11Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage11);\n//\t\t\t\t//Page12 -- resistance\n//\t\t\t\tfinal Composite wizpage12 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tfinal Label wiz12Label = new Label(wizpage12, SWT.NONE);\n//\t\t\t\twiz12Label.setText(\"Enter Spell resistance: (Yes/No)\");\n//\t\t\t\twiz12Label.pack();\n//\t\t\t\tfinal Text wizpage12text = new Text(wizpage12, SWT.BORDER);\n//\t\t\t\twizpage12text.setBounds(50, 50, 150, 50);\n//\t\t\t\twizpage12text.setText(\"Yes\");\n//\t\t\t\tButton next12 = createNextButton(wizpage12);\n//\t\t\t\tcreateBackButton(wizpage12, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage12, wizPanel, wizLayout);\n//\t\t\t\tnext12.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage12text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\tspellresistance = wizpage12text.getText();\n//\t\t\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t\t\tshell.close();\n//\t\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\twiz12Label.setBackground(display.getSystemColor(SWT.COLOR_RED));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t\n//\n//\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage12);\n//\t\t\t\t//Page13 - Description\n//\t\t\t\tfinal Composite wizpage13 = new Composite(wizPanel, SWT.NONE);\n//\t\t\t\tLabel wiz13Label = new Label(wizpage13, SWT.NONE);\n//\t\t\t\twiz13Label.setText(\"Enter Description (Optional)\");\n//\t\t\t\twiz13Label.pack(); \n//\t\t\t\tfinal Text wizpage13text = new Text(wizpage13, SWT.BORDER);\n//\t\t\t\twizpage13text.setBounds(50, 50, 300, 200);\n//\t\t\t\twizpage13text.setText(\"Description here\");\n//\t\t\t\tButton next13 = createNextButton(wizpage13);\n//\t\t\t\tcreateBackButton(wizpage13, wizPanel, wizLayout);\n//\t\t\t\tcreateCancelButton(wizpage13, wizPanel, wizLayout);\n//\t\t\t\tnext13.addListener(SWT.Selection, new Listener()\n//\t\t\t\t{\n//\t\t\t\t\tpublic void handleEvent(Event event)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tif(wizpage13text.getText() != \"\")\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tspellscript = wizpage13text.getText();\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\tspellscript = \"<empty>\";\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tCreateVerificationPage(wizPanel, wizLayout);\n//\t\t\t\t\t\tif(wizpagenum < wizPages.size() - 1)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\twizpagenum++;\n//\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\twizLayout.topControl = wizPages.get(wizpagenum);\n//\t\t\t\t\t\t\twizPanel.layout();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse if(wizpagenum == wizPages.size() - 1)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tshell.close();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\n//\t\t\t\t\t\n//\t\t\t\t});\n//\t\t\t\twizPages.add(wizpage13);\n//\t\t\t\t\n//\t\t\t\twizLayout.topControl = wizpage1;\n//\t\t\t\twizPanel.layout();\n\t}", "@Override\r\n public Evaluation getEvaluation ()\r\n {\r\n return evaluation;\r\n }", "public static void main(String[] args) {\n\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"d:\\\\java\\\\workspace\\\\chromedriver.exe\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\t\n\t\t// Using assert for checking expected values or result\n\t\tdriver.get(\"https://www.spicejet.com/\");\n\t\tdriver.findElement(By.cssSelector(\"input[id*='ctl00_mainContent_chk_IndArm']\")).click();\n\t\tSystem.out.println(driver.findElement(By.cssSelector(\"input[id*='ctl00_mainContent_chk_IndArm']\")).isSelected());\n\t\tAssert.assertTrue(driver.findElement(By.cssSelector(\"input[id*='ctl00_mainContent_chk_IndArm']\")).isSelected());\n\t\t\n//\t\tTotal check box count \n\t\t\n\t\tSystem.out.println(driver.findElements(By.cssSelector(\"input[type*='checkbox']\")).size());\n\t\tAssert.assertEquals(driver.findElements(By.cssSelector(\"input[type*='checkbox']\")).size(), \"8\");\n\t\t\n\t\t\n\t\tdriver.close();\n\t}", "@Test(dataProvider = \"testData\")\r\n\r\n public void createVacancyTest(String CVOption, String jobVisibility) throws InterruptedException {\r\n //STEP 1\r\n homePage.getSideBar().clickOnJobsMenu();\r\n Assert.assertTrue(jobsPage.isDisplayed());\r\n\r\n //STEP 2\r\n jobsPage.addNewJob();\r\n Assert.assertTrue(newJobPage.isDisplayed());\r\n Assert.assertTrue(newJobPage.getDetails().isDisplayed());\r\n\r\n //STEP 3\r\n newJobPage.getDetails().enterJobTitle(jobTitle);\r\n\r\n //STEP 4\r\n newJobPage.getDetails().enterJobLocation(randomCountry());\r\n Assert.assertTrue(newJobPage.getSearchSuggestion().isDisplayed());\r\n newJobPage.getSearchSuggestion().clickSuggestionByIndex();\r\n\r\n //STEP 5\r\n newJobPage.getDetails().enterSomeNote(randomText());\r\n\r\n //STEP 6\r\n newJobPage.getDetails().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getApplication().isDisplayed());\r\n\r\n //STEP 7\r\n newJobPage.getApplication().clickOnCVOption();\r\n Assert.assertTrue(newJobPage.getOptions().isDisplayed());\r\n newJobPage.getOptions().clickOnOption(CVOption);\r\n Assert.assertTrue(newJobPage.getApplication().isUpdateMessageDisplayed());\r\n\r\n //STEP 8\r\n newJobPage.getApplication().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getTeam().isDisplayed());\r\n\r\n //STEP 9\r\n newJobPage.getTeam().inviteTeamMember(email);\r\n Assert.assertTrue(newJobPage.getInvitedEmail().isDisplayed());\r\n Assert.assertEquals(newJobPage.getInvitedEmail().invitedEmailAddress(), email, \"the emails are not matching\");\r\n\r\n //STEP 10\r\n newJobPage.getTeam().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getEvaluation().isDisplayed());\r\n\r\n //STEP 11\r\n int skillCount = newJobPage.getEvaluation().getSkillCount();\r\n newJobPage.getEvaluation().addSomeSkill(randomSkill());\r\n int newSkillCount = newJobPage.getEvaluation().getSkillCount();\r\n Assert.assertTrue(newSkillCount > skillCount);\r\n\r\n //STEP 12\r\n newJobPage.getEvaluation().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getWorkflow().isDisplayed());\r\n\r\n //STEP 13\r\n newJobPage.getWorkflow().enterPipelineStage(stage);\r\n\r\n //STEP 14\r\n newJobPage.getWorkflow().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getOptional().isDisplayed());\r\n Assert.assertTrue(newJobPage.getInternalJobInformation().isDisplayed());\r\n Assert.assertTrue(newJobPage.getSalaryInfromation().isDisplayed());\r\n\r\n //STEP 15\r\n newJobPage.getInternalJobInformation().enterInternalJobInformation(internalJobTitle, id + \"\");\r\n\r\n //STEP 16\r\n newJobPage.getSalaryInfromation().enterSalaryInformation(minSalary + \"\", maxSalary + \"\", currency, minHour + \"\", maxHour + \"\");\r\n\r\n //STEP 17\r\n newJobPage.getOptional().clickOnNextButton();\r\n Assert.assertTrue(newJobPage.getPublish().isDisplayed());\r\n\r\n //STEP 18\r\n newJobPage.getPublish().chooseVisibility(jobVisibility);\r\n Assert.assertTrue(newJobPage.getPublish().updateMessageDisplayed());\r\n\r\n //STEP 19\r\n newJobPage.getPublish().clickOnSaveButton();\r\n Assert.assertTrue(newJobPage.getCreatedJobPage().isDisplayed());\r\n\r\n //EXPECTED RESULT\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getJobTitle(), internalJobTitle);\r\n Assert.assertEquals(newJobPage.getCreatedJobPage().getCreatedJobStatus(), jobVisibility);\r\n Assert.assertNotEquals(newJobPage.getCreatedJobPage().getJobInfo(), \"Remote\");\r\n }", "public QualificationsPage(){\n PageFactory.initElements(driver, this);\n }", "public void detailReport() {\r\n\t\tint testStepId = 1;\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><table class=\\\"width100\\\"><tr><td><div class=\\\"headertext1 bold\\\">Test Execution Detail Report</div></td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><div class=\\\"headertext1 bold\\\">Execution Browser Name: \"+ GlobalVariables.getBrowserName() + \"</div></td></tr>\");\r\n\t\tstrBufferReportAppend.append(\r\n\t\t\t\t\"<tr><td><div class=\\\"headertext1 bold\\\">Test Case Name: \"+ GlobalVariables.getTestCaseName() + \"</div></td></tr>\");\r\n\t\t\r\n\t\t\r\n\t\tstrBufferReportAppend.append(\"<tr><td>\");\r\n\t\tstrBufferReportAppend\r\n\t\t\t\t.append(\"<table colspan=3 border=0 cellpadding=3 cellspacing=1 class=\\\"reporttable width100\\\">\");\r\n\t\tstrBufferReportAppend.append(\"<tr><th class=\\\"auto-style1\\\">Test Step No</th>\" + \"<th class=\\\"auto-style2\\\">Action</th>\"\r\n\t\t\t\t+ \"<th class=\\\"auto-style3\\\">Actual Result</th>\" + \"<th class=\\\"auto-style4\\\">Status</th></tr>\");\r\n\t\tfor (ReportBean reportValue : GlobalVariables.getReportList()) {\r\n\r\n\t\t\tif (reportValue.getStatus().equalsIgnoreCase(\"Passed\")) {\r\n\r\n\t\t\t\tstrBufferReportAppend.append(\"<tr>\" + \"<td class=\\\"auto-style1 blue\\\">\" + testStepId++ + \"</td>\"// teststepid\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style2 blue\\\">\" + reportValue.getStrAction() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style3 blue\\\">\" + reportValue.getResult() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style4 green\\\">\" + reportValue.getStatus() + \"</td></tr>\");\r\n\t\t\t} else if (reportValue.getStatus().equalsIgnoreCase(\"Failed\")) {\r\n\t\t\t\tstrBufferReportAppend.append(\"<tr>\" + \"<td class=\\\"auto-style1 blue\\\">\" + testStepId++ + \"</td>\"// teststepid\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style2 blue\\\">\" + reportValue.getStrAction() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style3 blue\\\">\" + reportValue.getResult() + \"</td>\"\r\n\t\t\t\t\t\t+ \"<td class=\\\"auto-style4 red\\\">\" + reportValue.getStatus() + \"</td></tr>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrBufferReportAppend.append(\"</table>\");\r\n\t\tstrBufferReportAppend.append(\"</td></tr>\");\r\n\t\tstrBufferReportAppend.append(\"</table></td></tr></table></body></html>\");\r\n\t}", "@Test(description = \"Проверка отображения стартовой страницы\")\n public void startPageDisplayCheck() {\n StartPage startPage = (StartPage) context.getBean(\"startPage\");\n\n startPage.checkPageShow();\n }", "public void processResults() {\r\n try {\r\n rm5 = new Process(new File(_corePath.RAPID_MINER_PROCESS_XML));\r\n IOContainer ioResult = rm5.run();\r\n ExampleSet resultSet;\r\n int num_rules = 0;\r\n if (ioResult.getElementAt(0) instanceof ExampleSet) {\r\n resultSet = (ExampleSet) ioResult.getElementAt(0);\r\n for (int i = 0; i <= resultSet.size() - 1; i++) {\r\n if ((resultSet.getExample(i).get(\"Premise Items\").equals(1)) && (resultSet.getExample(i).get(\"Conclusion Items\").equals(1))) {\r\n num_rules++;\r\n results += \"<ul><li title=\\\"Premise\\\">\" + resultSet.getExample(i).get(\"Premise\") + \"</li>\"\r\n + \"<li title=\\\"Conclusion\\\">\" + resultSet.getExample(i).get(\"Conclusion\") + \"</li>\"\r\n + \"<li title=\\\"Confidence\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Confidence\")) + \"</li>\"\r\n + \"<li title=\\\"Conviction\\\" class=\\\"metrics\\\">\";\r\n\r\n if (resultSet.getExample(i).get(\"Conviction\").equals(\"Infinity\")) {\r\n results += resultSet.getExample(i).get(\"Conviction\");\r\n } else {\r\n results += String.format(\"%f%n\", resultSet.getExample(i).get(\"Conviction\"));\r\n }\r\n\r\n results += \"</li>\"\r\n + \"<li title=\\\"Gain\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Gain\")) + \"</li>\"\r\n + \"<li title=\\\"Laplace\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Laplace\")) + \"</li>\"\r\n + \"<li title=\\\"Lift\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Lift\")) + \"</li>\"\r\n + \"<li title=\\\"Ps\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Ps\")) + \"</li>\"\r\n + \"<li title=\\\"Total Support\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Total Support\")) + \"</li><li class=\\\"num_rules\\\">\" + num_rules + \"</li></ul>\";\r\n } else {\r\n break;\r\n }\r\n }\r\n } else {\r\n results = \"No results found.\";\r\n }\r\n\r\n results = results.replace(\"[\", \"\");\r\n results = results.replace(\"]\", \"\");\r\n\r\n\r\n } catch (OperatorException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (XMLException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Test\n public void exerciseTwoTest() {\n driver.get(properties.getProperty(\"URL\"));\n\n // 2. Assert Browser title\n homePageAsserts.shouldReturnPageTitle();\n\n // 3. Perform login\n homePageSteps.login(properties.getProperty(\"username\"), properties.getProperty(\"password\"));\n\n // 4. Assert User name in the left-top side of screen that user is loggined\n homePageAsserts.shouldReturnUsernameText();\n\n // 5. Open through the header menu Service -> Different Elements Page\n homePageSteps.clickServiceButton();\n homePageSteps.openDifferentElementsPage();\n\n // 6. Select checkboxes\n differentElementsPageSteps.selectCheckbox(WATER.getValue());\n differentElementsPageSteps.selectCheckbox(WIND.getValue());\n\n // 7. Select radio\n differentElementsPageSteps.selectRadioButton(SELEN.getValue());\n\n // 8. Select in dropdown\n differentElementsPageSteps.selectDropdown(YELLOW.getValue());\n\n // 9.1 Assert that for each checkbox there is an individual log row\n // and value is corresponded to the status of checkbox\n differentElementsAsserts.shouldReturnSelectedCheckbox();\n differentElementsAsserts.shouldReturnLogRowText(WATER.getValue(), \"true\");\n differentElementsAsserts.shouldReturnLogRowText(WIND.getValue(), \"true\");\n\n // 9.2 Assert that for radio button there is a log row and value is corresponded to the status of radio button\n differentElementsAsserts.shouldReturnSelectedRadioButton();\n differentElementsAsserts.shouldReturnLogRowText(METAL.getValue(), SELEN.getValue());\n\n // 9.3 Assert that for dropdown there is a log row and value is corresponded to the selected value\n differentElementsAsserts.shouldReturnSelectedDropdown();\n differentElementsAsserts.shouldReturnLogRowText(COLORS.getValue(), YELLOW.getValue());\n }", "public boolean AddionalQuestionnairePage(int ColumnCounter,String mode) throws AWTException, InterruptedException\n\t \t{\t\n\t\t \n\t\t boolean flag=false;\n\t\t//AddionalQuestionnairePage\t\n\t\t \n\t\t\t//Methods Xpath\n\t\tString UsernameXpath=\"//*[@class='header2 font-accent ']\";\n\t\tString UsernametypeXpath=\"//*[@class='font-accent']\";\n\t\tString CountryXpath=\"//*[@id='prg-hdr-main']//*[@class='font-accent highlight-blue']\";\n\t\t\n\t\t\n\n\t\t\n\t\t//String AddionalQuestionnaireSaveButtonXpath=\".//*[@id='btnSave']\"; \n\t\t\n\t\t\n\t\t//Excel sheet Data collection\n\t\tString TestcaseID=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 0, ColumnCounter);\n\t\tString AddionalQuestionnaireScenerio=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 2, ColumnCounter);\n\t\tString AddionalQuestionnaireTestcaseDescription=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 3, ColumnCounter);\t\t\n\t\tString AddionalQuestionnairePageURL=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 4, ColumnCounter);\n\t\tString AddionalQuestionnaireID=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 5, ColumnCounter);\t\t\t\n\t\tString AddionalQuestionnairetextQ1=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 6, ColumnCounter);\n\t/*\tString AddionalQuestionnaireQ2=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 7, ColumnCounter);\n\t\tString AddionalQuestionnaireQ3=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 8, ColumnCounter);\n\t\tString AddionalQuestionnaireQ4=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 9, ColumnCounter);\n\t\tString AddionalQuestionnaireQ5=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 10, ColumnCounter);\n\t\tString AddionalQuestionnaireQ6=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 11, ColumnCounter); \t\n\t\tString AddionalQuestionnaireQ7=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 12, ColumnCounter); \n\t\tString AddionalQuestionnaireQ8=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 13, ColumnCounter); \n\t\tString AddionalQuestionnaireQ9=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 14, ColumnCounter); \n\t\tString AddionalQuestionnaireQ10=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 15, ColumnCounter); \n\t\tString AddionalQuestionnaireQ11=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 16, ColumnCounter); \n\t\tString AddionalQuestionnaireQ12=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 17, ColumnCounter);\n\t\tString AddionalQuestionnaireQ13=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 18, ColumnCounter);\n\t\tString AddionalQuestionnaireQ14=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 19, ColumnCounter);\n\t\tString AddionalQuestionnaireQ15=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 20, ColumnCounter);\n\t\tString AddionalQuestionnaireQ16=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 21, ColumnCounter);\n\t\tString AddionalQuestionnaireQ17=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 22, ColumnCounter);\n\t\tString AddionalQuestionnaireQ18=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 23, ColumnCounter);\n\t\tString AddionalQuestionnaireQ19=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 24, ColumnCounter);\n\t\tString AddionalQuestionnaireQ20=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 25, ColumnCounter);\n\t\tString AddionalQuestionnaireQ21=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 26, ColumnCounter);\n\t\tString AddionalQuestionnaireQ22=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 27, ColumnCounter);\n\t\tString AddionalQuestionnaireQ23=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 28, ColumnCounter);\n\t\tString AddionalQuestionnaireQ24=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 29, ColumnCounter);\n\t\tString AddionalQuestionnaireQ25=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 30, ColumnCounter);\n\t\tString AddionalQuestionnaireQ26=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 31, ColumnCounter);\n\t\tString AddionalQuestionnaireQ27=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 32, ColumnCounter);\n\t\tString AddionalQuestionnaireQ28=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 33, ColumnCounter);\n\t\tString AddionalQuestionnaireQ29=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 34, ColumnCounter);\n\t\tString AddionalQuestionnaireQ30=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 35, ColumnCounter);\n\t\tString AddionalQuestionnaireQ31=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 36, ColumnCounter);\n\t\tString AddionalQuestionnaireQ32=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 37, ColumnCounter);\n\t\tString AddionalQuestionnaireQ33=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 38, ColumnCounter);\n\t\tString AddionalQuestionnaireQ34=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 39, ColumnCounter);\n\t\tString AddionalQuestionnaireQ35=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 40, ColumnCounter);\n\t\tString AddionalQuestionnaireQ36=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 41, ColumnCounter);\n\t\tString AddionalQuestionnaireQ37=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 42, ColumnCounter);\n\t\tString AddionalQuestionnaireQ38=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 43, ColumnCounter);\n\t\tString AddionalQuestionnaireQ39=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 44, ColumnCounter);\n\t\tString AddionalQuestionnaireQ40=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 45, ColumnCounter);\n\t\tString AddionalQuestionnaireQ41=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 46, ColumnCounter);\n\t\tString AddionalQuestionnaireQ42=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 47, ColumnCounter);\n\t\tString AddionalQuestionnaireQ43=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 48, ColumnCounter);\n\t\tString AddionalQuestionnaireQ44=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 49, ColumnCounter);\n\t\tString AddionalQuestionnaireQ45=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 50, ColumnCounter);\n\t\tString AddionalQuestionnaireQ46=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 51, ColumnCounter);\n\t\tString AddionalQuestionnaireQ47=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 52, ColumnCounter);\n\t\tString AddionalQuestionnaireQ48=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 53, ColumnCounter);\n\t\t\n\t\t\n\t\t\n\t\tString AddionalQuestionnaireQQE_DD=UtilFunction.getCellData(\"Test Data.xls\", \"AddionalQuestionnaire\", 54, ColumnCounter);\n*/\n\t\t//String Radio=\".//*[@class='question-group'][xx]//*[@class='question-option']/label[1]//*[@id]\";\n\t\tString Radio=\".//*[@class='question-group'][xx]//*[@class='question-option']//input[1]\";\n\t\tString Counter=\".//*[@class='question-group']\";\n\t\t//String Textbox=\".//*[@class='form-horizontal']/*[@class='question-group'][xx]/div[2]//textarea\";\n\t\tString Textbox=\".//*[@class='question-group'][xx]//*[@class='control-group'][2]//*[contains(@class,'control-explainationtext')]\";\n\t\tString Xpathnew1=\".//*[@class='control-group']//*[@class='controls']//*[@id]\";\n\t\tString Xpathnew2=\".//*[@class='control-group'][xx]//*[@class='controls']//*[@id]\";\n\t\t\n\t\t/////////////////////////////////URL FETCH///////////////////////////////////\n\t\tString QuestionarieName=\"Additional Questions\";\n\t\t//String URLwithID=UtilFunction.geturl(QuestionarieName);\n\t\tURLwithID=utilfunc.geturldirect(QuestionarieName);\n\t\t\n\t\tboolean Flag =false;\n\t\ttestcaseid=TestcaseID;\n\t\tscenerio=AddionalQuestionnaireScenerio;\n\t\tdescription=AddionalQuestionnaireTestcaseDescription;\n\t\t String ACTION=\"New\";\n\t\t String ACTION1=\"Edit\";\n\t\t String ACTION2=\"Delete\";\n\t\t \n\t\t if(URLwithID.equals(\"\")){\n\t\t\t utilfunc.closesidebar();\n\t\t\t\tFlag=false; \n\t\t\t }else{\n\t\t\t \n\t\t \n\t\t if(mode.equals(ACTION)|mode.equals(ACTION1)){\n\t\t\t try{\n\t\t\t\t /*String AddionalQuestionnaireURLwithID=AddionalQuestionnairePageURL+AddionalQuestionnaireID;\n\t\t\t\t \n\t\t\t\t utilfunc.NavigatetoURL(AddionalQuestionnaireURLwithID);*/\n\t\t\t\t \n\t\t\t\t try{\n\t\t\t\t\t utilfunc.NavigatetoURL(URLwithID);\n\t\t\t\t\t utilfunc.ServerErrorHandler();\n\t\t\t\t\t Thread.sleep(2000);\n\t\t\t\t\t }catch(Exception error){}\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t String Usernametext=utilfunc.MakeElement(UsernameXpath).getText();\n\t\t\t\t String Usernametypetext=utilfunc.MakeElement(UsernametypeXpath).getText();\n\t\t\t\t Usernametext=Usernametext+Usernametypetext;\n\t\t\t\t\t\n\t\t\t\t int ObjCount=utilfunc.GetObjectCount(Counter);\n\t\t\t\t \n\t\t\t\t \ttry{\t\t\t \n\t\t\t\t\t\t for(int count=1; count<=ObjCount; count++)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t try{\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t String NewRadio=Radio.replace(\"xx\", Integer.toString(count));\n\t\t\t\t\t\t\t\t utilfunc.MakeElement(NewRadio).click();\n\t\t\t\t\t\t\t\t// Thread.sleep(1000);\n\t\t\t\t\t\t\t\t try{\n\t\t\t\t\t\t\t\t\t String NewTextbox=Textbox.replace(\"xx\", Integer.toString(count));\n\t\t\t\t\t\t\t\t\t String Questionnaire=\"AddionalQuestionnairetextQ\"+count;\n\t\t\t\t\t\t\t\t\t utilfunc.MakeElement(NewTextbox).clear();\n\t\t\t\t\t\t\t\t\t utilfunc.MakeElement(NewTextbox).sendKeys(Questionnaire);\n\t\t\t\t\t\t\t\t }catch(Exception f){\n\t\t\t\t\t\t\t\t\t System.out.println(\"Exception1-->\"+f);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }catch(Exception f){\n\t\t\t\t\t\t\t\t System.out.println(\"Exception2-->\"+f);\n\t\t\t\t\t\t\t }\n\t\t \n\t\t\t\t\t\t }\n\t\t\t\t \t}catch(Exception error){}\n\n\n\t\t\t\t\t\t //function to call the dynamic text data\n\t\t\t\t\ttry{\n\t\t\t\t\t\tutilfunc.dynamic_data(Xpathnew1, Xpathnew2);\n\t\t\t\t\t\t}catch(Exception error){}\n\n\t\t\t\t\t \t /*String SaveButtonXpath=\".//*[@id='btnSave']\";\t\t\t\t\t\n\t\t\t\t\t utilfunc.MakeElement(SaveButtonXpath).click();*/\n\t\t\t\t\t \tutilfunc.savebutton();\n\n\t\t\t\t\t boolean error_flag=utilfunc.ErrorMessagehandler();\n\t\t\t\t\t\t if (error_flag){\n\t\t\t\t\t\t\t Flag=true;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t Flag=false;\n\t\t\t\t\t\t }\n\t\t\t\n\t\t\t\t }\n\t\t\t catch(Exception e){\n\n\t\t\t\t System.out.println(\"Exception ---->\"+e);\n\n\t\t\t }\n\t\t }else if(mode.equals(ACTION2)){\n\n\t\t\t try{\n\t\t\t\t\tutilfunc.ErrorMessage=\"\";\n\t\t\t\t\tutilfunc.ErrorMessage1=\"\";\n\t\t\t\t\tutilfunc.ErrorMessage4=\"\";\n\t\t\t\t\tutilfunc.ErrorMessage5=\"\";\n\t\t\t\t \ttestcaseid=\"TC001\";\n\t\t\t\t\tscenerio=\"Positive\";\n\t\t\t\t\tdescription=\"Verify that If Click on Delete Button Expected Result-Successfully Deleted\";\n\t\t\t\t\t\n\t\t\t\t\tutilfunc.NavigatetoURL(URLwithID);\n\t\t\t\t\t\n\t\t\t\t\tutilfunc.ServerErrorHandler();\n\t\t\t\t\t\n\t\t\t\t\tString deletexpath=\".//*[@class='table table-item-list']//tr[1]//*[@class='icon-trash']\";\n\t\t\t\t\tutilfunc.MakeElement(deletexpath).click();\n\t\t\t\t\tutilfunc.isAlertPresent();\n\t\t\t\t\t\n\t\t\t\t\tboolean error_flag=utilfunc.ErrorMessagehandler();\n\t\t\t\t\t if (error_flag){\n\t\t\t\t\t\t Flag=true;\n\t\t\t\t\t }else{\n\t\t\t\t\t\t Flag=false;\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t}catch(Exception z){\n\t\t\t\t\t\tutilfunc.ErrorMessage=\"\";\n\t\t\t\t\t\tutilfunc.ErrorMessage1=\"\";\t\t\t\t\t\t\t\n\t\t\t\t\t\tutilfunc.ErrorMessage4=\"\";\n\t\t\t\t\t\tutilfunc.ErrorMessage5=\"\";\n\t\t\t\t\t\tDeletecheck=\"Delete\";\n\t\t\t\t\t\ttestcaseid=\"TC001\";\n\t\t\t\t\t\tscenerio=\"Positive\";\n\t\t\t\t\t\tdescription=\"Verify that If Click on Delete Button Expected Result-Successfully Deleted\";\n\t\t\t\t\t\tutilfunc.ErrorMessage2=\"Delete option is not Implimented in Additional Questionnaire Module.\";\n\t\t\t\t\t\tutilfunc.TakeScreenshot();\n\t\t\t\t\t\tFlag=false;\n\t\t\t\t}\t\t\t\n\t\t\t \n\t\t }\n\t\t \n\t\t\t }///////////url ckeck end\n\t\t \n\t\treturn Flag;\n\t \t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout will be displayed for hyperlink url on selecting default layout in configuration and in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_1A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default layout and save the settings\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value); //Sets as default layout\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Enable.Value);\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_Default.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Default layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default' custom layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area layout will be displayed for hyperlink url on selecting No Java applet and no task area layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_4A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_NoTaskArea.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. No java applet and no task area layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Logout from the configuration page.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No java applet and No task area layout\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting No java applet and No task area layout\"\r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test\r\n\t\r\n\tpublic void reviewHotel() throws Throwable {\r\n\tTripAdvisorPage review=new TripAdvisorPage(driver);\r\n\t/*searching Club Mahindra */\r\n\treview.searchinTripAdvisor();\r\n\t/* review*/\r\n\treview.searchForReview();\r\n\t\r\n}", "public static void main(String[] args) {\n\t\t\r\n\t\thtmlReporter = new ExtentHtmlReporter(\"C:\\\\Users\\\\Suresh Mylam\\\\eclipse-workspace\\\\TestNG_Listners\\\\Reports\\\\TestReport.html\");\r\n\t\textent = new ExtentReports();\r\n\t\textent.attachReporter(htmlReporter);\r\n\t\ttest= extent.createTest(\"TEst123\");\r\n\t\ttest.pass(\"pass\");\r\n\t\ttest.fail(\"fail\");\r\n\t\ttest.info(\"info\");\r\n\t\textent.flush();\r\n\t\tSystem.out.println(\"Done\");\r\n\r\n\t}", "@RequestMapping(value=\"online-available-tests\",method=RequestMethod.GET)\n\tpublic String onlineAvailableTests(Model model) {\n\t\tList<TestConfiguration> testConfigurationsList=adminService.findAllAvailableOnlineTests();\n\t\tmodel.addAttribute(\"testConfigurationsList\",testConfigurationsList);\n\t\treturn AdminNavigationPage.ADMIN_BASE+AdminNavigationPage.AVAILABLE_ALL_ONLINE_TEST_PAGE;\t\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"Listing pane only layout will be displayed for hyperlink url on selecting Listing pane only layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_7A_1(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Listing pane layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_ListingPaneOnly.Value); //Sets as Listing pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_ListingPaneOnly.Value)) //Verifies if Listing pane and properties pane layout is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_ListingPaneOnly.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_ListingPaneOnly.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_ListingPaneOnly.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_ListingPaneOnly.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "public PanRallyPostEvaluation(String item, PanRallyEvaluationRow p, String skill, String chestNum, LinkedHashMap<Integer, String> detailsValues) {\n initComponents();\n this.p = p;\n this.item = item;\n this.chestNum = chestNum;\n this.skillId = Skill.getIdByName(skill).getId();\n this.detailsValues = detailsValues;\n\n panSkillDetailsListValue = new PanSkillDetailsListValue();\n Controller.panMatchSet.panButton.setVisible(false);\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception ex) {\n }\n\n// panCompListValue.setBounds(0, 0, dim.width, dim.height);\n panSkillDesc.add(panSkillDetailsListValue, BorderLayout.CENTER);\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"F://Web Drivers/chromedriver.exe\");\n\t\tWebDriver driver=new ChromeDriver();\n\t\tdriver.get(\"http://qaclickacademy.com/practice.php\");\n\t\t\n\t\t\n\t\tdriver.findElement(By.id(\"checkBoxOption1\")).click();\n\t\tSystem.out.println(driver.findElement(By.id(\"checkBoxOption1\")).isSelected());\n\t\tAssert.assertTrue(driver.findElement(By.id(\"checkBoxOption1\")).isSelected());\n\t\t\n//\t\tdriver.findElement(By.id(\"checkBoxOption1\")).click();\n//\t\tSystem.out.println(driver.findElement(By.id(\"checkBoxOption1\")));\n//\t\tAssert.assertFalse(driver.findElement(By.id(\"checkBoxOption1\")).isSelected());\n//\t\t\n\n\t\t\n\t\t//How to get the Count of number of check boxes present in the page\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(driver.findElements(By.xpath(\"//input[@type='checkbox']\")).size());\n\t\t\n\t\t\n\t\t\n\t}", "public static String getPollsHTML() {\r\n\t\tPollsController pc = new PollsController(PC.filterPolls(\"\", true, 0));\r\n\t\treturn xmlToHTML(\"/WEB-INF/PollsMainTransform.xsl\", pc,\r\n\t\t\t\tPollsController.class);\r\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"Listing pane and properties pane only layout will be displayed for hyperlink url on selecting Listing pane and properties pane only layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_6A_1(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Listing pane and properties pane layout layout and save the settings\r\n\t\t\t//------------------------------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value); //Sets as Listing pane and properties pane layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value)) //Verifies if Listing pane and properties pane layout is selected\r\n\t\t\t\tthrow new Exception(Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \" layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is available;\";\r\n\r\n\t\t\tif (homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_ListingPropertiesPaneOnly.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Test\n\tpublic void generateRecipeIngredientsReport(){\n\t\t\t\tWebDriver driver = new FirefoxDriver();\n\t\t\t\t// Alternatively the same thing can be done like this\n\t\t // driver.get(\"http://www.google.com\");\n\t\t\t\tdriver.navigate().to(determineUrl());\n\t\t\t\t// Find the text input element by its name\n\t\t\t\tWebElement user_name = driver.findElement(By.id(\"user_email\"));\n\t\t\t\tuser_name.sendKeys(user);\n\t\t\t\t\n\t\t\t\tWebElement password = driver.findElement(By.id(\"user_password\"));\n\t\t\t\tpassword.sendKeys(password_login);\n\t\t\t\tpassword.submit();\n\t\t\t\t\n\t\t\t\tWebElement select_venue = driver.findElement(By.id(\"change_venue\"));\n\t\t\t\tselect_venue.sendKeys(venue);\n\t\t\t\tselect_venue.submit();\n\t\t\t\t\n\t\t\t\tWebElement report = driver.findElement(By.linkText(\"Reporting\"));\n\t\t\t\treport.click();\n\t\t\t\tWebElement reports = driver.findElement(By.linkText(\"Reports\"));\n\t\t\t\treports.click();\n\t\t\t\t\n\t\t\t\tReports.select_report(driver).click();\n\t\t\t\tReports.select_report(driver).sendKeys(\"Receipe Ingredients Report\");\n\t\t\t\t\n\t\t\t\tWebElement select_event = driver.findElement(By.id(\"report_event\"));\n\t\t\t\tselect_event.sendKeys(event);\n\t\t\t\tselect_event.submit();\n\t\t\t\tdriver.close();\n\t\t\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area (but show 'Go To' shortcuts) layout will be displayed for hyperlink url on selecting No Java applet and no task area (but show 'Go To' shortcuts) layout in configuration and default in hyperlink dialog - Context menu.\")\r\n\tpublic void SprintTest54_1_30_5A_1A(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area but show Go to shortcuts layout layout and save the settings\r\n\t\t\t//------------------------------------------------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"2. No java applet with task area with go to layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \" layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//-------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from context menu\r\n\t\t\t//-------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.rightClickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.listView.clickContextMenuItem(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from context menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through context menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isTaskPaneGoToDisplayed()) //Checks if Task Pane GoTo present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane GoTo is not available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as .\" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value);\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting \" + Caption.ConfigSettings.Config_TaskAreaWithShowGoTo.Value + \". Refer additional information : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "@Override\r\n\tpublic String getPage() {\n\t\ttry {\r\n\t\t\tWriter wr = new OutputStreamWriter(\r\n\t\t\t\t\tnew FileOutputStream(OutputPath), \"utf-8\");\r\n\t\t\tList<String> colleges = IOUtil.read2List(\r\n\t\t\t\t\t\"property/speciality.properties\", \"GBK\");\r\n\t\t\tfor (String college : colleges) {\r\n\t\t\t\tfor (int i = 1; i < 10000; i++) {\r\n\t\t\t\t\tString html = getSeach(college, null, null, 1, i);\r\n\t\t\t\t\tif (html.equals(\"\")) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tDocument page = Jsoup.parse(html);\r\n\t\t\t\t\tElements authors = page.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\"class\", \"listBox wauto clearfix\");\r\n\t\t\t\t\tfor (Element author : authors) {\r\n\t\t\t\t\t\tElement e = author.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\"xuezheName\").get(0);\r\n\t\t\t\t\t\tElement a = e.getElementsByAttributeValue(\"target\",\r\n\t\t\t\t\t\t\t\t\"_blank\").first();\r\n\t\t\t\t\t\tString name = a.text();\r\n\t\t\t\t\t\tString school = author.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\t\"class\", \"f14\").text();\r\n\t\t\t\t\t\tString id = a.attr(\"href\");\r\n\t\t\t\t\t\tString speciallity = author\r\n\t\t\t\t\t\t\t\t.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\"xuezheDW\").first().text();\r\n\t\t\t\t\t\twr.write(school + \"\\t\" + id + \"\\t\" + speciallity\r\n\t\t\t\t\t\t\t\t+ \"\\r\\n\");\r\n\t\t\t\t\t\tSystem.out.println(i + \":\" + school);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twr.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public List<EntityAndArguments> getEvaluationList() {\r\n\t\t\treturn evaluationList;\r\n\t\t}", "public boolean printOutput(){\n output = \"<html>\";\n output += \"Thank you for your evaluation<br><br>\"; \n output += \"Name: \" + name.getText() + \"<br>\";\n output += \"Matric: \" + matric.getText() + \"<br>\";\n if(code_selection.equals(\"[Select]\") || code.getSelectedItem().equals(\"\") || \n name.getText().equals(\"\") || matric.getText().equals(\"\") || \n rb_selection.equals(\"\") || cb_selection.equals(\"\")){\n \n JOptionPane.showMessageDialog(null, \"All field must be fill, Thank you..\");\n return false;\n }\n output += \"Course: \" + code_selection + \"<br>\";\n output += \"Rating: \" + rb_selection + \"<br>\";\n output += \"Outcome: \" + cb_selection + \"<br>\";\n output += \"</html>\"; \n lbl_output.setText(output);\n jsp.getViewport().revalidate();\n return true;\n }", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\", \"SKIP_JavaApplet\"}, \r\n\t\t\tdescription = \"Default layout will be displayed for hyperlink url on selecting default layout in configuration and in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_1A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, true);\r\n\r\n\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//-----------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select Default layout and save the settings\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value); //Sets as default layout\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getLayout().equalsIgnoreCase(Caption.ConfigSettings.Config_Default.Value)) //Verifies if default layout is selected\r\n\t\t\t\tthrow new Exception(\"Default layout is not selected.\");\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Saves the settings\r\n\t\t\t\tthrow new Exception(\"Settings are not saved properly.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. Default layout is selected and settings are saved.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\thomePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar\";\r\n\r\n\t\t\tif (!homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb;\";\r\n\r\n\t\t\tif (!homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Metadatacard;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as Default layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are missing on selecting 'Default' custom layout. Missed layots : \" \r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\t\t\tUtility.quitDriver(driver);\r\n\t\t} //End finally\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"C://Users//NikilaPC//Downloads//geckodriver-v0.24.0-win64//geckodriver.exe\");\t\n\n\t\tWebDriver driver = new FirefoxDriver();\n\t\t\n//\t\tdriver.manage().timeouts().implicitlyWait(3000, TimeUnit.MILLISECONDS);\n//\t\tdriver.navigate().to(\"https://www.calculator.net/mortgage-payoff-calculator.html\");\n//\t\tdriver.manage().window().maximize();\n//\t\tdriver.findElement(By.id(\"cpayoff1\")).click();\n//\t\t\n//\t\tSystem.out.println(\"The output of isSlelected is : \"+driver.findElement(By.id(\"cpayoff1\")).isSelected());\n//\t\t\n//\t\tSystem.out.println(\"The output of isEnabled is : \"+driver.findElement(By.id(\"cpayoff1\")).isEnabled());\n//\n//\t\tSystem.out.println(\"The output of isDisplayed is : \"+driver.findElement(By.id(\"cpayoff1\")).isDisplayed());\n//\n//\t\t\n//\t\tdriver.close();\n\n\t\t\n\t\t//**********for checkbox***********\n\t\tdriver.navigate().to(\"https://www.calculator.net/mortgage-calculator.html\");\n\t\t\t\t\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.findElement(By.id(\"caddoptional\")).click();\n\t\tSystem.out.println(\"The result is:\" +driver.findElement(By.id(\"caddoptional\")).isEnabled());\n\t\tSystem.out.println(\"the result of isSelected :\"+driver.findElement(By.id(\"caddoptional\")).isSelected());\n\t\tdriver.close();\n\t\t\n\t}", "public void addPages() {\t\t\n\t\tpage1 = new Opera2ActionsTransformationWizardPage1(selection, operaModel);\n\t\taddPage(page1);\t\n\t}", "private JPanel createAvailableConditionsSetPanel() {\n\t\tJPanel toReturn = new JPanel(new GridBagLayout());\n\n\t\t\n\t\t// Action for show profiling preferences.\n\t\t AbstractAction showProfilingPageAction = new AbstractAction(\"Profiling Preferences\") {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tPluginWorkspaceProvider.getPluginWorkspace().showPreferencesPages(new String[] { \"profiling.conditions\" },\n\t\t\t\t\t\t\"profiling.conditions\", true);\n\t\t\t\n\t\t\t\t//update the panel \n\t\t\t\tcomboBoxUpdate();\n\t\t\t}\n\t\t};\n\n\t\t\n\t\t // Button for display profiling preferences\n\t\t ToolbarButton buttonToProfiling = new ToolbarButton(showProfilingPageAction, true);\n\t\t\n\t\t\n\t\tGridBagConstraints gbc = new GridBagConstraints();\n\t\t\n\t\t//add the checkBox\n\t\tgbc.gridx = 0;\n\t\tgbc.gridy = 0;\n\t\tgbc.weightx = 1;\n\t\ttoReturn.add(useAllCondSetsRBtn, gbc);\n\t\t\n\t\t//add the button\n\t\tgbc.gridx = 1;\n\t\tgbc.weightx = 0;\n\n\t\tURL imageToLoad = getClass().getClassLoader().getResource(Images.PREFERENCES_ICON);\n\t\tif (imageToLoad != null) {\n\t\t\tbuttonToProfiling.setIcon(ro.sync.ui.Icons.getIcon(imageToLoad.toString()));\n\t\t\tbuttonToProfiling.setText(\"\");\n\t\t} else {\n\t\t\tbuttonToProfiling.setText(\"PC\");\n\t\t}\n\t\ttoReturn.add(buttonToProfiling, gbc);\n\n\t\treturn toReturn;\n\t}", "public String checkCheckBox(String object, String data) \n\t{\n\t logger.debug(\"Checking checkbox\");\n\t List<WebElement> element_List=null;\n\t try {\n\t\twhile (true) \n\t\t{\n\t\t\t//waitForPageLoad(driver);\n\t\t element_List = explictWaitForElementList(object);\n\n\t\t List<WebElement> next_Link_List = driver.findElements(By.xpath(OR.getProperty(\"pagination_next_link\")));\n\n\t\t if (element_List.size() > 0 )\n\t\t {\n\t\t\tfor(int i=1;i<=element_List.size();i++)\n\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t boolean checked = element_List.get(0).isSelected();\n\n\t\t\t if (!checked) //checkbox is unchecked\n\t\t\t { \t\t\t\t\t\t\t\t\n\t\t\t\tString xpathVal=OR.getProperty(object);\t\t\t\t\t\t\n\n\t\t\t\tif(!xpathVal.contains(Constants.INPUT_C_X))\n\t\t\t\t{\n\n\t\t\t\t if(xpathVal.endsWith(Constants.LABEL_X) || xpathVal.endsWith(Constants.DIV_X) || xpathVal.endsWith(Constants.DIV_CLASS_X) || xpathVal.contains(Constants.LABEL_C_X) ||xpathVal.contains(Constants.DIV_C_X) )\n\t\t\t\t {\n\t\t\t\t\telement_List.get(0).click();\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" clicked on check-box\";\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \t \n\t\t\t\t WebElement ele1 = driver.findElement(By.xpath(OR.getProperty(object)+\"/following-sibling::*\")); // if Xpath is made using input as last nodes.\n\t\t\t\t if(ele1.getTagName().equals(Constants.LABEL))\n\t\t\t\t {\n\t\t\t\t\tJavascriptExecutor executor = (JavascriptExecutor) driver;\n\t\t\t\t\texecutor.executeScript(\"arguments[0].scrollIntoView(true);\", ele1);\n\t\t\t\t\texecutor.executeScript(\"arguments[0].click();\", ele1);\n\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" clicked on check-box\";\n\t\t\t\t } \n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" check-box is already checked\";\n\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\n\t\t }\n\t\t else if (next_Link_List.size() > 0) \n\t\t {\n\t\t\tnext_Link_List.get(0).click();\n\t\t }\n\n\t\t else \n\t\t {\n\t\t\treturn Constants.KEYWORD_FAIL + \" checkbox is not present\";\n\t\t }\n\n\t\t}\n\t }\n\t catch(TimeoutException ex)\n\t {\n\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t }\n\t catch(WebDriverException ex){\n\t\ttry{\n\t\t String exceptionMessage=ex.getMessage();\n\t\t if(exceptionMessage.contains(\"Element is not clickable at point\"))\n\t\t {\n\t\t\tif(new ApplicationSpecificKeywordEventsUtil().clickJs(element_List.get(0)).equals(Constants.KEYWORD_PASS))\n\t\t\t return Constants.KEYWORD_PASS;\n\t\t\telse\n\t\t\t return Constants.KEYWORD_FAIL+ex.getMessage();\n\t\t }\n\t\t else\n\t\t\treturn Constants.KEYWORD_FAIL+\"not able to Click\";\n\t\t}\n\t\tcatch(Exception e){\n\n\t\t return Constants.KEYWORD_FAIL+e.getMessage();\n\t\t}\n\n\t }\n\n\n\t catch (Exception e) {\n\n\t\treturn Constants.KEYWORD_FAIL + \" - Could not find checkbox\";\n\t }\n\t}", "@Test(dataProviderClass = DataProviderUtils.class, dataProvider = \"excelDataReader\", groups = { \"Sprint54\", \"Get Hyperlink\"}, \r\n\t\t\tdescription = \"No Java applet and no task area layout will be displayed for hyperlink url on selecting No Java applet and no task area layout in configuration and default in hyperlink dialog - Operations menu.\")\r\n\tpublic void SprintTest54_1_30_4A_1B(HashMap<String,String> dataValues, String driverType) throws Exception {\r\n\r\n\t\tdriver = null; \r\n\r\n\t\ttry {\r\n\r\n\r\n\r\n\r\n\r\n\t\t\tdriver = WebDriverUtils.getDriver();\r\n\r\n\r\n\t\t\tConcurrentHashMap <String, String> dataPool = new ConcurrentHashMap <String, String>(dataValues);\r\n\t\t\tConfigurationPage configurationPage = LoginPage.launchDriverAndLoginToConfig(driver, true); //Launched driver and logged in\r\n\r\n\t\t\t//Step-1 : Navigate to Vault in tree view\r\n\t\t\t//---------------------------------------\r\n\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.getPageName().toUpperCase().equalsIgnoreCase(testVault.toUpperCase())) //Checks if navigated to vault settings page\r\n\t\t\t\tthrow new Exception(\"Vault settings page in configuration is not opened.\");\r\n\r\n\t\t\tLog.message(\"1. Navigated to Vault settings page.\");\r\n\r\n\t\t\t//Step-2 : Select No Java applet and No task area layout layout and save the settings\r\n\t\t\t//--------------------------------------------------------------------\r\n\t\t\tconfigurationPage.configurationPanel.setJavaApplet(Caption.ConfigSettings.Config_Disable.Value);\r\n\r\n\t\t\tif(configurationPage.configurationPanel.isJavaAppletEnabled())\r\n\t\t\t\tthrow new Exception(\"Java applet is enabled\");\r\n\r\n\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_NoTaskArea.Value);\r\n\r\n\t\t\tif (!configurationPage.configurationPanel.saveSettings()) //Save the settings\r\n\t\t\t\tthrow new Exception(\"Configuration settings are not saved after changing its layout.\");\r\n\r\n\t\t\tLog.message(\"1. No java applet and no task area layout is selected and saved.\");\r\n\r\n\t\t\tif (!configurationPage.logOut()) //Logs out from configuration page\r\n\t\t\t\tthrow new Exception(\"Log out is not successful after saving the settings in configuration page.\");\r\n\r\n\t\t\tLog.message(\"2. No Java applet and no task area layout is selected and settings are saved in configuration page & log out from the configuration page.\");\r\n\r\n\t\t\t//Step-3 : Login to the default page and navigate to any view\r\n\t\t\t//--------------------------------------------------------------------------\r\n\t\t\tHomePage homePage = LoginPage.launchDriverAndLogin(driver, false); //Launches and logs into the default page\r\n\r\n\t\t\tString viewToNavigate = SearchPanel.searchOrNavigatetoView(driver, dataPool.get(\"NavigateToView\"), dataPool.get(\"ObjectName\"));\r\n\r\n\t\t\tLog.message(\"3. Logged into the default page and navigated to '\" + viewToNavigate + \"' view.\");\r\n\r\n\t\t\t//Step-4 : Open Get Hyperlink dialog for the object from operations menu\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tif (!homePage.listView.clickItem(dataPool.get(\"ObjectName\"))) //Selects the Object in the list\r\n\t\t\t\tthrow new Exception(\"Object (\" + dataPool.get(\"ObjectName\") + \") is not got selected.\");\r\n\r\n\t\t\thomePage.menuBar.ClickOperationsMenu(Caption.MenuItems.GetMFilesWebURL.Value); //Selects Get Hyperlink from operations menu\r\n\r\n\t\t\tMFilesDialog mfilesDialog = new MFilesDialog(driver); //Instantiating MFilesDialog wrapper class\r\n\r\n\t\t\tif (!mfilesDialog.isGetMFilesWebURLDialogOpened()) //Checks for MFiles dialog title\r\n\t\t\t\tthrow new Exception(\"M-Files dialog with 'Get Hyperlink' title is not opened.\");\r\n\r\n\t\t\tLog.message(\"4. Hyperlink dialog of an object (\" + dataPool.get(\"ObjectName\") + \") is opened through operations menu.\");\r\n\r\n\t\t\t//Step-5 : Copy the link from text box and close the Get Hyperlink dialog\r\n\t\t\t//-----------------------------------------------------------------------\r\n\t\t\tString hyperlinkText = mfilesDialog.getHyperlink(); //Gets the hyperlink\r\n\t\t\tmfilesDialog.close(); //Closes the Get Hyperlink dialog\r\n\r\n\t\t\tLog.message(\"5. Hyperlink is copied and Get Hyperlink dialog is closed.\");\r\n\r\n\t\t\t//Step-6 : Open the copied Hyperlink in the browser\r\n\t\t\t//-------------------------------------------------\r\n\t\t\thomePage = Utility.navigateToPage(driver, hyperlinkText, userName, password, \"\"); //Navigates to the hyperlink url\r\n\r\n\r\n\t\t\tif (!driver.getCurrentUrl().equalsIgnoreCase(hyperlinkText))\r\n\t\t\t\tthrow new Exception (\"Browser is not opened with copied object Hyperlink.[Expected URL: \"+hyperlinkText+\" & Current URL : \"+ driver.getCurrentUrl() +\"]\");\r\n\r\n\t\t\tLog.message(\"6. Object Hyperlink is opened in the browser.\");\r\n\r\n\t\t\t//Verification : Verify if default layout is displayed\r\n\t\t\t//----------------------------------------------------\r\n\t\t\tString unAvailableLayouts = \"\";\r\n\r\n\t\t\tif (!homePage.isSearchbarPresent()) //Checks if Search bar present\r\n\t\t\t\tunAvailableLayouts = \"Search Bar is not available;\";\r\n\r\n\t\t\tif (homePage.isTaskPaneDisplayed()) //Checks if Task Pane present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Task Pane is available;\";\r\n\r\n\t\t\tif (!homePage.previewPane.isTabExists(Caption.PreviewPane.MetadataTab.Value))\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Properties Pane is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isMenuInMenubarDisplayed()) //Checks if Menu Bar present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Menu Bar is not available;\";\r\n\r\n\t\t\tif (!homePage.menuBar.isBreadCrumbDisplayed()) //Checks if Breadcrumb present\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Breadcrumb is not available;\";\r\n\r\n\t\t\tif (homePage.taskPanel.isAppletEnabled())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Java Applet is available;\";\r\n\r\n\t\t\tif (!homePage.isListViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"List View is not available;\";\r\n\r\n\t\t\tif (homePage.isTreeViewDisplayed())\r\n\t\t\t\tunAvailableLayouts = unAvailableLayouts + \"Tree View is available;\";\r\n\r\n\t\t\tif (unAvailableLayouts.equals(\"\")) //Verifies default layout have selected default custom layout\r\n\t\t\t\tLog.pass(\"Test case Passed. Hyperlink URL page is displayed as No java applet and No task area layout.\");\r\n\t\t\telse\r\n\t\t\t\tLog.fail(\"Test case Failed. Few layots are not as expected on selecting No java applet and No task area layout.\"\r\n\t\t\t\t\t\t+ unAvailableLayouts, driver);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tLog.exception(e, driver);\r\n\t\t} //End catch\r\n\r\n\t\tfinally {\r\n\r\n\t\t\tif(driver != null){\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.get(configURL);\r\n\r\n\t\t\t\t\tConfigurationPage configurationPage = new ConfigurationPage(driver);\r\n\t\t\t\t\tconfigurationPage.treeView.clickTreeViewItem(Caption.ConfigSettings.VaultSpecificSettings.Value + \">>\" + testVault); //Clicks tree view item\r\n\r\n\t\t\t\t\tconfigurationPage.configurationPanel.setLayout(Caption.ConfigSettings.Config_Default.Value);\r\n\r\n\t\t\t\t\tif (!configurationPage.configurationPanel.saveSettings())\r\n\t\t\t\t\t\tthrow new Exception(\"Configuration settings are not saved.\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e0)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.exception(e0, driver);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tUtility.quitDriver(driver);\r\n\r\n\t\t} //End finally\r\n\r\n\t}", "private Page createPage() throws IOException {\n\n Page page = new Page(DenseLayerPath + indexkey + \"dense_\" + (++noPages) + \".class\");\n saveindex();\n return page;\n }", "@Override\r\n\tpublic EvaluationDTO create(EvaluationDTO e) {\n\t\treturn null;\r\n\t}" ]
[ "0.59307706", "0.5675231", "0.55172807", "0.538167", "0.5092922", "0.5063956", "0.50427014", "0.49727502", "0.49358886", "0.49131072", "0.4912127", "0.49089006", "0.49023986", "0.48809925", "0.48789173", "0.4873947", "0.48389095", "0.4837082", "0.4822877", "0.4816017", "0.48103017", "0.47789708", "0.477325", "0.47645742", "0.47636655", "0.4745975", "0.47452298", "0.47347385", "0.47347248", "0.47320494", "0.4730581", "0.47256815", "0.4719212", "0.47168654", "0.47055614", "0.47051716", "0.4701687", "0.46989754", "0.4697596", "0.4688214", "0.46876982", "0.46863988", "0.46787244", "0.46674097", "0.46647128", "0.4658003", "0.4650187", "0.46493098", "0.4649276", "0.46421567", "0.46387467", "0.46278894", "0.46245387", "0.4620349", "0.4615283", "0.4610604", "0.460477", "0.46047384", "0.4599739", "0.45956102", "0.4591354", "0.45863336", "0.45833683", "0.45824644", "0.45673653", "0.45585826", "0.45575574", "0.4556341", "0.45495108", "0.4546443", "0.45461252", "0.45460665", "0.4544303", "0.4538531", "0.453149", "0.45278725", "0.45270503", "0.45261794", "0.45251843", "0.4524593", "0.45244926", "0.4516299", "0.45148614", "0.45135492", "0.45111406", "0.45095348", "0.4508427", "0.45076692", "0.4506888", "0.45032227", "0.45001987", "0.44941324", "0.4489938", "0.44898033", "0.44863904", "0.44860798", "0.4480022", "0.44759178", "0.44603026", "0.44579735" ]
0.71327925
0
creates the control and adds the visualization selection top bar
@Override public void createControl(Composite parent) { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginTop = 0; layout.marginBottom = 0; layout.verticalSpacing = 0; layout.makeColumnsEqualWidth = true; rootComposite = new Composite(parent, SWT.NO_BACKGROUND); rootComposite.setLayout(layout); GridData rootData = new GridData(); rootData.grabExcessHorizontalSpace = true; rootData.horizontalAlignment = GridData.FILL; rootData.grabExcessVerticalSpace = true; rootData.verticalAlignment = GridData.FILL; rootComposite.setLayoutData(rootData); createTopBar(rootComposite, layout.numColumns); this.showMonitorVisualization(); setControl(rootComposite); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Composite createTopBar(Composite parent, int span) {\n\t\tComposite c = new Composite(parent, SWT.NO_BACKGROUND);\n\n\t\tGridData cData = new GridData();\n\t\tcData.horizontalSpan = span;\n\t\tcData.horizontalAlignment = GridData.FILL;\n\t\tc.setLayoutData(cData);\n\n\t\tGridLayout layout = new GridLayout();\n\t\tlayout.numColumns = 3;\n\t\tc.setLayout(layout);\n\n\n\t\tLabel weightLabel = new Label(c, SWT.LEFT);\n\t\tGridData weightData = new GridData();\n\t\tweightData.grabExcessHorizontalSpace = true;\n\t\tweightLabel.setLayoutData(weightData);\n\t\tweightLabel.setText(Resources.getMessage(\"RiskWizard.19\"));\n\t\tFontDescriptor boldDescriptor = FontDescriptor.createFrom(weightLabel.getFont()).setStyle(SWT.BOLD);\n\t\tFont boldFont = boldDescriptor.createFont(weightLabel.getDisplay());\n\t\tweightLabel.setFont(boldFont);\n\t\tfileLabel = weightLabel;\n\t\t\n\t\tfinal Combo visualizationDropDown = new Combo(c, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);\n\t\tString monitorTitle = Resources.getMessage(\"RiskWizard.12\");\n\t\tString stacksTitle = Resources.getMessage(\"RiskWizard.13\");\n\t\tvisualizationDropDown.add(monitorTitle);\n\t\tvisualizationDropDown.add(stacksTitle);\n\t\tvisualizationDropDown.setText(monitorTitle);\n\t\tvisualizationDropDown.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tString selected = visualizationDropDown.getText(); \n\t\t\t\tif(selected.equals(stacksTitle)) {\n\t\t\t\t\t//System.out.println(\"Select Stacks\");\n\t\t\t\t\tshowStacksVisualization();\n\t\t\t\t} else if(selected.equals(monitorTitle)) {\n\t\t\t\t\t//System.out.println(\"Select Monitor\");\n\t\t\t\t\tshowMonitorVisualization();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tLabel separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);\n\t\tGridData sepData = new GridData();\n\t\tsepData.horizontalSpan = layout.numColumns;\n\t\tsepData.grabExcessHorizontalSpace = true;\n\t\tsepData.horizontalAlignment = GridData.FILL;\n\t\tseparator.setLayoutData(sepData);\n\n\t\ttopBar = c;\n\t\treturn c;\n\t}", "public SelectionPanel(){\n\t\tthis.setHbarPolicy(ScrollBarPolicy.ALWAYS);\n\t\tthis.setVbarPolicy(ScrollBarPolicy.NEVER);\n\t\tsetButton();\n\t\tthis.setContent(container);\n\t\tthis.setPrefHeight(65);\n\t\tthis.setPrefWidth(700);\n\t\tcontainer.setVisible(false);\n\t}", "public Toolbar() {\n\t\tsuper();\n\t\tthis.setLayout(new FlowLayout(FlowLayout.CENTER));\n\t\tboxColor = new Color(230, 230, 184);\n\t\tbuttonColor = new Color(255, 255, 102);\n\t\t// graphBottomColor = new Color(108, 123, 139);\n\t\t// graphTopColor = new Color(159, 182, 205);\n\t\t// titleRectColor = new Color(184, 230, 92);\n\n\t\teventTypeLabel = new JLabel(\"Event Type:\");\n\t\teventTypeDropDown = new Choice();\n\n\t\tareaLabel = new JLabel(\"Area:\");\n\t\tareaDropDown = new Choice();\n\n\t\tnumberOfPmuLabel = new JLabel(\"Number of PMU:\");\n\t\tnumberOfPmuDropDown = new Choice();\n\n\t\tnoiseLabel = new JLabel(\"Varience of Noise:\");\n\t\tlowNoiseTextBox = new JTextField(5);\n\t\thighNoiseTextBox = new JTextField(5);\n\n\t\t// adding data to drop down\n\t\teventTypeDropDown.add(\"-----\");\n\t\teventTypeDropDown.add(\"Fault\");\n\t\teventTypeDropDown.add(\"Generation Loss\");\n\t\teventTypeDropDown.add(\"Load Switch Off\");\n\t\teventTypeDropDown.add(\"Load Switch On\");\n\t\teventTypeDropDown.add(\"Reactive Power Excluded\");\n\t\teventTypeDropDown.add(\"Reactive Power Introduced\");\n\t\teventTypeDropDown.add(\"Synchronous Motor Switching Off\");\n\t\teventTypeDropDown.add(\"Series Capacitor Switching Off\");\n\t\teventTypeDropDown.add(\"Series Capacitor Switching On\");\n\n\t\t// adding data to drop down\n\t\tareaDropDown.add(\"ALBERTA -- 54\");\n\t\tareaDropDown.add(\"ARIZONA -- 14\");\n\t\tareaDropDown.add(\"B.C. HYDRO -- 50\");\n\t\tareaDropDown.add(\"EL PASO -- 11\");\n\t\tareaDropDown.add(\"IDAHO -- 60\");\n\t\tareaDropDown.add(\"IMPERIALCA -- 21\");\n\t\tareaDropDown.add(\"LADWP -- 26\");\n\t\t// areaDropDown.add(\"MEXICO-CFE -- 20\");\n\t\tareaDropDown.add(\"MONTANA -- 62\");\n\t\tareaDropDown.add(\"NEVADA -- 18\");\n\t\tareaDropDown.add(\"NEW MEXICO -- 10\");\n\t\tareaDropDown.add(\"NORTHWEST -- 40\");\n\t\tareaDropDown.add(\"PACE -- 65\");\n\t\tareaDropDown.add(\"PG AND E -- 30\");\n\t\tareaDropDown.add(\"PSCOLORADO -- 70\");\n\t\tareaDropDown.add(\"SANDIEGO -- 22\");\n\t\tareaDropDown.add(\"SIERRA -- 64\");\n\t\tareaDropDown.add(\"SOCALIF -- 24\");\n\t\tareaDropDown.add(\"FORTISBC -- 52\");\n\t\tareaDropDown.add(\"WAPA R.M. -- 73\");\n\t\t// areaDropDown.add(\"WAPA U.M. -- 63\");\n\n\t\t// adding data to drop down\n\t\tnumberOfPmuDropDown.add(\"10\");\n\t\tnumberOfPmuDropDown.add(\"9\");\n\t\tnumberOfPmuDropDown.add(\"8\");\n\t\tnumberOfPmuDropDown.add(\"7\");\n\t\tnumberOfPmuDropDown.add(\"6\");\n\t\tnumberOfPmuDropDown.add(\"5\");\n\t\tnumberOfPmuDropDown.add(\"4\");\n\t\tnumberOfPmuDropDown.add(\"3\");\n\t\tnumberOfPmuDropDown.add(\"2\");\n\t\tnumberOfPmuDropDown.add(\"1\");\n\n\t\tstartButton = new JButton(\"Start\");\n\t\tstartButton.setFocusPainted(false);\n\t\tstopButton = new JButton(\"Stop\");\n\t\tstopButton.setFocusPainted(false);\n\t\tcreateEventButton = new JButton(\"Disturbance\");\n\t\tcreateEventButton.setFocusPainted(false);\n\t\tcreateEventButton.setEnabled(false);\n\t\tstopButton.setEnabled(false);\n\n\t\teventTypeDropDown.setBackground(boxColor);\n\t\tareaDropDown.setBackground(boxColor);\n\t\tnumberOfPmuDropDown.setBackground(boxColor);\n\n\t\tstartButton.setBackground(Color.green);\n\t\tstopButton.setBackground(Color.red);\n\t\tcreateEventButton.setBackground(buttonColor);\n\n\t\tstartButton.setForeground(Color.black);\n\t\tstopButton.setForeground(Color.black);\n\n\t\t// adding components to the panel\n\t\tthis.add(eventTypeLabel);\n\t\tthis.add(eventTypeDropDown);\n\n\t\tthis.add(areaLabel);\n\t\tthis.add(areaDropDown);\n\n\t\tthis.add(numberOfPmuLabel);\n\t\tthis.add(numberOfPmuDropDown);\n\n\t\tthis.add(noiseLabel);\n\t\tthis.add(lowNoiseTextBox);\n\t\tthis.add(highNoiseTextBox);\n\n\t\tthis.add(startButton);\n\t\tthis.add(stopButton);\n\t\tthis.add(createEventButton);\n\n\t\t// listeners get initialized here so that when the toolbar is\n\t\t// constructed there in only one instance of the listeners\n\t\tstartButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.START_BUTTON, tools));\n\t\tstopButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.STOP_BUTTON, tools));\n\t\tcreateEventButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.CREATE_EVENT_BUTTON, tools));\n\n\t}", "private FilterBar() {\n\t\t\n\t\tsuper(15);\n\t\tthis.setStyle(\"-fx-background-color: #FFFFFF;\");\n\t\tthis.setPadding(new Insets(25, 25, 25, 25));\n\t\t\n\t\taddNodes();\n\t\taddListeners();\n\t\t\n\t}", "@FXML\n public void addBar() {\n \tnew eMenuHandler().hideMenu();\n \tDisplayBuildingInstructions.showBuildingInstr();\n \tAddEntityOnMouseClick.setBuildMode(Boolean.TRUE);\n \tAddEntityOnMouseClick.entityList(new BuildingBar(0, 0));\n }", "public Visualize() {\n initComponents();\n \n }", "private void createToolbar() {\r\n // the visible toolbar is actually a toolbar next to a combobox.\r\n // That is why we need this extra composite, layout and numColums = 2.\r\n final Composite parent = new Composite(SHELL, SWT.FILL);\r\n final GridLayout layout = new GridLayout();\r\n layout.numColumns = 2;\r\n parent.setLayout(layout);\r\n\r\n final ToolBar bar = new ToolBar(parent, SWT.NONE);\r\n final GridData data = new GridData();\r\n data.heightHint = 55;\r\n data.grabExcessVerticalSpace = false;\r\n bar.setLayoutData(data);\r\n bar.setLayout(new GridLayout());\r\n\r\n createOpenButton(bar);\r\n\r\n createGenerateButton(bar);\r\n\r\n createSaveButton(bar);\r\n\r\n createSolveButton(bar);\r\n\r\n createAboutButton(bar);\r\n\r\n algorithmCombo = new AlgorithmCombo(parent);\r\n }", "@SuppressWarnings(\"unchecked\")\r\n public void createControl( Composite parent )\r\n {\n ScrolledComposite tabScroller = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);\r\n tabScroller.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );\r\n tabScroller.setLayout( new GridLayout( 1, false ) );\r\n tabScroller.setExpandHorizontal(true);\r\n tabScroller.setExpandVertical(true);\r\n Composite tab = new Composite(tabScroller, SWT.NONE);\r\n tab.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );\r\n tab.setLayout( new GridLayout( 1, false ) );\r\n\r\n Composite buttons = new Composite(tab, SWT.NONE);\r\n buttons.setLayoutData( new GridData( GridData.HORIZONTAL_ALIGN_CENTER ) );\r\n buttons.setLayout( new GridLayout( 2, false ) );\r\n\r\n setControl( tabScroller );\r\n tabScroller.setContent(tab);\r\n\r\n // Add the relevant controls for selecting parameters\r\n final UpdatableControlIF topFile = ControlRenderingFactory.fileSelectButton(buttons, \"Set top model from file selection\", false, (ConfigFile)getConfigs().get(ConfigGroup.TOP_MODEL_FILE));\r\n /*final Button defaults =*/ this.getDefaultButton(buttons);\r\n\r\n final Composite group2 = new Composite(tab, SWT.SHADOW_IN);\r\n group2.setLayoutData( new GridData(SWT.FILL, SWT.BEGINNING, true,true) );\r\n group2.setLayout( new GridLayout( 2, true ) );\r\n\r\n final Composite leftCol = new Composite(group2, SWT.NONE);\r\n leftCol.setLayoutData( new GridData(SWT.FILL, SWT.BEGINNING, true,true) );\r\n leftCol.setLayout( new GridLayout( 1, true ) );\r\n\r\n final Composite rightCol = new Composite(group2, SWT.NONE);\r\n rightCol.setLayoutData( new GridData(SWT.FILL, SWT.BEGINNING, true,true) );\r\n rightCol.setLayout( new GridLayout( 1, true ) );\r\n\r\n final UpdatableControlIF runDir = ControlRenderingFactory.renderConfigFileSelect((ConfigFile)getConfigs().get(ConfigGroup.RUN_DIR), leftCol, true, true); \r\n final UpdatableControlIF topName = ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.TOP_MODEL_NAME), leftCol); \r\n addControl(ConfigGroup.CACHE_DIR, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.CACHE_DIR), leftCol));\r\n\r\n final Composite leftColShort = new Composite(leftCol, SWT.NONE);\r\n leftColShort.setLayoutData( new GridData(SWT.FILL, SWT.BEGINNING, true,true) );\r\n leftColShort.setLayout( new GridLayout( 2, true ) );\r\n addControl(ConfigGroup.SIM_TIME, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_TIME), leftColShort));\r\n addControl(ConfigGroup.SIM_STEPS, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_STEPS), leftColShort));\r\n addControl(ConfigGroup.SIM_MAX_ERRORS, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_MAX_ERRORS), leftColShort));\r\n addControl(ConfigGroup.SIM_BUFFER_SIZE_WARNING, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_BUFFER_SIZE_WARNING), leftColShort));\r\n \r\n addControl(ConfigGroup.ELABORATE_TOP, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.ELABORATE_TOP), leftColShort));\r\n addControl(ConfigGroup.ENABLE_ASSERTIONS, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.ENABLE_ASSERTIONS), leftColShort));\r\n addControl(ConfigGroup.SIM_BUFFER_IGNORE, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_BUFFER_IGNORE), leftColShort));\r\n addControl(ConfigGroup.SIM_BUFFER_RECORD, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_BUFFER_RECORD), leftColShort));\r\n addControl(ConfigGroup.SIM_TRACE, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_TRACE), leftColShort));\r\n addControl(ConfigGroup.SIM_TYPE_CHECK, ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.SIM_TYPE_CHECK), leftColShort));\r\n \r\n addControl(ConfigGroup.SIM_INPUT_FILE, ControlRenderingFactory.renderConfigFileSelect((ConfigFile)getConfigs().get(ConfigGroup.SIM_INPUT_FILE), rightCol, true, true));\r\n addControl(ConfigGroup.SIM_OUTPUT_FILE, ControlRenderingFactory.renderConfigFileSelect((ConfigFile)getConfigs().get(ConfigGroup.SIM_OUTPUT_FILE), rightCol, true, true));\r\n final UpdatableControlIF modelPath = ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.MODEL_PATH), rightCol); \r\n final UpdatableControlIF modelParams = ControlRenderingFactory.renderConfig(getConfigs().get(ConfigGroup.TOP_MODEL_PARAMS), rightCol); \r\n addControl(ConfigGroup.MESSAGE_SUPPRESS_IDS, ControlRenderingFactory.renderConfig((ConfigList)getConfigs().get(ConfigGroup.MESSAGE_SUPPRESS_IDS), rightCol));\r\n\r\n addControl(ConfigGroup.MODEL_PATH, modelPath);\r\n addControl(ConfigGroup.RUN_DIR, runDir);\r\n addControl(ConfigGroup.TOP_MODEL_NAME, topName);\r\n addControl(ConfigGroup.TOP_MODEL_PARAMS, modelParams);\r\n\r\n // If the user uses the button to set the model by file selection, overide any values in \r\n // the relevent fields\r\n topFile.addModifyListener(new ConfigModificationListener(){\r\n public void registerModification (int type) { \r\n // Set to false to only update in case of no user setting.\r\n final boolean forceUpdate = true;\r\n\r\n ConfigFile topFileConfig = (ConfigFile)getConfigs().get(ConfigGroup.TOP_MODEL_FILE);\r\n // In case of spurious events ignore them (possible?)\r\n if (!topFileConfig.isUserSpecified())\r\n return;\r\n\r\n // Update the run directory whenever the top file is updated\r\n ConfigFile runDirConfig = (ConfigFile)getConfigs().get(ConfigGroup.RUN_DIR);\r\n if (forceUpdate/* || !runDirConfig.isUserSpecified()*/)\r\n runDirConfig.setValue(topFileConfig.getValueFile().getParent(), true);\r\n runDir.updateValue();\r\n\r\n // Update the top level model name\r\n ConfigString topNameConfig = (ConfigString)getConfigs().get(ConfigGroup.TOP_MODEL_NAME);\r\n if (forceUpdate/* || !topNameConfig.isUserSpecified()*/)\r\n {\r\n String name = topFileConfig.getValueFile().getName();\r\n name = name.indexOf('.') > 0 ? name.substring(0, name.lastIndexOf('.')):name;\r\n topNameConfig.setValue(name, true);\r\n }\r\n topName.updateValue();\r\n\r\n // Ensure that the model path contains the run directory\r\n ConfigList modelPathConfig = (ConfigList)getConfigs().get(ConfigGroup.MODEL_PATH);\r\n if (!modelPathConfig.getValue().contains(runDirConfig.getValue()))\r\n {\r\n // The contract for setValue on collections is to append\r\n modelPathConfig.addValue(Collections.singletonList(runDirConfig.getValue()), modelPathConfig.isUserSpecified());\r\n }\r\n modelPath.updateValue();\r\n\r\n // Update the model parameters\r\n ConfigMap paramsConfig = (ConfigMap)getConfigs().get(ConfigGroup.TOP_MODEL_PARAMS);\r\n if (forceUpdate/* || !paramsConfig.isUserSpecified()*/)\r\n {\r\n String[] modelPathArr = (String[])modelPathConfig.getValue().toArray(new String[0]);\r\n try {\r\n List<TopModelParamParse.ModelParameter> params = TopModelParamParse.parseModel(topNameConfig.getValue(), modelPathArr);\r\n Map map = new HashMap();\r\n for (ModelParameter mp : params)\r\n map.put(mp.getName(), mp.getValue());\r\n paramsConfig.setValue(map, false);\r\n } catch (TopModelParamParse.ModelAnalysisException exc) {\r\n Logging.dbg().severe(\"Error loading top model \" + exc);\r\n }\r\n }\r\n modelParams.updateValue();\r\n }\r\n });\r\n\r\n // The topFile control must be added AFTER the above modificationListener is added\r\n // so that the changes instituted there will be reflected in the call to updateLaunchConfigurationDialog().\r\n addControl(ConfigGroup.TOP_MODEL_FILE, topFile);\r\n\r\n tabScroller.setMinSize(tab.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n }", "@Override\n protected void initializeToolBars() {\n SharedToolBar sharedToolbar = getSharedToolBar();\n sharedToolbar.addPushButton(new HelpAction(\"org.geocraft.ui.traceviewer.MapPlot\"));\n\n // Create a custom toolbar just for the trace viewer.\n SimpleToolBar toolbar = addCustomToolBar();\n\n // Add a color selector for choosing the background color.\n final ColorSelector colorSelector = toolbar.addColorSelector(getBackgroundViewColor());\n colorSelector.getButton().setToolTipText(\"Select background color\");\n colorSelector.addListener(new IPropertyChangeListener() {\n\n /**\n * Invoked when a color is chosen in the color selector.\n * \n * @param event\n * the property change event.\n */\n public void propertyChange(final PropertyChangeEvent event) {\n RGB newColor = colorSelector.getColorValue();\n setBackgroundViewColor(newColor);\n _plot.getModelSpaceCanvas().setGridLineProperties(LineStyle.NONE, newColor, 0);\n }\n });\n }", "@Override\r\n\tpublic void createControl(Composite parent) {\r\n\t\tpageBook = new PageBook(parent, SWT.NONE);\r\n\t\t\r\n\t\toutline = getViewer().createControl(pageBook);\r\n\t\tgetViewer().setContents(new Root(model));\r\n\t\tselectionSynchronizer.addViewer(getViewer());\r\n\t\t\r\n\t\toverview = new Canvas(pageBook, SWT.NONE);\r\n\t\tlws = new LightweightSystem(overview);\r\n\t\t\r\n IToolBarManager tbm = getSite().getActionBars().getToolBarManager();\r\n showOutlineAction = new Action() {\r\n public void run() {\r\n showPage(outline);\r\n }\r\n };\r\n showOutlineAction.setImageDescriptor(ImageDescriptor.createFromFile(\r\n \t\tDeploymentOutlinePage.class, \"icons/outline.gif\"));\r\n tbm.add(showOutlineAction);\r\n showOverviewAction = new Action() {\r\n public void run() {\r\n showPage(overview);\r\n }\r\n };\r\n showOverviewAction.setImageDescriptor(ImageDescriptor.createFromFile(\r\n \t\tDeploymentOutlinePage.class, \"icons/overview.gif\"));\r\n tbm.add(showOverviewAction);\r\n \r\n initializeOverview();\r\n \r\n showPage(outline);\r\n\t}", "private JPanel topBar() {\n\t\t\n\t\t//creating a top bar with controls\n\t\tJPanel topBar = new JPanel();\n\t\tColor myPurp = new Color(191, 123, 123);\n\t\ttopBar.setBackground(myPurp);\n\t\t\n\t\t//reset button with listener\n\t\ttopBar.add(reset);\n\t\treset.addActionListener(this);\n\t\t\n\t\t//creating button that starts simulation\n\t\tstart.setSelected(false);\n\t\tstart.addActionListener(this);\n\t\ttopBar.add(start);\n\t\t\n\t\t//creating button that stops simulation\n\t\tstop.setSelected(true);\n\t\tstop.addActionListener(this);\n\t\ttopBar.add(stop);\n\t\t\n\t\t//button group to ensure you cannot start and stop at same time\n\t\tButtonGroup startStop = new ButtonGroup();\n\t\tstartStop.add(start);\n\t\tstartStop.add(stop);\n\t\t\n\t\t//creating label that shows # of steps\n\t\tsteps.setHorizontalAlignment(JLabel.CENTER);\n\t\ttopBar.add(steps);\n\t\t\n\t\t\n\t\treturn topBar;\n\t}", "private void createTopPanel(){\n computerPaquetView = new ViewDeckVisible(true);\n this.getContentPane().add(computerPaquetView);\n }", "protected void createSelection() {\r\n\t\tsel = new GraphSelection();\r\n\t}", "public ChampionSelectGUI() {\n\t\tsetupPanel();\n\t\tsetupScroll();\n\t\tsetupCenterPanel();\n\t\tsetupBottomPanel();\n\t\tsetupSidePanels();\n\t\taddWindowListener(this);\n\t}", "private void buildUI() {\n grid.setPadding(new Insets(10));\n grid.setHgap(10);\n grid.setVgap(10);\n \n // First row\n grid.add(tagsSelectLabel, 0, 0, 1, 1);\n selectTextSelector = new TextSelector();\n /*selectTextSelector.setEditable(true);\n selectTextSelector.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent evt) {\n UserPrefs.getShared().setPref\n (SELECT_TAGS, selectTextSelector.getText());\n }\n }); */\n grid.add(selectTextSelector, 1, 0, 1, 1);\n \n // Second row\n grid.add(tagsSuppressLabel, 0, 1, 1, 1);\n suppressTextSelector = new TextSelector();\n /* suppressTextSelector.setEditable(true);\n suppressTextSelector.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent evt) {\n UserPrefs.getShared().setPref\n (SUPPRESS_TAGS, suppressTextSelector.getText());\n }\n }); */\n grid.add(suppressTextSelector, 1, 1, 1, 1);\n \n selectTextSelector.setText\n (UserPrefs.getShared().getPref (SELECT_TAGS, \"\"));\n suppressTextSelector.setText\n (UserPrefs.getShared().getPref (SUPPRESS_TAGS, \"\"));\n \n }", "private void initialiseUI()\n { \n // The actual data go in this component.\n String defaultRootElement = \"icr:regionSetData\";\n JPanel contentPanel = initialiseContentPanel(defaultRootElement);\n pane = new JScrollPane(contentPanel);\n \n panelLayout = new GroupLayout(this);\n\t\tthis.setLayout(panelLayout);\n\t\tthis.setBackground(DAOConstants.BG_COLOUR);\n\n\t\tpanelLayout.setAutoCreateContainerGaps(true);\n\n panelLayout.setHorizontalGroup(\n\t\t\tpanelLayout.createParallelGroup()\n\t\t\t.addComponent(pane, 10, 520, 540)\n );\n\n panelLayout.setVerticalGroup(\n\t\t\tpanelLayout.createSequentialGroup()\n .addComponent(pane, 10, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)\n );\n }", "public void createControl(Composite parent) {\r\n\t\tComposite container = new Composite(parent, SWT.NONE);\r\n\t\tsetControl(container);\r\n\t\tGroup group = new Group(container, SWT.NONE);\r\n\t\tgroup.setBounds(0, 281, 533, 60);\r\n\t\t\r\n\t\tLabel lblSelectWhetherYou = new Label(group, SWT.NONE);\r\n\t\tlblSelectWhetherYou.setBounds(10, 22, 374, 26);\r\n\t\tlblSelectWhetherYou.setText(\"\\u9009\\u62E9\\u662F\\u5426\\u8981\\u53D1\\u5E03\\u3001\\u68C0\\u7D22\\u6216\\u5220\\u9664\\u670D\\u52A1\\u5668\\u4E0A\\u7684\\u62A5\\u544A\\u3002\");\r\n\t\t\r\n\t\tlb_pr = new Label(container, SWT.NONE);\r\n\t\tlb_pr.setBounds(69, 79, 48, 48);\r\n\t\tlb_pr.setImage(SwtImageConverter.ConvertToSwtImage(ImageResolver.get_Resolver().ResolveImage(\"[IMAGE]Core#Images.Icons.ReportPublish.png\"),48,48));\r\n\t\t\r\n\t\trbtn_pr = new Button(container, SWT.RADIO);\r\n\t\trbtn_pr.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseDoubleClick(MouseEvent e) {\r\n\t\t\t\tgetNextPage();\r\n\t\t\t}\r\n\t\t});\r\n\t\trbtn_pr.setBounds(59, 133, 69, 16);\r\n\t\trbtn_pr.setText(\"\\u53D1\\u5E03\\u62A5\\u544A\");\r\n\t\trbtn_pr.setData(\"PublishedReportW2_Pub\");\r\n\t\t\r\n\t\tlb_rr = new Label(container, SWT.NONE);\r\n\t\tlb_rr.setBounds(185, 79, 48, 48);\r\n\t\tlb_rr.setImage(SwtImageConverter.ConvertToSwtImage(ImageResolver.get_Resolver().ResolveImage(\"[IMAGE]Core#Images.Icons.ReportRetrieve.png\"),48,48));\r\n\t\t\r\n\t\t\r\n\t\trbtn_rr = new Button(container, SWT.RADIO);\r\n\t\trbtn_rr.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseDoubleClick(MouseEvent e) {\r\n\t\t\t\tgetNextPage();\r\n\t\t\t}\r\n\t\t});\r\n\t\trbtn_rr.setBounds(175, 133, 69, 16);\r\n\t\trbtn_rr.setText(\"\\u68C0\\u7D22\\u62A5\\u544A\");//»ρΘ‘\\u68C0\\u7D22\\\r\n\t\trbtn_rr.setData(\"PublishedReportW2_Ret\");\r\n\t\t\r\n\t\tlb_dr = new Label(container, SWT.NONE);\r\n\t\tlb_dr.setBounds(297, 79, 48, 48);\r\n\t\tlb_dr.setImage(SwtImageConverter.ConvertToSwtImage(ImageResolver.get_Resolver().ResolveImage(\"[IMAGE]Core#Images.Icons.ReportDelete.png\"),48,48));\r\n\t\t\r\n\t\t\r\n\t\trbtn_dr = new Button(container, SWT.RADIO);\r\n\t\trbtn_dr.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseDoubleClick(MouseEvent e) {\r\n\t\t\t\tgetNextPage();\r\n\t\t\t}\r\n\t\t});\r\n\t\trbtn_dr.setBounds(287, 133, 69, 16);\r\n\t\trbtn_dr.setText(\"\\u5220\\u9664\\u62A5\\u544A\");\r\n\t\trbtn_dr.setData(\"PublishedReportW2_Del\");\r\n\t\t\r\n\t}", "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 ToolWindowSelector() {\r\n\t\tfinal ImageStack slices = ImageStack.getInstance();\t\t\r\n\t\t\r\n\r\n\t\t// range_max needs to be calculated from the bits_stored value\r\n\t\t// in the current dicom series\r\n\t\tint window_center_min = 0;\r\n\t\tint window_width_min = 0;\r\n\t\tint window_center_max = 1<<(slices.getDiFile(0).getBitsStored());\r\n\t\tint window_width_max = 1<<(slices.getDiFile(0).getBitsStored());\r\n\t\t_window_center = slices.getWindowCenter();\r\n\t\t_window_width = slices.getWindowWidth();\r\n\t\t\r\n\t\t_window_settings_label = new JLabel(\"Window Settings\");\r\n\t\t_window_center_label = new JLabel(\"Window Center:\");\r\n\t\t_window_width_label = new JLabel(\"Window Width:\");\r\n\t\t\r\n\t\t_window_center_slider = new JSlider(window_center_min, window_center_max, _window_center);\r\n\t\t_window_center_slider.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tJSlider source = (JSlider) e.getSource();\r\n\t\t\t\tif (source.getValueIsAdjusting()) {\r\n\t\t\t\t\t_window_center = (int)source.getValue();\r\n//\t\t\t\t\tSystem.out.println(\"_window_center_slider state Changed: \"+_window_center);\r\n\t\t\t\t\tslices.setWindowCenter(_window_center);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\t\t\r\n\t\t\r\n\t\t_window_width_slider= new JSlider(window_width_min, window_width_max, _window_width);\r\n\t\t_window_width_slider.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tJSlider source = (JSlider) e.getSource();\r\n\t\t\t\tif (source.getValueIsAdjusting()) {\r\n\t\t\t\t\t_window_width = (int)source.getValue();\r\n//\t\t\t\t\tSystem.out.println(\"_window_width_slider state Changed: \"+_window_width);\r\n\t\t\t\t\tslices.setWindowWidth(_window_width);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tsetLayout(new GridBagLayout());\r\n\t\tGridBagConstraints c = new GridBagConstraints();\r\n\t\tc.weighty = 0.3;\r\n\t\tc.fill = GridBagConstraints.BOTH;\r\n\t\tc.insets = new Insets(2,2,2,2); // top,left,bottom,right\r\n\t\tc.weightx = 0.1;\r\n\t\tc.gridwidth = 2;\r\n\t\tc.gridx = 0; c.gridy = 0; this.add(_window_settings_label, c);\r\n\t\tc.gridwidth=1;\r\n\r\n\t\tc.weightx = 0;\r\n\t\tc.gridx = 0; c.gridy = 1; this.add(_window_center_label, c);\r\n\t\tc.gridx = 0; c.gridy = 2; this.add(_window_width_label, c);\r\n\t\tc.gridx = 1; c.gridy = 1; this.add(_window_center_slider, c);\r\n\t\tc.gridx = 1; c.gridy = 2; this.add(_window_width_slider, c);\r\n\t\t\r\n\r\n\t}", "private void buildControls() {\n\t\tsetLayout(new FillLayout());\n\t\tSashForm child = new SashForm(this, SWT.VERTICAL);\n\t\ttable = new Table(child, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER );\n\t\ttable.addSelectionListener(createSelctionListener());\n\t\tviewer = buildAndLayoutTable(table);\n\t\taddDNDSupport(viewer);\n\t\tattachContentProvider(viewer);\n\t\tattachLabelProvider(viewer);\n\t\tsingleRating = new RatingTable(child, null, SWT.HORIZONTAL, model);\n\t\t//Zum Debuggen ist das Textfeld sehr nützlich\n\t\t//Text target = new Text(child, SWT.NONE);\n\t\t//initDropTest(target);\n\t\t//child.setWeights(new int[] {2, 1, 1});\n\t\tchild.setWeights(new int[]{2, 1});\n\t\taddFilter(viewer);\n\t\tviewer.setInput(webtrace);\n\t}", "private static void createAndShowGUI()\r\n {\r\n JFrame f = new JFrame(\"Viewer\");\r\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n f.getContentPane().setLayout(new BorderLayout());\r\n \r\n JLabel usageLabel = new JLabel(\"<html>\"\r\n + \"Right mouse drags: Translate<br> \"\r\n + \"Left mouse drags: Create selection shape<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +shift: remove from selection<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: add to selection<br>\"\r\n + \"Left mouse clicks: Select single<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: toggle single selection<br>\"\r\n + \"Mouse wheel: Zoom uniformly<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +shift: zoom along x<br>\"\r\n + \"&nbsp;&nbsp;&nbsp;&nbsp; +ctrl: zoom along y<br>\"\r\n + \"</html>\");\r\n f.getContentPane().add(usageLabel, BorderLayout.NORTH);\r\n \r\n // Create a viewer, with mouse controls where the rotation is\r\n // disabled (left clicks are intended for the selection here)\r\n Viewer viewer = new Viewer();\r\n viewer.setMouseControl(\r\n MouseControls.createDefault(viewer, false, true));\r\n \r\n // Create the selection model\r\n SelectionModel<Point2D> selectionModel = SelectionModels.create();\r\n selectionModel.addSelectionListener(\r\n new LoggingSelectionListener<Point2D>());\r\n\r\n // Create the painter for the test\r\n ViewerSelectionTestPainter viewerSelectionTestPainter = \r\n new ViewerSelectionTestPainter(selectionModel::isSelected);\r\n \r\n // The painter also serves as the point- and shape based selector.\r\n // Make this clear by assigning it to respective variables\r\n PointBasedSelector<Point2D> pointBasedSelector = \r\n viewerSelectionTestPainter;\r\n ShapeBasedSelector<Point2D> shapeBasedSelector = \r\n viewerSelectionTestPainter;\r\n\r\n // Create a selection handler for clicks, and use it to connect\r\n // the viewer and the selection model\r\n SelectionHandler<Point2D> clickSelectionHandler = \r\n SelectionHandlers.createClick(pointBasedSelector);\r\n clickSelectionHandler.connect(viewer, selectionModel);\r\n \r\n // Create a selection handler for a lasso selection, and use it to \r\n // connect the viewer and the selection model\r\n SelectionHandler<Point2D> lassoSelectionHandler = \r\n SelectionHandlers.createLasso(shapeBasedSelector);\r\n lassoSelectionHandler.connect(viewer, selectionModel);\r\n\r\n // Create a selection handler for rectangles, which can be enabled\r\n // via the config panel\r\n SelectionHandler<Point2D> rectangleSelectionHandler = \r\n SelectionHandlers.createRectangle(shapeBasedSelector);\r\n \r\n viewer.addPainter(\r\n viewerSelectionTestPainter);\r\n f.getContentPane().add(viewer, BorderLayout.CENTER);\r\n\r\n JPanel configPanel = createConfigPanel(viewer, selectionModel, \r\n lassoSelectionHandler, rectangleSelectionHandler);\r\n f.getContentPane().add(configPanel, BorderLayout.EAST);\r\n\r\n JLabel infoLabel = new JLabel(\" \");\r\n f.getContentPane().add(infoLabel, BorderLayout.SOUTH);\r\n \r\n viewer.setPreferredSize(new Dimension(500,500));\r\n f.pack();\r\n viewer.setPreferredSize(null);\r\n f.setLocationRelativeTo(null);\r\n f.setVisible(true);\r\n \r\n viewer.setDisplayedWorldArea(-0.1, -0.1, 1.2, 1.2);\r\n }", "@Override\n public void createPartControl(Composite parent) {\n errorColor = parent.getDisplay().getSystemColor(SWT.COLOR_RED);\n parent.addControlListener(new ControlListener() {\n\n @Override\n public void controlMoved(ControlEvent e) {\n //\n }\n\n @Override\n public void controlResized(ControlEvent e) {\n computeOrientation();\n }\n });\n\n GridLayout parentLayout = new GridLayout();\n parentLayout.numColumns = 1;\n parentLayout.marginBottom = -5;\n parentLayout.marginTop = -5;\n parentLayout.marginLeft = -5;\n parentLayout.marginRight = -5;\n\n parent.setLayout(parentLayout);\n\n stackComposite = new Composite(parent, SWT.NONE);\n stackComposite.setLayoutData(new GridData(GridData.FILL_BOTH));\n stackComposite.setLayout(new StackLayout());\n\n statusLineManager = new StatusLineManager();\n statusControl = statusLineManager.createControl(parent, SWT.NONE);\n statusControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n\n createTextControl();\n\n createTextContextMenu();\n\n createVerifyControl();\n\n initModes();\n\n if (modes.get(BCOConstants.F_SHOW_ANALYZER)) {\n ((StackLayout) stackComposite.getLayout()).topControl = verifyControl;\n } else {\n ((StackLayout) stackComposite.getLayout()).topControl = textControl;\n }\n\n createSelectionProvider();\n\n createToolbarActions();\n\n setEnabled(false);\n\n// activateView();\n }", "@Override\n\tpublic void createPartControl(final Composite parent) {\n\t\tgetSite().getPage().addSelectionListener(this);\n\n\t\tthis.parent = parent;\n\n\t\tparent.setLayout(new GridLayout());\n\n\t\t// Add one composite that will be visible\n\t\t// when no token is selected:\n\t\tnoData = new GridData(SWT.CENTER, SWT.CENTER, true, false);\n\t\tnoLabel = new Label(parent, SWT.NONE);\n\t\tnoLabel.setText(\"Click on a token in Gantt Chart view to see details here.\");\n\t\tnoLabel.setLayoutData(noData);\n\n\t\t// Add a second composite that will be visible when\n\t\t// a token is selected:\n\t\tyesComposite = new Composite(parent,SWT.NONE);\n\t\tyesData = new GridData(SWT.FILL, SWT.FILL, true, true);\n\t\tyesComposite.setLayoutData(yesData);\n\n\t\t// We seem to need FillLayout for ScrolledComposite to work\n\t\t// (but embed a GridLayout inside that)\n\t\tyesComposite.setLayout(new FillLayout());\n\n\t\tcreateYesComposite();\n\t}", "public void openDialogCreateVisual(){\n DataHeader[] tabHeader = dataset.getListDataHeaderDouble(true);\n TypeVisualization[] tabVis = getListTypeVisualization(tabHeader.length);\n DataHeader[] tabHeaderLabel = dataset.getListDataHeaderDouble(false);\n CreateDataVisualDialog dialog = new CreateDataVisualDialog(this, tabVis, tabHeader, tabHeaderLabel);\n dialog.setVisible(true);\n }", "private JScrollPane createInferenceHistoryOptionsPanel() {\n\n\t\tJPanel filterpanel = new JPanel();\n\t\t// filterpanel.setBackground(Color.BLUE);\n\t\tfilterpanel.setLayout(new BoxLayout(filterpanel, BoxLayout.Y_AXIS));\n\t\tfilterpanel.setBorder(new EmptyBorder(3, 10, 3, 10));\n\n\t\tJPanel panel_axiomtypecheckboxes_plus_label = createLabelledGridLayoutPanel(\"Filter Axiomtypes\",\n\t\t\t\ttypecheckboxpanel);\n\t\t// JPanel panel_group_plus_label =\n\t\t// getLabelledGridLayoutPanel(\"Grouping\", combo_group);\n\t\t// JPanel panel_renderer_plus_label =\n\t\t// getLabelledGridLayoutPanel(\"Renderer\", combo_renderer);\n\n\t\taxiomtypelist.addListSelectionListener(e -> {\n //updateConsequenceTables();\n //updateView();\n EventLogging.saveEvent(System.currentTimeMillis(), getOWLWorkspace().getSelectedTab().getId(),\n \"list_axiomtypes_selection\", \"NA\", \"wii\");\n });\n\n\t\tJPanel panel_axiomprio_plus_label = createLabelledGridLayoutPanel(\"Priority Table\",\n\t\t\t\ttable_axiom_pattern_priority);\n\n\t\ttable_axiom_pattern_priority.addMouseListener(new LoggingMouseListener(table_axiom_pattern_priority,\n\t\t\t\t\"table_axiom_pattern_priority_click\", getOWLWorkspace()));\n\n\t\tJPanel gl = new JPanel(new GridLayout(1, 2));\n\t\tgl.add(bt_entity_filter);\n\t\tgl.add(bt_entity_filter_reset);\n\t\tgl.setPreferredSize(new Dimension(0, 25));\n\t\tJPanel panel_entityfilter_plus_label = createLabelledGridLayoutPanel(\"Entity Filter\", gl);\n\n\t\t// JPanel panel_tautology_select_plus_label =\n\t\t// createTautologyCheckboxPanel(cl);\n\n\t\t// panel_axiomtypecheckboxes_plus_label.setMaximumSize(new\n\t\t// Dimension(0,10));\n\t\t// filterpanel.add(getMainLabel(\"Options\"));\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 20)));\n\t\t// filterpanel.add(fontsize_panel);\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\t// filterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\n\t\tJPanel tautologypanel = createTautologyCheckboxPanel();\n\n\t\tfilterpanel.add(panel_axiomtypecheckboxes_plus_label);\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\tfilterpanel.add(bt_axtypes_advanced);\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\tfilterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\tfilterpanel.add(tautologypanel);\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\t// filterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\t// filterpanel.add(panel_at_advanced_plus_label);\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\t// filterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\t// filterpanel.add(panel_renderer_plus_label);\n\t\t// filterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\tfilterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\tfilterpanel.add(panel_entityfilter_plus_label);\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\tfilterpanel.add(entity_select_label);\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 10)));\n\t\tfilterpanel.add(new JSeparator(SwingConstants.HORIZONTAL));\n\t\tfilterpanel.add(Box.createRigidArea(new Dimension(10, 5)));\n\t\tfilterpanel.add(panel_axiomprio_plus_label);\n\t\t// filterpanel.add(panel_tautology_select_plus_label);\n\n\t\treturn new JScrollPane(filterpanel);\n\t}", "public void MakeBar() {\n\t\tBarButton = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(GetBarChartImage())));\t\n\t\tBarButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Bar chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(BarButton);\t\n\t}", "public QDMAppliedSelectionView() {\r\n\r\n VerticalPanel verticalPanel = new VerticalPanel();\r\n HorizontalPanel mainPanel = new HorizontalPanel();\r\n mainPanel.getElement().setId(\"mainPanel_HorizontalPanel\");\r\n SimplePanel simplePanel = new SimplePanel();\r\n simplePanel.getElement().setId(\"simplePanel_SimplePanel\");\r\n simplePanel.setWidth(\"5px\");\r\n /* Horizontal Button Panel\r\n * for copy, paste and clear\r\n * */\r\n HorizontalPanel topButtonLayOut = new HorizontalPanel();\r\n copyQDMTopButton.getElement().setId(\"copyQDMTop_button\");\r\n clearQDMTopButton.getElement().setId(\"clearQDMTop_butotn\");\r\n\r\n copyQDMTopButton.getElement().setAttribute(\"tabIndex\", \"0\");\r\n clearQDMTopButton.getElement().setAttribute(\"tabIndex\", \"0\");\r\n\r\n topButtonLayOut.getElement().setId(\"topButtonLayOut_HorzPanel\");\r\n//\t\ttopButtonLayOut.add(copyQDMTopButton);\r\n//\t\ttopButtonLayOut.add(buildPasteTopPanel(checkForEnable()));\r\n//\t\ttopButtonLayOut.add(clearQDMTopButton);\r\n topButtonLayOut.setStyleName(\"continueButton\");\r\n\r\n HorizontalPanel hp = new HorizontalPanel();\r\n hp.getElement().setId(\"hp_HorizontalPanel\");\r\n hp.add(buildElementWithVSACValueSetWidget());\r\n hp.add(simplePanel);\r\n hp.add(buildElementWithVSACExpansionIdentifier());\r\n\r\n verticalPanel.getElement().setId(\"vPanel_VerticalPanel\");\r\n//\t\tverticalPanel.add(new SpacerWidget());\r\n//\t\tverticalPanel.add(successMessagePanel);\r\n//\t\tverticalPanel.add(errorMessagePanel);\r\n//\t\terrorMessagePanel.getElement().setId(\r\n//\t\t\t\t\"errorMessagePanel_ErrorMessageDisplay\");\r\n\r\n HorizontalPanel bottomButtonLayOut = new HorizontalPanel();\r\n SimplePanel pasteTopPanel = new SimplePanel();\r\n copyQDMBottomButton.getElement().setId(\"copyQDMBottom_button\");\r\n clearQDMBottomButton.getElement().setId(\"clearQDMBottom_butotn\");\r\n\r\n copyQDMBottomButton.getElement().setAttribute(\"tabIndex\", \"0\");\r\n clearQDMBottomButton.getElement().setAttribute(\"tabIndex\", \"0\");\r\n\r\n bottomButtonLayOut.getElement().setId(\"bottomButtonLayOut_HorzPanel\");\r\n pasteTopPanel.add(pasteQDMBottomButton);\r\n\r\n//\t\tbottomButtonLayOut.add(copyQDMBottomButton);\r\n//\t\tbottomButtonLayOut.add(buildPasteBottomPanel(checkForEnable()));\r\n//\t\tbottomButtonLayOut.add(clearQDMBottomButton);\r\n bottomButtonLayOut.setStyleName(\"continueButton\");\r\n HorizontalPanel hPanel = new HorizontalPanel();\r\n hPanel.getElement().setId(\"hPanel_HorizontalPanel\");\r\n hPanel.setWidth(\"930px\");\r\n//\t\thPanel.add(updateVSACButton);\r\n hPanel.add(bottomButtonLayOut);\r\n\r\n//\t\tverticalPanel.add(new SpacerWidget());\r\n//\t\tverticalPanel.add(new SpacerWidget());\r\n verticalPanel.add(hp);\r\n//\t\tverticalPanel.add(new SpacerWidget());\r\n updateVSACButton.setTitle(\"Retrieve the most recent versions of applied value sets from VSAC\");\r\n updateVSACButton.getElement().setId(\"updateVsacButton_Button\");\r\n verticalPanel.add(topButtonLayOut);\r\n verticalPanel.add(cellTablePanel);\r\n//\t\tverticalPanel.add(new SpacerWidget());\r\n verticalPanel.add(hPanel);\r\n verticalPanel.add(inProgressMessageDisplay);\r\n verticalPanel.add(updateVSACSuccessMessagePanel);\r\n verticalPanel.add(updateVSACErrorMessagePanel);\r\n\r\n mainPanel.add(verticalPanel);\r\n containerPanel.getElement().setAttribute(\"id\",\r\n \"subQDMAPPliedListContainerPanel\");\r\n containerPanel.add(mainPanel);\r\n containerPanel.setStyleName(\"qdsContentPanel\");\r\n }", "public void createControl(Composite parent) \r\n\t{\r\n\t\tComposite container = new Composite(parent, SWT.NONE);\r\n\r\n\t\tsetControl(container);\r\n\t\t\r\n\t\tSelectionAdapter listener1 = new SelectionAdapter() {\r\n\t public void widgetSelected(SelectionEvent e) {\r\n\t \t if (btnFirstOption.getSelection()){\r\n\t \t\t btnSecondOption.setSelection(false);\r\n\t \t\t btnThirdOption.setSelection(false);\r\n\t \t }\t \t \r\n\t }\r\n\t };\r\n\t SelectionAdapter listener2 = new SelectionAdapter() {\r\n\t \tpublic void widgetSelected(SelectionEvent e) {\r\n\t \t\tif (btnSecondOption.getSelection()){\r\n\t\t \t\t btnFirstOption.setSelection(false);\r\n\t\t \t }\r\n\t \t\tif (btnThirdOption.getSelection()){\r\n\t\t \t\t btnFirstOption.setSelection(false);\r\n\t\t \t } \r\n\t \t}\r\n\t };\r\n\t \r\n\t\tbtnFirstOption = new Button(container, SWT.CHECK);\r\n\t\tbtnFirstOption.setBounds(10, 10, 20, 59);\r\n\t\tbtnFirstOption.addSelectionListener(listener1);\r\n\t\t\r\n\t\tbtnSecondOption = new Button(container, SWT.CHECK | SWT.WRAP);\r\n\t\tbtnSecondOption.setBounds(10, 75, 20, 85);\r\n\t\tbtnSecondOption.addSelectionListener(listener2);\r\n\t\t\r\n\t\tbtnThirdOption = new Button(container, SWT.CHECK | SWT.WRAP);\r\n\t\tbtnThirdOption.setBounds(292, 75, 20, 85);\r\n\t\tbtnThirdOption.addSelectionListener(listener2);\r\n\t\t\r\n\t\tyesList = new List(container,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\r\n\t\tyesList.setBounds(36, 166, 224, 106);\r\n\t\t\r\n\t\tfor(Property p: hetColl.getMemberEnds())\r\n\t\t{\t\t\r\n\t\t\tType type = p.getType();\r\n\t\t\tyesList.add(getStereotype(type)+\" \"+type.getName());\t\t\t\r\n\t\t}\r\n\t\tyesList.setSelection(0);\r\n\t\t\r\n\t\tbtnArrowRight = new Button(container, SWT.NONE);\r\n\t\tbtnArrowRight.setBounds(266, 181, 40, 25);\r\n\t\tbtnArrowRight.setText(\"->\");\r\n\t\tbtnArrowRight.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\tfor(String str: yesList.getSelection()){\r\n\t\t\t\t\tif(!contains(noList,str)) { noList.add(str); noList.select(noList.indexOf(str)); } \r\n\t\t\t\t}\r\n\t\t\t\tif(yesList.getSelectionIndex()>=0) { \r\n\t\t\t\t\tint prev = yesList.getSelectionIndex()-1;\r\n\t\t\t\t\tyesList.remove(yesList.getSelectionIndex());\r\n\t\t\t\t\tyesList.select(prev); \r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnArrowLeft = new Button(container, SWT.NONE);\r\n\t\tbtnArrowLeft.setBounds(266, 212, 40, 25);\r\n\t\tbtnArrowLeft.setText(\"<-\");\r\n\t\tbtnArrowLeft.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\tfor(String str: noList.getSelection()){\r\n\t\t\t\t\tif(!contains(yesList,str)) { yesList.add(str); yesList.select(yesList.indexOf(str)); } \r\n\t\t\t\t}\r\n\t\t\t\tif(noList.getSelectionIndex()>=0) {\r\n\t\t\t\t\tint prev = noList.getSelectionIndex()-1;\r\n\t\t\t\t\tnoList.remove(noList.getSelectionIndex());\r\n\t\t\t\t\tnoList.select(prev);\t\t\t\t\t \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tnoList = new List(container, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\r\n\t\tnoList.setBounds(318, 166, 224, 106);\r\n\t\t\r\n\t\tlblFirstOption = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);\r\n\t\tlblFirstOption.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\r\n\t\tlblFirstOption.setBounds(36, 10, 506, 59);\t\t\r\n\t\tlblFirstOption.setText(hetColl.getWhole().getName()+\" is a functional complex and all partOf relations are stereotyped as «componentOf»\");\r\n\t\t\r\n\t\tlblSecondOption = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);\r\n\t\tlblSecondOption.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\r\n\t\tlblSecondOption.setBounds(36, 75, 224, 85);\r\n\t\tlblSecondOption.setText(\"New Label\");\r\n\t\tlblSecondOption.setText(\"The parts are also collectives and their respective relations are stereotyped as «subCollectionOf»\");\r\n\t\t\r\n\t\tlblThirdOption = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);\r\n\t\tlblThirdOption.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BACKGROUND));\r\n\t\tlblThirdOption.setBounds(318, 75, 224, 85);\r\n\t\tlblThirdOption.setText(\"There is a new type, named MemberPart, which is the super-type of all parts and is connected to \"+hetColl.getWhole().getName()+\" through a single «memberOf» relation. In addition, all other partOf relations are deleted.\");\r\n\t}", "public Onview() {\r\n initComponents();\r\n loadDisplayScreen();\r\n jcbX_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbX_Axis.setEnabled(false);\r\n jcbY_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbY_Axis.setEnabled(false);\r\n setResizable(false);\r\n }", "public void createBluePickHiglight() {\n\t\tbluePickHighlight = new JLabel() {\n \t\tprotected void paintComponent(Graphics g) {\n\t \t g.setColor(getBackground());\n \t \tg.fillRect(0, 0, getWidth(), getHeight());\n \t\t\tsuper.paintComponent(g);\n\t\t }\n\t\t};\n\t\tbluePickHighlight.setBackground(new Color(218, 116, 32, 120));\n\t\tleftPanel.add(bluePickHighlight, new Integer(1));\n\t\tbluePickHighlight.setBounds(18, 10, 210, 88);\n\t}", "public void createControl(Composite parent) {\n\t\tComposite comp = new Composite(parent, SWT.NONE);\r\n\t\tsetControl(comp);\r\n\r\n\t\tLaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);\r\n\r\n\t\tGridLayout topLayout = new GridLayout();\r\n\t\ttopLayout.marginHeight = 10;\r\n\t\tcomp.setLayout(topLayout);\r\n\t\t\r\n\t\tcreateTargetCommGroup(comp, 1);\r\n\t\tcreateVerticalSpacer(comp, 1);\r\n\t\tcreateTargetInfoGroup(comp, 1);\r\n\t\t\r\n\t\tLaunchUIPlugin.setDialogShell(parent.getShell());\r\n\t}", "public void createPurplePickHiglight() {\n\t\tpurplePickHighlight = new JLabel() {\n \t\tprotected void paintComponent(Graphics g) {\n\t \t g.setColor(getBackground());\n \t \tg.fillRect(0, 0, getWidth(), getHeight());\n \t\t\tsuper.paintComponent(g);\n\t\t }\n\t\t};\n\t\tpurplePickHighlight.setBackground(new Color(218, 116, 32, 120));\n\t\trightPanel.add(purplePickHighlight, new Integer(1));\n\t\tpurplePickHighlight.setBounds(45, 10, 210, 88);\n\t\tpurplePickHighlight.setVisible(false);\n\t}", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setSize(550, 400);\n\t\tshell.setText(\"Source A Antenna 1 Data\");\n\t\t\n\t\tButton btnNewButton_1 = new Button(shell, SWT.NONE);\n\t\tbtnNewButton_1.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnNewButton_1.setBounds(116, 10, 98, 30);\n\t\tbtnNewButton_1.setText(\"pol 1\");\n\t\t\n\t\tButton btnPol = new Button(shell, SWT.NONE);\n\t\tbtnPol.setText(\"pol 2\");\n\t\tbtnPol.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol.setBounds(220, 10, 98, 30);\n\t\t\n\t\tButton btnPol_1 = new Button(shell, SWT.NONE);\n\t\tbtnPol_1.setText(\"pol 3\");\n\t\tbtnPol_1.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol_1.setBounds(324, 10, 98, 30);\n\t\t\n\t\tButton btnPol_2 = new Button(shell, SWT.NONE);\n\t\tbtnPol_2.setText(\"pol 4\");\n\t\tbtnPol_2.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol_2.setBounds(428, 10, 98, 30);\n\t\t\n\t\tButton button_3 = new Button(shell, SWT.NONE);\n\t\tbutton_3.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\n\t\t\t\tPlot_graph nw = new Plot_graph();\n\t\t\t\tnw.GraphScreen();\n\t\t\t}\n\t\t});\n\t\tbutton_3.setBounds(116, 46, 98, 30);\n\t\t\n\t\tButton button_4 = new Button(shell, SWT.NONE);\n\t\tbutton_4.setBounds(116, 83, 98, 30);\n\t\t\n\t\tButton button_5 = new Button(shell, SWT.NONE);\n\t\tbutton_5.setBounds(116, 119, 98, 30);\n\t\t\n\t\tButton button_6 = new Button(shell, SWT.NONE);\n\t\tbutton_6.setBounds(116, 155, 98, 30);\n\t\t\n\t\tButton button_7 = new Button(shell, SWT.NONE);\n\t\tbutton_7.setBounds(220, 155, 98, 30);\n\t\t\n\t\tButton button_8 = new Button(shell, SWT.NONE);\n\t\tbutton_8.setBounds(220, 119, 98, 30);\n\t\t\n\t\tButton button_9 = new Button(shell, SWT.NONE);\n\t\tbutton_9.setBounds(220, 83, 98, 30);\n\t\t\n\t\tButton button_10 = new Button(shell, SWT.NONE);\n\t\tbutton_10.setBounds(220, 46, 98, 30);\n\t\t\n\t\tButton button_11 = new Button(shell, SWT.NONE);\n\t\tbutton_11.setBounds(428, 155, 98, 30);\n\t\t\n\t\tButton button_12 = new Button(shell, SWT.NONE);\n\t\tbutton_12.setBounds(428, 119, 98, 30);\n\t\t\n\t\tButton button_13 = new Button(shell, SWT.NONE);\n\t\tbutton_13.setBounds(428, 83, 98, 30);\n\t\t\n\t\tButton button_14 = new Button(shell, SWT.NONE);\n\t\tbutton_14.setBounds(428, 46, 98, 30);\n\t\t\n\t\tButton button_15 = new Button(shell, SWT.NONE);\n\t\tbutton_15.setBounds(324, 46, 98, 30);\n\t\t\n\t\tButton button_16 = new Button(shell, SWT.NONE);\n\t\tbutton_16.setBounds(324, 83, 98, 30);\n\t\t\n\t\tButton button_17 = new Button(shell, SWT.NONE);\n\t\tbutton_17.setBounds(324, 119, 98, 30);\n\t\t\n\t\tButton button_18 = new Button(shell, SWT.NONE);\n\t\tbutton_18.setBounds(324, 155, 98, 30);\n\n\t}", "public void initialization(){\r\n\t\tfinal int w = current.getBounds().width;\r\n\t\tfinal int h = current.getBounds().height;\r\n\t\tcomposite.setBounds(0, 0, w, h);\r\n\t\t\r\n\t\t/**\r\n\t\t * left side navigate\r\n\t\t */\r\n\t\tComposite composite_left = new Composite(composite, SWT.NONE);\r\n//\t\tfinal Color base = new Color(composite.getDisplay(), 255,240,245);\r\n\t\tfinal Color base = new Color(composite.getDisplay(), 0xed, 0xf4, 0xfa);//??\r\n\t\tcomposite_left.setBackground(base);\r\n//\t\tcomposite_left.setBounds(0, 0, (int)(w/5), h);\r\n\t\tcomposite_left.setBounds(0, 0, 200, h);\r\n\t\tcomposite_left.setLayout(new FillLayout());\r\n\t\tComposite comp1 = null;\r\n\t\tComposite comp2 = null;\r\n\r\n\t\t//expand bar\r\n\t\texpandBar = new ExpandBar(composite_left, SWT.V_SCROLL); \t\t\r\n\t\t\r\n\t\titem1 = new ExpandItem(expandBar, SWT.NONE);\r\n\t\titem2 = new ExpandItem(expandBar, SWT.NONE);\r\n\t\t\r\n\t\texpandBar.addExpandListener(new ExpandAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void itemExpanded(ExpandEvent e) {\r\n\t\t\t\tif(e.item == item1){\r\n\t\t\t\t\titem2.setExpanded(false);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titem1.setExpanded(false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t { \r\n\t \t //shipment expandbar\r\n\t comp1 = new Composite(expandBar, SWT.NONE); \r\n\t GridLayout gd = new GridLayout(1, false);\r\n//\t gd.marginWidth=(int)(w/5/10);\r\n\t gd.marginWidth=10;\r\n\t comp1.setLayout(gd); \r\n\t //used for spacing the controls\r\n//\t Label lbl_space2 = new Label(comp1, SWT.NONE);\r\n//\t lbl_space2.setText(\"\");\r\n//\t lbl_space2.setVisible(false);\r\n\t \r\n\t Label lbl_brand = new Label(comp1, SWT.NONE);\r\n\t lbl_brand.setText(\"品牌\");\r\n\t \r\n\t combo_brand_shipment = new CCombo(comp1, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_brand_shipment.setVisibleItemCount(5);\r\n\t combo_brand_shipment.setText(AnalyzerConstants.ALL_BRAND);\r\n\t GridData gd_combo_brand = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_brand.widthHint = 151;\r\n\t combo_brand_shipment.setLayoutData(gd_combo_brand);\r\n\t \r\n\t \r\n\t combo_sub_shipment = new CCombo(comp1, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_sub_shipment.setText(AnalyzerConstants.ALL_SUB);\r\n\t combo_sub_shipment.setVisibleItemCount(5);\r\n\t GridData gd_combo_sub_brand = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_sub_brand.widthHint = 151;\r\n\t combo_sub_shipment.setLayoutData(gd_combo_sub_brand);\r\n\t combo_sub_shipment.setEnabled(false);\r\n\t combo_sub_shipment.setVisible(false);\r\n\t \r\n\t combo_brand_shipment.addListener(SWT.MouseDown, new Listener() {\r\n\r\n\t \t\t\t@Override\r\n\t \t\t\tpublic void handleEvent(Event event) {\r\n\t \t\t\t\tList<String> list = Utils.getBrands();\r\n\t \t\t\t\tcombo_brand_shipment.setItems(list.toArray(new String[list.size()]));\r\n\t \t\t\t\tcombo_brand_shipment.add(AnalyzerConstants.ALL_BRAND);\r\n\t \t\t\t}\r\n\t });\r\n\t combo_brand_shipment.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_brand_shipment.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_brand_shipment.setText(AnalyzerConstants.ALL_BRAND);\r\n\t\t \t\t\t\t\tcombo_sub_shipment.setText(AnalyzerConstants.ALL_SUB);\r\n\t\t \t\t\t\t\tcombo_sub_shipment.setVisible(false);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_sub_shipment.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_sub_shipment.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_sub_shipment.setText(AnalyzerConstants.ALL_SUB);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_sub_shipment.addListener(SWT.MouseDown, new Listener() {\r\n\t \t\t\t@Override\r\n\t \t\t\tpublic void handleEvent(Event event) {\r\n\t \t\t\t\tString brand = combo_brand_shipment.getText();\r\n\t \t\t\t\tList<String> list = Utils.getSub_Brands(brand);\t \t\t\t\t\t\t\r\n\t \t\t\t\tcombo_sub_shipment.setItems(list.toArray(new String[list.size()]));\r\n\t \t\t\t\tcombo_sub_shipment.add(AnalyzerConstants.ALL_SUB);\r\n\t \t\t\t}\r\n\t });\r\n\t combo_brand_shipment.addSelectionListener(new SelectionAdapter() {\r\n\t\t \t@Override\r\n\t\t \tpublic void widgetSelected(SelectionEvent e) {\r\n//\t\t \t\tcombo_subbrand.clearSelection();\r\n\t\t \t\tif(!combo_brand_shipment.getText().equals(AnalyzerConstants.ALL_BRAND)){\r\n\t\t \t\t\tcombo_sub_shipment.deselectAll();\r\n\t\t \t\t\tcombo_sub_shipment.setEnabled(true);\r\n\t\t \t\t\tcombo_sub_shipment.setVisible(true);\r\n\t\t \t\t\tcombo_sub_shipment.setText(AnalyzerConstants.ALL_SUB);\r\n\t\t \t\t}else{\r\n\t\t \t\t\tcombo_sub_shipment.setVisible(false);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t });\r\n\t \r\n\t Label lbl_space = new Label(comp1, SWT.NONE);\r\n\t lbl_space.setText(\"\");\r\n\t lbl_space.setVisible(false);\r\n\t \r\n\t Label lbl_area = new Label(comp1, SWT.NONE);\r\n\t lbl_area.setText(\"片区/客户\");\r\n\t \r\n\t combo_area_shipment = new CCombo(comp1, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_area_shipment.setVisibleItemCount(5);\r\n\t combo_area_shipment.setText(AnalyzerConstants.ALL_AREA);\r\n\t GridData gd_combo_area = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_area.widthHint = 151;\r\n\t combo_area_shipment.setLayoutData(gd_combo_area);\r\n\t \r\n\t combo_cus_shipment = new CCombo(comp1, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_cus_shipment.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t combo_cus_shipment.setVisible(false);\r\n\t combo_cus_shipment.setVisibleItemCount(5);\r\n\t GridData gd_combo_customer = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_customer.widthHint = 151;\r\n\t combo_cus_shipment.setLayoutData(gd_combo_customer);\r\n\t combo_cus_shipment.setEnabled(false);\r\n\t \r\n\t combo_area_shipment.addListener(SWT.MouseDown, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tcombo_area_shipment.setItems(DataCachePool.getCustomerAreas());\t\r\n\t\t \t\t\t\tcombo_area_shipment.add(AnalyzerConstants.ALL_AREA);\r\n\t\t \t\t\t}\r\n\t\t });\t \r\n\t combo_area_shipment.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_area_shipment.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_area_shipment.setText(AnalyzerConstants.ALL_AREA);\r\n\t\t \t\t\t\t\tcombo_cus_shipment.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t\t\tcombo_cus_shipment.setVisible(false);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_cus_shipment.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_cus_shipment.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_cus_shipment.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_cus_shipment.addListener(SWT.MouseDown, new Listener() {\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tString area = combo_area_shipment.getText();\r\n//\t\t\t\t\t\tSystem.out.println(\"area: \"+area);\r\n\t\t\t\t\t\tString[] names = DataCachePool.getCustomerNames(area);\r\n\t\t\t\t\t\tif(names.length != 0){//no such areas\r\n\t\t\t\t\t\t\tcombo_cus_shipment.setItems(names);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcombo_sub_shipment.add(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t\t \r\n\t combo_area_shipment.addSelectionListener(new SelectionAdapter() {\r\n\t\t \t@Override\r\n\t\t \tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t \t\tif(!combo_area_shipment.getText().equals(AnalyzerConstants.ALL_AREA)){\r\n\t\t \t\tcombo_cus_shipment.deselectAll();\r\n\t\t \t\tcombo_cus_shipment.setEnabled(true);\r\n\t\t \t\tcombo_cus_shipment.setVisible(true);\r\n\t\t \t\tcombo_cus_shipment.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t}else{\r\n\t\t \t\t\tcombo_cus_shipment.setVisible(false);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t });\r\n\t \r\n//\t item1 = new ExpandItem(expandBar, SWT.NONE); \r\n\t item1.setText(\"出货量分析\"); \r\n\t item1.setExpanded(true);\r\n\t item1.setHeight((int)(h/3));// 设置Item的高度 \r\n\t comp1.setBackground(new Color(composite.getDisplay(), 240,255,255));\r\n\t item1.setControl(comp1);// setControl方法控制comp1的显现 \t \t \r\n\t } \r\n\t { \r\n\t \t //the profit expandbar\r\n\t comp2 = new Composite(expandBar, SWT.NONE); \r\n\t GridLayout gd = new GridLayout(1, false);\r\n//\t gd.marginWidth=(int)(w/5/10);\r\n\t gd.marginWidth=10;\r\n\t comp2.setLayout(gd); \r\n\r\n//\t Label lbl_space2 = new Label(comp2, SWT.NONE);\r\n//\t lbl_space2.setText(\"\");\r\n//\t lbl_space2.setVisible(false);\r\n\t \r\n\t Label lbl_brand = new Label(comp2, SWT.NONE);\r\n\t lbl_brand.setText(\"品牌\");\r\n\t \r\n\t combo_brand_profit = new CCombo(comp2, SWT.BORDER|SWT.READ_ONLY);\r\n\t GridData gd_combo_brand = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_brand.widthHint = 151;\r\n\t combo_brand_profit.setText(AnalyzerConstants.ALL_BRAND);\r\n\t combo_brand_profit.setLayoutData(gd_combo_brand);\r\n\t \r\n\t combo_sub_profit = new CCombo(comp2, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_sub_profit.setText(AnalyzerConstants.ALL_SUB);\r\n\t combo_sub_profit.setVisible(false);\r\n\t GridData gd_combo_sub_brand = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_sub_brand.widthHint = 151;\r\n\t combo_sub_profit.setLayoutData(gd_combo_sub_brand);\r\n\t \r\n\t combo_brand_profit.addListener(SWT.MouseDown, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tList<String> list = Utils.getBrands();\r\n\t\t \t\t\t\tcombo_brand_profit.setItems(list.toArray(new String[list.size()]));\r\n\t\t \t\t\t\tcombo_brand_profit.add(AnalyzerConstants.ALL_BRAND);\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_brand_profit.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t\t \t\t\t@Override\r\n\t\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t\t \t\t\t\tif(combo_brand_profit.getText().equals(\"\")){\r\n\t\t\t \t\t\t\t\tcombo_brand_profit.setText(AnalyzerConstants.ALL_BRAND);\r\n\t\t\t \t\t\t\t\tcombo_sub_profit.setText(AnalyzerConstants.ALL_SUB);\r\n\t\t\t \t\t\t\t\tcombo_sub_profit.setVisible(false);\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\t\t });\r\n\t combo_sub_profit.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t\t \t\t\t@Override\r\n\t\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t\t \t\t\t\tif(combo_sub_profit.getText().equals(\"\")){\r\n\t\t\t \t\t\t\t\tcombo_sub_profit.setText(AnalyzerConstants.ALL_SUB);\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\t\t });\r\n\t combo_sub_profit.addListener(SWT.MouseDown, new Listener() {\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tString brand = combo_brand_profit.getText();\r\n\t\t \t\t\t\tList<String> list = Utils.getSub_Brands(brand);\t \t\t\t\t\t\t\r\n\t\t \t\t\t\tcombo_sub_profit.setItems(list.toArray(new String[list.size()]));\r\n\t\t \t\t\t\tcombo_sub_profit.add(AnalyzerConstants.ALL_SUB);\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_brand_profit.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t \t@Override\r\n\t\t\t \tpublic void widgetSelected(SelectionEvent e) {\r\n//\t\t\t \t\tcombo_subbrand.clearSelection();\r\n\t\t\t \t\tif(!combo_brand_profit.getText().equals(AnalyzerConstants.ALL_BRAND)){\r\n\t\t\t \t\t\tcombo_sub_profit.deselectAll();\r\n\t\t\t \t\t\tcombo_sub_profit.setEnabled(true);\r\n\t\t\t \t\t\tcombo_sub_profit.setVisible(true);\r\n\t\t\t \t\t\tcombo_sub_profit.setText(AnalyzerConstants.ALL_SUB);\r\n\t\t\t \t\t}else{\r\n\t\t\t \t\t\tcombo_sub_profit.setVisible(false);\r\n\t\t\t \t\t}\r\n\t\t\t \t}\r\n\t\t\t });\r\n\t\t \r\n\t Label lbl_space = new Label(comp2, SWT.NONE);\r\n\t lbl_space.setText(\"\");\r\n\t lbl_space.setVisible(false);\r\n\t \r\n\t Label lbl_area = new Label(comp2, SWT.NONE);\r\n\t lbl_area.setText(\"片区/客户\");\r\n\t \r\n\t combo_area_profit = new CCombo(comp2, SWT.BORDER|SWT.READ_ONLY);\r\n\t GridData gd_combo_area = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_area.widthHint = 151;\r\n\t combo_area_profit.setText(AnalyzerConstants.ALL_AREA);\r\n\t combo_area_profit.setLayoutData(gd_combo_area);\r\n\t \r\n\t combo_cus_profit = new CCombo(comp2, SWT.BORDER|SWT.READ_ONLY);\r\n\t combo_cus_profit.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t combo_cus_profit.setVisible(false);\r\n\t GridData gd_combo_customer = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t gd_combo_customer.widthHint = 151;\r\n\t combo_cus_profit.setLayoutData(gd_combo_customer);\r\n\t \r\n\t combo_area_profit.addListener(SWT.MouseDown, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tcombo_area_profit.setItems(DataCachePool.getCustomerAreas());\t\r\n\t\t \t\t\t\tcombo_area_profit.add(AnalyzerConstants.ALL_AREA);\r\n\t\t \t\t\t}\r\n\t\t });\t \r\n\t combo_area_profit.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_area_profit.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_area_profit.setText(AnalyzerConstants.ALL_AREA);\r\n\t\t \t\t\t\t\tcombo_cus_profit.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t\t\tcombo_cus_profit.setVisible(false);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_cus_profit.addListener(SWT.MouseUp, new Listener() {\r\n\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tif(combo_cus_profit.getText().equals(\"\")){\r\n\t\t \t\t\t\t\tcombo_cus_profit.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t\t}\t\t \t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t combo_cus_profit.addListener(SWT.MouseDown, new Listener() {\r\n\t\t \t\t\t@Override\r\n\t\t \t\t\tpublic void handleEvent(Event event) {\r\n\t\t \t\t\t\tString area = combo_area_profit.getText();\r\n//\t\t\t\t\t\tSystem.out.println(\"area: \"+area);\r\n\t\t\t\t\t\tString[] names = DataCachePool.getCustomerNames(area);\r\n\t\t\t\t\t\tif(names.length != 0){//no such areas\r\n\t\t\t\t\t\t\tcombo_cus_profit.setItems(names);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcombo_cus_profit.add(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t\t}\r\n\t\t });\r\n\t\t \r\n\t combo_area_profit.addSelectionListener(new SelectionAdapter() {\r\n\t\t \t@Override\r\n\t\t \tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t \t\tif(!combo_area_profit.getText().equals(AnalyzerConstants.ALL_AREA)){\r\n\t\t \t\t\tcombo_cus_profit.deselectAll();\r\n\t\t \t\t\tcombo_cus_profit.setEnabled(true);\r\n\t\t \t\t\tcombo_cus_profit.setVisible(true);\r\n\t\t \t\t\tcombo_cus_profit.setText(AnalyzerConstants.ALL_CUSTOMER);\r\n\t\t \t\t}else{\r\n\t\t \t\t\tcombo_cus_profit.setVisible(false);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t });\r\n \t \r\n//\t item2 = new ExpandItem(expandBar, SWT.NONE); \r\n\t \r\n\t item2.setText(\"利润分析\"); \t \r\n\t item2.setHeight((int)(h/3));// 设置Item的高度 \r\n\t comp2.setBackground(new Color(composite.getDisplay(), 240,255,255));\r\n\t item2.setControl(comp2);// setControl方法控制comp1的显现 \r\n\t } \r\n\t expandBar.setBackground(new Color(composite.getDisplay(), 204,255,204));\r\n\t composite_left.layout();\r\n \r\n\t \r\n\t\t//=============================================================================================\r\n\r\n\t /**\r\n\t * right part to show the analyzed result\t\r\n\t */\r\n\t //right part base compoiste\r\n\t\tComposite composite_right = new Composite(composite, SWT.NONE);\r\n\t\tcomposite_right.setBackground(new Color(composite.getDisplay(), 255, 250, 250));\r\n//\t\tcomposite_right.setBounds((int)(w/5), 0, (int)(4*w/5), h);\r\n\t\tcomposite_right.setBounds(200, 0, 760, h);\r\n\t\t\r\n\t\t//text area to show the tips\r\n\t\tstyledText = new StyledText(composite_right, SWT.BORDER|SWT.WRAP);\r\n\t\tstyledText.setEditable(false);\r\n\t\tstyledText.setBounds((int)(4*w/5/50), (int)(4*w/5/50), (int)(6*w/5/4), (int)(h/10));\r\n\t\tstyledText.setText(\"\");//\"五得利最近一个月出货量\\n\"+\"总计:15000包\"\r\n//\t\tStyleRange styleRange = new StyleRange();\r\n//\t\tstyleRange.start = 0;\r\n//\t\tstyleRange.length = \"五得利最近一个月出货量\".length();\r\n//\t\tstyleRange.fontStyle = SWT.BOLD;\r\n//\t\tstyledText.setStyleRange(styleRange);\r\n\t\t\r\n\t\t/**\r\n\t\t * the group buttons, showing the for kind of classification\r\n\t\t */\r\n\t\tComposite composite_group = new Composite(composite_right, SWT.NONE);\r\n\t\tcomposite_group.setBounds((int)(2*4*w/5/3), (int)(2*4*w/5/50/3), (int)(4*w/5/3-h/30), (int)(h/18));\r\n\t\tGridLayout layout = new GridLayout(4, true); \r\n\t\t//put the four button\r\n layout.numColumns = 4; \r\n layout.horizontalSpacing = 0;\r\n layout.verticalSpacing = 0;\r\n layout.marginHeight = 0;\r\n layout.marginWidth = 0;\r\n composite_group.setLayout(layout);\r\n \r\n GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n\t\tgd_text.heightHint = (int)(h/18);\r\n Button btn_month = new Button(composite_group, SWT.NONE); \r\n btn_month.setText(\"一个月\");\r\n btn_month.setLayoutData(gd_text);\r\n\r\n\t\t\r\n GridData gd_text2 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n gd_text2.heightHint = (int)(h/18);\r\n Button btn_season = new Button(composite_group, SWT.NONE);\r\n btn_season.setText(\"一个季度\");\r\n btn_season.setLayoutData(gd_text2);\r\n \r\n GridData gd_text3 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n gd_text3.heightHint = (int)(h/18);\r\n Button btn_year = new Button(composite_group, SWT.NONE);\r\n btn_year.setText(\"一年\");\r\n btn_year.setLayoutData(gd_text3);\r\n\r\n \r\n GridData gd_text4 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);\r\n gd_text4.heightHint = (int)(h/18);\r\n Button btn_all = new Button(composite_group, SWT.NONE);\r\n btn_all.setText(\"全部记录\");\r\n btn_all.setLayoutData(gd_text4); \r\n composite_group.layout();\r\n\r\n /**\r\n * the scroll composite to show the analyzed table result and graph\r\n */\r\n final Composite composite_main = new Composite(composite_right, SWT.NONE);\r\n// composite_main.setBounds(0, (int)(h/8+h/100), (int)(4*w/5), (int)(7*h/8-h/100));\r\n composite_main.setBounds(0, (int)(h/8+h/100), 740, (int)(7*h/8-h/100));\r\n \r\n composite_main.setBackground(new Color(composite.getDisplay(), 255,250,250));\r\n composite_main.setLayout(new FillLayout());\r\n composite_scroll = new ScrolledComposite(composite_main, SWT.NONE|SWT.V_SCROLL);//\r\n//\t\tcomposite_scroll.setVisible(true);\r\n\t\tcomposite_scroll.setExpandHorizontal(true); \r\n\t\tcomposite_scroll.setExpandVertical(true); \r\n\t\tcomposite_scroll.addListener(SWT.Activate, new Listener(){ \r\n\t\t\tpublic void handleEvent(Event e){\r\n\t\t\t\t//need to forceFocus\r\n\t\t\t\tcomposite_scroll.forceFocus();\r\n\t\t\t\t}\r\n\t\t}); \r\n\t\tcomposite_content = new Composite(composite_scroll, SWT.NONE);\r\n\t\tcomposite_scroll.setContent(composite_content);\r\n\t\tcomposite_content.setBackground(new Color(composite.getDisplay(), 255,240,245));\r\n\t\tlayout_content = new GridLayout(1, false); \r\n\t\tlayout_content.numColumns = 1; \r\n\t\tlayout_content.horizontalSpacing = 0;\r\n\t\tlayout_content.verticalSpacing = 0;\r\n\t\tlayout_content.marginHeight = 0;//not recommended\r\n\t\tlayout_content.marginWidth = 10;\r\n composite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n /**\r\n * add the button listener for the classification\r\n */\r\n btn_month.addSelectionListener(new SelectionAdapter() {\r\n \t@Override\r\n \tpublic void widgetSelected(SelectionEvent e) {\r\n \t\t\r\n \t\tinitialTitle(TYPE.MONTH);\r\n \t\tfor(int i=0;i<alys.size();i++){\r\n \t\t\tComposite c = (Composite)alys.get(i);\r\n \t\t\tc.dispose();\r\n \t\t}\r\n \t\talys.clear();\r\n \t\tshowResult(TYPE.MONTH);\r\n \t}\r\n });\r\n \r\n btn_season.addSelectionListener(new SelectionAdapter() {\r\n \t@Override\r\n \tpublic void widgetSelected(SelectionEvent e) {\r\n \t\tinitialTitle(TYPE.SEASON);\r\n \t\tfor(int i=0;i<alys.size();i++){\r\n \t\t\tComposite c = (Composite)alys.get(i);\r\n \t\t\tc.dispose();\r\n \t\t}\r\n \t\talys.clear();\r\n \t\tshowResult(TYPE.SEASON);\r\n \t}\r\n });\r\n btn_year.addSelectionListener(new SelectionAdapter() {\r\n \t@Override\r\n \tpublic void widgetSelected(SelectionEvent e) {\r\n \t\tinitialTitle(TYPE.YEAR);\r\n \t\tfor(int i=0;i<alys.size();i++){\r\n \t\t\tComposite c = (Composite)alys.get(i);\r\n \t\t\tc.dispose();\r\n \t\t}\r\n \t\talys.clear();\r\n \t\tshowResult(TYPE.YEAR);\r\n \t}\r\n });\r\n \r\n btn_all.addSelectionListener(new SelectionAdapter() {\r\n \t@Override\r\n \tpublic void widgetSelected(SelectionEvent e) {\r\n \t\tinitialTitle(TYPE.ALL);\r\n \t\tfor(int i=0;i<alys.size();i++){\r\n \t\t\tComposite c = (Composite)alys.get(i);\r\n \t\t\tc.dispose();\r\n \t\t}\r\n \t\talys.clear();\r\n \t\tshowResult(TYPE.ALL);\r\n \t}\r\n });\r\n composite_main.layout();\r\n composite_content.layout();\r\n// composite_scroll.layout();\r\n \r\n\t\ttry {\r\n\t\t\tDataCachePool.cacheProductInfo();\r\n\t\t\t DataCachePool.cacheCustomerInfo();\r\n\t\t} catch (Exception e1) {\r\n\t\t\tMessageBox mbox = new MessageBox(MainUI.getMainUI_Instance(Display.getDefault()));\r\n\t\t\tmbox.setMessage(\"连接数据库异常\");\r\n\t\t\tmbox.open();\r\n\t\t}\r\n \r\n\r\n\t}", "protected void createControl() {\n\t\tGridLayout layout = new GridLayout(1, true);\n\t\tsetLayout(layout);\n\t\tsetLayoutData(new GridData(GridData.FILL_BOTH));\n\n\t\tComposite nameGroup = new Composite(this, SWT.NONE);\n\t\tlayout = new GridLayout();\n\t\tlayout.numColumns = 2;\n\t\tnameGroup.setLayout(layout);\n\t\tnameGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n\n\t\tLabel label = new Label(nameGroup, SWT.NONE);\n\t\tlabel.setText(PHPServerUIMessages\n\t\t\t\t.getString(\"ServerCompositeFragment.nameLabel\")); //$NON-NLS-1$\n\t\tGridData data = new GridData();\n\t\tlabel.setLayoutData(data);\n\n\t\tname = new Text(nameGroup, SWT.BORDER);\n\t\tdata = new GridData(GridData.FILL_HORIZONTAL);\n\t\tname.setLayoutData(data);\n\t\tname.addModifyListener(new ModifyListener() {\n\t\t\tpublic void modifyText(ModifyEvent e) {\n\t\t\t\tif (getServer() != null)\n\t\t\t\t\tmodifiedValuesCache.serverName = name.getText();\n\t\t\t\tvalidate();\n\t\t\t}\n\t\t});\n\t\tcreateURLGroup(this);\n\t\tinit();\n\t\tvalidate();\n\n\t\tDialog.applyDialogFont(this);\n\n\t\tname.forceFocus();\n\t}", "public ImageDataSetVisualPanel3() {\n initComponents();\n fillComboBox();\n }", "public jHistorialSeleccionarVoluntario() {\n initComponents();\n \n \n }", "private void initUI() {\r\n\t\t//Äußeres Panel\r\n\t\tContainer pane = getContentPane();\r\n\t\tGroupLayout gl = new GroupLayout(pane);\r\n\t\tpane.setLayout(gl);\r\n\t\t//Abstende von den Containern und dem äußeren Rand\r\n\t\tgl.setAutoCreateContainerGaps(true);\r\n\t\tgl.setAutoCreateGaps(true);\r\n\t\t//TextFeld für die Ausgabe\r\n\t\tJTextField output = view.getTextField();\r\n\t\t//Die jeweiligen Panels für die jeweiigen Buttons\r\n\t\tJPanel brackets = view.getBracketPanel();\r\n\t\tJPanel remove = view.getTop2Panel();\r\n\t\tJPanel numbers = view.getNumbersPanel();\r\n\t\tJPanel last = view.getBottomPanel();\r\n\t\t//Anordnung der jeweiligen Panels durch den Layout Manager\r\n\t\tgl.setHorizontalGroup(gl.createParallelGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tgl.setVerticalGroup(gl.createSequentialGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tpack();\r\n\t\tsetTitle(\"Basic - Taschenrechner\");\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t}", "@Override\n\tpublic void createPartControl(Composite parent) {\n\t\tTree tree = new Tree(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); //create a tree \n\t\ttree.setHeaderVisible(true);//show header in interface\n\t\ttree.setLinesVisible(true); //show lines in interface\n\t\tviewer = new TreeViewer(tree);\n\n\t\t//first column\n\t\tTreeColumn column1 = new TreeColumn(tree, SWT.LEFT);\n\t\tcolumn1.setText(\"Project\");\n\t\tcolumn1.setWidth(500);\n\n\t\t//second column\n\t\tTreeColumn column2 = new TreeColumn(tree, SWT.LEFT);\n\t\tcolumn2.setText(\"DUAs Coverage\");\n\t\tcolumn2.setWidth(200);\n\n\t\tlong start = System.currentTimeMillis();\n\t\t\n\t\tviewer.setContentProvider(new CoverageContentProvider());\n\t\tviewer.setLabelProvider(new CoverageLabelProvider());\n\t\tviewer.setInput(new CoverageInput());\t\t// provide the input to the ContentProvider\n\t\tlogger.info(\"Time to show view: \" + (System.currentTimeMillis() - start) / 1000.0);\n\t\t\n\t\t//change selection event\n\t\tviewer.addSelectionChangedListener(new ISelectionChangedListener() {\n\n\t\t\t@Override\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\n\t\t\t\tIStructuredSelection thisSelection = (IStructuredSelection) event.getSelection();\n\t\t\t\tObject selectedNode = thisSelection.getFirstElement();\n\t\t\t\t\n\t\t\t\tif(selectedNode instanceof TreeDua){\n\t\t\t\t\tfinal ICompilationUnit cu = ((TreeDua) selectedNode).getCompilationUnit();\n\t\t\t\t\ttry {\n\t\t\t\t\t\t//remove old markers\n\t\t\t\t\t\tCodeMarkerFactory.removeMarkers(CodeMarkerFactory.findMarkers(cu.getUnderlyingResource()));\n\t\t\t\t\t\t//get the first and last char of definition line to draw\n\t\t\t\t\t\tint[] defOffset = parserLine(cu.getSource(),((TreeDua) selectedNode).getDef());\n\t\t\t\t\t\t//get the first and last char of c-use line to draw\n\t\t\t\t\t\tint[] useOffset = parserLine(cu.getSource(), ((TreeDua) selectedNode).getUse());\n\t\t\t\t\t\t//get the first and last char of target line to draw\n\t\t\t\t\t\tint[] targetOffset = null;\n\t\t\t\t\t\tif(((TreeDua) selectedNode).getTarget() != 1){\n\t\t\t\t\t\t\ttargetOffset = parserLine(cu.getSource(),((TreeDua) selectedNode).getTarget());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//create new markers based on selected DUA\n\t\t\t\t\t\tfinal TreeDua dua = (TreeDua) selectedNode;\n\t\t\t\t\t\tfinal String covered = dua.isCovered()? \"true\" : \"false\";\n\t\t\t\t\t\tCodeMarkerFactory.mark(cu.getUnderlyingResource(), defOffset, useOffset, targetOffset, covered);\n\t\t\t\t\t\tsetFocus();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\t//double click event to expand state\n\t\tviewer.addDoubleClickListener(new IDoubleClickListener() {\n\t\t\t@Override\n\t\t\tpublic void doubleClick(DoubleClickEvent event) {\n\t\t\t\tTreeViewer viewer = (TreeViewer) event.getViewer();\n\t\t\t\tIStructuredSelection thisSelection = (IStructuredSelection) event\n\t\t\t\t\t\t.getSelection();\n\t\t\t\tObject selectedNode = thisSelection.getFirstElement();\n\n\t\t\t\tif(selectedNode instanceof TreeMethod \n\t\t\t\t\t\t|| selectedNode instanceof TreeClass \n\t\t\t\t\t\t|| selectedNode instanceof TreePackage \n//\t\t\t\t\t\t|| selectedNode instanceof TreeFolder \n\t\t\t\t\t\t|| selectedNode instanceof TreeProject){\n\n\t\t\t\t\tviewer.setExpandedState(selectedNode,\n\t\t\t\t\t\t\t!viewer.getExpandedState(selectedNode));\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\t\n\t\t//Listener to closing view in workbench shutdown\n\t\tPlatformUI.getWorkbench().addWorkbenchListener(new IWorkbenchListener() {\n\t\t\t@Override\n\t\t\tpublic boolean preShutdown(IWorkbench workbench, boolean forced) {\n\t\t\t\tcloseViews();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void postShutdown(IWorkbench workbench) {\n\t\t\t}\n\t\t});\n\n\t}", "private void createViewerArea(Composite top) {\n Group viewerComp = new Group(top, SWT.SHADOW_IN);\n viewerComp.setText(\"PSH Viewer\");\n GridLayout viewerLayout = new GridLayout(1, false);\n viewerLayout.marginWidth = 15;\n viewerLayout.marginTop = 15;\n viewerLayout.marginBottom = 16;\n viewerComp.setLayout(viewerLayout);\n viewerComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\n\n previewText = new Text(viewerComp,\n SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);\n GridData textData = new GridData(SWT.FILL, SWT.FILL, true, true);\n\n textData.widthHint = PshUtil.getProductWidth(previewText, productFont);\n\n previewText.setLayoutData(textData);\n previewText.setEditable(false);\n previewText.setBackground(\n top.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));\n previewText.setForeground(\n top.getDisplay().getSystemColor(SWT.COLOR_WHITE));\n previewText.setFont(productFont);\n textData.heightHint = previewText.getLineHeight() * 30;\n previewText.setText(previewProduct);\n }", "private void addComponentsToOptionsPanel(){\r\n\t\tBox box = Box.createVerticalBox();\r\n\t\tbox.add(new JLabel(\"Active Feature Type\",SwingConstants.LEFT));\r\n\t\tJPanel featuresPanel = new JPanel(new GridLayout(2, 2));\r\n\t\tfeaturesPanel.setBorder(BorderFactory.createLineBorder (Color.black, 1));\r\n\t\tfeaturesPanel.add(asCB);\r\n\t\tfeaturesPanel.add(new JLabel(\"\"));\r\n\t\tfeaturesPanel.add(bldngCB);\r\n\t\tfeaturesPanel.add(stuCB);\r\n\t\tbox.add(featuresPanel);\r\n\r\n\t\t//creating empty space\r\n\t\tbox.add(new JPanel());\r\n\t\t\r\n\t\tJLabel queryLabel = new JLabel(\"Query\",SwingConstants.LEFT);\r\n\t\tbox.add(queryLabel);\r\n\t\tJPanel queriesRB = new JPanel();\r\n\t\tqueriesRB.setLayout(new BoxLayout(queriesRB, BoxLayout.Y_AXIS));\r\n\t\tbuttonGroup = new ButtonGroup();\r\n\t\twholeRegion = new JRadioButton(\"Whole Region\");\r\n\t\twholeRegion.addItemListener(new ItemListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent arg0) {\r\n\t\t\t\tgetQuery().setSubmitFlag(false);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tpointQuery = new JRadioButton(\"Point Query\");\r\n\t\tpointQuery.addItemListener(new ItemListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent ie) {\r\n\t\t\t\tgetQuery().setSubmitFlag(false);\r\n\t\t\t\tif(ie.getStateChange() == ItemEvent.SELECTED){\r\n\t\t\t\t\tpointQuery.setSelected(true);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(\"Point Query\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpointQuery.setSelected(false);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(null);\r\n\t\t\t\t\tsetPqX(-300);\r\n\t\t\t\t\tsetPqY(-300);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\timagePanel.repaint();\r\n\t\t\t}\r\n\t\t});\r\n\t\trangeQuery = new JRadioButton(\"Range Query\");\r\n\t\trangeQuery.addItemListener(new ItemListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent ie) {\r\n\t\t\t\tgetQuery().setSubmitFlag(false);\r\n\t\t\t\tif(ie.getStateChange() == ItemEvent.SELECTED){\r\n\t\t\t\t\trangeQuery.setSelected(true);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(\"Range Query\");\r\n\t\t\t\t\tsetDrawPoly(true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\trangeQuery.setSelected(false);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(null);\r\n\t\t\t\t\tgetPath().clear();\r\n\t\t\t\t}\r\n\t\t\t\timagePanel.repaint();\r\n\t\t\t}\r\n\t\t});\r\n\t\tsurrStudent = new JRadioButton(\"Surrounding Student\");\r\n\t\tsurrStudent.addItemListener(new ItemListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent ie) {\r\n\t\t\t\tgetQuery().setSubmitFlag(false);\r\n\t\t\t\tif(ie.getStateChange() == ItemEvent.SELECTED){\r\n\t\t\t\t\tsurrStudent.setSelected(true);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(\"Surrounding Student\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tsurrStudent.setSelected(false);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(null);\r\n\t\t\t\t}\r\n\t\t\t\timagePanel.repaint();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\temerQuery = new JRadioButton(\"Emergency Query\");\r\n\t\temerQuery.addItemListener(new ItemListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent ie) {\r\n\t\t\t\tgetQuery().setSubmitFlag(false);\r\n\t\t\t\tif(ie.getStateChange() == ItemEvent.SELECTED){\r\n\t\t\t\t\temerQuery.setSelected(true);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(\"Emergency Query\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\temerQuery.setSelected(false);\r\n\t\t\t\t\tgetQuery().setSelectedQuery(null);\r\n\t\t\t\t}\r\n\t\t\t\timagePanel.repaint();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tbuttonGroup.add(wholeRegion);\r\n\t\tbuttonGroup.add(pointQuery);\r\n\t\tbuttonGroup.add(rangeQuery);\r\n\t\tbuttonGroup.add(surrStudent);\r\n\t\tbuttonGroup.add(emerQuery);\r\n\t\tqueriesRB.add(wholeRegion);\r\n\t\tqueriesRB.add(pointQuery);\r\n\t\tqueriesRB.add(rangeQuery);\r\n\t\tqueriesRB.add(surrStudent);\r\n\t\tqueriesRB.add(emerQuery);\r\n\t\tqueriesRB.setBorder(BorderFactory.createLineBorder (Color.black, 1));\r\n\t\tbox.add(queriesRB);\r\n\t\t//creating empty space\r\n\t\tbox.add(new JPanel());\r\n\t\tJPanel buttonPanel = new JPanel();\r\n\t\tbuttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));\r\n\t\tsubmitButton = new JButton(\"Submit Query\");\r\n\t\tsubmitButton.addActionListener(new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\r\n\t\t\t\tQuery query = new Query();\r\n\t\t\t\tquery.setAsFlag(asCB.isSelected());\r\n\t\t\t\tquery.setBuildingFlag(bldngCB.isSelected());\r\n\t\t\t\tquery.setStudentFlag(stuCB.isSelected());\r\n\t\t\t\tquery.setSubmitFlag(true);\r\n\t\t\t\tfor(Enumeration<AbstractButton> radButtons = buttonGroup.getElements(); radButtons.hasMoreElements();){\r\n\t\t\t\t\tAbstractButton ab = radButtons.nextElement();\r\n\t\t\t\t\tif(ab.isSelected()){\r\n\t\t\t\t\t\tquery.setSelectedQuery(ab.getText());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tsetQuery(query);\r\n\t\t\t\timagePanel.repaint();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonPanel.add(submitButton);\r\n\t\tbuttonPanel.setBorder(BorderFactory.createLineBorder (Color.black, 1));\r\n\t\tbox.add(buttonPanel);\r\n\t\toptionsPanel.add(box);\r\n\t}", "private void setUpGui() {\n \n // make sure that the scroll panes are see-through\n qualityFiltersTableScrollPane.getViewport().setOpaque(false);\n\n // disable column reordering\n qualityFiltersTable.getTableHeader().setReorderingAllowed(false);\n\n // set the validation combo box\n validationLevelJComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));\n validationLevelJComboBox.setEditable(false);\n\n // set up the table header tooltips\n validationTableToolTips = new ArrayList<>(3);\n validationTableToolTips.add(null);\n validationTableToolTips.add(\"Quality Test\");\n validationTableToolTips.add(\"Passed\");\n }", "@Override\n\tprotected void addToControl(Composite control) {\n\t\t\n\t}", "public void createControl(Composite parent) {\n Group group = SWTFactory.createGroup(parent, PDEUIMessages.ProfileBlock_0, 1, 1, GridData.FILL_HORIZONTAL);\n fGenerateProfileButton = SWTFactory.createCheckButton(group, PDEUIMessages.ProfileBlock_1, null, false, 1);\n fGenerateProfileButton.addSelectionListener(new SelectionAdapter() {\n\n @Override\n public void widgetSelected(SelectionEvent e) {\n fTab.updateLaunchConfigurationDialog();\n }\n });\n }", "public void createUI() {\r\n\t\ttry {\r\n\t\t\tJPanel centerPanel = this.createCenterPane();\r\n\t\t\tJPanel westPanel = this.createWestPanel();\r\n\t\t\tm_XONContentPane.add(westPanel, BorderLayout.WEST);\r\n\t\t\tm_XONContentPane.add(centerPanel, BorderLayout.CENTER);\r\n\t\t\tm_XONContentPane.revalidate();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tRGPTLogger.logToFile(\"Exception at createUI \", ex);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void createPartControl(Composite parent) {\n\t\tViewForm viewForm = new ViewForm(parent, SWT.NONE);\n\t\tviewForm.setLayoutData(new FillLayout());\n\t\t\n\t\tfinal Text text = new Text(viewForm, SWT.BORDER |SWT.WRAP |SWT.V_SCROLL );\n\t\tviewForm.setContent(text);\n\t\t\n\t\tToolBar toolBar = new ToolBar(viewForm, SWT.FLAT);\n\t\tToolItem getItem = new ToolItem(toolBar, SWT.PUSH);\n\t\tgetItem.setText(\"get\");\n\t\tgetItem.addSelectionListener(new SelectionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tMessageDialog.openInformation(parent.getShell(), \"info\", ((ToolItem)e.getSource()).getText());\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tToolItem clearItem = new ToolItem(toolBar, SWT.PUSH);\n\t\tclearItem.setText(\"clear\");\n\t\tclearItem.addSelectionListener(new SelectionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tMessageDialog.openInformation(parent.getShell(), \"info\", ((ToolItem)e.getSource()).getText());\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tviewForm.setTopRight(toolBar);\n\t\t\n\t}", "private void setupUIElements() {\n setBadgeDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.company_logo));\n //setTitle(getString(R.string.browse_title));\n\n setHeadersState(HEADERS_ENABLED);\n setHeadersTransitionOnBackEnabled(true);\n\n // Set headers and rows background color\n setBrandColor(ContextCompat.getColor(getActivity(), R.color.browse_headers_bar));\n mBackgroundManager.setColor(ContextCompat.getColor(getActivity(),\n R.color.browse_background_color));\n\n // Disables the scaling of rows when Headers bar is in open state.\n enableRowScaling(false);\n\n // Here is where a header presenter can be set to customize the look\n // of the headers list.\n setHeaderPresenterSelector(new PresenterSelector() {\n @Override\n public Presenter getPresenter(Object o) {\n\n return new RowHeaderPresenter();\n }\n });\n }", "private void buildUpGUI() {\n\t\tsetLayout( new BorderLayout() );\n\t\tadd(new JScrollPane( summaryEditorPane) );\n\t}", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setModified(true);\n\t\tshell.setSize(512, 300);\n\t\tshell.setText(\"SWT Application\");\n\t\tshell.setLayout(null);\n\n\t\tLabel label = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);\n\t\tlabel.setBounds(253, 26, 2, 225);\n\n\t\tcomboCarBrandBuy = new Combo(shell, SWT.READ_ONLY);\n\t\tcomboCarBrandBuy.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tlabel_1.setText(\"Selected\");\n\t\t\t}\n\t\t});\n\t\tcomboCarBrandBuy.setItems(new String[] {\"Maruti\", \"Fiat\", \"Tata\", \"Ford\", \"Honda\", \"Hyundai\"});\n\t\tcomboCarBrandBuy.setBounds(87, 33, 123, 23);\n\t\tcomboCarBrandBuy.setText(\"--select--\");\n\n\t\tLabel lblCarBrand = new Label(shell, SWT.NONE);\n\t\tlblCarBrand.setAlignment(SWT.RIGHT);\n\t\tlblCarBrand.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlblCarBrand.setBounds(12, 38, 71, 15);\n\t\tlblCarBrand.setText(\"Car Brand :\");\n\n\t\ttextCarNameBuy = new Text(shell, SWT.BORDER);\n\t\ttextCarNameBuy.setBounds(87, 67, 123, 21);\n\n\t\tLabel lblCarName = new Label(shell, SWT.NONE);\n\t\tlblCarName.setAlignment(SWT.RIGHT);\n\t\tlblCarName.setText(\"Car Name :\");\n\t\tlblCarName.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlblCarName.setBounds(12, 70, 71, 15);\n\n\t\tcomboCarModelBuy = new Combo(shell, SWT.READ_ONLY);\n\t\tcomboCarModelBuy.setItems(new String[] {\"2015\", \"2014\", \"2013\", \"2012\", \"2011\", \"2010\", \"2009\", \"2008\", \"2007\", \"2006\", \"2005\", \"2004\", \"2003\", \"2002\", \"2001\", \"2000\"});\n\t\tcomboCarModelBuy.setBounds(87, 99, 91, 23);\n\t\tcomboCarModelBuy.setText(\"--select--\");\n\n\t\tLabel lblModelYear = new Label(shell, SWT.NONE);\n\t\tlblModelYear.setAlignment(SWT.RIGHT);\n\t\tlblModelYear.setText(\"Model :\");\n\t\tlblModelYear.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlblModelYear.setBounds(12, 105, 71, 15);\n\n\t\tButton buttonBuy = new Button(shell, SWT.NONE);\n\t\tbuttonBuy.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\n\t\t\t\tString carName = textCarNameBuy.getText();\n\t\t\t\tString carModel = comboCarModelBuy.getText();\n\n\t\t\t\tif(comboCarBrandBuy.getText().equalsIgnoreCase(\"maruti\")){\n\t\t\t\t\tmarutiMap.put(carName, carModel);\n\t\t\t\t}\n\n\t\t\t\tlabel_1.setText(\"Added to Inventory\");\n\t\t\t\tSystem.out.println(marutiMap);\n\t\t\t}\n\t\t});\n\t\tbuttonBuy.setBounds(87, 138, 63, 25);\n\t\tbuttonBuy.setText(\"BUY\");\n\n\t\tlabel_1 = new Label(shell, SWT.BORDER | SWT.HORIZONTAL | SWT.CENTER);\n\t\tlabel_1.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\n\t\tlabel_1.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));\n\t\tlabel_1.setBounds(73, 198, 137, 19);\n\n\t\tLabel lblStatus = new Label(shell, SWT.NONE);\n\t\tlblStatus.setBounds(22, 198, 45, 15);\n\t\tlblStatus.setText(\"Status :\");\n\n\t\tLabel label_2 = new Label(shell, SWT.NONE);\n\t\tlabel_2.setText(\"Car Brand :\");\n\t\tlabel_2.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlabel_2.setAlignment(SWT.RIGHT);\n\t\tlabel_2.setBounds(280, 38, 71, 15);\n\n\t\tcomboCarBrandSell = new Combo(shell, SWT.READ_ONLY);\n\t\tcomboCarBrandSell.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\n\t\t\t\tString carBrand = comboCarBrandSell.getText();\n\t\t\t\tcomboCarNameSell.clearSelection();\n\t\t\t\t\n\t\t\t\tif(carBrand.equalsIgnoreCase(\"maruti\")){\n\t\t\t\t\tSet<String> keyList = marutiMap.keySet();\n\t\t\t\t\tint i=0;\n\t\t\t\t\tfor(String key : keyList){\n\t\t\t\t\t\tcarNames.add(key);\n\t\t\t\t\t\t//comboCarNameSell.setItem(i, key);\n\t\t\t\t\t\t//i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tString[] strArray = (String[]) carNames.toArray(new String[0]);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcomboCarNameSell.setItems(strArray);\n\n\t\t\t}\n\t\t});\n\t\tcomboCarBrandSell.setItems(new String[] {\"Maruti\", \"Fiat\", \"Tata\", \"Ford\", \"Honda\", \"Hyundai\"});\n\t\tcomboCarBrandSell.setBounds(355, 33, 123, 23);\n\t\tcomboCarBrandSell.setText(\"--select--\");\n\n\t\tLabel label_3 = new Label(shell, SWT.NONE);\n\t\tlabel_3.setText(\"Car Name :\");\n\t\tlabel_3.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlabel_3.setAlignment(SWT.RIGHT);\n\t\tlabel_3.setBounds(280, 70, 71, 15);\n\n\t\tLabel label_4 = new Label(shell, SWT.NONE);\n\t\tlabel_4.setText(\"Model :\");\n\t\tlabel_4.setFont(SWTResourceManager.getFont(\"Segoe UI\", 10, SWT.NORMAL));\n\t\tlabel_4.setAlignment(SWT.RIGHT);\n\t\tlabel_4.setBounds(280, 105, 71, 15);\n\n\t\tCombo comboCarModelSell = new Combo(shell, SWT.READ_ONLY);\n\t\tcomboCarModelSell.setItems(new String[] {\"2015\", \"2014\", \"2013\", \"2012\", \"2011\", \"2010\", \"2009\", \"2008\", \"2007\", \"2006\", \"2005\", \"2004\", \"2003\", \"2002\", \"2001\", \"2000\"});\n\t\tcomboCarModelSell.setBounds(355, 99, 91, 23);\n\t\tcomboCarModelSell.setText(\"--select--\");\n\n\t\tButton buttonSell = new Button(shell, SWT.NONE);\n\t\tbuttonSell.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tlabel_5.setText(\"Sold Successfully\");\n\t\t\t}\n\t\t});\n\t\tbuttonSell.setText(\"SELL\");\n\t\tbuttonSell.setBounds(355, 138, 63, 25);\n\n\t\tlabel_5 = new Label(shell, SWT.BORDER | SWT.HORIZONTAL | SWT.CENTER);\n\t\tlabel_5.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\n\t\tlabel_5.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));\n\t\tlabel_5.setBounds(341, 198, 137, 19);\n\n\t\tLabel label_6 = new Label(shell, SWT.NONE);\n\t\tlabel_6.setText(\"Status :\");\n\t\tlabel_6.setBounds(290, 198, 45, 15);\n\n\t\tcomboCarNameSell = new Combo(shell, SWT.READ_ONLY);\n\t\tcomboCarNameSell.setItems(new String[] {});\n\t\tcomboCarNameSell.setBounds(355, 65, 123, 23);\n\t\tcomboCarNameSell.setText(\"--select--\");\n\n\t}", "public void setupUI() {\r\n\t\t\r\n\t\tvPanel = new VerticalPanel();\r\n\t\thPanel = new HorizontalPanel();\r\n\t\t\r\n\t\titemName = new Label();\r\n\t\titemName.addStyleName(Styles.page_title);\r\n\t\titemDesc = new Label();\r\n\t\titemDesc.addStyleName(Styles.quest_desc);\r\n\t\titemType = new Label();\r\n\t\titemType.addStyleName(Styles.quest_lvl);\r\n\t\t\r\n\t\tVerticalPanel img = new VerticalPanel();\r\n\t\timg.add(new Image(imgDir));\r\n\t\t\r\n\t\tvPanel.add(itemName);\r\n\t\tvPanel.add(itemDesc);\r\n\t\tvPanel.add(img);\r\n\t\tvPanel.add(hPanel);\r\n\t\t\r\n\t\tVerticalPanel mainPanel = new VerticalPanel();\r\n\t\tmainPanel.setWidth(\"100%\");\r\n\t\tvPanel.addStyleName(NAME);\r\n\t\t\r\n\t\tmainPanel.add(vPanel);\r\n \tinitWidget(mainPanel);\r\n }", "private void initMainComponentsLayout() {\r\n VerticalPanel selectDatasetLayout = new VerticalPanel();\r\n selectDatasetLayout.setWidth(\"300px\");\r\n selectDatasetLayout.setHeight(\"40px\");\r\n selectDatasetList = new ListBox();\r\n selectDatasetList.getElement().setAttribute(\"style\", \"border: 1px solid gray;height: 24px;font-weight: bold;width: 300px;border-radius: 5px;\");\r\n selectDatasetList.setWidth(\"300px\");\r\n selectDatasetList.addItem(\"Select Dataset\");\r\n selectDatasetLayout.add(selectDatasetList);\r\n selectDatasetList.setVisible(false);\r\n\r\n selectSubDatasetList = new ListBox();\r\n selectSubDatasetList.getElement().setAttribute(\"style\", \"border: 1px solid gray;height: 24px;font-weight: bold;width: 300px;border-radius: 5px;\");\r\n selectSubDatasetList.setWidth(\"300px\");\r\n selectSubDatasetList.addItem(\"Select Sub-Dataset\");\r\n selectSubDatasetList.setVisible(false);\r\n selectDatasetLayout.add(selectSubDatasetList);\r\n\r\n tempSelectDatasetList = new ListBox();\r\n tempSelectDatasetList.addItem(\"Select Dataset\");\r\n\r\n tempSelectDatasetList.setWidth(\"300px\");\r\n tempSelectDatasetList.setHeight(\"24px\");\r\n\r\n getDatasetsList(\"\");//get available dataset names\r\n RootPanel.get(\"dropdown_select\").add(selectDatasetLayout);\r\n selectDatasetList.addChangeHandler(this);\r\n selectSubDatasetList.addChangeHandler(this);\r\n\r\n tempSelectDatasetList.addChangeHandler(this);\r\n tempSelectDatasetList.addChangeHandler(this);\r\n Window.addResizeHandler(new ResizeHandler() {\r\n\r\n @Override\r\n public void onResize(ResizeEvent event) {\r\n if (masterWidth != Page.getScreenWidth() || masterHeight != Page.getScreenHeight()) {\r\n BooleanCallback ok = new BooleanCallback() {\r\n\r\n @Override\r\n public void execute(Boolean value) {\r\n if (value) {\r\n Window.Location.reload();\r\n }\r\n }\r\n };\r\n SC.confirm(\"You have changed the screen size the application need to reload the page press OK to proceed or close and back to the old screen\", ok);\r\n }\r\n }\r\n });\r\n\r\n initHomePage();\r\n welcomePage.setStyleName(\"welcomepagelayout\");\r\n RootPanel.get(\"welcomediva\").add(welcomePage);\r\n if (!oldIE) {\r\n initMiddleBodyLayout();\r\n }\r\n }", "public SubspaceClustererPanel() {\r\n\r\n\t\t// Connect / configure the components\r\n\t\tm_OutText.setEditable(false);\r\n\t\tm_OutText.setFont(new Font(\"Monospaced\", Font.PLAIN, 12));\r\n\t\tm_OutText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n\t\tm_OutText.addMouseListener(new MouseAdapter() {\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\tif ((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK) {\r\n\t\t\t\t\tm_OutText.selectAll();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tm_History.setBorder(BorderFactory.createTitledBorder(\"Result list\"));\r\n\r\n\t\tm_ClustererEditor.setClassType(SubspaceClusterer.class);\r\n\t\t//TODO m_ClustererEditor.setValue(ExplorerDefaults.getSubspaceClusterer());\r\n\t\tm_ClustererEditor.setValue(new weka.subspaceClusterer.Proclus());\r\n\t\tm_ClustererEditor\r\n\t\t\t\t.addPropertyChangeListener(new PropertyChangeListener() {\r\n\t\t\t\t\tpublic void propertyChange(PropertyChangeEvent e) {\r\n\t\t\t\t\t\trepaint();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\r\n\t\tm_ClassCombo\r\n\t\t\t\t.setToolTipText(\"Select the class attribute for class based\"\r\n\t\t\t\t\t\t+ \" evaluation\");\r\n\t\tm_StartBut.setToolTipText(\"Starts the clustering\");\r\n\t\tm_StopBut.setToolTipText(\"Stops a running clusterer\");\r\n\t\tm_EnableStoreVisual\r\n\t\t\t\t.setToolTipText(\"Store predictions in the result list for later \"\r\n\t\t\t\t\t\t+ \"visualization\");\r\n\t\tm_EnableStoreVisual\r\n\t\t\t\t.setToolTipText(\"Enable Bracketing over Parameters\");\r\n\r\n\t\tm_ignoreBut.setToolTipText(\"Ignore attributes during clustering\");\r\n\r\n\t\tm_ClassCombo.setPreferredSize(COMBO_SIZE);\r\n\t\tm_ClassCombo.setMaximumSize(COMBO_SIZE);\r\n\t\tm_ClassCombo.setMinimumSize(COMBO_SIZE);\r\n\t\tm_ClassCombo.setEnabled(true);\r\n\t\t\r\n\t\tm_EnableClassesToClusters.setSelected(true);\r\n\t\tm_BracketingBut.setEnabled(false);\r\n\t\tm_timer.setEnabled(true);\r\n\r\n\t\tm_EnableStoreVisual.setSelected(\r\n\t\t\t\tExplorerDefaults.getClustererStoreClustersForVis());\r\n\t\tm_EnableEvaluation.setSelected(true);\r\n\t\tm_EnableTimer.setSelected(true);\r\n\t\t\r\n\t\tm_StartBut.setEnabled(false);\r\n\t\tm_StopBut.setEnabled(false);\r\n\t\tm_ignoreBut.setEnabled(false);\r\n\t\tm_StartBut.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tstartClusterer();\r\n\t\t\t}\r\n\t\t});\r\n\t\tm_StopBut.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tstopClusterer();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tm_BracketingBut.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_RunThread == null)\r\n\t\t\t\t\tbracketingFrame();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tm_EvaluationBut.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_RunThread == null)\r\n\t\t\t\t\tevaluationFrame();\r\n\t\t\t}\r\n\t\t});\t\r\n\t\t\r\n\t\tm_EnableClassesToClusters.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_EnableClassesToClusters.isSelected()){\r\n\t\t\t\t\tm_ClassCombo.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tm_ClassCombo.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tm_EnableBracketing.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_EnableBracketing.isSelected()){\r\n\t\t\t\t\tm_StartBut.setText(\"Start Bracketing\");\r\n\t\t\t\t\tm_BracketingBut.setEnabled(true);\r\n\t\t\t\t\tif(m_RunThread == null)\r\n\t\t\t\t\t\tbracketingFrame();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tm_StartBut.setText(\"Start\");\r\n\t\t\t\t\tm_BracketingBut.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tm_EnableTimer.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_EnableTimer.isSelected()){\r\n\t\t\t\t\tm_timer.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tm_StartBut.setText(\"Start\");\r\n\t\t\t\t\tm_timer.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\t\r\n\t\tm_EnableEvaluation.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(m_EnableEvaluation.isSelected()){\r\n\t\t\t\t\tm_EvaluationBut.setEnabled(true);\r\n\t\t\t\t\tif(m_RunThread == null)\r\n\t\t\t\t\t\tevaluationFrame();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tm_EvaluationBut.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tm_ignoreBut.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsetIgnoreColumns();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tm_History.setHandleRightClicks(false);\r\n\t\t// see if we can popup a menu for the selected result\r\n\t\tm_History.getList().addMouseListener(new MouseAdapter() {\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\tif (((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)\r\n\t\t\t\t\t\t|| e.isAltDown()) {\r\n\t\t\t\t\tint index = m_History.getList().locationToIndex(\r\n\t\t\t\t\t\t\te.getPoint());\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tString name = m_History.getNameAtIndex(index);\r\n\t\t\t\t\t\tvisualizeClusterer(name, e.getX(), e.getY());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvisualizeClusterer(null, e.getX(), e.getY());\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\tm_ClassCombo.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tupdateCapabilitiesFilter(m_ClustererEditor\r\n\t\t\t\t\t\t.getCapabilitiesFilter());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//allow MultiSelection to load multiple models at a time\r\n\t\tm_FileChooser.setMultiSelectionEnabled(true);\r\n\r\n\t\t// Layout the GUI\r\n\t\tJPanel p1 = new JPanel();\r\n\t\tp1.setBorder(BorderFactory.createCompoundBorder(BorderFactory\r\n\t\t\t\t.createTitledBorder(\"SubspaceClusterer\"), BorderFactory\r\n\t\t\t\t.createEmptyBorder(0, 5, 5, 5)));\r\n\t\tp1.setLayout(new BorderLayout());\r\n\t\tp1.add(m_CLPanel, BorderLayout.NORTH);\r\n\r\n\t\tJPanel p2 = new JPanel();\r\n\t\t\r\n\t\tp2.setLayout(new GridBagLayout());\r\n\t\tp2.setBorder(BorderFactory.createCompoundBorder(\r\n\t\t\t\t\t\tBorderFactory.createTitledBorder(\"Class to cluster evaluation\"),\r\n\t\t\t\t\t\tBorderFactory.createEmptyBorder(0, 5, 5, 5)));\r\n\r\n\t\tGridBagConstraints gbC; \r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\t\tp2.add(m_EnableClassesToClusters,gbC);\r\n\t\t\r\n\t\tm_ClassCombo.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.gridy = 1;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\t\tp2.add(m_ClassCombo,gbC);\r\n\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.gridy = 2;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\t\tp2.add(m_EnableStoreVisual,gbC);\r\n\t\t\r\n\r\n\t\tJPanel buttons = new JPanel();\r\n\t\tbuttons.setLayout(new GridLayout(2, 1));\r\n\t\tJPanel ssButs = new JPanel();\r\n\t\tssButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n\t\tssButs.setLayout(new GridLayout(1, 2, 5, 5));\r\n\t\tssButs.add(m_StartBut);\r\n\t\tssButs.add(m_StopBut);\r\n\r\n\t\tJPanel ib = new JPanel();\r\n\t\tib.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n\t\tib.setLayout(new GridLayout(1, 1, 5, 5));\r\n\t\tib.add(m_ignoreBut);\r\n\t\tbuttons.add(ib);\r\n\t\tbuttons.add(ssButs);\r\n\t\t\r\n\t\tJPanel p4 = new JPanel();\r\n\t\tp4.setLayout(new GridBagLayout());\r\n\t\tp4.setBorder(BorderFactory.createCompoundBorder(\r\n\t\t\t\t\t\tBorderFactory.createTitledBorder(\"Bracketing\"),\r\n\t\t\t\t\t\tBorderFactory.createEmptyBorder(0, 5, 5, 5)));\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\r\n\t\tp4.add(m_EnableBracketing, gbC);\r\n\t\t\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 1;\r\n\t\tp4.add(m_BracketingBut, gbC);\r\n\t\t\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 1;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\t\tp4.add(m_EnableTimer, gbC);\r\n\t\t\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 1;\r\n\t\t\r\n\t\tm_timer.setHorizontalAlignment(JTextField.RIGHT);\r\n\t\tp4.add(m_timer, gbC);\r\n\t\tJPanel p5 = new JPanel();\r\n\t\tp5.setLayout(new GridBagLayout());\r\n\t\tp5.setBorder(BorderFactory.createCompoundBorder(\r\n\t\t\t\t\t\tBorderFactory.createTitledBorder(\"Evaluation\"),\r\n\t\t\t\t\t\tBorderFactory.createEmptyBorder(0, 5, 5, 5)));\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 1;\r\n\r\n\t\tp5.add(m_EnableEvaluation, gbC);\r\n\t\t\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.anchor = GridBagConstraints.WEST;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 1;\r\n\t\tp5.add(m_EvaluationBut, gbC);\r\n\t\r\n\r\n\t\tJPanel p3 = new JPanel();\r\n\t\tp3.setBorder(BorderFactory.createTitledBorder(\"SubspaceClusterer output\"));\r\n\t\tp3.setLayout(new BorderLayout());\r\n\t\tfinal JScrollPane js = new JScrollPane(m_OutText);\r\n\t\tp3.add(js, BorderLayout.CENTER);\r\n\t\tjs.getViewport().addChangeListener(new ChangeListener() {\r\n\t\t\tprivate int lastHeight;\r\n\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tJViewport vp = (JViewport) e.getSource();\r\n\t\t\t\tint h = vp.getViewSize().height;\r\n\t\t\t\tif (h != lastHeight) { // i.e. an addition not just a user scrolling\r\n\t\t\t\t\tlastHeight = h;\r\n\t\t\t\t\tint x = h - vp.getExtentSize().height;\r\n\t\t\t\t\tvp.setViewPosition(new Point(0, x));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tJPanel mondo = new JPanel();\r\n\t\tGridBagLayout gbL = new GridBagLayout();\r\n\t\tgbL = new GridBagLayout();\r\n\t\tmondo.setLayout(gbL);\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbL.setConstraints(p2, gbC);\r\n\t\tmondo.add(p2);\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.NORTH;\r\n\t\tgbC.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbC.gridy = 1;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbL.setConstraints(p4, gbC);\r\n\t\tmondo.add(p4);\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.NORTH;\r\n\t\tgbC.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbC.gridy = 2;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbL.setConstraints(p5, gbC);\r\n\t\tmondo.add(p5);\r\n\r\n\t\t\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.anchor = GridBagConstraints.NORTH;\r\n\t\tgbC.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tgbC.gridy = 3;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbL.setConstraints(buttons, gbC);\r\n\t\tmondo.add(buttons);\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.gridy = 4;\r\n\t\tgbC.gridx = 0;\r\n\t\tgbC.weightx = 0;\r\n\t\tgbL.setConstraints(m_History, gbC);\r\n\t\tmondo.add(m_History);\r\n\t\tgbC = new GridBagConstraints();\r\n\t\tgbC.fill = GridBagConstraints.BOTH;\r\n\t\tgbC.gridy = 0;\r\n\t\tgbC.gridx = 1;\r\n\t\tgbC.gridheight = 5;\r\n\t\tgbC.weightx = 100;\r\n\t\tgbC.weighty = 100;\r\n\t\tgbL.setConstraints(p3, gbC);\r\n\t\tmondo.add(p3);\r\n\r\n\t\tsetLayout(new BorderLayout());\r\n\t\tadd(p1, BorderLayout.NORTH);\r\n\t\tadd(mondo, BorderLayout.CENTER);\r\n\t}", "private void init() {\n List<Contructor> list = servisContructor.getAllContructors();\n for (Contructor prod : list) {\n contructor.add(new ContructorViewer(prod));\n }\n\n Label label = new Label(\"Catalog Contructors\");\n label.setLayoutX(140);\n label.setLayoutY(20);\n label.setStyle(\"-fx-font-size:20px\");\n\n initTable();\n table.setLayoutX(120);\n table.setLayoutY(60);\n table.setStyle(\"-fx-font-size:16px\");\n\n GridPane control = new ControlPanel(this, 2).getPanel();\n control.setLayoutX(120);\n control.setLayoutY(300);\n\n panel.setAlignment(Pos.CENTER);\n panel.add(label, 0, 0);\n panel.add(table, 0, 1);\n panel.add(control, 0, 2);\n }", "private void initTop(BorderPane root) {\n // Make HBox\n HBox topBox = new HBox();\n // Set Label\n Label titleLabel = new Label(); // title label for top of UI\n titleLabel.setStyle(\"-fx-font-size:20\");\n titleLabel.setText(\n \"Fair Job Planning System \" + date.format(new Date()) + \" \" + clock.format(new Date()));\n titleLabel.setPadding(new Insets(20, 0, 20, 100));\n\n // Add stuff to topBox\n topBox.getChildren().addAll(titleLabel);\n // Add to BorderPane root\n root.setTop(topBox);\n }", "public CrosstabEditorPanel() {\r\n initComponents();\r\n\r\n selectionStroke = new java.awt.BasicStroke(\r\n (float)(2f),\r\n java.awt.BasicStroke.CAP_BUTT,\r\n java.awt.BasicStroke.JOIN_BEVEL,\r\n 0f,\r\n new float[]{5f, 3f},\r\n 0f);\r\n\r\n addFormatItemsToMenu(jPopupMenuCrosstabReporteElement);\r\n new DropTarget( this, // component\r\n DnDConstants.ACTION_COPY_OR_MOVE, // actions\r\n this); // DropTargetListener\r\n \r\n \r\n I18n.addOnLanguageChangedListener( new LanguageChangedListener() {\r\n public void languageChanged(LanguageChangedEvent evt) {\r\n applyI18n();\r\n }\r\n });\r\n applyI18n();\r\n }", "public void createControl(Composite parent) {\n\t\tComposite container = new Composite(parent, SWT.NONE);\n\t\tcontainer.setLayout(new GridLayout());\n\t\tsetControl(container);\n\n\t\tComposite container2 = new Composite(container, SWT.BORDER);\n\t\tcontainer2.setLayout(new GridLayout());\n\t\tcontainer2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\n\n\t\ttxtSummary = new StyledText(container2, SWT.LEFT | SWT.BORDER\n\t\t\t\t| SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);\n\t\ttxtSummary.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\n\t\ttxtSummary.setBackground(SWTResourceConstents.COLOR_WHITE);\n\n\t\ttxtDDL = new StyledText(container2, SWT.LEFT | SWT.BORDER\n\t\t\t\t| SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);\n\t\tGridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);\n\t\tgd.exclude = true;\n\t\ttxtDDL.setLayoutData(gd);\n\t\ttxtDDL.setVisible(false);\n\t\ttxtDDL.setBackground(SWTResourceConstents.COLOR_WHITE);\n\t\tcreateButtons(container);\n\t}", "public admin() {\n initComponents(); \n setIcon();\n pl = new options();\n GridBagConstraints G2 = new GridBagConstraints();\n G2.gridx = 0;\n G2.gridy = 0;\n paneljtop.add(pl, G2);\n pl.setVisible(false);\n }", "public void setMenu() {\n\t \n\t\ttop = new JPanel(new FlowLayout(FlowLayout.LEFT));\n\t add(top, BorderLayout.CENTER);\n\t \n\t lPro = new JLabel(\"Projects: \");\n\t top.add(lPro);\n\t \n\t cPro = new JComboBox();\n\t getProject();\n\t\ttop.add(cPro);\n\t\t\n\t\tview = new JButton(\"View Sample\");\n\t\ttop.add(view);\n\t\t\n\t\tbottom = new JPanel(new FlowLayout(FlowLayout.CENTER));\n\t\tadd(bottom, BorderLayout.SOUTH);\n\t\t\n\t\tcancel = new JButton(\"Cancel\");\n\t\tbottom.add(cancel);\n\t\t\n\t\tdownload = new JButton(\"Download\");\n\t\tbottom.add(download);\n\t\t\n\t\tsetActionListener();\t\n\t}", "public void MakeBar3D() {\n\t\tBarButton3D = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(\n\t\t\t\t\tGet3DBarChartImage())));\n\t\tBarButton3D.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\t\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart3D(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"3D Bar Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart3D(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\t\n\t\t\n\t\tChartTypeInterface.add(BarButton3D);\n\t}", "public History_GUI(){\n super();\n InitializeComponents();\n ConfigureWin();\n\n }", "private void createGUI() {\n ResizeGifPanel newContentPane = new ResizeGifPanel();\n newContentPane.setOpaque(true); \n setContentPane(newContentPane); \n }", "private void initGUI() {\r\n this.setLayout(new RiverLayout());\r\n\r\n /**\r\n * Add the following selectively\r\n */\r\n titledSearchResultsPanel = new Cab2bTitledPanel(\"Search Results :- \" + \"Total results ( \"\r\n + allElements.size() + \" )\");\r\n GradientPaint gp = new GradientPaint(new Point2D.Double(.05d, 0), new Color(185, 211, 238),\r\n new Point2D.Double(.95d, 0), Color.WHITE);\r\n titledSearchResultsPanel.setTitlePainter(new BasicGradientPainter(gp));\r\n titledSearchResultsPanel.setBorder(new EmptyBorder(0, 0, 0, 0));\r\n titledSearchResultsPanel.setTitleFont(new Font(\"SansSerif\", Font.BOLD, 11));\r\n titledSearchResultsPanel.setTitleForeground(Color.BLACK);\r\n\r\n pagination = initPagination(allElements);\r\n\r\n searchResultsPanel = new Cab2bPanel(new BorderLayout(0, 5));\r\n\r\n Cab2bComboBox serviceURLCombo = new Cab2bComboBox(serviceURLComboContents);\r\n serviceURLCombo.setPreferredSize(new Dimension(250, 20));\r\n serviceURLCombo.addActionListener(new ServiceURLSelectionListener());\r\n Cab2bPanel comboContainer = new Cab2bPanel(new RiverLayout(5, 5));\r\n \r\n JLabel jLabel = new JLabel(\"Results From\");\r\n jLabel.setForeground(new Cab2bHyperlink().getUnclickedColor());\r\n \r\n \r\n comboContainer.add(\"left\", jLabel);\r\n comboContainer.add(\"tab\", serviceURLCombo);\r\n\r\n searchResultsPanel.add(BorderLayout.NORTH, comboContainer);\r\n\r\n searchResultsPanel.add(BorderLayout.CENTER, pagination);\r\n initDataListSummaryPanel();\r\n initDataListButtons();\r\n\r\n Cab2bPanel buttonPanel = new Cab2bPanel(new RiverLayout(8, 0));\r\n buttonPanel.add(addToDataListButton);\r\n buttonPanel.add(m_applyAllButton);\r\n searchResultsPanel.add(BorderLayout.SOUTH, buttonPanel);\r\n\r\n m_addSummaryParentPanel = new Cab2bPanel(new BorderLayout());\r\n m_addSummaryParentPanel.add(searchResultsPanel, BorderLayout.CENTER);\r\n m_addSummaryParentPanel.add(myDataListParentPanel, BorderLayout.EAST);\r\n titledSearchResultsPanel.setContentContainer(m_addSummaryParentPanel);\r\n this.add(\"p vfill hfill\", titledSearchResultsPanel);\r\n }", "private Parent initControls() {\n VBox root = new VBox();\n root.setSpacing(20.0);\n root.setPadding(new Insets(10.0));\n\n buttonBar.setPadding(new Insets(0.0));\n buttonBar.setPrefSize(Control.USE_COMPUTED_SIZE, Control.USE_COMPUTED_SIZE);\n \n Font police = Font.loadFont(getClass().getResourceAsStream(\"Comfortaa-Regular.ttf\"), 12);\n nomMethode.setFont(police);\n typeMethode.setFont(police);\n ajouterParametre.setFont(police);\n parametresLabel.setFont(police);\n supprimerParametre.setFont(police);\n visibiliteMethode.setFont(police);\n annuler.setFont(police);\n confirmer.setFont(police);\n \n annuler.getStyleClass().add(\"annuler\");\n\n comboBoxVisibilite.setItems(FXCollections.observableArrayList(Visibilite.values()));\n comboBoxType.setItems(FXCollections.observableArrayList(Type.values()));\n\n hBoxNom.getChildren().addAll(nomMethode, textFieldNom);\n hBoxNom.setSpacing(10.0);\n hBoxTyoe.getChildren().addAll(typeMethode, comboBoxType);\n hBoxTyoe.setSpacing(10.0);\n hBoxVisibilite.getChildren().addAll(visibiliteMethode, comboBoxVisibilite);\n hBoxVisibilite.setSpacing(10.0);\n vBox.getChildren().addAll(hBoxNom, hBoxTyoe, hBoxVisibilite);\n vBox.setSpacing(10.0);\n\n erreurLabel.setId(\"erreur\");\n annuler.setId(\"annuler\");\n\n vBoxParametres.setSpacing(5.0);\n vBoxParametres.getChildren().addAll(parametresLabel, parametreListView, parametreBar);\n\n parametreBar.getButtons().addAll(ajouterParametre, modifierParametre, supprimerParametre);\n buttonBar.getButtons().addAll(confirmer, annuler);\n\n root.getChildren().addAll(vBox, vBoxParametres, erreurLabel, buttonBar);\n\n modifierParametre.disableProperty().bind(Bindings.isEmpty(parametreListView.getSelectionModel().getSelectedItems()));\n supprimerParametre.disableProperty().bind(Bindings.isEmpty(parametreListView.getSelectionModel().getSelectedItems()));\n\n confirmer.setOnAction(event -> {\n creerMethode();\n });\n\n annuler.setOnAction(event -> {\n close();\n });\n\n ajouterParametre.setOnAction(event -> {\n ajouterParametre();\n });\n\n modifierParametre.setOnAction(event -> {\n modifierParametre();\n });\n\n supprimerParametre.setOnAction(event -> {\n supprimerParametre();\n });\n\n return root;\n }", "@Override\r\n\tpublic void createPartControl(Composite parent) {\n\t\ttoolkit = new FormToolkit(parent.getDisplay());\r\n\t\t\r\n\t\t/*\r\n\t\t * Create a scrolled form widget, \r\n\t\t */\r\n\t\tscrolledForm = toolkit.createScrolledForm(parent);\r\n\t\tscrolledForm.setFont(new Font(null,\"Times\",18,SWT.BOLD|SWT.ITALIC));\r\n\t\tscrolledForm.setText(\"Simulation Results\");\r\n\t\tscrolledForm.setImage(JQuantPlugin.getImageDescriptor(\"money.png\").createImage());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Make a nice gradient\r\n\t\t */\r\n\t\ttoolkit.decorateFormHeading(scrolledForm.getForm());\r\n\t\t\r\n\t\treadSimulationResults();\r\n\t\tbuildStatSection();\r\n\t\tif(results != null)\r\n\t\t\trefreshSimulationStatistics();\r\n\r\n\t\t\r\n\t}", "private void initSelectedAlgoVisuals()\r\n\t{\r\n\t String searchText = useKDTreeToSearch ? \"Using KDTree for Nearest Neighbour Search\" : \"Using Linear Search for Nearest Neighbour Search\";\r\n\t String hullText = useConcaveHull ? \"Using Concave Hull with digDecider=\"+ConcaveHull.decision : \"Using Convex Hull\";\r\n\t \r\n\t usedAlgorithms.addCodeLine(searchText, null, 0, null);\r\n\t usedAlgorithms.addCodeLine(hullText, null, 0, null);\r\n\t \r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, new Color(100, 200, 100));\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t\tusingRect = lang.newRect(new Offset(-5, -5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_NW), new Offset(10, 5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_SE), \"usingInfoBackground\", null, rectProps);\r\n\t}", "@Override\n\tprotected void createInteractiveControlPanel()\n\t{\n\t\tsuper.createInteractiveControlPanel();\n\t\t\n\t\t// create a tabbed pane that contains the telescope-window controls\n\t\tJTabbedPane tabbedPane = new JTabbedPane();\n\t\ttabbedPane.setBorder(GUIBitsAndBobs.getTitledBorder(\"Telescope window\"));\n\t\tinteractiveControlPanel.add(tabbedPane, \"span\");\n\t\t\n\t\t// refraction-parameter tab\n\t\tJPanel refractionParametersPanel = new JPanel();\n\t\trefractionParametersPanel.setLayout(new MigLayout(\"insets 0\"));\n\t\ttabbedPane.add(\"Refraction\", refractionParametersPanel);\n\t\t\n\t\taHatPanel = new LabelledVector3DPanel(\n\t\t\t\t// \"aHat = \"\n\t\t\t\t\"<html><b>a</b>&#x302; = </html>\"\n\t\t\t); // \"aHat\"\n\t\taHatPanel.setToolTipText(\"Direction of optical axis of telescopelets\");\n\t\taHatPanel.setVector3D(aHat);\n\t\trefractionParametersPanel.add(aHatPanel, \"span\");\n\n\t\tuHatPanel = new LabelledVector3DPanel(\n\t\t\t\t// \"uHat = \"\n\t\t\t\t\"<html><b>u</b>&#x302; = </html>\"\n\t\t\t);\t// \"uHat\"\n\t\tuHatPanel.setToolTipText(\n\t\t\t\t// \"First direction normal to aHat\"\n\t\t\t\t\"<html>First direction normal to <b>a</b>&#x302;</html>\"\n\t\t\t);\n\t\tuHatPanel.setVector3D(uHat);\n\t\trefractionParametersPanel.add(uHatPanel, \"span\");\n\n\t\tvHatPanel = new LabelledVector3DPanel(\n\t\t\t\t// \"vHat = \"\n\t\t\t\t\"<html><b>v</b>&#x302; = </html>\"\n\t\t\t);\t// \"vHat\"\n\t\tvHatPanel.setToolTipText(\n\t\t\t\t// \"Second direction normal to aHat\"\n\t\t\t\t\"<html>Second direction normal to <b>a</b>&#x302;</html>\"\n\t\t\t);\n\t\tvHatPanel.setVector3D(vHat);\n\t\trefractionParametersPanel.add(vHatPanel, \"span\");\n\n\t\tetaPanel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&eta;</i><sub><i>u</i></sub>, <i>&eta;</i><sub><i>v</i></sub>) = </html>\"\n\t\t\t);\n\t\tetaPanel.setToolTipText(\n\t\t\t\t\"<html><i>&eta;</i><sub><i>i</i></sub> = (-1) times focal-length ratio of telescopelets in <i>i</i> direction</html>\"\n\t\t\t);\n\t\tetaPanel.setVector2D(etaU, etaV);\n\t\trefractionParametersPanel.add(etaPanel, \"span\");\n\n\t\tdeltaPanel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&delta;</i><sub><i>u</i></sub>, <i>&delta;</i><sub><i>v</i></sub>) = </html>\"\n\t\t\t);\n\t\tdeltaPanel.setToolTipText(\n\t\t\t\t\"<html><i>&delta;</i><sub><i>i</i></sub> = (offset between the two lenslets' optical axes in <i>i</i> direction)/(<i>f</i><sub>1</sub>)\"\n\t\t\t);\n\t\tdeltaPanel.setVector2D(deltaU, deltaV);\n\t\trefractionParametersPanel.add(deltaPanel, \"span\");\n\n\t\t// aperture-parameter tab\n\t\tapertureParametersTabbedPane = new JTabbedPane();\n\t\ttabbedPane.add(\"Clear-aperture placement\", apertureParametersTabbedPane);\n\n\t\t// this is another tabbed pane, which decides on the algorithm that is used to set the aperture parameters, and sets any parameters\n\t\t\n\t\t// zero tab\n\t\tzeroParametersLabel = new JLabel(\"No additional parameters\");\n\t\tapertureParametersTabbedPane.add(AlphaChoice.ZERO.toString(), zeroParametersLabel);\n\n\t\t// manual tab\n\t\tmanualParametersPanel = new JPanel();\n\t\tmanualParametersPanel.setLayout(new MigLayout(\"insets 0\"));\n\t\tapertureParametersTabbedPane.add(AlphaChoice.MANUAL.toString(), manualParametersPanel);\n\t\t\n\t\tsigma1Panel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&sigma;</i><sub><i>1u</i></sub>, <i>&sigma;</i><sub><i>1v</i></sub>) = </html>\"\n\t\t\t);\n\t\tsigma1Panel.setToolTipText(\"sigma_1i = ...\");\n\t\tsigma1Panel.setVector2D(sigma1U, sigma1V);\n\t\tmanualParametersPanel.add(sigma1Panel, \"span\");\n\n\t\tsigma2Panel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&sigma;</i><sub><i>2u</i></sub>, <i>&sigma;</i><sub><i>2v</i></sub>) = </html>\"\n\t\t\t);\n\t\tsigma2Panel.setToolTipText(\"sigma_2i = ...\");\n\t\tsigma2Panel.setVector2D(sigma2U, sigma2V);\n\t\tmanualParametersPanel.add(sigma2Panel, \"span\");\n\t\t\n\t\talpha1Panel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&alpha;</i><sub><i>1u</i></sub>, <i>&alpha;</i><sub><i>1v</i></sub>) = </html>\"\n\t\t\t);\n\t\talpha1Panel.setToolTipText(\"alpha_1i = ...\");\n\t\talpha1Panel.setVector2D(alpha1U, alpha1V);\n\t\tmanualParametersPanel.add(alpha1Panel, \"span\");\n\n\t\talpha2Panel = new LabelledVector2DPanel(\n\t\t\t\t\"<html>(<i>&alpha;</i><sub><i>2u</i></sub>, <i>&alpha;</i><sub><i>2v</i></sub>) = </html>\"\n\t\t\t);\n\t\talpha2Panel.setToolTipText(\"alpha_2i = ...\");\n\t\talpha2Panel.setVector2D(alpha2U, alpha2V);\n\t\tmanualParametersPanel.add(alpha2Panel, \"span\");\n\n\t\t// optimised tab\n\t\toptimisedParametersPanel = new JPanel();\n\t\toptimisedParametersPanel.setLayout(new MigLayout(\"insets 0\"));\n\t\tapertureParametersTabbedPane.add(AlphaChoice.OPTIMISED.toString(), optimisedParametersPanel);\n\n\t\tpointAtFOVCentrePanel = new LabelledVector3DPanel(\"Point at FOV centre\");\n\t\tpointAtFOVCentrePanel.setVector3D(pointAtFOVCentre);\n\t\toptimisedParametersPanel.add(pointAtFOVCentrePanel, \"span\");\n\t\t\n//\t\tLabelledDoublePanel parallelityParameterPanel;\n//\t\tJComboBox alphaChoiceComboBox;\n\t\t\n\t\tswitch(alphaChoice)\n\t\t{\n\t\tcase ZERO:\n\t\t\tapertureParametersTabbedPane.setSelectedComponent(zeroParametersLabel);\n\t\t\tbreak;\n\t\tcase MANUAL:\n\t\t\tapertureParametersTabbedPane.setSelectedComponent(manualParametersPanel);\n\t\t\tbreak;\n\t\tcase OPTIMISED:\n\t\tdefault:\n\t\t\tapertureParametersTabbedPane.setSelectedComponent(optimisedParametersPanel);\n\t\t}\n\t\t\n\t\t// the camera\n\t\t\n\t\tJPanel cameraPanel = new JPanel();\n\t\tcameraPanel.setLayout(new MigLayout(\"insets 0\"));\n\t\tcameraPanel.setBorder(GUIBitsAndBobs.getTitledBorder(\"Camera\"));\n\t\tinteractiveControlPanel.add(cameraPanel, \"span\");\n\t\t\n\t\tapertureCentrePanel = new LabelledVector3DPanel(\"Aperture centre = \");\n\t\tapertureCentrePanel.setToolTipText(\"Aperture centre; framed sheet is centred at (0, 0, 10)\");\n\t\tapertureCentrePanel.setVector3D(apertureCentre);\n\t\tcameraPanel.add(apertureCentrePanel, \"span\");\n\t\t\n\t\tbrightnessFactorPanel = new LabelledDoublePanel(\"Brightness factor (i.e. exposure compensation) = \");\n\t\tbrightnessFactorPanel.setToolTipText(\"Factor by which light intensity appears brighter\");\n\t\tbrightnessFactorPanel.setNumber(brightnessFactor);\n\t\tcameraPanel.add(brightnessFactorPanel, \"span\");\n\t}", "public WindowAutoLineaging()\n\t\t{\n\t\tsetLayout(new GridLayout(1,1));\n\t\t/*\n\t\tJPanel top=new JPanel(new GridBagLayout());\n\t\tGridBagConstraints c=new GridBagConstraints();\n\t\tc.gridy=0; top.add(new JLabel(\"Lineage \"),c);\n\t\t//c.gridy=1; top.add(new JLabel(\"Channel \"),c);\n\t\tc.gridy=1; top.add(new JLabel(\"Algorithm \"),c);\n\t\t\n\t\tc.fill=GridBagConstraints.HORIZONTAL;\n\t\tc.gridx=1;\n\t\tc.weightx=1;\n\t\t\n\t\tc.gridy=0; top.add(comboLin,c);\n//\t\tc.gridy=1; top.add(comboChan,c);\n\t\tc.gridy=1; top.add(comboAlgo,c);\n\t\t*/\n\t\tJComponent top=EvSwingUtil.layoutTableCompactWide(\n\t\t\t\tnew JLabel(\"Lineage \"),comboLin,\n\t\t\t\tnew JLabel(\"Algorithm \"),comboAlgo\n\t\t\t\t);\n\t\t\n\t\tpanelOptions.setBorder(BorderFactory.createTitledBorder(\"Options\"));\n\n\t\t\n\t\tadd(EvSwingUtil.layoutCompactVertical(\n\t\t\t\ttop,\n\t\t\t\tpanelOptions,\n\t\t\t\tpanelStatus,\n\t\t\t\tEvSwingUtil.withLabel(\"Frame\", frameStart),\n\t\t\t\tEvSwingUtil.layoutEvenHorizontal(bStartStop,bStep,bFlatten)));\n\t\t\n\t\tcomboAlgo.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){updateCurrentAlgo();}});\n\t\t\n\t\tbStartStop.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){startStop();}});\n\n\t\tbStep.addActionListener(new ActionListener(){\n\t\tpublic void actionPerformed(ActionEvent e){step();}});\n\n\n\t\tbFlatten.addActionListener(new ActionListener(){\n\t\tpublic void actionPerformed(ActionEvent e){flatten();}});\n\n\t\tsetTitleEvWindow(\"Auto-lineage\");\n\t\tupdateCurrentAlgo();\n\t\tpackEvWindow();\n\t\tsetVisibleEvWindow(true);\n\t\t}", "public HeatMapColorToolBar() {\n initialize();\n }", "private void createGUI() {\r\n\r\n cgRect modelSpace = new cgRect(0, 0, 11, 11);\r\n cgRect deviceSpace = new cgRect(0, 0, 600, 600);\r\n\r\n cgTransformation tr = new cgTransformation(modelSpace, deviceSpace, false, false);\r\n\r\n /**\r\n *\r\n */\r\n // The formatter of axis' labels will use default locale and pattern\r\n NumberFormat nf = NumberFormat.getInstance();\r\n\r\n // We will use \"fixed size\" axis renderer for all axes\r\n \r\n // 参数一:标签刻度长度大小 参数二:标签数字长度大小 参数三:数字和刻度之间的距离大小,长度为像素\r\n cgAxisRenderer ar = new cgFixedSizeAxisRenderer(5, 15, 50, nf);\r\n\r\n // ----------------------------------------------------\r\n // First axis - values match the model coordinates,\r\n // model origin is at 0.0\r\n // ----------------------------------------------------\r\n \r\n // 第三个参数为显示的数字数\r\n cgRect bbox1 = new cgRect(0, 0, 11, 1);\r\n TickGenerator tg1 = new NumericTickGenerator(1.0);\r\n cgAxisShape axis1 = new cgAxisShape(cgAxisShape.NORTH, bbox1, tg1, ar);\r\n\r\n cgShapeListLayer layer = new cgShapeListLayer();\r\n\r\n layer.addShape(axis1);\r\n\r\n /**\r\n *\r\n */\r\n // ----------------------------------------------------\r\n // Create grid using regular grid renderer\r\n // ----------------------------------------------------\r\n cgRect bbox = new cgRect(0, 0, 10, 10);\r\n TickGenerator htg = new NumericTickGenerator(1.0);\r\n TickGenerator vtg = new NumericTickGenerator(1.0);\r\n cgGridRenderer gr = new cgRegularGridRenderer();\r\n cgGridShape grid = new cgGridShape(bbox, htg, vtg, gr);\r\n\r\n // ----------------------------------------------------\r\n // Create view\r\n // ----------------------------------------------------\r\n// cgShapeListLayer layer = new cgShapeListLayer();\r\n// layer.addShape( grid );\r\n cgContainerModel model = new cgContainerModel();\r\n model.setBoundingBox(modelSpace);\r\n model.addLayer(layer);\r\n\r\n cgPlotView view = new cgPlotView(model, tr);\r\n\r\n // ----------------------------------------------------\r\n // Create plot\r\n // ----------------------------------------------------\r\n cgPlot plot = new cgPlot(view);\r\n\r\n plot.addScrollbar(cgGenericPlotLayout.SOUTH);\r\n plot.addScrollbar(cgGenericPlotLayout.EAST);\r\n\r\n getContentPane().add(plot);\r\n\r\n // ----------------------------------------------------\r\n // Set up listeners\r\n // ----------------------------------------------------\r\n // Set window listener\r\n addWindowListener(new WindowAdapter() {\r\n public void windowClosing(WindowEvent e) {\r\n System.exit(0);\r\n }\r\n });\r\n }", "private void createUIComponents() {\n this.selectorApplication = new AzureArtifactComboBox(project, true);\n this.selectorApplication.refreshItems();\n }", "public Visualizador() {\n initComponents();\n inicializar();\n }", "private void buildUI() {\n initComponents();\n\n FormLayout layout = new FormLayout(\"3dlu, pref:grow, 3dlu\",\n \"3dlu, pref, 3dlu, pref, 3dlu, fill:0:grow\");\n\n PanelBuilder builder = new PanelBuilder(layout);\n CellConstraints cc = new CellConstraints();\n\n // Toolbar\n JPanel toolbar = createToolBar();\n toolbar.setOpaque(false);\n builder.add(toolbar, cc.xy(2, 2));\n builder.addSeparator(null, cc.xyw(1, 4, 2));\n\n // Main panel in scroll pane\n JPanel mainPanel = buildMainPanel();\n mainPanel.setOpaque(false);\n JScrollPane scrollPane = new JScrollPane(mainPanel);\n scrollPane.setOpaque(false);\n scrollPane.getVerticalScrollBar().setUnitIncrement(10);\n UIUtil.removeBorder(scrollPane);\n builder.add(scrollPane, cc.xyw(1, 6, 2));\n\n uiComponent = builder.getPanel();\n }", "@Override\r\n public void initControl() {\n \r\n }", "public OPTION() {\n initComponents();\n setVisible(true);\n setBounds(500,190,575,400);\n }", "public SelectPanel() {\n initComponents();\n \n buttonSelection.add(jRadioButtonEverything);\n buttonSelection.add(jRadioButtonLinesCurves);\n buttonSelection.add(jRadioButtonControlPoints);\n buttonSelection.add(jRadioButtonAllItem);\n jRadioButtonControlPoints.setSelected(true);\n \n buttonLayer.add(jRadioButtonCurrentLayer);\n buttonLayer.add(jRadioButtonAllVisibleLayers);\n jRadioButtonCurrentLayer.setSelected(true);\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "private void CreateToolBars(){\n toolBar = new ToolBar();\n btoolBar = new ToolBar();\n login=new Button(\"Login\");\n simulate=new Button(\"Simulate\");\n scoreBoardButton=new Button(\"ScoreBoard\");\n viewBracket= new Button(\"view Bracket\");\n clearButton=new Button(\"Clear\");\n resetButton=new Button(\"Reset\");\n finalizeButton=new Button(\"Finalize\");\n toolBar.getItems().addAll(\n createSpacer(),\n login,\n simulate,\n scoreBoardButton,\n viewBracket,\n createSpacer()\n );\n btoolBar.getItems().addAll(\n createSpacer(),\n clearButton,\n resetButton,\n finalizeButton,\n createSpacer()\n );\n }", "private void renderToolBarCustomizingSection() {\n\t\tfinal SpinnerField spinner = new SpinnerField();\n\n\t\tspinner.setMaxValue(50);\n\t\tspinner.setMinValue(20);\n\t\tspinner.setValue(Constants.TASK_BAR_SIZE);\n\n\t\tspinner.addListener(Events.Change, new Listener<BaseEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tGwosDesktop.getInstance().getTaskBar()\n\t\t\t\t\t\t.setBarSize(spinner.getValue().intValue());\n\t\t\t}\n\t\t});\n\n\t\tspinner.setFieldLabel(\"Task bar size (px)\");\n\n\t\t// 2. Task bar color\n\t\t// TODO\n\n\t\t// Add controls to the panel\n\t\ttoolbarSection.add(spinner);\n\t}", "@Override\n protected void addControls() {\n super.addControls(); //Adds parent controls\n //adds the button for our 2016 filter (VisionFilter2016.java)\n addImageProcessingButton(\"No Filter\", new TargetFilter(0)); \n addImageProcessingButton(\"Color Filter\", new TargetFilter(1));\n addImageProcessingButton(\"Classic Filter\", new TargetFilter(3));\n addImageProcessingButton(\"Bounding Filter\", new TargetFilter(4));\n addImageProcessingButton(\"Cube Filter\", new TargetFilter(5));\n \n JButton button = new JButton(createSaveConfig());\n\t\taddControl(button);\n }", "@Override\n\tpublic void createPartControl(Composite parent) {\n\t\tComposite container = new Composite(parent, SWT.NONE);\n\t\tcontainer.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n\t\tarchitectureCanvas = new ArchitectureCanvas(container,\n\t\t\t\tSWT.DOUBLE_BUFFERED);\n\n\t\tcreateActions();\n\t\tinitializeToolBar();\n\t\tinitializeMenu();\n\n\t\tCadmosUi.getInstance()\n\t\t\t\t.addListener(cadmosEditorSelectionChangedListener);\n\t}", "public void createControl(Composite parent) {\r\n \t\tinitializeDialogUnits(parent);\r\n \r\n \t\tComposite root = new Composite(parent, SWT.NONE);\r\n \t\tGridData gd = new GridData();\r\n \r\n \t\tgd.horizontalSpan = 1;\r\n \t\tgd.horizontalAlignment = GridData.FILL;\r\n \t\tgd.grabExcessHorizontalSpace = true;\r\n \t\tgd.grabExcessVerticalSpace = false;\r\n \r\n \t\tGridLayout gridLayout = new GridLayout(1, false);\r\n \t\troot.setLayout(gridLayout);\r\n \t\tGroup generalGroup = new Group(root, SWT.NONE);\r\n \t\tgeneralGroup.setLayoutData(gd);\r\n \t\tgeneralGroup.setText(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_GENERAL);\r\n \t\tgridLayout = new GridLayout(3, false);\r\n \r\n \t\tgeneralGroup.setLayout(gridLayout);\r\n \t\tregisterEditor(jBossSeamHomeEditor, generalGroup, 3);\r\n \t\tregisterEditor(jBossAsDeployAsEditor, generalGroup, 3);\r\n \r\n \t\tgd = new GridData();\r\n \t\tgd.horizontalSpan = 1;\r\n \t\tgd.horizontalAlignment = GridData.FILL;\r\n \t\tgd.grabExcessHorizontalSpace = true;\r\n \t\tgd.grabExcessVerticalSpace = false;\r\n \r\n \t\tGroup databaseGroup = new Group(root, SWT.NONE);\r\n \t\tdatabaseGroup.setLayoutData(gd);\r\n \t\tdatabaseGroup.setText(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE);\r\n \t\tgridLayout = new GridLayout(4, false);\r\n \t\tdatabaseGroup.setLayout(gridLayout);\r\n \t\tregisterEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);\r\n \t\tregisterEditor(connProfileSelEditor, databaseGroup, 4);\r\n \t\tregisterEditor(dbSchemaName, databaseGroup, 4);\r\n \t\tregisterEditor(dbCatalogName, databaseGroup, 4);\r\n \t\tregisterEditor(dbTablesExists, databaseGroup, 4);\r\n \t\tregisterEditor(recreateTablesOnDeploy, databaseGroup, 4);\r\n \t\t// registerEditor(pathToJdbcDriverJar,databaseGroup, 4);\r\n \r\n \t\tGroup generationGroup = new Group(root, SWT.NONE);\r\n \t\tgd = new GridData();\r\n \t\tgd.horizontalSpan = 1;\r\n \t\tgd.horizontalAlignment = GridData.FILL;\r\n \t\tgd.grabExcessHorizontalSpace = true;\r\n \t\tgd.grabExcessVerticalSpace = false;\r\n \r\n \t\tgenerationGroup.setLayoutData(gd);\r\n \t\tgenerationGroup.setText(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CODE_GENERATION);\r\n \t\tgridLayout = new GridLayout(3, false);\r\n \t\tgenerationGroup.setLayout(gridLayout);\r\n \t\tregisterEditor(sessionBeanPkgNameditor, generationGroup, 3);\r\n \t\tregisterEditor(entityBeanPkgNameditor, generationGroup, 3);\r\n \t\tregisterEditor(testsPkgNameditor, generationGroup, 3);\r\n \r\n \t\tsetControl(root);\r\n \t\tNewProjectDataModelFacetWizard wizard = (NewProjectDataModelFacetWizard) getWizard();\r\n \r\n \t\tIDataModel model = wizard.getDataModel();\r\n \r\n \t\tif (validatorDelegate == null) {\r\n \t\t\tvalidatorDelegate = new DataModelValidatorDelegate(this.model, this);\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(jBossSeamHomeEditor\r\n \t\t\t\t\t.getName(),\r\n \t\t\t\t\tValidatorFactory.SEAM_RUNTIME_NAME_VALIDATOR);\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(connProfileSelEditor\r\n \t\t\t\t\t.getName(),\r\n \t\t\t\t\tValidatorFactory.CONNECTION_PROFILE_VALIDATOR);\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(testsPkgNameditor\r\n \t\t\t\t\t.getName(), new PackageNameValidator(testsPkgNameditor\r\n \t\t\t\t\t.getName(), \"tests\")); //$NON-NLS-1$\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(entityBeanPkgNameditor\r\n \t\t\t\t\t.getName(), new PackageNameValidator(entityBeanPkgNameditor\r\n \t\t\t\t\t.getName(), \"entity beans\")); //$NON-NLS-1$\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(sessionBeanPkgNameditor\r\n \t\t\t\t\t.getName(), new PackageNameValidator(\r\n \t\t\t\t\tsessionBeanPkgNameditor.getName(), \"session beans\")); //$NON-NLS-1$\r\n \t\t\tvalidatorDelegate.addValidatorForProperty(\r\n \t\t\t\t\tIFacetDataModelProperties.FACET_PROJECT_NAME, \r\n \t\t\t\t\tnew ProjectNamesDuplicationValidator(\r\n \t\t\t\t\t\t\tIFacetDataModelProperties.FACET_PROJECT_NAME));\r\n \t\t}\r\n \r\n \t\tjBossHibernateDbTypeEditor\r\n \t\t\t\t.addPropertyChangeListener(new PropertyChangeListener() {\r\n \t\t\t\t\tpublic void propertyChange(PropertyChangeEvent evt) {\r\n \t\t\t\t\t\tSeamInstallWizardPage.this.model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_DIALECT,\r\n \t\t\t\t\t\tHIBERNATE_HELPER.getDialectClass(evt.getNewValue().toString()));\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t);\r\n \r\n\r\n\r\n Dialog.applyDialogFont(parent);\r\n \t}", "public ToolBarView() {\r\n\t\tbuttonsToolbar = new JButton[14];\r\n\t\tfor (int i = 0; i < imagesToolbar.length; i++) {\r\n\t\t\tif (i == 2 || i == 3 || i == 8 || i == 10 || i == 11 || i == 12 ) {\r\n /* adding separator to the toolbar */\r\n\t\t\t\taddSeparator();\r\n } \r\n /* adding the buttons to toolbar */\r\n\t\t\tadd(buttonsToolbar[i] = new JButton(new ImageIcon(ClassLoader.getSystemResource(imagesToolbar[i]))));\r\n\t\t\t/* setting the ToolTipText to the buttons of toolbar */\r\n\t\t\tbuttonsToolbar[i].setToolTipText(tipText[i]);\r\n\t\t}\r\n\t}", "private void setupToolBar() {\n\t\tbOk = ConfirmPanel.createOKButton(false);\n\t\tbOk.addActionListener(this);\n\t\tbSearch = ConfirmPanel.createRefreshButton(true);\n\t\tbSearch.addActionListener(this);\n\t\tbCancel = ConfirmPanel.createCancelButton(false);\n\t\tbCancel.addActionListener(this);\n\t\tbZoom = ConfirmPanel.createZoomButton(true);\n\t\tbZoom.addActionListener(this);\n\t\tbExport = ConfirmPanel.createExportButton(true);\n\t\tbExport.addActionListener(this);\n\t\tbDelete = ConfirmPanel.createDeleteButton(true);\n\t\tbDelete.addActionListener(this);\n\t\tAppsAction selectAllAction = new AppsAction(\"SelectAll\", null, Msg.getMsg(Env.getCtx(),\"SelectAll\"));\n\t\tselectAllAction.setDelegate(this);\n\t\tbSelectAll = (CButton) selectAllAction.getButton();\n\t\ttoolsBar = new javax.swing.JToolBar();\n\t}", "@Override\n\tprotected Control createDialogArea(Composite parent) {\n\t\tComposite container = (Composite) super.createDialogArea(parent);\n\t\tcontainer.setLayout(new GridLayout(1, false));\n\n\t\tScrolledComposite scrolledComposite = new ScrolledComposite(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tscrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));\n\t\tscrolledComposite.setExpandHorizontal(true);\n\t\tscrolledComposite.setExpandVertical(true);\n\n\t\tfinal Composite composite = new Composite(scrolledComposite, SWT.NONE);\n\t\tcomposite.setLayout(new GridLayout(1, false));\n\n\t\tGroup grpSlectionDuMois = new Group(composite, SWT.NONE);\n\t\tgrpSlectionDuMois.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));\n\t\tgrpSlectionDuMois.setText(\"S\\u00E9lection du mois :\");\n\t\tgrpSlectionDuMois.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n\t\t_comboViewer = new ComboViewer(grpSlectionDuMois, SWT.NONE);\n\t\t_comboViewer.setContentProvider(new MoisStatCP(_controler));\n\t\t_comboViewer.setLabelProvider(new MoisLP());\n\t\t_comboViewer.setInput(new Object());\n\t\t_comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {\n\n\t\t\t@Override\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\n\n\t\t\t\tif (_comboViewer.getSelection() instanceof IStructuredSelection) {\n\n\t\t\t\t\tif (((IStructuredSelection) _comboViewer.getSelection()).getFirstElement() instanceof Calendar) {\n\n\t\t\t\t\t\t_controler.setSelectedMois((Calendar) ((IStructuredSelection) _comboViewer.getSelection()).getFirstElement());\n\t\t\t\t\t\t_tableViewer.refresh();\n\t\t\t\t\t\tcpcc.reDoChart();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\t\n\t\t_comboViewer.setSorter(new ViewerSorter(){\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic int compare(Viewer viewer, Object e1, Object e2) {\n\t\t\t\t\n\t\t\t\treturn ((Calendar)e1).compareTo((Calendar) e2);\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t\tGroup grpDpenses = new Group(composite, SWT.NONE);\n\t\tgrpDpenses.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));\n\t\tgrpDpenses.setText(\"D\\u00E9penses :\");\n\t\tgrpDpenses.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n\t\t_tableViewer = new TableViewer(grpDpenses, SWT.BORDER | SWT.FULL_SELECTION);\n\t\t_table = _tableViewer.getTable();\n\t\t_table.setLinesVisible(true);\n\t\t_table.setHeaderVisible(true);\n\t\t_tableViewer.setContentProvider(new CategorieMoisStatCP(_controler));\n\t\t_tableViewer.setInput(new Object());\n\n\t\tTableViewerColumn tableViewerColumn = new TableViewerColumn(_tableViewer, SWT.NONE);\n\t\tTableColumn tblclmnCatgorie = tableViewerColumn.getColumn();\n\t\ttblclmnCatgorie.setWidth(200);\n\t\ttblclmnCatgorie.setText(\"Cat\\u00E9gorie\");\n\t\ttableViewerColumn.setLabelProvider(new CategorieCellLP());\n\n\t\tTableViewerColumn tableViewerColumn_1 = new TableViewerColumn(_tableViewer, SWT.NONE);\n\t\tTableColumn tblclmnNewColumn = tableViewerColumn_1.getColumn();\n\t\ttblclmnNewColumn.setWidth(100);\n\t\ttblclmnNewColumn.setText(\"Moyenne\");\n\t\ttableViewerColumn_1.setLabelProvider(new CategorieMeanCellLP(_controler));\n\n\t\tTableViewerColumn tableViewerColumn_2 = new TableViewerColumn(_tableViewer, SWT.NONE);\n\t\tTableColumn tblclmnNewColumn_1 = tableViewerColumn_2.getColumn();\n\t\ttblclmnNewColumn_1.setWidth(100);\n\t\ttblclmnNewColumn_1.setText(\"Total\");\n\t\ttableViewerColumn_2.setLabelProvider(new CategorieTotalCellLP(_controler));\n\n\t\tgrpGraphique = new Group(composite, SWT.NONE);\n\t\tgrpGraphique.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));\n\t\tgrpGraphique.setLayout(new FillLayout());\n\t\tgrpGraphique.setText(\"Graphique :\");\n\t\t\n\t\tcpcc =new CategoriePieChartComposite(grpGraphique,_controler);\n\t\t\n\t\t\n\t\tgrpGraphique.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\tscrolledComposite.setContent(composite);\n\t\tscrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));\n\n\t\t_tableViewer.refresh();\n\t\t_comboViewer.refresh();\n\n\t\treturn container;\n\t}", "public VisualizarLlamada() {\n initComponents();\n }", "@Override\r\n\tpublic void createControl(Composite parent) {\n\t\tinitializeDialogUnits(parent);\r\n\r\n\t\tint sectionStyle = Section.TITLE_BAR | Section.CLIENT_INDENT\r\n\t\t\t\t| Section.EXPANDED;\r\n\t\tSection section = toolkit.createSection(parent, sectionStyle);\r\n\t\tsection.setText(\"Bind all parameters to values\");\r\n\t\tsection.setLayout(new GridLayout());\r\n\t\tComposite comp = toolkit.createComposite(section);\r\n\t\tcomp.setLayout(new GridLayout(2, false));\r\n\r\n\t\tcomp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL\r\n\t\t\t\t| GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));\r\n\t\tsection.setClient(comp);\r\n\t\tselectionLabel = toolkit.createLabel(comp, \"\");\r\n\t\tGridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL\r\n\t\t\t\t| GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);\r\n\t\tgridData.horizontalSpan = 2;\r\n\t\tselectionLabel.setLayoutData(gridData);\r\n\r\n\t\tmainComp = comp;\r\n\t\t// PatternToProtocolExportWizard wizard =\r\n\t\t// (PatternToProtocolExportWizard) this\r\n\t\t// .getWizard();\r\n\t\t// assume there are not more than 10 parameters\r\n\t\tint max = 10;\r\n\t\t/*\r\n\t\t * for(CoordinationPattern pattern : wizard.getPatternList()) { int\r\n\t\t * parametersize = pattern.getPatternParameters().size();\r\n\t\t * if(parametersize > max) { max = parametersize; } }\r\n\t\t */\r\n\r\n\t\tif (max > Integer.MIN_VALUE) {\r\n\t\t\tfor (int i = 0; i < max; i++) {\r\n\t\t\t\tLabel l = toolkit.createLabel(mainComp, \"\");\r\n\t\t\t\tl.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL\r\n\t\t\t\t\t\t| GridData.HORIZONTAL_ALIGN_FILL\r\n\t\t\t\t\t\t| GridData.GRAB_HORIZONTAL));\r\n\t\t\t\tText t = toolkit.createText(mainComp, \"\");\r\n\r\n\t\t\t\tt.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL\r\n\t\t\t\t\t\t| GridData.HORIZONTAL_ALIGN_FILL\r\n\t\t\t\t\t\t| GridData.GRAB_HORIZONTAL));\r\n\t\t\t\tl.setVisible(true);\r\n\t\t\t\tt.setVisible(true);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tthis.setControl(section);\r\n\r\n\t}", "private static void createContents() {\r\n\t\t\r\n\t\tcolorPreview = new Composite(colorUI, SWT.BORDER);\r\n\t\tcolorPreview.setBounds(10, 23, 85, 226);\r\n\t\t\r\n\t\tscRed = new Scale(colorUI, SWT.NONE);\r\n\t\tscRed.setMaximum(255);\r\n\t\tscRed.setMinimum(0);\r\n\t\tscRed.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscRed.setBounds(244, 34, 324, 42);\r\n\t\tscRed.setIncrement(1);\r\n\t\tscRed.setPageIncrement(10);\r\n\t\tscRed.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tR = scRed.getSelection();\r\n\t\t\t\tmRed.setText(Integer.toString(scRed.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmRed = new Label(colorUI, SWT.NONE);\r\n\t\tmRed.setAlignment(SWT.RIGHT);\r\n\t\tmRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmRed.setBounds(180, 47, 55, 15);\r\n\t\tmRed.setText(\"0\");\r\n\r\n\t\tscGreen = new Scale(colorUI, SWT.NONE);\r\n\t\tscGreen.setMaximum(255);\r\n\t\tscGreen.setMinimum(0);\r\n\t\tscGreen.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscGreen.setBounds(244, 84, 324, 42);\r\n\t\tscGreen.setIncrement(1);\r\n\t\tscGreen.setPageIncrement(10);\r\n\t\tscGreen.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tG = scGreen.getSelection();\r\n\t\t\t\tmGreen.setText(Integer.toString(scGreen.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmGreen = new Label(colorUI, SWT.NONE);\r\n\t\tmGreen.setAlignment(SWT.RIGHT);\r\n\t\tmGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmGreen.setText(\"0\");\r\n\t\tmGreen.setBounds(180, 97, 55, 15);\r\n\t\t\r\n\t\tscBlue = new Scale(colorUI, SWT.NONE);\r\n\t\tscBlue.setMaximum(255);\r\n\t\tscBlue.setMinimum(0);\r\n\t\tscBlue.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscBlue.setBounds(244, 138, 324, 42);\r\n\t\tscBlue.setIncrement(1);\r\n\t\tscBlue.setPageIncrement(10);\r\n\t\tscBlue.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tB = scBlue.getSelection();\r\n\t\t\t\tmBlue.setText(Integer.toString(scBlue.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmBlue = new Label(colorUI, SWT.NONE);\r\n\t\tmBlue.setAlignment(SWT.RIGHT);\r\n\t\tmBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmBlue.setText(\"0\");\r\n\t\tmBlue.setBounds(180, 151, 55, 15);\r\n\t\t\r\n\t\tscAlpha = new Scale(colorUI, SWT.NONE);\r\n\t\tscAlpha.setMaximum(255);\r\n\t\tscAlpha.setMinimum(0);\r\n\t\tscAlpha.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscAlpha.setBounds(244, 192, 324, 42);\r\n\t\tscAlpha.setIncrement(1);\r\n\t\tscAlpha.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tA = scAlpha.getSelection();\r\n\t\t\t\tmAlpha.setText(Integer.toString(scAlpha.getSelection()));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnOkay = new Button(colorUI, SWT.NONE);\r\n\t\tbtnOkay.setBounds(300, 261, 80, 30);\r\n\t\tbtnOkay.setText(\"Okay\");\r\n\t\tbtnOkay.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.cr.ColorR = R;\r\n\t\t\t\tOptions.cr.ColorG = G;\r\n\t\t\t\tOptions.cr.ColorB = B;\r\n\t\t\t\tOptions.cr.ColorA = A;\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnCancel = new Button(colorUI, SWT.NONE);\r\n\t\tbtnCancel.setText(\"Cancel\");\r\n\t\tbtnCancel.setBounds(195, 261, 80, 30);\r\n\t\tbtnCancel.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(Options.cr.ColorR, Options.cr.ColorG, Options.cr.ColorB));\r\n\t\t\t\tR = Options.cr.ColorR;\r\n\t\t\t\tG = Options.cr.ColorG;\r\n\t\t\t\tB = Options.cr.ColorB;\r\n\t\t\t\tA = Options.cr.ColorA;\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tmAlpha.setAlignment(SWT.RIGHT);\r\n\t\tmAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmAlpha.setText(\"0\");\r\n\t\tmAlpha.setBounds(180, 206, 55, 15);\r\n\t\t\r\n\t\tLabel lblRed = new Label(colorUI, SWT.NONE);\r\n\t\tlblRed.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblRed.setBounds(123, 47, 55, 15);\r\n\t\tlblRed.setText(\"Red\");\r\n\t\t\r\n\t\tLabel lblGreen = new Label(colorUI, SWT.NONE);\r\n\t\tlblGreen.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblGreen.setText(\"Green\");\r\n\t\tlblGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblGreen.setBounds(123, 97, 55, 15);\r\n\t\t\r\n\t\tLabel lblBlue = new Label(colorUI, SWT.NONE);\r\n\t\tlblBlue.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblBlue.setText(\"Blue\");\r\n\t\tlblBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblBlue.setBounds(123, 151, 55, 15);\r\n\t\t\r\n\t\tLabel lblAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tlblAlpha.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblAlpha.setText(\"Alpha\");\r\n\t\tlblAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblAlpha.setBounds(123, 206, 55, 15);\r\n\t\t\r\n\t\t\r\n\t}", "private Widget buildElementWithVSACValueSetWidget() {\r\n mainPanel = new VerticalPanel();\r\n mainPanel.getElement().setId(\"mainPanel_VerticalPanel\");\r\n mainPanel.setWidth(\"95%\");\r\n mainPanel.add(new SpacerWidget());\r\n mainPanel.add(new SpacerWidget());\r\n return mainPanel;\r\n }", "private void setUpGUI() {\n \n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n enzymeTypeCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useFlankingCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n monoPrecursorCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n peptideListCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n decoyFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n keepTerminalAaCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeMethionineCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n exactPvalueCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n spScoreCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n chargesCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useNeutralLossCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n outputFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeTempFoldersCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n \n minPepLengthTxt.setEditable(editable);\n minPepLengthTxt.setEnabled(editable);\n maxPepLengthTxt.setEditable(editable);\n maxPepLengthTxt.setEnabled(editable);\n minPrecursorMassTxt.setEditable(editable);\n minPrecursorMassTxt.setEnabled(editable);\n maxPrecursorMassTxt.setEditable(editable);\n maxPrecursorMassTxt.setEnabled(editable);\n monoPrecursorCmb.setEnabled(editable);\n removeMethionineCmb.setEnabled(editable);\n //minPtmsPerPeptideTxt.setEditable(editable);\n //minPtmsPerPeptideTxt.setEnabled(editable);\n maxPtmsPerPeptideTxt.setEditable(editable);\n maxPtmsPerPeptideTxt.setEnabled(editable);\n maxVariablePtmsPerTypeTxt.setEditable(editable);\n maxVariablePtmsPerTypeTxt.setEnabled(editable);\n enzymeTypeCmb.setEnabled(editable);\n peptideListCmb.setEnabled(editable);\n decoyFormatCombo.setEnabled(editable);\n keepTerminalAaCombo.setEnabled(editable);\n decoySeedTxt.setEditable(editable);\n decoySeedTxt.setEnabled(editable);\n removeTempFoldersCmb.setEnabled(editable);\n exactPvalueCombo.setEnabled(editable);\n spScoreCombo.setEnabled(editable);\n minSpectrumMzTxt.setEditable(editable);\n minSpectrumMzTxt.setEnabled(editable);\n maxSpectrumMzTxt.setEditable(editable);\n maxSpectrumMzTxt.setEnabled(editable);\n minPeaksTxt.setEditable(editable);\n minPeaksTxt.setEnabled(editable);\n chargesCombo.setEnabled(editable);\n removePrecursorPeakCombo.setEnabled(editable);\n removePrecursorPeakToleranceTxt.setEditable(editable);\n removePrecursorPeakToleranceTxt.setEnabled(editable);\n useFlankingCmb.setEnabled(editable);\n useNeutralLossCmb.setEnabled(editable);\n mzBinWidthTxt.setEditable(editable);\n mzBinWidthTxt.setEnabled(editable);\n mzBinOffsetTxt.setEditable(editable);\n mzBinOffsetTxt.setEnabled(editable);\n numberMatchesTxt.setEditable(editable);\n numberMatchesTxt.setEnabled(editable);\n outputFormatCombo.setEnabled(editable);\n \n }", "@Override\n public Component getToolbarPresenter() {\n \n fxPanel = new JFXPanel();\n \n Platform.setImplicitExit(false); //Ensure JavaFX thread does not close application\n Platform.runLater(()-> { //Create FX scene outside Swing Thread\n createFXScene();\n });\n\n return fxPanel;\n }", "@Override\n\tprotected void createAdditionalControls(Composite parent) {\n\t\tComposite container = new Composite(parent, SWT.NONE);\n\t\tcontainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n\t\tGridLayout containerLayout = new GridLayout(2, false);\n\t\tcontainerLayout.marginWidth = 0;\n\t\tcontainer.setLayout(containerLayout);\n\t\t\n\t\tLabel comboLabel = new Label(container, SWT.NONE);\n\t\tcomboLabel.setText(Messages.common_calculation);\n\t\t\n\t\tcalculationTypeCombo = new Combo(container, SWT.READ_ONLY);\n\t\tcalculationTypeCombo.setItems(NamedEnumPropertyDescriptor.getEnumItems(calculationTypes, NullEnum.NOTNULL));\n\t\tcalculationTypeCombo.select(0);\n\t\tcalculationTypeCombo.addSelectionListener(new SelectionAdapter() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tint selectedIndex = calculationTypeCombo.getSelectionIndex();\n\t\t\t\tselectedEnum = (CalculationEnum)calculationTypes[selectedIndex];\n\t\t\t}\n\t\t});\n\t}", "abstract GridPane createSearchDashBoard();", "private JPanel createSelectDocTypePanel(){\n\t\tJPanel toReturn = new JPanel(new GridBagLayout());\n\n\t\tGridBagConstraints gbc = new GridBagConstraints();\n\t\t\n\t\t//add document type JLabel\n\t\tgbc.gridx = 0;\n\t\tgbc.gridy = 0;\n\t\ttoReturn.add(new JLabel(translator.getTranslation(Tags.SELECT_DOCUMENT_TYPE)) , gbc);\n\t\t\t\n\t\t//add comboBox\n\t\tgbc.gridx++;\n\t\tgbc.weightx = 1;\n\t\tgbc.anchor = GridBagConstraints.WEST;\n\t\tgbc.insets.left = 2;\n\t\tgbc.fill = GridBagConstraints.HORIZONTAL;\n\t\ttoReturn.add(combBoxDocumentTypes, gbc);\n\t\t\n\t\t//action for add button\n\t\tAction addDocTypeAction = new AbstractAction() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString docType = JOptionPane.showInputDialog(null, (Object)new JLabel(translator.getTranslation(Tags.INSERT_DOC_TYPE_LABEL)), \"\", \n\t\t\t\t\t\t JOptionPane.PLAIN_MESSAGE);\n\t\t\t\tif(docType !=null && !docType.isEmpty()){\n\t\t\t\t\tcombBoxDocumentTypes.addItem(docType);\n\t\t\t\t\tcombBoxDocumentTypes.setSelectedItem(docType);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\taddDocumentTypeButton = new ToolbarButton(addDocTypeAction, false);\n\t\t\n\t\t// Get the image for toolbar button\n\t\tURL imageToLoad = getClass().getClassLoader().getResource(Images.ADD_ICON);\n\t\tif (imageToLoad != null) {\n\t\t\taddDocumentTypeButton.setText(\"\");\n\t\t\taddDocumentTypeButton.setIcon(ro.sync.ui.Icons.getIcon(imageToLoad.toString()));\n\t\t}\n\t\t\n\t\t//add the addButton\n\t\tgbc.gridx++;\n\t\tgbc.weightx = 0;\n\t\tgbc.insets.left = 0;\n\t\ttoReturn.add(addDocumentTypeButton,gbc);\n\t\t\n\t\t\n\t\t\n\t\t//action for remove button\n\t\t\tAction removeAction = new AbstractAction() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tcombBoxDocumentTypes.removeItem(combBoxDocumentTypes.getSelectedItem());\n\t\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tremoveDocumentTypeButton = new ToolbarButton(removeAction, false);\n\t\t\t\n\t\t\t// Get the image for toolbar button\n\t\t\timageToLoad = getClass().getClassLoader().getResource(Images.REMOVE_ICON);\n\t\t\tif (imageToLoad != null) {\n\t\t\t\tremoveDocumentTypeButton.setText(\"\");\n\t\t\t\tremoveDocumentTypeButton.setIcon(ro.sync.ui.Icons.getIcon(imageToLoad.toString()));\n\t\t\t}\n\t\t\t\n\t\t\t//add the addButton\n\t\t\tgbc.gridx++;\n\t\t\ttoReturn.add(removeDocumentTypeButton,gbc);\n\t\t\n\t\t\n\t\treturn toReturn;\n\t\t\n\t}", "public void MakeStacked() {\n\t\tStackedButton = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(\n\t\t\t\t GetStackedAreaChartImage())));\n\t\tStackedButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Stacked Area Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(StackedButton);\n\t}", "@Override\n public void createPageControls(Composite pageContainer) {\n fSelectionPage.createControl(pageContainer);\n }", "public SummaryPane() {\n\t\tbuildUpGUI();\n\t\tsetDefaultValues();\n\t\t//summaryEditorPane.addHyperlinkListener( new Hyperactive() );\n\t}", "private void selectMenu()\n\t{\n\t\t//clear the panel first\n\t\tclearPanel(getPanel1());\n\t\t\n\t\tJLabel label1=new JLabel(\"Select two rows to inspect data:\");\n\t\t\n\t\t//set up panel\n\t\tgetPanel1().setLayout(null);\n\t\tadd(getPanel1(),BorderLayout.CENTER);\n\t\t\n\t\t//add buttons to panel\n\t\tgetPanel1().add(getButton1());\n\t\tgetPanel1().add(getTopics1());\n\t\tgetPanel1().add(getTopics2());\n\t\tgetPanel1().add(label1);\n\t\t\n\t\t\n\t\t//manually set their position\n\t\tlabel1.setBounds(380,10,400,40);\n\t\tgetButton1().setBounds(430,350,230,60);\n\t\tgetTopics1().setBounds(430,80,230,60);\n\t\tgetTopics2().setBounds(430,215,230,60);\n\n\t\tlabel1.setFont(new Font(\"Serif\", Font.CENTER_BASELINE, 24));\t\n\t}", "private void createContents() {\n\t\tshell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);\n\t\tshell.setSize(750, 450);\n\t\tshell.setText(\"Sensitivity Analysis for: \" + parentNode.getName());\n\t\tshell.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n\t\tsashForm = new SashForm(shell, SWT.NONE);\n\n\t\tscrolledComposite = new ScrolledComposite(sashForm, SWT.BORDER\n\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tscrolledComposite.setExpandHorizontal(true);\n\t\tscrolledComposite.setExpandVertical(true);\n\n\t\tSaCriterionListComp = new Composite(scrolledComposite, SWT.NONE);\n\t\tSaCriterionListComp.setLayout(new RowLayout(SWT.VERTICAL));\n\n\t\t// Create a criterion weighting SaCriterionListComp for every criterion\n\t\tweightingSelectComponents = new SaCriterionWeightingSelectComp[c.length];\n\n\t\tArrayList<Criterion> criteria = parentNode.getCriteria();\n\t\tfor (int i = 0; i < c.length; i++) {\n\n\t\t\tSaCriterionWeightingSelectComp scwsc = new SaCriterionWeightingSelectComp(\n\t\t\t\t\tSaCriterionListComp, SWT.None, criteria.get(i), c[i], i);\n\n\t\t\tscwsc.addWeightingChangedListener(new SaCriterionWeightingChangedListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void doCriterionWeightingChanged(\n\t\t\t\t\t\tSaCriterionWeightingChangedEvent e) {\n\t\t\t\t\tupdateCriteriaWeightings(e.getCriterionIndex(),\n\t\t\t\t\t\t\te.getNewValue());\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tweightingSelectComponents[i] = scwsc;\n\t\t}\n\n\t\tscrolledComposite.setContent(SaCriterionListComp);\n\t\tscrolledComposite.setMinSize(SaCriterionListComp.computeSize(\n\t\t\t\tSWT.DEFAULT, SWT.DEFAULT));\n\n\t\tscrolledComposite_1 = new ScrolledComposite(sashForm, SWT.BORDER\n\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL);\n\t\tscrolledComposite_1.setExpandHorizontal(true);\n\t\tscrolledComposite_1.setExpandVertical(true);\n\n\t\tSaAlternativeWeighingComp = new Composite(scrolledComposite_1, SWT.NONE);\n\t\tSaAlternativeWeighingComp.setLayout(new RowLayout(SWT.VERTICAL));\n\n\t\t// Create a bar component for every alternative\n\t\talternativeBarComponents = new SaAlternativeWeightingBarComp[a.length];\n\n\t\tfor (int i = 0; i < alternatives.size(); i++) {\n\t\t\tSaAlternativeWeightingBarComp sawc = new SaAlternativeWeightingBarComp(\n\t\t\t\t\tSaAlternativeWeighingComp, SWT.NONE, alternatives.get(i)\n\t\t\t\t\t\t\t.getName(), a[i]);\n\n\t\t\talternativeBarComponents[i] = sawc;\n\t\t}\n\n\t\tscrolledComposite_1.setContent(SaAlternativeWeighingComp);\n\t\tscrolledComposite_1.setMinSize(SaAlternativeWeighingComp.computeSize(\n\t\t\t\tSWT.DEFAULT, SWT.DEFAULT));\n\n\t\tsashForm.setWeights(new int[] { 1, 1 });\n\n\t\tsetBarValues();\n\t}", "public TesteCrossover() {\n initComponents();\n }", "private void initHomePage() {\r\n welcomePage.setSpacing(30);\r\n HTML welcomeLabel = new HTML(\"<h1 style='color:black;font-family:verdana; font-weight:bold;text-decoration:none;font-style:normal;'>Welcome to DiVA <font size='3'>omics </h1>\");\r\n welcomeLabel.setWidth(\"400px\");\r\n VerticalPanel leftSideLayout = new VerticalPanel();\r\n welcomePage.add(leftSideLayout);\r\n welcomePage.setCellVerticalAlignment(leftSideLayout, VerticalPanel.ALIGN_MIDDLE);\r\n welcomePage.setCellHorizontalAlignment(leftSideLayout, VerticalPanel.ALIGN_RIGHT);\r\n leftSideLayout.add(welcomeLabel);\r\n leftSideLayout.setSpacing(10);\r\n\r\n HTML ieErrorLabel = new HTML(\"<p align=\\\"left\\\" style=\\\"margin-left:0px;color:red;\\\"><font size=\\\"3\\\">It looks like you are using an old version of Internet Explorer. Unfortunatly Internet Explorer 6,7,8,9 and 10 are not supported in the curent version of DiVA. Please try other browsers.</font></p>\");\r\n ieErrorLabel.setWidth(\"400px\");\r\n\r\n HTML infoLabel = new HTML(\"<p align=\\\"justify\\\" style=\\\"margin-left:0px;color:#585858;\\\"><font size=\\\"2\\\">Start using DiVA by selecting a dataset</font></p>\");\r\n infoLabel.setWidth(\"400px\");\r\n\r\n HorizontalPanel selectionLayout = new HorizontalPanel();\r\n\r\n if (oldIE) {\r\n leftSideLayout.add(ieErrorLabel);\r\n } else {\r\n leftSideLayout.add(infoLabel);\r\n leftSideLayout.add(selectionLayout);\r\n selectionLayout.setWidth(\"400px\");\r\n selectionLayout.add(tempSelectDatasetList);\r\n }\r\n\r\n tempSelectDatasetList.getElement().setAttribute(\"style\", \"border: 1px solid gray;height: 24px;font-weight: bold;width: 400px;border-radius: 5px;\");\r\n\r\n leftSideLayout.setCellVerticalAlignment(tempSelectDatasetList, VerticalPanel.ALIGN_MIDDLE);\r\n leftSideLayout.setCellHorizontalAlignment(tempSelectDatasetList, VerticalPanel.ALIGN_LEFT);\r\n \r\n HTML info2Label = new HTML(\"<p align=\\\"justify\\\" style=\\\"margin-top:20px;margin-left:0px;color:#585858;line-height: 200%;\\\"><font size=\\\"2\\\">Getting started tutorial available <a target=\\\"_blank\\\" href='\" +\"tutorial/diva_tutorial.pdf\" + \"'>here</a>. </font><br/><font size=\\\"2\\\">More information available <a target=\\\"_blank\\\" href='\" + \"http://diva-omics-demo.googlecode.com/\" + \"'>here</a>. </font></p>\");\r\n leftSideLayout.add(info2Label);\r\n\r\n// HTML info3Label = new HTML(\"<p align=\\\"justify\\\" style=\\\"margin-top:5px;margin-left:0px;color:#585858;\\\"><font size=\\\"2\\\">More information available <a target=\\\"_blank\\\" href='\" + \"http://diva-omics-demo.googlecode.com/\" + \"'>here</a>. </font></p>\");\r\n// leftSideLayout.add(info3Label);\r\n\r\n Image screenImg = new Image(\"images/divascreen1.png\");\r\n screenImg.getElement().setAttribute(\"style\", \"width:640px;\");\r\n\r\n welcomePage.add(screenImg);\r\n welcomePage.setCellVerticalAlignment(screenImg, VerticalPanel.ALIGN_MIDDLE);\r\n welcomePage.setCellHorizontalAlignment(screenImg, VerticalPanel.ALIGN_CENTER);\r\n tempSelectDatasetList.setFocus(true);\r\n\r\n }" ]
[ "0.68818516", "0.64811087", "0.63617045", "0.61782485", "0.61098", "0.6083931", "0.6065876", "0.6011963", "0.6005443", "0.6004427", "0.6003962", "0.597917", "0.5964754", "0.5961197", "0.5926585", "0.59058166", "0.5868826", "0.5855421", "0.5813672", "0.5788606", "0.577924", "0.5773572", "0.5771713", "0.57658243", "0.5740325", "0.5736943", "0.573327", "0.5700959", "0.56989247", "0.5698432", "0.5694457", "0.5673757", "0.5668128", "0.56489354", "0.5641544", "0.5631486", "0.5627711", "0.56220496", "0.5609715", "0.560281", "0.5593996", "0.55899936", "0.5586647", "0.5580075", "0.55793583", "0.5579043", "0.5576512", "0.5569582", "0.556251", "0.5562068", "0.55596846", "0.5557086", "0.5550439", "0.55457014", "0.5541352", "0.55398893", "0.5531893", "0.5531316", "0.55291533", "0.5526666", "0.55216026", "0.5520449", "0.5518195", "0.5517426", "0.55148214", "0.5508836", "0.5508799", "0.55025846", "0.54947376", "0.5494383", "0.5493408", "0.5487615", "0.5484088", "0.5483063", "0.54693884", "0.54686797", "0.5465888", "0.5465815", "0.5459135", "0.5456325", "0.5450483", "0.5450477", "0.544954", "0.54475516", "0.5443552", "0.54412985", "0.5440321", "0.54374313", "0.5433257", "0.5428806", "0.5427563", "0.5425282", "0.54242134", "0.54229736", "0.5421669", "0.541955", "0.54139286", "0.5399824", "0.53995264", "0.53977764" ]
0.626864
3
creates the top bar used for switching between visualizations
private Composite createTopBar(Composite parent, int span) { Composite c = new Composite(parent, SWT.NO_BACKGROUND); GridData cData = new GridData(); cData.horizontalSpan = span; cData.horizontalAlignment = GridData.FILL; c.setLayoutData(cData); GridLayout layout = new GridLayout(); layout.numColumns = 3; c.setLayout(layout); Label weightLabel = new Label(c, SWT.LEFT); GridData weightData = new GridData(); weightData.grabExcessHorizontalSpace = true; weightLabel.setLayoutData(weightData); weightLabel.setText(Resources.getMessage("RiskWizard.19")); FontDescriptor boldDescriptor = FontDescriptor.createFrom(weightLabel.getFont()).setStyle(SWT.BOLD); Font boldFont = boldDescriptor.createFont(weightLabel.getDisplay()); weightLabel.setFont(boldFont); fileLabel = weightLabel; final Combo visualizationDropDown = new Combo(c, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); String monitorTitle = Resources.getMessage("RiskWizard.12"); String stacksTitle = Resources.getMessage("RiskWizard.13"); visualizationDropDown.add(monitorTitle); visualizationDropDown.add(stacksTitle); visualizationDropDown.setText(monitorTitle); visualizationDropDown.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { String selected = visualizationDropDown.getText(); if(selected.equals(stacksTitle)) { //System.out.println("Select Stacks"); showStacksVisualization(); } else if(selected.equals(monitorTitle)) { //System.out.println("Select Monitor"); showMonitorVisualization(); } } }); Label separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL); GridData sepData = new GridData(); sepData.horizontalSpan = layout.numColumns; sepData.grabExcessHorizontalSpace = true; sepData.horizontalAlignment = GridData.FILL; separator.setLayoutData(sepData); topBar = c; return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private JPanel topBar() {\n\t\t\n\t\t//creating a top bar with controls\n\t\tJPanel topBar = new JPanel();\n\t\tColor myPurp = new Color(191, 123, 123);\n\t\ttopBar.setBackground(myPurp);\n\t\t\n\t\t//reset button with listener\n\t\ttopBar.add(reset);\n\t\treset.addActionListener(this);\n\t\t\n\t\t//creating button that starts simulation\n\t\tstart.setSelected(false);\n\t\tstart.addActionListener(this);\n\t\ttopBar.add(start);\n\t\t\n\t\t//creating button that stops simulation\n\t\tstop.setSelected(true);\n\t\tstop.addActionListener(this);\n\t\ttopBar.add(stop);\n\t\t\n\t\t//button group to ensure you cannot start and stop at same time\n\t\tButtonGroup startStop = new ButtonGroup();\n\t\tstartStop.add(start);\n\t\tstartStop.add(stop);\n\t\t\n\t\t//creating label that shows # of steps\n\t\tsteps.setHorizontalAlignment(JLabel.CENTER);\n\t\ttopBar.add(steps);\n\t\t\n\t\t\n\t\treturn topBar;\n\t}", "private void setupToolbars(){\n\t\ttopBar = new TopBar(0, 0, setup.getFrameWidth()+12, Constants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.COLOR_HEADER_1, setup);\n\t\t\n\t\tbottomBar = new BottomBar(0, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT+(Constants.WINDOW_MAP_MARGIN*2)+Constants.WINDOW_MAP_HEIGHT, \n\t\t\t\tsetup.getFrameWidth()+12, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.COLOR_HEADER_1, setup);\n\t\t\n\t\trightBar = new RightBar((Constants.WINDOW_MAP_MARGIN*2)+Constants.WINDOW_MAP_WIDTH, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.WINDOW_RIGHT_BAR_WIDTH, \n\t\t\t\tConstants.WINDOW_RIGHT_BAR_HEIGHT, \n\t\t\t\tConstants.COLOR_MAP_LAND, setup);\n\t}", "private void CreateToolBars(){\n toolBar = new ToolBar();\n btoolBar = new ToolBar();\n login=new Button(\"Login\");\n simulate=new Button(\"Simulate\");\n scoreBoardButton=new Button(\"ScoreBoard\");\n viewBracket= new Button(\"view Bracket\");\n clearButton=new Button(\"Clear\");\n resetButton=new Button(\"Reset\");\n finalizeButton=new Button(\"Finalize\");\n toolBar.getItems().addAll(\n createSpacer(),\n login,\n simulate,\n scoreBoardButton,\n viewBracket,\n createSpacer()\n );\n btoolBar.getItems().addAll(\n createSpacer(),\n clearButton,\n resetButton,\n finalizeButton,\n createSpacer()\n );\n }", "private void createTopPanel(){\n computerPaquetView = new ViewDeckVisible(true);\n this.getContentPane().add(computerPaquetView);\n }", "@Override\n\tprotected void initTopbar(){\n\t\tsuper.initTopbar();\n\t\tTextView textView = new TextView(mContext);\n\t\ttextView.setText(\"宝贝\");\n\t\ttextView.setTextSize(22);\n\t\ttextView.setTextColor(Color.BLACK);\n\t\tTopBar topBar = new TopBar(this,false, textView, null);\n\t\ttopBar.bind();\n\t}", "private void initTop(BorderPane root) {\n // Make HBox\n HBox topBox = new HBox();\n // Set Label\n Label titleLabel = new Label(); // title label for top of UI\n titleLabel.setStyle(\"-fx-font-size:20\");\n titleLabel.setText(\n \"Fair Job Planning System \" + date.format(new Date()) + \" \" + clock.format(new Date()));\n titleLabel.setPadding(new Insets(20, 0, 20, 100));\n\n // Add stuff to topBox\n topBox.getChildren().addAll(titleLabel);\n // Add to BorderPane root\n root.setTop(topBox);\n }", "@Override\n protected void initializeToolBars() {\n SharedToolBar sharedToolbar = getSharedToolBar();\n sharedToolbar.addPushButton(new HelpAction(\"org.geocraft.ui.traceviewer.MapPlot\"));\n\n // Create a custom toolbar just for the trace viewer.\n SimpleToolBar toolbar = addCustomToolBar();\n\n // Add a color selector for choosing the background color.\n final ColorSelector colorSelector = toolbar.addColorSelector(getBackgroundViewColor());\n colorSelector.getButton().setToolTipText(\"Select background color\");\n colorSelector.addListener(new IPropertyChangeListener() {\n\n /**\n * Invoked when a color is chosen in the color selector.\n * \n * @param event\n * the property change event.\n */\n public void propertyChange(final PropertyChangeEvent event) {\n RGB newColor = colorSelector.getColorValue();\n setBackgroundViewColor(newColor);\n _plot.getModelSpaceCanvas().setGridLineProperties(LineStyle.NONE, newColor, 0);\n }\n });\n }", "private void createToolbar() {\r\n // the visible toolbar is actually a toolbar next to a combobox.\r\n // That is why we need this extra composite, layout and numColums = 2.\r\n final Composite parent = new Composite(SHELL, SWT.FILL);\r\n final GridLayout layout = new GridLayout();\r\n layout.numColumns = 2;\r\n parent.setLayout(layout);\r\n\r\n final ToolBar bar = new ToolBar(parent, SWT.NONE);\r\n final GridData data = new GridData();\r\n data.heightHint = 55;\r\n data.grabExcessVerticalSpace = false;\r\n bar.setLayoutData(data);\r\n bar.setLayout(new GridLayout());\r\n\r\n createOpenButton(bar);\r\n\r\n createGenerateButton(bar);\r\n\r\n createSaveButton(bar);\r\n\r\n createSolveButton(bar);\r\n\r\n createAboutButton(bar);\r\n\r\n algorithmCombo = new AlgorithmCombo(parent);\r\n }", "private void init_titlebar() {\n\t\tbackBtn = (Button) findViewById(R.id.titlebar_back);\n\t\ttitleTv = (TextView) findViewById(R.id.titlebar_title);\n\t\totherBtn = (Button) findViewById(R.id.titlebar_other);\n\n\t\tbackBtn.setOnClickListener(this);\n\t\ttitleTv.setText(R.string.WXYT);\n\t\totherBtn.setVisibility(View.GONE);\n\t\tprogressBar = (ProgressBar) findViewById(R.id.progressbar);\n\t\tprogressBar\n\t\t\t\t.setScrollBarStyle(android.R.attr.progressBarStyleHorizontal);\n\t}", "public void MakeBar() {\n\t\tBarButton = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(GetBarChartImage())));\t\n\t\tBarButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Bar chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(BarButton);\t\n\t}", "public void createStatusBar(JPanel bar) {\n bar.setPreferredSize(new Dimension(getWidth(), 25));\n bar.setBackground(Color.LIGHT_GRAY);\n\n // add into container\n bar.add(paintModule.sizeLabel);\n bar.add(paintModule.coordinate);\n\n }", "private JPanel buildTopPanel() {\n\t\tJPanel topPanel = new JPanel(new BorderLayout());\n\t\t\n\t\tJLabel titleLabel = new JLabel(\"Montessori Monkeys\");\n\t\ttitleLabel.setFont(Design.getSmallTitleFont());\n\t\ttitleLabel.setForeground(Design.getDarkGreen());\n\t\t\n\t\t//empty border around the title (top, left, bottom, right)\n\t\ttitleLabel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));\n\t\t\t\t\n\t\tJLabel adminLogin = new JLabel(\"Admin Login\");\n\t\tadminLogin.setFont(Design.getBoldFont());\n\t\tadminLogin.setBorder(BorderFactory.createEmptyBorder(10, 30, 10, 10));\n\t\t\n\t\ttopPanel.add(titleLabel, BorderLayout.NORTH);\n\t\ttopPanel.add(adminLogin, BorderLayout.CENTER);\t\n\t\ttopPanel.setBackground(Design.getLightGreen());\n\t\t\n\t\treturn topPanel;\n\t}", "private void buildTopPanel() {\n \t\tJPanel panel = new JPanel();\n \t\tpanel.setLayout(new BorderLayout(10, 10));\n \t\t\n \t\t// this does not need to be referenced else where, only for layout\n \t\tJPanel paneButtons = new JPanel();\n \t\tGridLayout bl = new GridLayout(2, 1);\n \t\tpaneButtons.setLayout(bl);\n \t\t\n \t\tpaneButtons.add(bCastOff);\n \t\tpaneButtons.add(bSavePlayer);\n \t\t\n \t\t// add all components on top:\n \t\tpanel.add(imgDisplay, BorderLayout.LINE_START);\n \t\tpanel.add(paneEditFields, BorderLayout.CENTER);\n \t\tpanel.add(paneButtons, BorderLayout.LINE_END);\n \t\t\n \t\tadd(panel, BorderLayout.PAGE_START);\n \t}", "public TopMenuBar(DrawWindow dw){\n\t\tthis.dw = dw;\n\t\tthis.paint = dw.getPaint();\n\t\tbuild();\n\t}", "private Component createToolBar()\n {\n Component toolbarPanel = null;\n\n mainToolBar = new MainToolBar(this);\n\n boolean chatToolbarVisible\n = ConfigurationUtils.isChatToolbarVisible();\n\n if (OSUtils.IS_MAC)\n {\n UnifiedToolBar macToolbarPanel = new UnifiedToolBar();\n\n MacUtils.makeWindowLeopardStyle(getRootPane());\n\n macToolbarPanel.addComponentToLeft(mainToolBar);\n macToolbarPanel.addComponentToRight(contactPhotoPanel);\n macToolbarPanel.disableBackgroundPainter();\n macToolbarPanel.installWindowDraggerOnWindow(this);\n macToolbarPanel.getComponent()\n .setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));\n macToolbarPanel.getComponent().setVisible(chatToolbarVisible);\n\n toolbarPanel = macToolbarPanel.getComponent();\n }\n else\n {\n ToolbarPanel panel = new ToolbarPanel(new BorderLayout());\n\n panel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));\n panel.add(mainToolBar, BorderLayout.CENTER);\n panel.add(contactPhotoPanel, BorderLayout.EAST);\n panel.setVisible(chatToolbarVisible);\n\n toolbarPanel = panel;\n }\n\n return toolbarPanel;\n }", "private void drawTopBorder(StringBuffer canvas) {\n \t\t\tfor (int i=0; i<width; i++)\r\n \t\t\t\tcanvas.append('_'); //Top bar.\r\n \t\t\tcanvas.append('\\n');}", "private void createToolbars() {\r\n\t\tJToolBar toolBar = new JToolBar(\"Tool bar\");\r\n\t\ttoolBar.add(createBlankDocument);\r\n\t\ttoolBar.add(openDocumentAction);\r\n\t\ttoolBar.add(saveDocumentAction);\r\n\t\ttoolBar.add(saveDocumentAsAction);\r\n\t\ttoolBar.add(closeCurrentTabAction);\r\n\t\t\r\n\t\ttoolBar.addSeparator();\r\n\t\ttoolBar.add(copyAction);\r\n\t\ttoolBar.add(cutAction);\r\n\t\ttoolBar.add(pasteAction);\r\n\t\t\r\n\t\ttoolBar.addSeparator();\r\n\t\ttoolBar.add(getStatsAction);\r\n\t\t\r\n\t\ttoolBar.addSeparator();\r\n\t\ttoolBar.add(exitAction);\r\n\t\t\r\n\t\tgetContentPane().add(toolBar, BorderLayout.PAGE_START);\r\n\t}", "@Override\n\tpublic void FacultyTopBar() {\n\t\t\n\t}", "public StatusBar() {\r\n setLayout(new BorderLayout());\r\n setPreferredSize(new Dimension(100, 20));\r\n panel = new WebPanel();\r\n BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.LINE_AXIS);\r\n panel.setLayout(boxLayout);\r\n panel.add(Box.createHorizontalGlue());\r\n add(panel, BorderLayout.CENTER);\r\n setVisible(false);\r\n }", "public void setTopBar(boolean toolBarVisiblity, int backVisibility, String title, int addVisibility,\n int logoutVisibility) {\n if (toolBarVisiblity) {\n mFlToolBar.setVisibility(View.VISIBLE);\n mImgBack.setVisibility(backVisibility);\n mTxtTitle.setText(title);\n mImgAdd.setVisibility(addVisibility);\n mImgLogout.setVisibility(logoutVisibility);\n } else {\n mFlToolBar.setVisibility(View.GONE);\n }\n }", "private void create_toolbar() {\n setSupportActionBar(toolbar);\n getSupportActionBar().setTitle(\"Event Planner\");//this will set the title of our application\n\n }", "private HBox addTopBox() {\n\n // Create a menuTab that is holding all menu nodes to return\n HBox menuTab = new HBox();\n menuTab.setStyle(\"-fx-background-color: DAE6F3;\");\n menuTab.setAlignment(Pos.CENTER);\n menuTab.setPadding(new Insets(15, 12, 15, 12));\n menuTab.setSpacing(10);\n\n // Game status label and Speed controller\n HBox speedTab = new HBox();\n speedTab.setPrefWidth(200);\n speedTab.setSpacing(10);\n speedTab.setAlignment(Pos.CENTER_LEFT);\n Label speedLbl= new Label(\"Speed:\");\n speedLbl.setPrefWidth(80);\n speedLbl.setAlignment(Pos.CENTER);\n\n Slider speedCtrl = new Slider();\n speedCtrl.setPrefWidth(80);\n speedCtrl.setMin(0); speedCtrl.setMax(2);\n speedCtrl.setValue(1);\n speedCtrl.setTooltip(new Tooltip(\"Game Speed\"));\n speedCtrl.setOnMouseDragged(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent mouseEvent) {\n timeline.setRate(speedCtrl.getValue());\n gaming.setRate(Math.max(speedCtrl.getValue(), 0.01D));\n }\n });\n speedTab.getChildren().addAll(speedLbl, speedCtrl);\n //TODO get status?\n timeline.statusProperty().addListener(new ChangeListener<Animation.Status>() {\n @Override\n public void changed(ObservableValue<? extends Animation.Status> observableValue, Animation.Status status, Animation.Status t1) {\n speedLbl.setText(t1.toString());\n }\n });\n\n // Assemble buttons into menuTab\n ButtonBar bb = new ButtonBar();\n Button play = new Button(\"Play\");\n Button pause = new Button(\"Pause\");\n Button reset = new Button(\"Reset\");\n bb.getButtons().addAll(play, pause, reset);\n\n bb.getButtons().forEach(b -> {\n ((Button) b).setPrefWidth(80);\n ((Button) b).setBackground(new Background(bgf));\n ((Button) b).setBorder(new Border(bos));\n });\n\n // Set ActionEvent for 3 buttons\n play.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent actionEvent) {\n if (timeline.getStatus().toString().equals(\"STOPPED\")) {\n gameMap = new CreatureControl(plantQuantity, trexQuantity);\n root.setCenter(gameMap);\n frame = new KeyFrame(Duration.millis(10), new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if (!gameMap.run()) {\n bgmHelper = true;\n playBGM();\n }\n }\n });\n if (!timeline.getKeyFrames().isEmpty()) timeline.getKeyFrames().remove(0); // Help to stable the reset\n timeline.getKeyFrames().add(frame);\n timeline.setRate(1.0D);\n gaming.setRate(1.0D);\n speedCtrl.setValue(1.0D);\n playBGM();\n gameStart = true;\n }\n timeline.play();\n }\n });\n\n pause.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent actionEvent) {\n if (gameStart) timeline.pause();\n }\n });\n\n reset.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent actionEvent) {\n // Reset to title frame in what ever status\n if (gameStart) {\n timeline.stop();\n timeline.setRate(1.0D);\n gaming.setRate(1.0D);\n speedCtrl.setValue(1.0D);\n playBGM();\n gameStart = false;\n bgmHelper = false;\n gameMap = new CreatureControl();\n root.setCenter(gameMap);\n }\n }\n });\n\n // Assemble all nodes into menuTab.\n menuTab.getChildren().addAll(bb, speedTab);\n menuTab.setBorder(new Border(bos));\n return menuTab;\n }", "public ToolBarView() {\r\n\t\tbuttonsToolbar = new JButton[14];\r\n\t\tfor (int i = 0; i < imagesToolbar.length; i++) {\r\n\t\t\tif (i == 2 || i == 3 || i == 8 || i == 10 || i == 11 || i == 12 ) {\r\n /* adding separator to the toolbar */\r\n\t\t\t\taddSeparator();\r\n } \r\n /* adding the buttons to toolbar */\r\n\t\t\tadd(buttonsToolbar[i] = new JButton(new ImageIcon(ClassLoader.getSystemResource(imagesToolbar[i]))));\r\n\t\t\t/* setting the ToolTipText to the buttons of toolbar */\r\n\t\t\tbuttonsToolbar[i].setToolTipText(tipText[i]);\r\n\t\t}\r\n\t}", "private void createToolbars() {\n\t\tJToolBar toolBar = new JToolBar(\"Tools\");\n\t\ttoolBar.setFloatable(true);\n\n\t\ttoolBar.add(new JButton(new ActionNewDocument(flp, this)));\n\t\ttoolBar.add(new JButton(new ActionOpen(flp, this)));\n\t\ttoolBar.add(new JButton(new ActionSave(flp, this)));\n\t\ttoolBar.add(new JButton(new ActionSaveAs(flp, this)));\n\t\ttoolBar.addSeparator();\n\t\ttoolBar.add(new JButton(new ActionCut(flp, this)));\n\t\ttoolBar.add(new JButton(new ActionCopy(flp, this)));\n\t\ttoolBar.add(new JButton(new ActionPaste(flp, this)));\n\t\ttoolBar.addSeparator();\n\t\ttoolBar.add(new JButton(new ActionStatistics(flp, this)));\n\n\t\tthis.getContentPane().add(toolBar, BorderLayout.PAGE_START);\n\t}", "@Override\n protected FlowPanel buildBottomNavBar() {\n return buildTopNavBar();\n }", "@Override\n\tpublic void createControl(Composite parent) {\n\t\tGridLayout layout = new GridLayout();\n\t\tlayout.numColumns = 1;\n\t\tlayout.marginHeight = 0;\n\t\tlayout.marginTop = 0;\n\t\tlayout.marginBottom = 0;\n\t\tlayout.verticalSpacing = 0;\n\t\tlayout.makeColumnsEqualWidth = true;\n\n\t\trootComposite = new Composite(parent, SWT.NO_BACKGROUND);\n\t\trootComposite.setLayout(layout);\n\t\tGridData rootData = new GridData();\n\t\trootData.grabExcessHorizontalSpace = true;\n\t\trootData.horizontalAlignment = GridData.FILL;\n\t\trootData.grabExcessVerticalSpace = true;\n\t\trootData.verticalAlignment = GridData.FILL;\n\t\trootComposite.setLayoutData(rootData);\n\n\t\tcreateTopBar(rootComposite, layout.numColumns);\n\t\t\n\t\tthis.showMonitorVisualization();\n\n\t\tsetControl(rootComposite);\n\t}", "@Override\n\tpublic StatusBar createStatusBar() {\n\t\tLightVisualThemeStatusBar lightVisualThemeStatusBar = new LightVisualThemeStatusBar();\n\t\treturn lightVisualThemeStatusBar;\n\t}", "private BrowserToolbar() {\n\t\tinitComponents();\n\t}", "protected void initTimeBar() {\n\t\tcurrentTimeBar = new SimplePanel();\n\t\tcurrentTimeBar.addStyleName(\"current-time-bar\");\n\t\tcontainer.add(currentTimeBar);\n\t\tint y = dateToPixel(new Date());\n\t\tcurrentTimeBar.getElement().getStyle().setTop(y, Unit.PX);\n\t\t\n\t\tTimer t = new Timer() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tint y = dateToPixel(new Date());\n\t\t\t\tcurrentTimeBar.getElement().getStyle().setTop(y, Unit.PX);\n\t\t\t}\n\t\t};\n\t\tt.scheduleRepeating(1 * 60 * 1000); // Repeat every 1 minutes\n\t}", "public SketchBar(Number top) {\n super(top);\n }", "public MainToolbar createToolbar()\r\n {\n WbSwingUtilities.invoke(this::_createToolbar);\r\n return toolbar;\r\n }", "private FilterBar() {\n\t\t\n\t\tsuper(15);\n\t\tthis.setStyle(\"-fx-background-color: #FFFFFF;\");\n\t\tthis.setPadding(new Insets(25, 25, 25, 25));\n\t\t\n\t\taddNodes();\n\t\taddListeners();\n\t\t\n\t}", "private void initTopPanel()\r\n {\r\n GridBagConstraints TopPanelConstraints = new GridBagConstraints();\r\n GridBagLayout TopPanelLayout = new GridBagLayout();\r\n JPanel TopPanel = new JPanel();\r\n TopPanel.setLayout(TopPanelLayout);\r\n\r\n TopPanelConstraints.insets = new Insets(4, 4, 4, 4);\r\n TopPanelConstraints.anchor = GridBagConstraints.WEST;\r\n TopPanelConstraints.gridwidth = 1;\r\n TopPanelConstraints.gridheight = 1;\r\n TopPanelConstraints.fill = GridBagConstraints.HORIZONTAL;\r\n TopPanelConstraints.weighty = 0.0;\r\n\r\n // The first line.\r\n TopPanelConstraints.gridy = 0;\r\n TopPanelConstraints.gridx = 0;\r\n TopPanelConstraints.weightx = 1.0;\r\n Container FirstLineContainer = buildFirstLine();\r\n TopPanel.add(FirstLineContainer, TopPanelConstraints);\r\n\r\n TopPanelConstraints.gridx = 1;\r\n TopPanelConstraints.weightx = 0.0;\r\n // TopPanel.add(AboutButton, TopPanelConstraints);\r\n\r\n TopPanelConstraints.gridx = 2;\r\n TopPanelConstraints.weightx = 0.0;\r\n // TopPanel.add(ExitButton, TopPanelConstraints);\r\n\r\n // The second line.\r\n TopPanelConstraints.gridy = 1;\r\n TopPanelConstraints.gridx = 0;\r\n TopPanelConstraints.weightx = 1.0;\r\n Container SecondLineContainer = buildSecondLine();\r\n TopPanel.add(SecondLineContainer, TopPanelConstraints);\r\n\r\n TopPanelConstraints.gridx = 1;\r\n TopPanelConstraints.weightx = 0.0;\r\n TopPanelConstraints.gridwidth = 2;\r\n TopPanel.add(SaveResultsButton, TopPanelConstraints);\r\n\r\n \tBrowseButton.addActionListener(new BrowseButtonListener() );\r\n \tSearchButton.addActionListener(new SearchButtonListener() );\r\n \t//ExitButton.addActionListener(new ExitButtonListener() );\r\n \t//AboutButton.addActionListener(new AboutButtonListener() );\r\n \tSaveResultsButton.addActionListener(new SaveButtonListener() );\r\n\r\n\t getContentPane().add(\"North\", TopPanel);\r\n }", "private void showBars() {\n if (!mIsActive || mShowBars) {\n return;\n }\n mShowBars = true;\n mOrientationManager.unlockOrientation();\n showToolBar(true);\n showStatusBar();\n // mActionBar.show();\n //mActivity.getGLRoot().setLightsOutMode(false);\n refreshHidingMessage();\n refreshBottomControlsWhenReady();\n }", "private void defineToolBar() {\r\n //ARREGLO CON LOS BOTONES ORDENADOS POR POSICION\r\n tools = new ImageView[]{im_tool1,im_tool2,im_tool3,im_tool4,im_tool5,im_tool6,im_tool7,im_tool8,im_tool9,im_tool10,im_tool11,im_tool12}; \r\n //CARGA DE LA BD LA CONFIGURACION DE USUARIO PARA LA PANTALLA\r\n toolsConfig = Ln.getInstance().loadToolBar();\r\n // arreglo con cada etiqueta, ordenado por boton\r\n tooltips = new String[]{\r\n \"Nueva \" + ScreenName + \" \",\r\n \"Editar \" + ScreenName + \" \",\r\n \"Guardar \" + ScreenName + \" \",\r\n \"Cambiar Status de \" + ScreenName + \" \",\r\n \"Imprimir \" + ScreenName + \" \",\r\n \"Cancelar \",\r\n \"Sin Asignar \",\r\n \"Faltante en \" + ScreenName + \" \",\r\n \"Devolución en \" + ScreenName + \" \",\r\n \"Sin Asignar\",\r\n \"Sin Asignar\",\r\n \"Buscar \" + ScreenName + \" \"\r\n };\r\n //se asigna la etiqueta a su respectivo boton\r\n for (int i = 0; i < tools.length; i++) { \r\n Tooltip tip_tool = new Tooltip(tooltips[i]);\r\n Tooltip.install(tools[i], tip_tool);\r\n }\r\n \r\n im_tool7.setVisible(false);\r\n im_tool8.setVisible(false);\r\n im_tool9.setVisible(false);\r\n im_tool10.setVisible(false);\r\n im_tool11.setVisible(false);\r\n }", "public void layoutTop() {\n\t\tJPanel top = new JPanel();\n\t\tcloseButton = new JButton(\"Save and Exit\");\n\t\tcloseButton.addActionListener(this);\n\t\ttop.add(closeButton);\n\t\tattendanceButton = new JButton(\"View Attendances\");\n\t\tattendanceButton.addActionListener(this);\n\t\ttop.add(attendanceButton);\n\t\tadd(top, BorderLayout.NORTH);\n\t}", "public void topBarClicked()\n\t{\n\t\tkillMe();\n\t\tnew AccountScreen() {\n\t\t\tpublic void showNextScreen()\n\t\t\t{\n\t\t\t\tnew EnemyCacheScreen(EnemyCacheScreen.getStaticTheCache(), EnemyCacheScreen.getTheUser());\n\t\t\t}\n\t\t};\n\t}", "@Test\n public void testTopBarInitialized() {\n Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();\n appContext.setTheme(R.style.Theme_Entree);\n MenuBarsView v = new MenuBarsView(appContext, null, null);\n\n assertTrue(v.getTopBar() != null);\n }", "public TopPanel2() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public JMTToolBar createToolbar() {\r\n \t\tJMTToolBar toolbar = new JMTToolBar(JMTImageLoader.getImageLoader());\r\n \t\t// Builds an array with all actions to be put in the toolbar\r\n \t\tAbstractJmodelAction[] actions = new AbstractJmodelAction[] { newModel, openModel, saveModel, null,\r\n \t\t\t\t// editUndo, editRedo, null,\r\n \t\t\t\tactionCut, actionCopy, actionPaste, null, editUserClasses, editMeasures, editSimParams, editPAParams, null, switchToExactSolver,\r\n \t\t\t\tnull, simulate, pauseSimulation, stopSimulation, showResults, null, editDefaults, openHelp };\r\n \t\ttoolbar.populateToolbar(actions);\r\n \t\treturn toolbar;\r\n \t}", "private void setActionBar() {\n headView.setText(\"消息中心\");\n headView.setGobackVisible();\n headView.setRightGone();\n // headView.setRightResource();\n }", "public Toolbar() {\n\t\tsuper();\n\t\tthis.setLayout(new FlowLayout(FlowLayout.CENTER));\n\t\tboxColor = new Color(230, 230, 184);\n\t\tbuttonColor = new Color(255, 255, 102);\n\t\t// graphBottomColor = new Color(108, 123, 139);\n\t\t// graphTopColor = new Color(159, 182, 205);\n\t\t// titleRectColor = new Color(184, 230, 92);\n\n\t\teventTypeLabel = new JLabel(\"Event Type:\");\n\t\teventTypeDropDown = new Choice();\n\n\t\tareaLabel = new JLabel(\"Area:\");\n\t\tareaDropDown = new Choice();\n\n\t\tnumberOfPmuLabel = new JLabel(\"Number of PMU:\");\n\t\tnumberOfPmuDropDown = new Choice();\n\n\t\tnoiseLabel = new JLabel(\"Varience of Noise:\");\n\t\tlowNoiseTextBox = new JTextField(5);\n\t\thighNoiseTextBox = new JTextField(5);\n\n\t\t// adding data to drop down\n\t\teventTypeDropDown.add(\"-----\");\n\t\teventTypeDropDown.add(\"Fault\");\n\t\teventTypeDropDown.add(\"Generation Loss\");\n\t\teventTypeDropDown.add(\"Load Switch Off\");\n\t\teventTypeDropDown.add(\"Load Switch On\");\n\t\teventTypeDropDown.add(\"Reactive Power Excluded\");\n\t\teventTypeDropDown.add(\"Reactive Power Introduced\");\n\t\teventTypeDropDown.add(\"Synchronous Motor Switching Off\");\n\t\teventTypeDropDown.add(\"Series Capacitor Switching Off\");\n\t\teventTypeDropDown.add(\"Series Capacitor Switching On\");\n\n\t\t// adding data to drop down\n\t\tareaDropDown.add(\"ALBERTA -- 54\");\n\t\tareaDropDown.add(\"ARIZONA -- 14\");\n\t\tareaDropDown.add(\"B.C. HYDRO -- 50\");\n\t\tareaDropDown.add(\"EL PASO -- 11\");\n\t\tareaDropDown.add(\"IDAHO -- 60\");\n\t\tareaDropDown.add(\"IMPERIALCA -- 21\");\n\t\tareaDropDown.add(\"LADWP -- 26\");\n\t\t// areaDropDown.add(\"MEXICO-CFE -- 20\");\n\t\tareaDropDown.add(\"MONTANA -- 62\");\n\t\tareaDropDown.add(\"NEVADA -- 18\");\n\t\tareaDropDown.add(\"NEW MEXICO -- 10\");\n\t\tareaDropDown.add(\"NORTHWEST -- 40\");\n\t\tareaDropDown.add(\"PACE -- 65\");\n\t\tareaDropDown.add(\"PG AND E -- 30\");\n\t\tareaDropDown.add(\"PSCOLORADO -- 70\");\n\t\tareaDropDown.add(\"SANDIEGO -- 22\");\n\t\tareaDropDown.add(\"SIERRA -- 64\");\n\t\tareaDropDown.add(\"SOCALIF -- 24\");\n\t\tareaDropDown.add(\"FORTISBC -- 52\");\n\t\tareaDropDown.add(\"WAPA R.M. -- 73\");\n\t\t// areaDropDown.add(\"WAPA U.M. -- 63\");\n\n\t\t// adding data to drop down\n\t\tnumberOfPmuDropDown.add(\"10\");\n\t\tnumberOfPmuDropDown.add(\"9\");\n\t\tnumberOfPmuDropDown.add(\"8\");\n\t\tnumberOfPmuDropDown.add(\"7\");\n\t\tnumberOfPmuDropDown.add(\"6\");\n\t\tnumberOfPmuDropDown.add(\"5\");\n\t\tnumberOfPmuDropDown.add(\"4\");\n\t\tnumberOfPmuDropDown.add(\"3\");\n\t\tnumberOfPmuDropDown.add(\"2\");\n\t\tnumberOfPmuDropDown.add(\"1\");\n\n\t\tstartButton = new JButton(\"Start\");\n\t\tstartButton.setFocusPainted(false);\n\t\tstopButton = new JButton(\"Stop\");\n\t\tstopButton.setFocusPainted(false);\n\t\tcreateEventButton = new JButton(\"Disturbance\");\n\t\tcreateEventButton.setFocusPainted(false);\n\t\tcreateEventButton.setEnabled(false);\n\t\tstopButton.setEnabled(false);\n\n\t\teventTypeDropDown.setBackground(boxColor);\n\t\tareaDropDown.setBackground(boxColor);\n\t\tnumberOfPmuDropDown.setBackground(boxColor);\n\n\t\tstartButton.setBackground(Color.green);\n\t\tstopButton.setBackground(Color.red);\n\t\tcreateEventButton.setBackground(buttonColor);\n\n\t\tstartButton.setForeground(Color.black);\n\t\tstopButton.setForeground(Color.black);\n\n\t\t// adding components to the panel\n\t\tthis.add(eventTypeLabel);\n\t\tthis.add(eventTypeDropDown);\n\n\t\tthis.add(areaLabel);\n\t\tthis.add(areaDropDown);\n\n\t\tthis.add(numberOfPmuLabel);\n\t\tthis.add(numberOfPmuDropDown);\n\n\t\tthis.add(noiseLabel);\n\t\tthis.add(lowNoiseTextBox);\n\t\tthis.add(highNoiseTextBox);\n\n\t\tthis.add(startButton);\n\t\tthis.add(stopButton);\n\t\tthis.add(createEventButton);\n\n\t\t// listeners get initialized here so that when the toolbar is\n\t\t// constructed there in only one instance of the listeners\n\t\tstartButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.START_BUTTON, tools));\n\t\tstopButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.STOP_BUTTON, tools));\n\t\tcreateEventButton.addActionListener(new ToolbarListener(\n\t\t\t\tToolbarListener.CREATE_EVENT_BUTTON, tools));\n\n\t}", "BossBar createBossBar(String title, BossColor color, BossStyle style);", "public Boolean getShowHBar() { return _showHBar; }", "private static ToolBar header(Stage stage) {\n\t\t// Main menu button on the right\n\t\tButton mainMenu = new Button(\"Main menu\");\n\t\tmainMenu.setOnAction(actionEvent -> mainMenu(stage));\n\t\t\n\t\t// Username on the left\n\t\tLabel usernameLabel = new Label(UserInterfaceLogic.getUsernameLabel());\n\t\t\n\t\tToolBar toolBar = new ToolBar();\n\t\ttoolBar.getItems().addAll(usernameLabel, new Separator(), mainMenu);\n\t\t\n\t\treturn toolBar;\n\t}", "public void MakeBar3D() {\n\t\tBarButton3D = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(\n\t\t\t\t\tGet3DBarChartImage())));\n\t\tBarButton3D.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\t\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart3D(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"3D Bar Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new BarChart3D(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\t\n\t\t\n\t\tChartTypeInterface.add(BarButton3D);\n\t}", "void setupBars() {\n\n // ID, Horiz, Left\n bars.add(new LedBar(0, false, true));\n bars.add(new LedBar(1, true, true));\n bars.add(new LedBar(2, false, false));\n bars.add(new LedBar(3, false, true));\n bars.add(new LedBar(4, true, true));\n bars.add(new LedBar(5, true, false));\n bars.add(new LedBar(6, true, false));\n bars.add(new LedBar(7, true, false));\n bars.add(new LedBar(8, true, false));\n bars.add(new LedBar(9, true, true));\n bars.add(new LedBar(10, false, true));\n bars.add(new LedBar(11, false, false));\n bars.add(new LedBar(12, true, true));\n bars.add(new LedBar(13, false, false));\n bars.add(new LedBar(14, false, true));\n\n // hnext, hprev, vbro\n bars.get(0).setLinks(null, null, bars.get(4));\n bars.get(1).setLinks(bars.get(4), bars.get(8), bars.get(3));\n bars.get(2).setLinks(null, null, bars.get(5));\n bars.get(3).setLinks(null, null, bars.get(1));\n bars.get(4).setLinks(bars.get(9), bars.get(1), bars.get(0));\n bars.get(5).setLinks(bars.get(6), bars.get(12), bars.get(2));\n bars.get(6).setLinks(bars.get(7), bars.get(5), bars.get(11));\n bars.get(7).setLinks(bars.get(8), bars.get(6), bars.get(13));\n bars.get(8).setLinks(bars.get(1), bars.get(7), null); //Only one that hasn't got a vertical 'brother'\n bars.get(9).setLinks(bars.get(12), bars.get(4), bars.get(14));\n bars.get(10).setLinks(null, null, bars.get(12));\n bars.get(11).setLinks(null, null, bars.get(6));\n bars.get(12).setLinks(bars.get(5), bars.get(9), bars.get(10));\n bars.get(13).setLinks(null, null, bars.get(7));\n bars.get(14).setLinks(null, null, bars.get(9));\n\n verticals.add(0);\n verticals.add(2);\n verticals.add(3);\n verticals.add(10);\n verticals.add(11);\n verticals.add(13);\n verticals.add(14);\n }", "private void setupSystemUI() {\r\n toolbar.animate().translationY(Measure.getStatusBarHeight(getResources())).setInterpolator(new DecelerateInterpolator())\r\n .setDuration(0).start();\r\n getWindow().getDecorView().setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\r\n }", "private void setUpHeader() {\n header = new JPanel();\n header.setLayout(new BorderLayout());\n header.setBackground(Color.darkGray);\n highscoreTitle = new JLabel();\n highscoreTitle.setText(\"Highscores:\");\n highscoreTitle.setForeground(Color.white);\n highscoreTitle.setHorizontalAlignment(JLabel.CENTER);\n highscoreTitle.setFont(new Font(\"Arial Black\", Font.BOLD, 24));\n header.add(highscoreTitle, BorderLayout.CENTER);\n setUpSortingBtn();\n\n rootPanel.add(header, BorderLayout.NORTH);\n }", "private void drawWindowSetup(){\n\t\t//draw header\n\t\ttopBar.draw(graphics);\n\t\t//draw footer\n\t\tbottomBar.draw(graphics);\n\t\t//draw right bar\n\t\trightBar.draw(graphics);\n\t}", "@Override\n public int getNumGuiBars() {\n return 1;\n }", "private void configureToolBar() {\n toolBar = findViewById(R.id.my_first_toolbar);\n setSupportActionBar(toolBar);\n getSupportActionBar().setDisplayShowTitleEnabled(false);\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 }", "private void createToolBar() {\r\n toolbar = new JToolBar();\r\n inbox = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.INBOX_ICON)), \"Maintain Inbox\", \"Maintain Inbox\");\r\n awards = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.AWARDS_ICON)), \"Maintain Awards\", \"Maintain Awards\");\r\n proposal = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.PROPOSAL_ICON)), \"Maintain InstituteProposals\", \"Maintain Institute Proposals\");\r\n proposalDevelopment = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.PROPOSAL_DEVELOPMENT_ICON)), \"Maintain ProposalDevelopment\", \"Maintain Proposal Development\");\r\n rolodex = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.ROLODEX_ICON)), \"Maintain Rolodex\", \"Maintain Rolodex\");\r\n sponsor = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.SPONSOR_ICON)), \"Maintain Sponsor\", \"Maintain Sponsor\");\r\n subContract = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.SUBCONTRACT_ICON)), \"Maintain SubContract\", \"Maintain Subcontract\");\r\n negotiations = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.NEGOTIATIONS_ICON)), \"Maintain Negotiations\", \"Maintain Negotiations\");\r\n buisnessRules = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.BUSINESS_RULES_ICON)), \"Maintain BusinessRules\", \"Maintain Business Rules\");\r\n map = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.MAP_ICON)), \"Maintain Map\", \"Maintain Map\");\r\n personnal = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.PERSONNAL_ICON)), \"Maintain Personal\", \"Maintain Personnel\");\r\n users = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.USERS_ICON)), \"Maintain Users\", \"Maintain Users\");\r\n unitHierarchy = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.UNIT_HIERARCHY_ICON)), \"Maintain UnitHierarchy\", \"Maintain Unit Hierarchy\");\r\n cascade = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.CASCADE_ICON)), \"Cascade\", \"Cascade\");\r\n tileHorizontal = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.TILE_HORIZONTAL_ICON)), \"Tile Horizontal\", \"Tile Horizontal\");\r\n tileVertical = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.TILE_VERTICAL_ICON)), \"Tile Vertical\", \"Tile Vertical\");\r\n layer = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.LAYER_ICON)), \"Layer\", \"Layer\");\r\n \r\n /*Added Icons are Committe,Protocol,Shedule. The Icons are different.Non-availability of standard Icon - Chandrashekar*/\r\n //Added for COEUSQA-2580_Change menu item name from \"Protocol\" to \"IRB Protocol\" on Maintain menu in Premium - Start\r\n /* JM 05-02-2013\r\n irbProtocol = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.PROTOCOL_ICON)), \"Protocol\", \"IRB Protocol\");\r\n \r\n irbProtocolSubmission = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.PROTOCOL_SUBMISSION_BASE_ICON)),\"Protocol Submission\",\"IRB Protocol Submission\");\r\n */\r\n //Added for COEUSQA-2580_Change menu item name from \"Protocol\" to \"IRB Protocol\" on Maintain menu in Premium - End\r\n /* JM 05-02-2013\r\n schedule = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.SCHEDULE_ICON)), \"Schedule\", \"Schedule\");\r\n committee = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.COMMITTEE_ICON)), \"Committee\", \"Committee\");\r\n */\r\n //Added for COEUSQA-2580_Change menu item name from \"Protocol\" to \"IRB Protocol\" on Maintain menu in Premium - Start\r\n //irbProtocolSubmission = new CoeusToolBarButton(new ImageIcon(\r\n // getClass().getClassLoader().getResource(CoeusGuiConstants.PROTOCOL_SUBMISSION_BASE_ICON)),\"Protocol Submission\",\"IRB Protocol Submission\");\r\n //Added for COEUSQA-2580_Change menu item name from \"Protocol\" to \"IRB Protocol\" on Maintain menu in Premium - End\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium start\r\n /* JM 05-02-2013\r\n iacucProtocol = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.IACUC_PROTOCOL_ICON)), \"Protocol\", \"IACUC Protocol\");\r\n \r\n iacucProtocolSubmission = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.IACUC_PROTOCOL_SUBMISSION_BASE_ICON)),\"Protocol Submission\",\"IACUC Protocol Submission\");\r\n */\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium end\r\n \r\n /* JM 4-25-2016 adding new Contact Coeus Help button */\r\n contactCoeusHelp = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.HELP_ICON)), \"Contact Coeus Help\", \"Contact Coeus Help\");\r\n /* JM END */\r\n \r\n exit = new CoeusToolBarButton(new ImageIcon(\r\n getClass().getClassLoader().getResource(CoeusGuiConstants.EXIT_ICON)), \"Exit\", \"Exit\");\r\n \r\n \r\n toolbar.add(inbox);\r\n toolbar.addSeparator();\r\n toolbar.add(awards);\r\n toolbar.add(proposal);\r\n toolbar.add(proposalDevelopment);\r\n toolbar.add(rolodex);\r\n toolbar.add(sponsor);\r\n toolbar.add(subContract);\r\n toolbar.add(negotiations);\r\n toolbar.add(buisnessRules);\r\n toolbar.add(map);\r\n toolbar.add(personnal);\r\n toolbar.add(users);\r\n toolbar.add(unitHierarchy);\r\n \r\n /*Added Icons are Committe,Protocol,Shedule - Chandrashekar*/\r\n /* JM 05-02-2013\r\n toolbar.add(irbProtocol);\r\n toolbar.add(irbProtocolSubmission);\r\n \r\n toolbar.add(schedule);\r\n toolbar.add(committee);\r\n */\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium start\r\n /* JM 05-02-2013\r\n toolbar.add(iacucProtocol);\r\n toolbar.add(iacucProtocolSubmission);\r\n */\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium end\r\n \r\n toolbar.addSeparator();\r\n toolbar.add(cascade);\r\n toolbar.add(tileHorizontal);\r\n toolbar.add(tileVertical);\r\n toolbar.add(layer);\r\n toolbar.addSeparator();\r\n \r\n /* JM 4-25-2016 adding new Contact Coeus Help button */\r\n toolbar.add(contactCoeusHelp);\r\n toolbar.addSeparator();\r\n /* JM END */\r\n \r\n toolbar.add(exit);\r\n \r\n toolbar.setFloatable(false);\r\n setTextLabels(false);\r\n MouseListener pl = new PopupListener();\r\n cpm = new CoeusPopupMenu();\r\n toolbar.addMouseListener(pl);\r\n \r\n inbox.addActionListener(this);\r\n awards.addActionListener(this);\r\n proposal.addActionListener(this);\r\n proposalDevelopment.addActionListener(this);\r\n rolodex.addActionListener(this);\r\n sponsor.addActionListener(this);\r\n subContract.addActionListener(this);\r\n negotiations.addActionListener(this);\r\n buisnessRules.addActionListener(this);\r\n map.addActionListener(this);\r\n personnal.addActionListener(this);\r\n users.addActionListener(this);\r\n unitHierarchy.addActionListener(this);\r\n cascade.addActionListener(this);\r\n tileHorizontal.addActionListener(this);\r\n tileVertical.addActionListener(this);\r\n layer.addActionListener(this);\r\n /*Added Icons are Committe,Protocol,Shedule - Chandrashekar*/\r\n /* JM 05-02-2013\r\n irbProtocol.addActionListener(this);\r\n schedule.addActionListener(this);\r\n committee.addActionListener(this);\r\n irbProtocolSubmission.addActionListener(this);\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium start\r\n iacucProtocol.addActionListener(this);\r\n iacucProtocolSubmission.addActionListener(this); */\r\n //Added for case id COEUSQA-2717 icons for IACUC to Coeus Premium end\r\n \r\n /* JM 4-25-2016 adding new Contact Coeus Help button */\r\n contactCoeusHelp.addActionListener(this);\r\n /* JM END */\r\n \r\n exit.addActionListener(this);\r\n }", "private final void initBar() {\r\n \t//---------- Start ActionListener ----------\r\n \tActionListener readPhyTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tphysicalTopologyFile = importFile(\"josn\");\r\n \tcheckImportStatus();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener readVirTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tdeploymentFile = importFile(\"json\");\r\n \tcheckImportStatus();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener readWorkloadBkListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tworkloads_background = importFile(\"cvs\");\r\n\t\t \tcheckImportStatus();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener readWorkloadListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tworkloads = importFile(\"cvs\");\r\n\t\t \tcheckImportStatus();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener addPhysicalNodeListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \topenAddPhysicalNodeDialog();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener addVirtualNodeListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \topenAddVirtualNodeDialog();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener addPhysicalEdgeListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \topenAddPhysicalEdgeDialog();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener addVirtualEdgeListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \topenAddVirtualEdgeDialog();\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener importPhyTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tString fileName = importFile(\"josn\");\r\n\t\t \tGraph phyGraph= Bridge.jsonToGraph(fileName, 0);\r\n/*\t\t \tSystem.out.println(phyGraph.getAdjacencyList().size());\r\n\t\t \tfor (Entry<Node, List<Edge>> entry : phyGraph.getAdjacencyList().entrySet()) {\r\n\t\t \t\tSystem.out.println(entry.getKey().getName()+entry.getKey().getType());\r\n\t\t \t}*/\r\n\t\t \tphysicalCanvas.setGraph(phyGraph);\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener importVirTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \tString fileName = importFile(\"josn\");\r\n\t\t \tGraph virGraph= Bridge.jsonToGraph(fileName, 1);\r\n\t\t \tvirtualCanvas.setGraph(virGraph);\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener savePhyTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \ttry {\r\n\t\t\t\t\tsaveFile(\"json\", physicalGraph);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t};\r\n\t\tActionListener saveVirTopoListener = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t \ttry {\r\n\t\t\t\t\tsaveFile(\"json\", virtualGraph);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t};\r\n\t\t \r\n\t\t//---------- End ActionListener ----------\r\n \t\r\n //---------- Start Creating project tool bar ----------\r\n JToolBar toolbar = new JToolBar();\r\n\r\n ImageIcon iHost = new ImageIcon(\r\n getClass().getResource(\"/src/dc.png\"));\r\n ImageIcon iHline = new ImageIcon(\r\n getClass().getResource(\"/src/hline2.png\"));\r\n ImageIcon iHOpen = new ImageIcon(\r\n getClass().getResource(\"/src/openPhyTop.png\"));\r\n ImageIcon iHSave = new ImageIcon(\r\n getClass().getResource(\"/src/savePhyTop.png\"));\r\n ImageIcon iVM = new ImageIcon(\r\n getClass().getResource(\"/src/vm2.png\"));\r\n ImageIcon iVline = new ImageIcon(\r\n getClass().getResource(\"/src/vline2.png\"));\r\n ImageIcon iVOpen = new ImageIcon(\r\n getClass().getResource(\"/src/openVirTop.png\"));\r\n ImageIcon iVSave = new ImageIcon(\r\n getClass().getResource(\"/src/saveVirTop.png\"));\r\n ImageIcon iPhy = new ImageIcon(\r\n getClass().getResource(\"/src/upload1.png\"));\r\n ImageIcon iVir = new ImageIcon(\r\n getClass().getResource(\"/src/upload2.png\"));\r\n ImageIcon iWl1 = new ImageIcon(\r\n getClass().getResource(\"/src/upload3.png\"));\r\n ImageIcon iWl2 = new ImageIcon(\r\n getClass().getResource(\"/src/upload4.png\"));\r\n ImageIcon run = new ImageIcon(\r\n getClass().getResource(\"/src/play.png\"));\r\n ImageIcon exit = new ImageIcon(\r\n getClass().getResource(\"/src/exit.png\"));\r\n\r\n final JButton btnHost = new JButton(iHost);\r\n btnHost.setToolTipText(\"Add Host Node\");\r\n final JButton btnVm = new JButton(iVM);\r\n btnVm.setToolTipText(\"Add virtual Machine\");\r\n final JButton btnHedge = new JButton(iHline);\r\n btnHedge.setToolTipText(\"Add Host Edge\");\r\n final JButton btnVedge = new JButton(iVline);\r\n btnVedge.setToolTipText(\"Add VM Edge\");\r\n final JButton btnHopen = new JButton(iHOpen);\r\n btnHopen.setToolTipText(\"Open Physical Topology\");\r\n final JButton btnVopen = new JButton(iVOpen);\r\n btnVopen.setToolTipText(\"Open virtual Topology\");\r\n final JButton btnHsave = new JButton(iHSave);\r\n btnHsave.setToolTipText(\"Save Physical Topology\");\r\n final JButton btnVsave = new JButton(iVSave);\r\n btnVsave.setToolTipText(\"Save virtual Topology\");\r\n \r\n final JButton btnPhy = new JButton(iPhy);\r\n btnPhy.setToolTipText(\"Import topology network\");\r\n final JButton btnVir = new JButton(iVir);\r\n btnVir.setToolTipText(\"Import virtual network\");\r\n final JButton btnWl1 = new JButton(iWl1);\r\n btnWl1.setToolTipText(\"Import workload background\");\r\n final JButton btnWl2 = new JButton(iWl2);\r\n btnWl2.setToolTipText(\"Import workload\");\r\n \r\n btnRun = new JButton(run);\r\n btnRun.setToolTipText(\"Start simulation\");\r\n JButton btnExit = new JButton(exit);\r\n btnExit.setToolTipText(\"Exit CloudSim\");\r\n toolbar.setAlignmentX(0);\r\n \r\n btnHost.addActionListener(addPhysicalNodeListener);\r\n btnHedge.addActionListener(addPhysicalEdgeListener);\r\n btnHopen.addActionListener(importPhyTopoListener);\r\n btnHsave.addActionListener(savePhyTopoListener);\r\n btnVm.addActionListener(addVirtualNodeListener);\r\n btnVedge.addActionListener(addVirtualEdgeListener);\r\n btnVopen.addActionListener(importVirTopoListener);\r\n btnVsave.addActionListener(saveVirTopoListener);\r\n \r\n btnPhy.addActionListener(readPhyTopoListener);\r\n btnVir.addActionListener(readVirTopoListener);\r\n btnWl1.addActionListener(readWorkloadBkListener);\r\n btnWl2.addActionListener(readWorkloadListener);\r\n btnRun.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent event) {\r\n \tif(\"i\"==mode){\r\n \t\tif(physicalTopologyFile==null || physicalTopologyFile.isEmpty()){\r\n \t\t\tJOptionPane.showMessageDialog(panel, \"Please select physicalTopologyFile\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tif(deploymentFile==null || deploymentFile.isEmpty()){\r\n \t\t\tJOptionPane.showMessageDialog(panel, \"Please select deploymentFile\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tif(workloads_background==null || workloads_background.isEmpty()){\r\n \t\t\tJOptionPane.showMessageDialog(panel, \"Please select workloads_background\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tif(workloads==null || workloads.isEmpty()){\r\n \t\t\tJOptionPane.showMessageDialog(panel, \"Please select workloads\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t// run simulation\r\n \t\tSDNRun run = new SDNRun(physicalTopologyFile, deploymentFile, \r\n \t\t\t\t\t\t\t\tworkloads_background, workloads, GraphicSDN.this);\r\n\r\n \t\t\r\n\t\t }else if(\"m\"==mode){\r\n\t\t \t\r\n\t\t }\r\n \t\r\n }\r\n });\r\n btnExit.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent event) {\r\n System.exit(0);\r\n }\r\n\r\n }); \r\n\r\n toolbar.add(btnHost);\r\n toolbar.add(btnHedge);\r\n toolbar.add(btnHopen);\r\n toolbar.add(btnHsave);\r\n toolbar.addSeparator();\r\n toolbar.add(btnVm);\r\n toolbar.add(btnVedge);\r\n toolbar.add(btnVopen);\r\n toolbar.add(btnVsave);\r\n \r\n toolbar.add(btnPhy);\r\n toolbar.add(btnVir);\r\n toolbar.add(btnWl1);\r\n toolbar.add(btnWl2);\r\n toolbar.addSeparator();\r\n \r\n toolbar.add(btnRun);\r\n toolbar.add(btnExit);\r\n\r\n panel.add(toolbar);\r\n \r\n contentPane.add(panel, BorderLayout.NORTH);\r\n //---------- End Creating project tool bar ----------\r\n \r\n \r\n \r\n \t//---------- Start Creating project menu bar ----------\r\n \t//1-1\r\n JMenuBar menubar = new JMenuBar();\r\n //ImageIcon iconNew = new ImageIcon(getClass().getResource(\"/src/new.png\"));\r\n\r\n //2-1\r\n JMenu graph = new JMenu(\"Graph\");\r\n graph.setMnemonic(KeyEvent.VK_G);\r\n \r\n //Graph by importing json and cvs files\r\n final JMenuItem MiPhy = new JMenuItem(\"Physical Topology\");\r\n final JMenuItem MiVir = new JMenuItem(\"Virtual Topology\");\r\n final JMenuItem MiWl1 = new JMenuItem(\"Workload Background\");\r\n final JMenuItem MiWl2 = new JMenuItem(\"Workload\");\r\n //Graph drawing elements\r\n final JMenu MuPhy = new JMenu(\"Physical\");\r\n JMenuItem MiPhyNode = new JMenuItem(\"Add Node\");\r\n JMenuItem MiPhyEdge = new JMenuItem(\"Add Edge\");\r\n JMenuItem MiPhyOpen = new JMenuItem(\"Import Physical Topology\");\r\n JMenuItem MiPhySave = new JMenuItem(\"Save Physical Topology\");\r\n MuPhy.add(MiPhyNode);\r\n MuPhy.add(MiPhyEdge);\r\n MuPhy.add(MiPhyOpen);\r\n MuPhy.add(MiPhySave);\r\n final JMenu MuVir = new JMenu(\"Virtual\");\r\n JMenuItem MiVirNode = new JMenuItem(\"Add Node\");\r\n JMenuItem MiVirEdge = new JMenuItem(\"Add Edge\");\r\n JMenuItem MiVirOpen = new JMenuItem(\"Import Virtual Topology\");\r\n JMenuItem MiVirSave = new JMenuItem(\"Save Virtual Topology\");\r\n MuVir.add(MiVirNode);\r\n MuVir.add(MiVirEdge); \r\n MuVir.add(MiVirOpen);\r\n MuVir.add(MiVirSave);\r\n \r\n \r\n MiPhy.addActionListener(readPhyTopoListener);\r\n MiVir.addActionListener(readVirTopoListener);\r\n MiWl1.addActionListener(readWorkloadBkListener);\r\n MiWl2.addActionListener(readWorkloadListener);\r\n \r\n MiPhyNode.addActionListener(addPhysicalNodeListener);\r\n MiPhyEdge.addActionListener(addPhysicalEdgeListener);\r\n MiPhyOpen.addActionListener(importPhyTopoListener);\r\n MiPhySave.addActionListener(savePhyTopoListener);\r\n MiVirNode.addActionListener(addVirtualNodeListener);\r\n MiVirEdge.addActionListener(addVirtualEdgeListener);\r\n MiVirOpen.addActionListener(importVirTopoListener);\r\n MiVirSave.addActionListener(saveVirTopoListener);\r\n\r\n graph.add(MuPhy);\r\n graph.add(MuVir);\r\n graph.add(MiPhy);\r\n graph.add(MiVir);\r\n graph.add(MiWl1);\r\n graph.add(MiWl2);\r\n\r\n //2-2\r\n JMenu view = new JMenu(\"View\");\r\n view.setMnemonic(KeyEvent.VK_F);\r\n \r\n //switch mode between manual mode (to create graph by hand) and import mode (to create graph from file)\r\n\t\tActionListener actionSwitcher = new ActionListener() {\r\n\t\t public void actionPerformed(ActionEvent e) {\r\n\t\t try {\r\n\t\t \t String cmd = e.getActionCommand();\r\n\t\t \t if(\"Canvas\" == cmd){\r\n\t\t \t \tbtnHost.setVisible(true);\r\n\t\t \t \tbtnHedge.setVisible(true);\r\n\t\t \t \tbtnHopen.setVisible(true);\r\n\t\t \t \tbtnHsave.setVisible(true);\r\n\t\t \t \tbtnVm.setVisible(true);\r\n\t\t \t \tbtnVedge.setVisible(true);\r\n\t\t \t \tbtnVopen.setVisible(true);\r\n\t\t \t \tbtnVsave.setVisible(true);\r\n\t\t \t \tbtnPhy.setVisible(false);\r\n\t\t \t \tbtnVir.setVisible(false);\r\n\t\t \t \tbtnWl1.setVisible(false);\r\n\t\t \t \tbtnWl2.setVisible(false);\r\n\t\t \t \t\r\n\t\t \t \tMiPhy.setVisible(false);\r\n\t\t \t \tMiVir.setVisible(false);\r\n\t\t \t \tMiWl1.setVisible(false);\r\n\t\t \t \tMiWl2.setVisible(false);\r\n\t\t \t \tMuPhy.setVisible(true);\r\n\t\t \t \tMuVir.setVisible(true);\r\n\t\t \t \t\r\n\t\t \t \tbtnRun.setVisible(false);\r\n\t\t \t \tbtnRun.setEnabled(false);\r\n\t\t \t \t\r\n\t\t \t \tmode = \"m\";\r\n\t\t \t \t\r\n\t\t \t }else if(\"Execution\" == cmd){\r\n\t\t \t \tbtnHost.setVisible(false);\r\n\t\t \t \tbtnHedge.setVisible(false);\r\n\t\t \t \tbtnHopen.setVisible(false);\r\n\t\t \t \tbtnHsave.setVisible(false);\r\n\t\t \t \tbtnVm.setVisible(false);\r\n\t\t \t \tbtnVedge.setVisible(false);\r\n\t\t \t \tbtnVopen.setVisible(false);\r\n\t\t \t \tbtnVsave.setVisible(false);\r\n\t\t \t \tbtnPhy.setVisible(true);\r\n\t\t \t \tbtnVir.setVisible(true);\r\n\t\t \t \tbtnWl1.setVisible(true);\r\n\t\t \t \tbtnWl2.setVisible(true);\r\n\t\t \t \t\r\n\t\t \t \tMiPhy.setVisible(true);\r\n\t\t \t \tMiVir.setVisible(true);\r\n\t\t \t \tMiWl1.setVisible(true);\r\n\t\t \t \tMiWl2.setVisible(true);\r\n\t\t \t \tMuPhy.setVisible(false);\r\n\t\t \t \tMuVir.setVisible(false);\r\n\t\t \t \t\r\n\t\t \t \tbtnRun.setVisible(true);\r\n\t\t \t \tbtnRun.setEnabled(false);\r\n\t\t \t \t\r\n\t\t \t \tmode = \"i\";\r\n\t\t \t }\r\n\t\t \t //System.out.println(e.getActionCommand());\r\n\t\t } catch (Exception ex) {\r\n\t\t ex.printStackTrace();\r\n\t\t }\r\n\t\t }\r\n\t\t};\r\n JRadioButtonMenuItem manualMode = new JRadioButtonMenuItem(\"Canvas\");\r\n manualMode.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK));\r\n manualMode.addActionListener(actionSwitcher);\r\n JRadioButtonMenuItem importMode = new JRadioButtonMenuItem(\"Execution\");\r\n importMode.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.CTRL_MASK));\r\n importMode.addActionListener(actionSwitcher);\r\n ButtonGroup group = new ButtonGroup();\r\n group.add(manualMode);\r\n group.add(importMode);\r\n \r\n JMenuItem fileExit = new JMenuItem(\"Exit\");\r\n fileExit.setMnemonic(KeyEvent.VK_C);\r\n fileExit.setToolTipText(\"Exit CloudSim\");\r\n fileExit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W,\r\n ActionEvent.CTRL_MASK));\r\n\r\n fileExit.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent event) {\r\n System.exit(0);\r\n }\r\n\r\n });\r\n\r\n view.add(manualMode);\r\n view.add(importMode);\r\n view.addSeparator();\r\n view.add(fileExit); \r\n\r\n \r\n //3-1\r\n menubar.add(view);\r\n menubar.add(graph);\r\n\r\n //4-1\r\n setJMenuBar(menubar);\r\n //----- End Creating project menu bar -----\r\n \r\n \r\n \r\n //----- Start Initialize menu and tool bar -----\r\n manualMode.setSelected(true);\r\n mode = \"m\";\r\n \r\n btnHost.setVisible(true);\r\n \tbtnHedge.setVisible(true);\r\n \tbtnHopen.setVisible(true);\r\n \tbtnHsave.setVisible(true);\r\n \tbtnVm.setVisible(true);\r\n \tbtnVedge.setVisible(true);\r\n \tbtnVopen.setVisible(true);\r\n \tbtnVsave.setVisible(true);\r\n \tbtnPhy.setVisible(false);\r\n \tbtnVir.setVisible(false);\r\n \tbtnWl1.setVisible(false);\r\n \tbtnWl2.setVisible(false);\r\n \t\r\n \tMiPhy.setVisible(false);\r\n \tMiVir.setVisible(false);\r\n \tMiWl1.setVisible(false);\r\n \tMiWl2.setVisible(false);\r\n \tMuPhy.setVisible(true);\r\n \tMuVir.setVisible(true);\r\n \t\r\n \tbtnRun.setVisible(false);\r\n \tbtnRun.setEnabled(false);\r\n //----- End Initialize menu and tool bar -----\r\n\r\n }", "private void createMainMenuHeaderComposite() {\n\n\t\tGridData gridData8 = new GridData();\n\t\tgridData8.grabExcessHorizontalSpace = true;\n\t\tgridData8.horizontalAlignment = GridData.FILL;\n\t\tgridData8.verticalAlignment = GridData.BEGINNING;\n\t\tgridData8.grabExcessVerticalSpace = true;\n\t\tGridData gridData7 = new GridData();\n\t\tgridData7.grabExcessHorizontalSpace = true;\n\t\tgridData7.horizontalAlignment = GridData.FILL;\n\t\tgridData7.verticalAlignment = GridData.END;\n\t\tgridData7.grabExcessVerticalSpace = true;\n\t\tGridData gridData21 = new GridData();\n\t\tgridData21.horizontalAlignment = GridData.FILL;\n\t\tgridData21.grabExcessHorizontalSpace = true;\n\t\tgridData21.grabExcessVerticalSpace = false;\n\t\tgridData21.heightHint = 150;\n\t\tgridData21.verticalAlignment = GridData.BEGINNING;\n\t\tGridLayout gridLayout = new GridLayout();\n\t\tgridLayout.horizontalSpacing = 50;\n\t\tgridLayout.marginWidth = 20;\n\t\tgridLayout.marginHeight = 0;\n\t\tgridLayout.verticalSpacing = 35;\n\t\tmainMenuHeaderComposite = new Composite(this, SWT.NONE);\n\t\tmainMenuHeaderComposite.setBackground(new Color(Display.getCurrent(),\n\t\t\t\t255, 255, 255));\n\t\tmainMenuHeaderComposite.setLayoutData(gridData21);\n\t\tmainMenuHeaderComposite.setLayout(gridLayout);\n\n\t\tlblTitle1 = new CbctlLabel(mainMenuHeaderComposite, SWT.CENTER);\n\t\tlblTitle1\n\t\t\t\t.setText(LabelLoader\n\t\t\t\t\t\t.getLabelValue(LabelKeyConstants.WELCOME_NOTE_ON_TOUCH_SCREEN_HOMEPAGE));\n\t\tlblTitle1\n\t\t\t\t.setFont(SDSControlFactory.getStandardTouchScreenFont());\n\t\tlblTitle1.setLayoutData(gridData7);\n\n\t\tlblTitle2 = new CbctlLabel(mainMenuHeaderComposite, SWT.CENTER);\n\t\tlblTitle2\n\t\t\t\t.setText(LabelLoader\n\t\t\t\t\t\t.getLabelValue(LabelKeyConstants.SELECT_NOTE_ON_TOUCH_SCREEN_HOMEPAGE));\n\t\tlblTitle2\n\t\t\t\t.setFont(SDSControlFactory.getStandardTouchScreenFont());\n\t\tlblTitle2.setLayoutData(gridData8);\n\t}", "private void setupToolBar() {\n\t\tJPanel buttons = new JPanel(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints();\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\n\t\ttoolBar = new JToolBar(\"Buttons\");\n\t\ttoolBar.setFloatable(false);\n\t\ttoolBar.setOrientation(SwingConstants.VERTICAL);\n\t\tbuttons.add(toolBar, c);\n\t\tadd(buttons, BorderLayout.EAST);\n\t}", "@FXML\n public void addBar() {\n \tnew eMenuHandler().hideMenu();\n \tDisplayBuildingInstructions.showBuildingInstr();\n \tAddEntityOnMouseClick.setBuildMode(Boolean.TRUE);\n \tAddEntityOnMouseClick.entityList(new BuildingBar(0, 0));\n }", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setSize(550, 400);\n\t\tshell.setText(\"Source A Antenna 1 Data\");\n\t\t\n\t\tButton btnNewButton_1 = new Button(shell, SWT.NONE);\n\t\tbtnNewButton_1.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnNewButton_1.setBounds(116, 10, 98, 30);\n\t\tbtnNewButton_1.setText(\"pol 1\");\n\t\t\n\t\tButton btnPol = new Button(shell, SWT.NONE);\n\t\tbtnPol.setText(\"pol 2\");\n\t\tbtnPol.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol.setBounds(220, 10, 98, 30);\n\t\t\n\t\tButton btnPol_1 = new Button(shell, SWT.NONE);\n\t\tbtnPol_1.setText(\"pol 3\");\n\t\tbtnPol_1.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol_1.setBounds(324, 10, 98, 30);\n\t\t\n\t\tButton btnPol_2 = new Button(shell, SWT.NONE);\n\t\tbtnPol_2.setText(\"pol 4\");\n\t\tbtnPol_2.setFont(SWTResourceManager.getFont(\"Ubuntu\", 11, SWT.BOLD));\n\t\tbtnPol_2.setBounds(428, 10, 98, 30);\n\t\t\n\t\tButton button_3 = new Button(shell, SWT.NONE);\n\t\tbutton_3.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\n\t\t\t\tPlot_graph nw = new Plot_graph();\n\t\t\t\tnw.GraphScreen();\n\t\t\t}\n\t\t});\n\t\tbutton_3.setBounds(116, 46, 98, 30);\n\t\t\n\t\tButton button_4 = new Button(shell, SWT.NONE);\n\t\tbutton_4.setBounds(116, 83, 98, 30);\n\t\t\n\t\tButton button_5 = new Button(shell, SWT.NONE);\n\t\tbutton_5.setBounds(116, 119, 98, 30);\n\t\t\n\t\tButton button_6 = new Button(shell, SWT.NONE);\n\t\tbutton_6.setBounds(116, 155, 98, 30);\n\t\t\n\t\tButton button_7 = new Button(shell, SWT.NONE);\n\t\tbutton_7.setBounds(220, 155, 98, 30);\n\t\t\n\t\tButton button_8 = new Button(shell, SWT.NONE);\n\t\tbutton_8.setBounds(220, 119, 98, 30);\n\t\t\n\t\tButton button_9 = new Button(shell, SWT.NONE);\n\t\tbutton_9.setBounds(220, 83, 98, 30);\n\t\t\n\t\tButton button_10 = new Button(shell, SWT.NONE);\n\t\tbutton_10.setBounds(220, 46, 98, 30);\n\t\t\n\t\tButton button_11 = new Button(shell, SWT.NONE);\n\t\tbutton_11.setBounds(428, 155, 98, 30);\n\t\t\n\t\tButton button_12 = new Button(shell, SWT.NONE);\n\t\tbutton_12.setBounds(428, 119, 98, 30);\n\t\t\n\t\tButton button_13 = new Button(shell, SWT.NONE);\n\t\tbutton_13.setBounds(428, 83, 98, 30);\n\t\t\n\t\tButton button_14 = new Button(shell, SWT.NONE);\n\t\tbutton_14.setBounds(428, 46, 98, 30);\n\t\t\n\t\tButton button_15 = new Button(shell, SWT.NONE);\n\t\tbutton_15.setBounds(324, 46, 98, 30);\n\t\t\n\t\tButton button_16 = new Button(shell, SWT.NONE);\n\t\tbutton_16.setBounds(324, 83, 98, 30);\n\t\t\n\t\tButton button_17 = new Button(shell, SWT.NONE);\n\t\tbutton_17.setBounds(324, 119, 98, 30);\n\t\t\n\t\tButton button_18 = new Button(shell, SWT.NONE);\n\t\tbutton_18.setBounds(324, 155, 98, 30);\n\n\t}", "protected void setupStatusBar() {\r\n\t\tStatusBar statusBar = new StatusBar() {\r\n\t\t\tprivate static final long serialVersionUID = -8334549384792867496L;\r\n\r\n\t\t\t@Override\r\n\t\t\tprotected String makeAngleDescription(String label, Angle angle) {\r\n\t\t\t\tString s;\r\n\t\t\t\tif (Angle.ANGLE_FORMAT_DMS.equals(getAngleFormat()))\r\n\t\t\t\t\ts = String.format(\"%s %s\", label, angle.toDMSString());\r\n\t\t\t\telse\r\n\t\t\t\t\ts = String.format(\"%s %,.6f\\u00B0\", label, angle.degrees);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Overridden to capture the current altitude.\r\n\t\t\t */\r\n\t\t\t@Override\r\n\t\t\tprotected String makeEyeAltitudeDescription(double metersAltitude){\r\n\t\t\t\t//System.out.println(\"metersAltitude: \"+ metersAltitude);\r\n\t\t\t\tsetCurrentAltitude(metersAltitude);\r\n\t\t\t\treturn super.makeEyeAltitudeDescription(metersAltitude);\r\n\t\t\t}\r\n\t\t};\r\n\t\tadd(statusBar, BorderLayout.PAGE_END);\r\n\t\tstatusBar.setEventSource(getWWD());\r\n\t}", "public void initNavigationBar() {\n navigationBar = new JPanel();\n navigationBar.setBackground(new Color(199, 0, 0));\n navigationBar.setLayout(new FlowLayout());\n navigationBar.setPreferredSize(new Dimension(buttonHeight + 10, buttonHeight + 10));\n navigationBar.setBorder(BorderFactory.createBevelBorder(0));\n\n initMarketButton();\n initProdCardButton();\n initReserveButton();\n initPlayerMenu();\n\n this.navigationBar.add(marketButton);\n this.navigationBar.add(prodCardButton);\n this.navigationBar.add(reserveButton);\n this.navigationBar.add(menuPanel);\n\n }", "public void initToolbar(){\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n if(getSupportActionBar()!=null) {\n getSupportActionBar().setTitle(\"\");\n }\n getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_launcher_white);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimaryDarkest));\n }\n }", "public ToolBarManager initTitle(String toolBarTitle,int start,int top,int end,int bottom){\n if(toolBarTitle!=null){\n mToolbar.setTitle(toolBarTitle);\n mToolbar.setTitleMargin(start,top,end,bottom);\n }\n return instance;\n }", "public TopBar(LoginView loginView){\n\t\tthis.loginView = loginView;\n\t\t\n\t\tvalidatedHeader();\n\t}", "protected void createContents() {\n\t\tshell = new Shell(SWT.CLOSE | SWT.MIN);// 取消最大化与拖拽放大功能\n\t\tshell.setImage(SWTResourceManager.getImage(WelcomPart.class, \"/images/MC.ico\"));\n\t\tshell.setBackgroundImage(SWTResourceManager.getImage(WelcomPart.class, \"/images/back.jpg\"));\n\t\tshell.setBackgroundMode(SWT.INHERIT_DEFAULT);\n\t\tshell.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));\n\t\tshell.setSize(1157, 720);\n\t\tshell.setText(\"\\u56FE\\u4E66\\u67E5\\u8BE2\");\n\t\tshell.setLocation(Display.getCurrent().getClientArea().width / 2 - shell.getShell().getSize().x / 2,\n\t\t\t\tDisplay.getCurrent().getClientArea().height / 2 - shell.getSize().y / 2);\n\n\t\tMenu menu = new Menu(shell, SWT.BAR);\n\t\tshell.setMenuBar(menu);\n\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/base.png\"));\n\t\tmenuItem.setText(\"\\u7A0B\\u5E8F\");\n\n\t\tMenu menu_1 = new Menu(menuItem);\n\t\tmenuItem.setMenu(menu_1);\n\n\t\tMenuItem menuI_main = new MenuItem(menu_1, SWT.NONE);\n\t\tmenuI_main.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/about.png\"));\n\t\tmenuI_main.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tAdmin_BookShow window = new Admin_BookShow();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenuI_main.setText(\"\\u4E3B\\u9875\");\n\n\t\tMenuItem menu_exit = new MenuItem(menu_1, SWT.NONE);\n\t\tmenu_exit.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/reset.png\"));\n\t\tmenu_exit.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tWelcomPart window = new WelcomPart();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu_exit.setText(\"\\u9000\\u51FA\");\n\n\t\tMenuItem menubook = new MenuItem(menu, SWT.CASCADE);\n\t\tmenubook.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/bookTypeManager.png\"));\n\t\tmenubook.setText(\"\\u56FE\\u4E66\\u7BA1\\u7406\");\n\n\t\tMenu menu_2 = new Menu(menubook);\n\t\tmenubook.setMenu(menu_2);\n\n\t\tMenuItem menu1_add = new MenuItem(menu_2, SWT.NONE);\n\t\tmenu1_add.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/add.png\"));\n\t\tmenu1_add.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBook_add window = new Book_add();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu1_add.setText(\"\\u6DFB\\u52A0\\u56FE\\u4E66\");\n\n\t\tMenuItem menu1_select = new MenuItem(menu_2, SWT.NONE);\n\t\tmenu1_select.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/search.png\"));\n\t\tmenu1_select.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\tshell.close();\n\t\t\t\tBook_select window = new Book_select();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu1_select.setText(\"\\u67E5\\u8BE2\\u56FE\\u4E66\");\n\n\t\tMenuItem menu1_alter = new MenuItem(menu_2, SWT.NONE);\n\t\tmenu1_alter.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/modify.png\"));\n\t\tmenu1_alter.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBook_alter window = new Book_alter();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu1_alter.setText(\"\\u4FEE\\u6539\\u56FE\\u4E66\");\n\n\t\tMenuItem menuI1_delete = new MenuItem(menu_2, SWT.NONE);\n\t\tmenuI1_delete.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/exit.png\"));\n\t\tmenuI1_delete.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBook_del window = new Book_del();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenuI1_delete.setText(\"\\u5220\\u9664\\u56FE\\u4E66\");\n\n\t\tMenuItem menutype = new MenuItem(menu, SWT.CASCADE);\n\t\tmenutype.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/bookManager.png\"));\n\t\tmenutype.setText(\"\\u4E66\\u7C7B\\u7BA1\\u7406\");\n\n\t\tMenu menu_3 = new Menu(menutype);\n\t\tmenutype.setMenu(menu_3);\n\n\t\tMenuItem menu2_add = new MenuItem(menu_3, SWT.NONE);\n\t\tmenu2_add.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/add.png\"));\n\t\tmenu2_add.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBooktype_add window = new Booktype_add();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu2_add.setText(\"\\u6DFB\\u52A0\\u4E66\\u7C7B\");\n\n\t\tMenuItem menu2_alter = new MenuItem(menu_3, SWT.NONE);\n\t\tmenu2_alter.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/modify.png\"));\n\t\tmenu2_alter.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBooktype_alter window = new Booktype_alter();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu2_alter.setText(\"\\u4FEE\\u6539\\u4E66\\u7C7B\");\n\n\t\tMenuItem menu2_delete = new MenuItem(menu_3, SWT.NONE);\n\t\tmenu2_delete.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/exit.png\"));\n\t\tmenu2_delete.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tBooktype_delete window = new Booktype_delete();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu2_delete.setText(\"\\u5220\\u9664\\u4E66\\u7C7B\");\n\n\t\tMenuItem menumark = new MenuItem(menu, SWT.CASCADE);\n\t\tmenumark.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/student.png\"));\n\t\tmenumark.setText(\"\\u501F\\u8FD8\\u8BB0\\u5F55\");\n\n\t\tMenu menu_4 = new Menu(menumark);\n\t\tmenumark.setMenu(menu_4);\n\n\t\tMenuItem menu3_borrow = new MenuItem(menu_4, SWT.NONE);\n\t\tmenu3_borrow.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/edit.png\"));\n\t\tmenu3_borrow.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tAdmin_borrowmark window = new Admin_borrowmark();\n\t\t\t\twindow.open();// 借书记录\n\t\t\t}\n\t\t});\n\t\tmenu3_borrow.setText(\"\\u501F\\u4E66\\u8BB0\\u5F55\");\n\n\t\tMenuItem menu3_return = new MenuItem(menu_4, SWT.NONE);\n\t\tmenu3_return.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/search.png\"));\n\t\tmenu3_return.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tAdmin_returnmark window = new Admin_returnmark();\n\t\t\t\twindow.open();// 还书记录\n\t\t\t}\n\t\t});\n\t\tmenu3_return.setText(\"\\u8FD8\\u4E66\\u8BB0\\u5F55\");\n\n\t\tMenuItem mntmhelp = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmhelp.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/about.png\"));\n\t\tmntmhelp.setText(\"\\u5173\\u4E8E\");\n\n\t\tMenu menu_5 = new Menu(mntmhelp);\n\t\tmntmhelp.setMenu(menu_5);\n\n\t\tMenuItem menu4_Info = new MenuItem(menu_5, SWT.NONE);\n\t\tmenu4_Info.setImage(SWTResourceManager.getImage(Admin_BookShow.class, \"/images/me.png\"));\n\t\tmenu4_Info.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tshell.close();\n\t\t\t\tAdmin_Info window = new Admin_Info();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmenu4_Info.setText(\"\\u8F6F\\u4EF6\\u4FE1\\u606F\");\n\n\t\ttable = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION);\n\t\ttable.setFont(SWTResourceManager.getFont(\"黑体\", 10, SWT.NORMAL));\n\t\ttable.setLinesVisible(true);\n\t\ttable.setHeaderVisible(true);\n\t\ttable.setBounds(10, 191, 1119, 447);\n\n\t\tTableColumn tableColumn = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn.setWidth(29);\n\n\t\tTableColumn tableColumn_id = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_id.setWidth(110);\n\t\ttableColumn_id.setText(\"\\u56FE\\u4E66\\u7F16\\u53F7\");\n\n\t\tTableColumn tableColumn_name = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_name.setWidth(216);\n\t\ttableColumn_name.setText(\"\\u56FE\\u4E66\\u540D\\u79F0\");\n\n\t\tTableColumn tableColumn_author = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_author.setWidth(117);\n\t\ttableColumn_author.setText(\"\\u56FE\\u4E66\\u79CD\\u7C7B\");\n\n\t\tTableColumn tableColumn_pub = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_pub.setWidth(148);\n\t\ttableColumn_pub.setText(\"\\u4F5C\\u8005\");\n\n\t\tTableColumn tableColumn_stock = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_stock.setWidth(167);\n\t\ttableColumn_stock.setText(\"\\u51FA\\u7248\\u793E\");\n\n\t\tTableColumn tableColumn_sortid = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_sortid.setWidth(79);\n\t\ttableColumn_sortid.setText(\"\\u5E93\\u5B58\");\n\n\t\tTableColumn tableColumn_record = new TableColumn(table, SWT.CENTER);\n\t\ttableColumn_record.setWidth(247);\n\t\ttableColumn_record.setText(\"\\u767B\\u8BB0\\u65F6\\u95F4\");\n\n\t\tCombo combo_way = new Combo(shell, SWT.NONE);\n\t\tcombo_way.add(\"图书编号\");\n\t\tcombo_way.add(\"图书名称\");\n\t\tcombo_way.add(\"图书作者\");\n\t\tcombo_way.setFont(SWTResourceManager.getFont(\"黑体\", 12, SWT.NORMAL));\n\t\tcombo_way.setBounds(314, 157, 131, 28);\n\n\t\t// 遍历查询book表\n\t\tButton btnButton_select = new Button(shell, SWT.NONE);\n\t\tbtnButton_select.setImage(SWTResourceManager.getImage(Book_select.class, \"/images/search.png\"));\n\t\tbtnButton_select.setFont(SWTResourceManager.getFont(\"黑体\", 12, SWT.NORMAL));\n\t\tbtnButton_select.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tBook book = new Book();\n\t\t\t\tSelectbook selectbook = new Selectbook();\n\t\t\t\ttable.removeAll();\n\t\t\t\tif (combo_way.getText().equals(\"图书编号\")) {\n\t\t\t\t\tbook.setBook_id(text_select.getText().trim());\n\t\t\t\t\tString str[][] = selectbook.ShowAidBook(book);\n\t\t\t\t\tfor (int i = 1; i < str.length; i++) {\n\t\t\t\t\t\tTableItem item = new TableItem(table, SWT.NONE);\n\t\t\t\t\t\titem.setText(i + \".\");\n\t\t\t\t\t\titem.setText(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (combo_way.getText().equals(\"图书名称\")) {\n\t\t\t\t\tbook.setBook_name(\"%\" + text_select.getText().trim() + \"%\");\n\t\t\t\t\tString str[][] = selectbook.ShowAnameBook(book);\n\t\t\t\t\tfor (int i = 1; i < str.length; i++) {\n\t\t\t\t\t\tTableItem item = new TableItem(table, SWT.NONE);\n\t\t\t\t\t\titem.setText(i + \".\");\n\t\t\t\t\t\titem.setText(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (combo_way.getText().equals(\"图书作者\")) {\n\t\t\t\t\tbook.setBook_author(\"%\" + text_select.getText().trim() + \"%\");\n\t\t\t\t\tString str[][] = selectbook.ShowAauthorBook(book);\n\t\t\t\t\tfor (int i = 1; i < str.length; i++) {\n\t\t\t\t\t\tTableItem item = new TableItem(table, SWT.NONE);\n\t\t\t\t\t\titem.setText(i + \".\");\n\t\t\t\t\t\titem.setText(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (combo_way.getText().length() == 0) {\n\t\t\t\t\tString str[][] = selectbook.ShowAllBook();\n\t\t\t\t\tfor (int i = 1; i < str.length; i++) {\n\t\t\t\t\t\tTableItem item = new TableItem(table, SWT.NONE);\n\t\t\t\t\t\titem.setText(i + \".\");\n\t\t\t\t\t\titem.setText(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnButton_select.setBounds(664, 155, 98, 30);\n\t\tbtnButton_select.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));\n\t\tbtnButton_select.setText(\"查询\");\n\n\t\ttext_select = new Text(shell, SWT.BORDER);\n\t\ttext_select.setBounds(472, 155, 186, 30);\n\n\t\tLabel lblNewLabel_way = new Label(shell, SWT.NONE);\n\t\tlblNewLabel_way.setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));\n\t\tlblNewLabel_way.setFont(SWTResourceManager.getFont(\"黑体\", 12, SWT.NORMAL));\n\t\tlblNewLabel_way.setBounds(314, 128, 107, 30);\n\t\tlblNewLabel_way.setText(\"\\u67E5\\u8BE2\\u65B9\\u5F0F\\uFF1A\");\n\n\t\tLabel lblNewLabel_1 = new Label(shell, SWT.NONE);\n\t\tlblNewLabel_1.setText(\"\\u56FE\\u4E66\\u67E5\\u8BE2\");\n\t\tlblNewLabel_1.setForeground(SWTResourceManager.getColor(255, 255, 255));\n\t\tlblNewLabel_1.setFont(SWTResourceManager.getFont(\"黑体\", 25, SWT.BOLD));\n\t\tlblNewLabel_1.setAlignment(SWT.CENTER);\n\t\tlblNewLabel_1.setBounds(392, 54, 266, 48);\n\n\t\tLabel lblNewLabel = new Label(shell, SWT.NONE);\n\t\tlblNewLabel.setText(\"\\u8F93\\u5165\\uFF1A\");\n\t\tlblNewLabel.setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));\n\t\tlblNewLabel.setFont(SWTResourceManager.getFont(\"黑体\", 12, SWT.NORMAL));\n\t\tlblNewLabel.setBounds(472, 129, 76, 20);\n\n\t}", "private void setupUIElements() {\n setBadgeDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.company_logo));\n //setTitle(getString(R.string.browse_title));\n\n setHeadersState(HEADERS_ENABLED);\n setHeadersTransitionOnBackEnabled(true);\n\n // Set headers and rows background color\n setBrandColor(ContextCompat.getColor(getActivity(), R.color.browse_headers_bar));\n mBackgroundManager.setColor(ContextCompat.getColor(getActivity(),\n R.color.browse_background_color));\n\n // Disables the scaling of rows when Headers bar is in open state.\n enableRowScaling(false);\n\n // Here is where a header presenter can be set to customize the look\n // of the headers list.\n setHeaderPresenterSelector(new PresenterSelector() {\n @Override\n public Presenter getPresenter(Object o) {\n\n return new RowHeaderPresenter();\n }\n });\n }", "public HeatMapColorToolBar() {\n initialize();\n }", "private void createGUI() {\n ResizeGifPanel newContentPane = new ResizeGifPanel();\n newContentPane.setOpaque(true); \n setContentPane(newContentPane); \n }", "public ToolBarManager initTitle(String toolBarTitle, int color,int start,int top,int end,int bottom){\n if(toolBarTitle!=null){\n mToolbar.setTitle(toolBarTitle);\n mToolbar.setTitleTextColor(color);\n mToolbar.setTitleMargin(start,top,end,bottom);\n }\n return instance;\n }", "public void initCon() {\n\t\t\n\t\t//ImageIcon icon = new ImageIcon(this.getClass().getResource(\"lib/data/icon/log.png\"));\n\t\t//txtArea.setLineWrap(true);\n\t\ttxtArea = new JTextArea(16,70);\n\t\t//txtArea.setLineWrap(true);\n\t\tJTabbedPane tPane = new JTabbedPane();\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane(txtArea); \n\t\t\n\t\t\n\t\tJPanel top = new JPanel();\n\t\tJPanel center = new JPanel();\n\t\t\n\t\tbottom = new JPanel();\n\t\tColor color = UIManager.getColor ( \"Panel.background\" );\n\t\t\n\t\ttop.add( scrollPane );\n\t\ttPane.addTab(\"Console\", top);\n\t\t\n\t\t\n\t\t//set colors\n\t\treadout.setBackground(color);\n\t\ttop.setBackground(color);\n\t\tcenter.setBackground(color);\n\t\tbottom.setBackground(color);\n\t\t//.setOpaque(true);\n\t\t\n\t\tbottom.setLayout(new GridLayout(1,2));\n\t\tbottom.add(readout);\n\t\tcenter.setLayout(new GridLayout(2,1));\n\t\tadd(center, BorderLayout.CENTER);\n\t\tadd(bottom, BorderLayout.SOUTH);\n\t\tadd(tPane, BorderLayout.NORTH);\n\t}", "private void initBars()\n\t{\n\t\tfor (int i = 0; i < Constants.MAX_VALUE; i++)\n\t\t{\n\t\t\trows[i] = new Bar();\n\t\t\tcolumns[i] = new Bar();\n\t\t\tgrids[i] = new Bar();\n\t\t}\n\n\t\tfor (int rowIndex = 0; rowIndex < this.nodes.length; rowIndex++)\n\t\t{\n\t\t\tNode[] row = this.nodes[rowIndex];\n\t\t\tfor (int colIndex = 0; colIndex < row.length; colIndex++)\n\t\t\t{\n\t\t\t\tNode node = row[colIndex];\n\n\t\t\t\t// Make Rows\n\t\t\t\tthis.rows[rowIndex].nodes[colIndex] = node;\n\t\t\t\tnode.setRow(this.rows[rowIndex]);\n\n\t\t\t\t// Make Columns\n\t\t\t\tthis.columns[colIndex].nodes[rowIndex] = node;\n\t\t\t\tnode.setColumn(this.columns[colIndex]);\n\n\t\t\t\t// Make Grid\n\t\t\t\t// the index of Grid Array\n\t\t\t\tint gridIndex = colIndex / 3 + (rowIndex / 3) * 3;\n\n\t\t\t\t// the index of nodes array of one grid object\n\t\t\t\tint gridNodeIndex = colIndex % 3 + (rowIndex % 3) * 3;\n\t\t\t\tthis.grids[gridIndex].nodes[gridNodeIndex] = node;\n\t\t\t\tnode.setGrid(this.grids[gridIndex]);\n\t\t\t}\n\t\t}\n\t}", "protected void fillCoolBar(ICoolBarManager coolBar) {\n\t\tIWorkbenchWindow window = getActionBarConfigurer().getWindowConfigurer().getWindow();\n\t\tIToolBarManager toolbar = new ToolBarManager(SWT.LEFT);\n\t\tcoolBar.add(new ToolBarContributionItem(toolbar, Messages.getString(\"IU.Strings.15\"))); //$NON-NLS-1$\n\t\ttoolbar.add(new GroupMarker(Messages.getString(\"IU.Strings.16\"))); //$NON-NLS-1$\n\n\n\t\t/*IWorkbenchAction open = ActionFactory..create(window);\n\t\topen.setImageDescriptor(Activator.getImageDescriptor(\"icons/charger.png\"));\n\t\ttoolbar.add(open);*/\n\n\t\tIWorkbenchAction save = ActionFactory.SAVE.create(window);\n\t\tsave.setImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.17\"))); //$NON-NLS-1$\n\t\tsave.setDisabledImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.18\"))); //$NON-NLS-1$\n\t\tsave.setHoverImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.19\"))); //$NON-NLS-1$\n\t\tsave.setText(Messages.getString(\"IU.Strings.20\")); //$NON-NLS-1$\n\t\tsave.setToolTipText(Messages.getString(\"IU.Strings.21\")); //$NON-NLS-1$\n\t\ttoolbar.add(save);\n\n\t\tIWorkbenchAction print = ActionFactory.PRINT.create(window);\n\t\tprint.setImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.22\"))); //$NON-NLS-1$\n\t\tprint.setDisabledImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.23\"))); //$NON-NLS-1$\n\t\tprint.setHoverImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.24\"))); //$NON-NLS-1$\n\t\tprint.setText(Messages.getString(\"IU.Strings.25\")); //$NON-NLS-1$\n\t\tprint.setToolTipText(Messages.getString(\"IU.Strings.26\")); //$NON-NLS-1$\n\t\ttoolbar.add(print);\n\n\n\t\ttoolbar.add(new GroupMarker(Messages.getString(\"IU.Strings.27\"))); //$NON-NLS-1$\n\t\ttoolbar.add(new Separator());\n\t\tIWorkbenchAction find = ActionFactory.FIND.create(window);\n\t\tfind.setImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.28\"))); //$NON-NLS-1$\n\t\t//find.setDisabledImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.29\"))); //$NON-NLS-1$\n\t\t//find.setHoverImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.30\"))); //$NON-NLS-1$\n\t\tfind.setText(Messages.getString(\"IU.Strings.31\")); //$NON-NLS-1$\n\t\tfind.setToolTipText(Messages.getString(\"IU.Strings.32\")); //$NON-NLS-1$\n\t\ttoolbar.add(find);\n\n\t\t/*toolbar.add(ActionFactory.COPY.create(window));\n\t\ttoolbar.add(ActionFactory.CUT.create(window));\n\t\ttoolbar.add(ActionFactory.PASTE.create(window));\n\t\ttoolbar.add(new Separator());*/\n\n\t\t//TODO Rrgler le bug d'icon non charger undo / redo entre l'editeur et la console\n\t\t/*IWorkbenchAction undo = ActionFactory.UNDO.create(window);\n\t\tundo.setImageDescriptor(Activator.getImageDescriptor(\"icons/undo.gif\"));\n\t\tundo.setDisabledImageDescriptor(Activator.getImageDescriptor(\"icons/undo.gif\"));\n\t\tundo.setHoverImageDescriptor(Activator.getImageDescriptor(\"icons/undo.gif\"));\n\t\ttoolbar.add(undo);\n\n\t\tIWorkbenchAction redo = ActionFactory.REDO.create(window);\n\t\tredo.setImageDescriptor(Activator.getImageDescriptor(\"icons/redo.gif\"));\n\t\tredo.setDisabledImageDescriptor(Activator.getImageDescriptor(\"icons/redo.gif\"));\n\t\tredo.setHoverImageDescriptor(Activator.getImageDescriptor(\"icons/redo.gif\"));\n\t\ttoolbar.add(redo);*/\n\n\t\t\n\t\t//toolbar.add(ActionFactory.REDO.create(window));*/\n\n\t\t//toolbox2.png\n\t\tToolsBoxAction toolBox = new ToolsBoxAction(window);\n\t\ttoolBox.setImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.33\"))); //$NON-NLS-1$\n\t\ttoolBox.setDisabledImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.34\"))); //$NON-NLS-1$\n\t\ttoolBox.setHoverImageDescriptor(Activator.getImageDescriptor(Messages.getString(\"IU.Strings.35\"))); //$NON-NLS-1$\n\t\ttoolbar.add(toolBox);\n\t\t\n\t\t\n\t\t//action_toolsBox.setMenuCreator(new IMenuCreator(){});\n\t\n\t\t//coolBar.add(new ToolBarContributionItem(toolbar2, \"main2\"));\n\t\t//toolbar2.add(ActionFactory.SHOW_VIEW_MENU.create(window));\n\n\t\t\n\t\tIToolBarManager toolbar2 = new ToolBarManager(SWT.RIGHT | SWT.FLAT | SWT.HORIZONTAL);\n\t\t\n\t\tcoolBar.add(new ToolBarContributionItem(toolbar2, Messages.getString(\"IU.Strings.36\")));\t //$NON-NLS-1$\n\t\ttoolbar2.add(new GroupMarker(Messages.getString(\"IU.Strings.37\"))); //$NON-NLS-1$\n\t\ttoolbar2.add(new GroupMarker(Messages.getString(\"IU.Strings.38\"))); //$NON-NLS-1$\n\t}", "private void initialiseToolbar() {\n getSupportActionBar().setTitle(\"Custom Interval\");\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n }", "private RGridBagLayoutPane getTitlePane() {\n if (titlePane == null) {\n titlePane = new RGridBagLayoutPane();\n titlePane.setName(\"titlePane\");\n titlePane.setStyleProperties(\"{/fill \\\"HORIZONTAL\\\"/weightY \\\"0\\\"}\");\n titlePane.add(getHeaderPane(), new com.ulcjava.base.application.GridBagConstraints(0, 0, 1, 1, -1, -1,\n com.ulcjava.base.application.GridBagConstraints.CENTER, com.ulcjava.base.application.GridBagConstraints.NONE,\n new com.ulcjava.base.application.util.Insets(0, 0, 0, 0), 0, 0));\n }\n return titlePane;\n }", "protected abstract JToolBar getNorthToolbar();", "public synchronized void setupHistoWindows() {\r\n\t\tif (log.isLoggable(Level.INFO)) log.log(Level.INFO, String.format(\"started\")); //$NON-NLS-1$\r\n\t\tthis.histoSet = HistoSet.getInstance();\r\n\t\tthis.histoSet.initialize();\r\n\r\n\t\tif (this.histoGraphicsTabItem != null) this.resetGraphicsWindowHeaderAndMeasurement();\r\n\r\n\t\tthis.setHistoGraphicsTabItemVisible(this.settings.isHistoActive());\r\n\t\tthis.setHistoTableTabItemVisible(this.settings.isHistoActive());\r\n\t\tif (this.settings.isHistoActive()) {\r\n\t\t\tthis.updateHistoTabs(RebuildStep.A_HISTOSET, true);\r\n\t\t}\r\n\t}", "public JComponent createTopPanel() {\n\n\t//\tcontent();\n\t\tfields = new JTextField[NBR_FIELDS];\n\t\tmyTable = new PalletTable(db);\n\t\ttable = new JTable(myTable);\n\t\ttable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\t\ttable.setPreferredScrollableViewportSize(new Dimension(750, 100));\n table.setFillsViewportHeight(true);\n\t\tscroll = new JScrollPane(table);\n\t//\tcontent();\n\t\tmainPanel= new JPanel();\n\t\tmainPanel.setLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints();\n\t\tc.gridy=0;\n\t\tmainPanel.add(scroll,c);\n\t\tc.gridy=1;\n\t\tmainPanel.add(content(),c);\n\t\t//scroll.setPreferredSize(new Dimension(300,250));\n\t\treturn mainPanel;\n\t}", "public abstract BossBar show();", "@Override\n\tpublic Toolbar createToolbar() {\n\t\tLightVisualThemeToolbar lightVisualThemeToolbar = new LightVisualThemeToolbar();\n\t\treturn lightVisualThemeToolbar;\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setTitle(\"JUltima Toolbar\");\n setAlwaysOnTop(true);\n setFocusable(false);\n setLocationByPlatform(true);\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, 192, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 123, Short.MAX_VALUE)\n );\n\n pack();\n }", "private void createConent() {\n\t\tdockPanel = new DockLayoutPanel(Unit.PX);\n\t\tribbonBarPanel = new RibbonBarContainer();\n\t\tbattleMatCanvasPanel = new SimpleLayoutPanel();\n\t\tmainPanel = new LayoutPanel();\n\t\tmainPanel.setSize(\"100%\", \"100%\");\n\t\tbattleMatCanvas = new BattleMatCanvas();\n\t\tbattleMatCanvasPanel.clear();\n\t\tbattleMatCanvasPanel.add(battleMatCanvas);\n\t\teast.setSize(\"100%\", \"100%\");\n\t\teast.add(assetManagementPanel);\n\t\tsplitPanel = new SplitLayoutPanel() {\n\t\t\t@Override\n\t\t\tpublic void onResize() {\n\t\t\t\tsuper.onResize();\n\t\t\t\tbattleMatCanvas.onResize();\n\t\t\t};\n\t\t};\n\t\tmainPanel.add(splitPanel);\n\t\tdockPanel.clear();\n\t\tdockPanel.addNorth(ribbonBarPanel, Constants.RIBBON_BAR_SIZE);\n\t\tdockPanel.add(mainPanel);\n\t\t// MUST CALL THIS METHOD to set the constraints; if you don't not much\n\t\t// will be displayed!\n\t\tdockPanel.forceLayout();\n\n\t\tWindow.addResizeHandler(new ResizeHandler() {\n\t\t\tpublic void onResize(final ResizeEvent event) {\n\t\t\t\tdoWindowResize(event);\n\t\t\t}\n\t\t});\n\t}", "private void setToolBar() {\r\n toolbar.setTitle(R.string.photo_details);\r\n ActionBar ab = getSupportActionBar();\r\n if (ab != null) {\r\n ab.setDisplayHomeAsUpEnabled(true);\r\n }\r\n toolbar.setNavigationIcon(R.drawable.ic_back);\r\n }", "private void $$$setupUI$$$() {\n topPanel = new JPanel();\n topPanel.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));\n headerLabel = new JLabel();\n headerLabel.setText(\"Header\");\n topPanel.add(headerLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n contentPanel = new JPanel();\n contentPanel.setLayout(new BorderLayout(0, 0));\n topPanel.add(contentPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));\n topPanel.add(panel1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final Spacer spacer1 = new Spacer();\n panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n buttonBack = new JButton();\n buttonBack.setText(\"Back\");\n panel1.add(buttonBack, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonNext = new JButton();\n buttonNext.setText(\"Next\");\n panel1.add(buttonNext, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonCancel = new JButton();\n buttonCancel.setText(\"Cancel\");\n panel1.add(buttonCancel, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n topPanel.add(panel2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n statusLabel = new JLabel();\n statusLabel.setText(\"Status\");\n panel2.add(statusLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "public SketchBar(Number top, Integer offset) {\n super(top);\n setOffset(offset);\n }", "private void setTopBorder() {\n\t\tVBox topBorder = new VBox();\n\t\ttopBorder.setAlignment(Pos.CENTER);\n\t\ttopBorder.setPadding(new Insets(10, 10, 10, 10));\n\t\t\n\t\ttopText = new Text (\"Please enter information about the property below.\");\n\t\ttopText.setFont(Font.font(\"Bauhaus 93\", FontWeight.BOLD, 24));\n\t\ttopText.setFill(Color.rgb(100, 0, 150));\n\t\ttopBorder.getChildren().add(topText);\n\t\t\n\t\tmainPane.setTop(topBorder);\n\t}", "public void setupHistoTableHeader() {\r\n\t\tif (this.histoTableTabItem != null && !this.histoTableTabItem.isDisposed()) this.histoTableTabItem.setHeader();\r\n\t}", "private void initStatusBar() {\n ModelerSession.getStatusBarService().addStatusBarItem(\n getIdentifier(), selectedToolStatusBarItem, JideBoxLayout.FIX\n );\n }", "private Component buildToolBar() {\r\n DToolBar toolBar = new DToolBar();\r\n// toolBar.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n toolBar.setFloatable(true);\r\n toolBar.putClientProperty(\"JToolBar.isRollover\", Boolean.TRUE);\r\n // Swing\r\n toolBar.putClientProperty(\r\n Options.HEADER_STYLE_KEY,\r\n settings.getToolBarHeaderStyle());\r\n toolBar.putClientProperty(\r\n PlasticLookAndFeel.BORDER_STYLE_KEY,\r\n settings.getToolBarPlasticBorderStyle());\r\n toolBar.putClientProperty(\r\n WindowsLookAndFeel.BORDER_STYLE_KEY,\r\n settings.getToolBarWindowsBorderStyle());\r\n toolBar.putClientProperty(\r\n PlasticLookAndFeel.IS_3D_KEY,\r\n settings.getToolBar3DHint());\r\n\r\n AbstractButton button;\r\n/*\r\n toolBar.add(createToolBarButton(\"backward.gif\", \"Back\"));\r\n button = createToolBarButton(\"forward.gif\", \"Next\");\r\n button.setEnabled(false);\r\n toolBar.add(button);*/\r\n \r\n button = createToolBarButton(\"home.gif\", ResourceUtil.getString(\"HOME\"));\r\n toolBar.add(button);\r\n button.addActionListener(this);\r\n button.setActionCommand(\"home\");\r\n// toolBar.addSeparator();\r\n \r\n button = createToolBarButton(\"preference16.gif\", ResourceUtil.getString(\"PREFERENCES\"));\r\n toolBar.add(button);\r\n button.setRolloverIcon(readImageIcon(\"preference16_over.gif\"));\r\n button.addActionListener(this);\r\n button.setActionCommand(\"Preferences\");\r\n toolBar.addSeparator();\r\n\r\n button = createToolBarButton(\"new16.gif\", ResourceUtil.getString(\"NEW\"));\r\n button.setActionCommand(\"new\");\r\n button.addActionListener(this);\r\n toolBar.add(button);\r\n \r\n button = createToolBarButton(\"save_edit.gif\", ResourceUtil.getString(\"SAVE\"));\r\n button.setActionCommand(\"save\");\r\n button.addActionListener(this);\r\n toolBar.add(button);\r\n \r\n button = createToolBarButton(\"delete16.gif\", ResourceUtil.getString(\"DELETE\"));\r\n button.setActionCommand(\"delete\");\r\n button.addActionListener(this);\r\n toolBar.add(button);\r\n \r\n button = createToolBarButton(\"print.gif\", ResourceUtil.getString(\"PRINT\"));\r\n button.setActionCommand(\"print\");\r\n button.addActionListener(this);\r\n toolBar.add(button);\r\n/* \r\n toolBar.add(createToolBarButton(\"print.gif\", \"Print\"));\r\n toolBar.add(createToolBarButton(\"refresh.gif\", \"Update\"));\r\n toolBar.addSeparator();\r\n\r\n ButtonGroup group = new ButtonGroup();\r\n button = createToolBarRadioButton(\"pie_mode.png\", \"Pie Chart\");\r\n button.setSelectedIcon(readImageIcon(\"pie_mode_selected.gif\"));\r\n group.add(button);\r\n button.setSelected(true);\r\n toolBar.add(button);\r\n\r\n button = createToolBarRadioButton(\"bar_mode.png\", \"Bar Chart\");\r\n button.setSelectedIcon(readImageIcon(\"bar_mode_selected.gif\"));\r\n group.add(button);\r\n toolBar.add(button);\r\n\r\n button = createToolBarRadioButton(\"table_mode.png\", \"Table\");\r\n button.setSelectedIcon(readImageIcon(\"table_mode_selected.gif\"));\r\n group.add(button);\r\n toolBar.add(button);\r\n toolBar.addSeparator();\r\n\r\n button = createToolBarButton(\"help.gif\", \"Open Help\");\r\n button.addActionListener(createHelpActionListener());\r\n toolBar.add(button);*/\r\n\r\n return toolBar;\r\n }", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\r\n\t}", "private JPanel topPanel()\r\n\t{\r\n\t\tJPanel top = new JPanel();\r\n\t\ttop.setLayout(new GridLayout(0,1));\r\n\t\ttop.add(input);\r\n\t\t//top.add(submit);\r\n\t\treturn top;\r\n\t}", "private void addComponentsTopane() {\n \tsetLayout(new BorderLayout());\n \t\n \tJButton b1 = new JButton(\"Login\");\n \tColor customBlue = new Color(86, 132, 197);\n \tb1.setBackground(customBlue);\n b1.setForeground(Color.WHITE);\n this.add(b1, BorderLayout.SOUTH);\n }", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setLayout(new GridLayout(1, false));\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\t\t{\r\n\t\t\tfinal Button btnShowTheFake = new Button(shell, SWT.TOGGLE);\r\n\t\t\tbtnShowTheFake.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t\tif (btnShowTheFake.getSelection()) {\r\n\t\t\t\t\t\tRectangle bounds = btnShowTheFake.getBounds();\r\n\t\t\t\t\t\tPoint pos = shell.toDisplay(bounds.x + 5, bounds.y + bounds.height);\r\n\t\t\t\t\t\ttooltip = showTooltip(shell, pos.x, pos.y);\r\n\t\t\t\t\t\tbtnShowTheFake.setText(\"Hide it\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (tooltip != null && !tooltip.isDisposed())\r\n\t\t\t\t\t\t\ttooltip.dispose();\r\n\t\t\t\t\t\tbtnShowTheFake.setText(\"Show The Fake Tooltip\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbtnShowTheFake.setText(\"Show The Fake Tooltip\");\r\n\t\t}\r\n\t}", "protected void createContents() {\n\t\tshell = new Shell();\n\t\tshell.setSize(1200, 1100);\n\t\tshell.setText(\"Zagreb Montaža d.o.o\");\n\n\t\tfinal Composite cmpMenu = new Composite(shell, SWT.NONE);\n\t\tcmpMenu.setBackground(SWTResourceManager.getColor(119, 136, 153));\n\t\tcmpMenu.setBounds(0, 0, 359, 1061);\n\t\t\n\t\tFormToolkit formToolkit = new FormToolkit(Display.getDefault());\n\t\tfinal Section sctnCalculator = formToolkit.createSection(cmpMenu, Section.TWISTIE | Section.TITLE_BAR);\n\t\tsctnCalculator.setExpanded(false);\n\t\tsctnCalculator.setBounds(10, 160, 339, 23);\n\t\tformToolkit.paintBordersFor(sctnCalculator);\n\t\tsctnCalculator.setText(\"Kalkulator temperature preddgrijavanja\");\n\n\t\tfinal Section sctn10112ce = formToolkit.createSection(cmpMenu, Section.TREE_NODE | Section.TITLE_BAR);\n\t\tsctn10112ce.setBounds(45, 189, 304, 23);\n\t\tformToolkit.paintBordersFor(sctn10112ce);\n\t\tsctn10112ce.setText(\"1011-2 CE\");\n\t\tsctn10112ce.setVisible(false);\n\n\t\tfinal Section sctn10112cet = formToolkit.createSection(cmpMenu, Section.TREE_NODE | Section.TITLE_BAR);\n\t\tsctn10112cet.setBounds(45, 218, 304, 23);\n\t\tformToolkit.paintBordersFor(sctn10112cet);\n\t\tsctn10112cet.setText(\"1011-2 CET\");\n\t\tsctn10112cet.setVisible(false);\n\n\t\tfinal Section sctnAws = formToolkit.createSection(cmpMenu, Section.TREE_NODE | Section.TITLE_BAR);\n\t\tsctnAws.setBounds(45, 247, 304, 23);\n\t\tformToolkit.paintBordersFor(sctnAws);\n\t\tsctnAws.setText(\"AWS\");\n\t\tsctnAws.setVisible(false);\n\t\t\n\t\tfinal Composite composite10112ce = new Composite(shell, SWT.COLOR_DARK_GRAY);\n\t\t//composite10112ce.setBackground(SWTResourceManager.getColor(255, 255, 255));\n\t\tcomposite10112ce.setBounds(365, 0, 829, 1061);\n\t\tcomposite10112ce.setVisible(false);\n\t\t\n\t\tfinal Composite composite10112cet = new Composite(shell, SWT.COLOR_DARK_GRAY);\n\t\t//composite10112ce.setBackground(SWTResourceManager.getColor(255, 255, 255));\n\t\tcomposite10112cet.setBounds(365, 0, 829, 1061);\n\t\tcomposite10112cet.setVisible(false);\n\t\t\n\t\tfinal Composite compositeAws = new Composite(shell, SWT.COLOR_DARK_GRAY);\n\t\t//composite10112ce.setBackground(SWTResourceManager.getColor(255, 255, 255));\n\t\tcompositeAws.setBounds(365, 0, 829, 1061);\n\t\tcompositeAws.setVisible(false);\n\t\t\n\t\tsctnCalculator.addExpansionListener(new IExpansionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanged(ExpansionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\n\t\t\t\tif (sctnCalculator.isExpanded() == false) {\n\t\t\t\t\tsctn10112ce.setVisible(true);\n\t\t\t\t\tsctn10112cet.setVisible(true);\n\t\t\t\t\tsctnAws.setVisible(true);\n\n\t\t\t\t} else {\n\t\t\t\t\tsctn10112ce.setVisible(false);\n\t\t\t\t\tsctn10112cet.setVisible(false);\n\t\t\t\t\tsctnAws.setVisible(false);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\n\t\tsctn10112ce.addExpansionListener(new IExpansionListener() {\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanged(ExpansionEvent arg0) {\n\t\t\t\tif (sctn10112ce.isExpanded() == true) {\n\t\t\t\t\tsctn10112cet.setVisible(false);\n\t\t\t\t\tcompositeAws.setVisible(false);\n\t\t\t\t\tnew F10112ce(composite10112ce, cmpMenu.getStyle());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcomposite10112ce.setVisible(false);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tsctn10112cet.addExpansionListener(new IExpansionListener() {\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanged(ExpansionEvent arg0) {\n\t\t\t\tif (sctn10112cet.isExpanded() == true) {\n\t\t\t\t\tsctn10112ce.setVisible(false);\n\t\t\t\t\tcompositeAws.setVisible(false);\n\t\t\t\t\tnew F10112cet(composite10112cet, cmpMenu.getStyle());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcomposite10112ce.setVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t\tsctnAws.addExpansionListener(new IExpansionListener() {\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanging(ExpansionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void expansionStateChanged(ExpansionEvent arg0) {\n\t\t\t\tif (sctnAws.isExpanded() == true) {\n\t\t\t\t\tsctn10112ce.setVisible(false);\n\t\t\t\t\tsctn10112cet.setVisible(false);\n\t\t\t\t\tnew FAws(compositeAws, cmpMenu.getStyle());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcompositeAws.setVisible(false);\n\t\t\t}\n\t\t});\n\t}", "private JMenuBar createbar(){\n\t\tJMenuBar menuBar = new JMenuBar();\n\n\t\t//Add a JMenu\n\t\tJMenu c = new JMenu(\"Create\");\n\t\tJMenu m = new JMenu(\"Manipulate\"); \n\t\tJMenu o = new JMenu(\"Other\");\n\n\t\tmenuBar.add(c);\n\t\tmenuBar.add(m);\n\t\tmenuBar.add(o);\n\n\t\t//Create menu\n\t\tJMenuItem cPyramid = new JMenuItem(\"Pyramid\");\n\t\tJMenuItem cSquare = new JMenuItem(\"Square\");\n\t\tJMenuItem cStar = new JMenuItem(\"Star\");\n\t\tJMenuItem cSphere = new JMenuItem(\"Sphere\");\n\t\tJMenuItem cCube = new JMenuItem(\"Cube\");\n\t\tJMenuItem cLight = new JMenuItem(\"Light\");\n\n\t\tc.add(cPyramid);\n\t\tc.add(cSquare);\n\t\tc.add(cStar);\n\t\tc.add(cSphere);\n\t\tc.add(cCube);\n\t\tc.add(cLight);\n\t\t\n\n\t\t//Manipulate menu\n\t\tJMenuItem mModify = new JMenuItem(\"Modify\");\n\t\tJMenuItem mDelete = new JMenuItem(\"Delete\");\n\n\t\tm.add(mModify);\n\t\tm.add(mDelete);\n\n\t\tJMenuItem oDeleteAll = new JMenuItem(\"Delete All (lights remain but will be overwritten)\"); \n\t\tJMenuItem oPrint = new JMenuItem(\"Print Structure\");\n\n\t\to.add(oPrint);\n\t\to.add(oDeleteAll);\n\n\n\t\tcPyramid.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Pyramid, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\n\t\t});\n\n\t\tcSquare.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Square, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\t\t});\n\n\t\tcStar.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Star, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\t\t});\n\n\t\tcSphere.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Sphere, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\t\t});\n\t\t\n\t\tcCube.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Cube, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\t\t});\n\n\t\tcLight.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfigure_id+=1;\n\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, Fig_type.Light, figure_id);\n\t\t\t\tif (cdialog.getAnswer()!=null)\n\t\t\t\t\tdraw.figurelist.add(cdialog.getAnswer());\n\t\t\t}\n\t\t});\n\n\t\tmModify.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tfor (Figure_deployment_type fig: draw.figurelist) {\n\t\t\t\t\tif (fig.getId()==draw.picked_figure){\n\t\t\t\t\t\tCustomCreateDialog cdialog = new CustomCreateDialog(frame, true, fig.type, draw.picked_figure);\n\t\t\t\t\t\tif (cdialog.getAnswer()!=null){\n\t\t\t\t\t\t\tfig.modify(cdialog.getModify());\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\tmDelete.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tint n =-1;\n\t\t\t\tfor (int i = 0; i < draw.figurelist.size(); i++) {\n\t\t\t\t\tif(draw.figurelist.get(i).getId()==draw.picked_figure)\n\t\t\t\t\t\tn=i;\n\t\t\t\t}\n\t\t\t\tif (n!=-1)\n\t\t\t\tdraw.figurelist.remove(n);\n\t\t\t}\n\t\t});\n\n\t\toDeleteAll.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tdraw.figurelist.clear();\n\t\t\t}\n\t\t});\n\n\t\toPrint.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nArrayList<Figure_deployment_type> : {\");\n\t\t\t\tfor (Figure_deployment_type fig : draw.figurelist) {\n\t\t\t\t\tSystem.out.print(\"[ \");\n\t\t\t\t\tSystem.out.print(fig.toString());\n\t\t\t\t\tSystem.out.println(\" ]\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"}\");\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\treturn menuBar;\n\t}", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"带进度条的表\");\r\n\t\tshell.setLayout(new FillLayout());\r\n\r\n\t\tTable table = new Table(shell, SWT.BORDER);\r\n\t\ttable.setHeaderVisible(true);\r\n\t\ttable.setLinesVisible(true);\r\n\r\n//\t\t两列\r\n\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\tnew TableColumn(table, SWT.NONE);\r\n\t\t}\r\n\t\ttable.getColumn(0).setText(\"Task\");\r\n\t\ttable.getColumn(1).setText(\"Progress\");\r\n\r\n//\t\t四十行\r\n\t\tfor (int i = 0; i < 40; i++) {\r\n\t\t\tTableItem item = new TableItem(table, SWT.NONE);\r\n\t\t\titem.setText(\"Task \" + i);\r\n//\t\t\t行数为5的倍数时添加进度条\r\n\t\t\tif (i % 5 == 0) {\r\n\t\t\t\tProgressBar bar = new ProgressBar(table, SWT.NONE);\r\n\t\t\t\tbar.setSelection(i); // 进度条显示的百分比\r\n\t\t\t\tTableEditor editor = new TableEditor(table);\r\n\t\t\t\teditor.grabHorizontal = editor.grabVertical = true; // 宽度高度同表格\r\n\t\t\t\teditor.setEditor(bar, item, 1); // 在表格上方显示进度条\r\n\t\t\t}\r\n\t\t}\r\n\t\ttable.getColumn(0).pack();\r\n\t\ttable.getColumn(1).setWidth(128);\r\n\r\n\t\tshell.pack();\r\n\t}", "public ConductorTopComponent() {\n initComponents();\n setName(Bundle.CTL_ConductorTopComponent());\n setToolTipText(Bundle.HINT_ConductorTopComponent());\n conductorPanel = (ConductorPanel) castConductorPanel;\n setEnabledOnComponentAndChildren(this, false);\n }", "protected void createContents() {\r\n\t\tsetText(Messages.getString(\"HMS.PatientManagementShell.title\"));\r\n\t\tsetSize(900, 700);\r\n\r\n\t}", "void hideTop() {\n }", "private void createContents() {\r\n\t\tshlAboutGoko = new Shell(getParent(), getStyle());\r\n\t\tshlAboutGoko.setSize(376, 248);\r\n\t\tshlAboutGoko.setText(\"About Goko\");\r\n\t\tshlAboutGoko.setLayout(new GridLayout(1, false));\r\n\r\n\t\tComposite composite_1 = new Composite(shlAboutGoko, SWT.NONE);\r\n\t\tcomposite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));\r\n\t\tcomposite_1.setLayout(new GridLayout(1, false));\r\n\r\n\t\tLabel lblGokoIsA = new Label(composite_1, SWT.WRAP);\r\n\t\tGridData gd_lblGokoIsA = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t\tgd_lblGokoIsA.widthHint = 350;\r\n\t\tlblGokoIsA.setLayoutData(gd_lblGokoIsA);\r\n\t\tlblGokoIsA.setText(\"Goko is an open source desktop application for CNC control and operation\");\r\n\r\n\t\tComposite composite_2 = new Composite(composite_1, SWT.NONE);\r\n\t\tcomposite_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\r\n\t\tcomposite_2.setLayout(new GridLayout(2, false));\r\n\r\n\t\tLabel lblAlphaVersion = new Label(composite_2, SWT.NONE);\r\n\t\tlblAlphaVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));\r\n\t\tlblAlphaVersion.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.ITALIC));\r\n\t\tlblAlphaVersion.setText(\"Version\");\r\n\r\n\t\tLabel lblVersion = new Label(composite_2, SWT.NONE);\r\n\t\tlblVersion.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));\r\n\t\tnew Label(composite_1, SWT.NONE);\r\n\r\n\t\tLabel lblDate = new Label(composite_2, SWT.NONE);\r\n\t\tlblDate.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));\r\n\t\tlblDate.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.ITALIC));\r\n\t\tlblDate.setText(\"Build\");\r\n\t\t\r\n\t\tLabel lblBuild = new Label(composite_2, SWT.NONE);\r\n\t\tlblBuild.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\r\n\t\t\t\t\r\n\t\tProperties prop = new Properties();\r\n\t\tClassLoader loader = Thread.currentThread().getContextClassLoader(); \r\n\t\tInputStream stream = loader.getResourceAsStream(\"/version.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(stream);\r\n\t\t\tString version = prop.getProperty(\"goko.version\");\r\n\t\t\tString build = prop.getProperty(\"goko.build.timestamp\");\r\n\t\t\tlblVersion.setText(version);\r\n\t\t\tlblBuild.setText(build);\t\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tLOG.error(e);\r\n\t\t}\r\n\t\t\r\n\t\tComposite composite = new Composite(composite_1, SWT.NONE);\r\n\t\tcomposite.setLayout(new GridLayout(2, false));\r\n\r\n\t\tLabel lblMoreInformationOn = new Label(composite, SWT.NONE);\r\n\t\tGridData gd_lblMoreInformationOn = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);\r\n\t\tgd_lblMoreInformationOn.widthHint = 60;\r\n\t\tlblMoreInformationOn.setLayoutData(gd_lblMoreInformationOn);\r\n\t\tlblMoreInformationOn.setText(\"Website :\");\r\n\r\n\t\tLink link = new Link(composite, SWT.NONE);\r\n\t\tlink.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseUp(MouseEvent event) {\r\n\t\t\t\tif (event.button == 1) { // Left button pressed & released\r\n\t\t Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;\r\n\t\t if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {\r\n\t\t try {\r\n\t\t desktop.browse(URI.create(\"http://www.goko.fr\"));\r\n\t\t } catch (Exception e) {\r\n\t\t LOG.error(e);\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\t}\r\n\t\t});\r\n\t\tlink.setText(\"<a>http://www.goko.fr</a>\");\r\n\t\t\r\n\t\tComposite composite_3 = new Composite(composite_1, SWT.NONE);\r\n\t\tcomposite_3.setLayout(new GridLayout(2, false));\r\n\t\t\r\n\t\tLabel lblForum = new Label(composite_3, SWT.NONE);\r\n\t\tGridData gd_lblForum = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);\r\n\t\tgd_lblForum.widthHint = 60;\r\n\t\tlblForum.setLayoutData(gd_lblForum);\r\n\t\tlblForum.setText(\"Forum :\");\r\n\t\t\r\n\t\tLink link_1 = new Link(composite_3, 0);\r\n\t\tlink_1.setText(\"<a>http://discuss.goko.fr</a>\");\r\n\t\tlink_1.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseUp(MouseEvent event) {\r\n\t\t\t\tif (event.button == 1) { // Left button pressed & released\r\n\t\t Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;\r\n\t\t if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {\r\n\t\t try {\r\n\t\t desktop.browse(URI.create(\"http://discuss.goko.fr\"));\r\n\t\t } catch (Exception e) {\r\n\t\t LOG.error(e);\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tComposite composite_4 = new Composite(composite_1, SWT.NONE);\r\n\t\tcomposite_4.setLayout(new GridLayout(2, false));\r\n\t\t\r\n\t\tLabel lblContact = new Label(composite_4, SWT.NONE);\r\n\t\tGridData gd_lblContact = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);\r\n\t\tgd_lblContact.widthHint = 60;\r\n\t\tlblContact.setLayoutData(gd_lblContact);\r\n\t\tlblContact.setText(\"Contact :\");\r\n\t\t\t \r\n\t\tLink link_2 = new Link(composite_4, 0);\r\n\t\tlink_2.setText(\"<a>\"+toAscii(\"636f6e7461637440676f6b6f2e6672\")+\"</a>\");\r\n\r\n\t}", "protected JPanel getTopPanel() {\n List topComps = new ArrayList();\n getTopComponents(topComps);\n if (topComps.size() == 0) {\n return null;\n }\n JPanel topPanel = GuiUtils.left(GuiUtils.doLayout(topComps, 0, GuiUtils.WT_N, GuiUtils.WT_N));\n topPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n \n return McVGuiUtils.makeLabeledComponent(\"Options:\", topPanel);\n }" ]
[ "0.7731646", "0.73646903", "0.6758461", "0.6736407", "0.653869", "0.6530729", "0.64662385", "0.6455751", "0.6378216", "0.63525146", "0.62789875", "0.6270931", "0.6196071", "0.61305463", "0.61214", "0.61141694", "0.6112783", "0.6110247", "0.60832685", "0.6074513", "0.6039429", "0.60387135", "0.6027827", "0.6027116", "0.5989012", "0.5978563", "0.5978555", "0.5973472", "0.5961628", "0.5929532", "0.59249395", "0.59112525", "0.59101844", "0.59073746", "0.59073025", "0.58948493", "0.5893982", "0.5892583", "0.5875137", "0.5868795", "0.5861701", "0.5858968", "0.5857021", "0.5855794", "0.5838313", "0.58351797", "0.58230996", "0.58148617", "0.58145046", "0.58121014", "0.5811397", "0.58098555", "0.58087176", "0.5805866", "0.5794293", "0.5784105", "0.57831293", "0.5777177", "0.5770611", "0.57635844", "0.5753912", "0.5751096", "0.5749382", "0.5746977", "0.57365346", "0.57335997", "0.5723594", "0.5720004", "0.5716547", "0.56991076", "0.5695224", "0.56935465", "0.567769", "0.5676282", "0.5676059", "0.56757385", "0.5669861", "0.56511015", "0.5650648", "0.5643457", "0.5643225", "0.56411296", "0.5637745", "0.5627291", "0.5624124", "0.56228477", "0.5614223", "0.56058896", "0.56058115", "0.56049496", "0.5599277", "0.5596225", "0.5593322", "0.5588278", "0.5587277", "0.5577973", "0.5575639", "0.55699354", "0.5564331", "0.5545347" ]
0.7340439
2
update the current visualization when the weights change
protected void updateWeights() { visualization.updateWeights(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update_weight() {\n this.weights = this.updatedWeights;\n }", "public void updateWeights() {\n\t\t\n\t}", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "public void batchUpdateWeights() {\n\t\tObject[] keys = nextLayerNodes.keySet().toArray();\n\t\tfor (Object key : keys) {\n\t\t\tNode nextLayerNode = (Node) key;\n\t\t\t// System.out.printf(\"Updating weight from %f to %f%n\", nextLayerNodes.get(nextLayerNode), nextLayerNodesUpdateMap.get(nextLayerNode));\n\t\t\tdouble oldWeight = nextLayerNodes.get(nextLayerNode);\n\t\t\tnextLayerNodes.put(nextLayerNode, nextLayerNodesUpdateMap.get(nextLayerNode));\n\t\t\tdouble newWeight = nextLayerNodes.get(nextLayerNode);\n\t\t\tdouble deltaWeight = oldWeight-newWeight;\n\t\t\tSystem.out.printf(\"Changed from %f to %f%n\", oldWeight, newWeight);\n\t\t\tif (deltaWeight > 0.0) {\n\t\t\t\tif (nextLayerNodesArrayList.get(0).nextLayerNodes.size() == 0) {\n\t\t\t\t\tSystem.out.print(\"Hidden Node connected to output layer \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"Node connected to another hidden layer \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf (\"Increased!! Delta weight = %.10f%n\", deltaWeight);\n\t\t\t} else if (deltaWeight < 0.0) {\n\t\t\t\tif (nextLayerNodesArrayList.get(0).nextLayerNodes.size() == 0) {\n\t\t\t\t\tSystem.out.print(\"Hidden Node connected to output layer \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"Node connected to another hidden layer \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(\"Decreased!! Delta weight = %.10f%n\", deltaWeight);\n\t\t\t}\n\t\t}\n\t}", "protected abstract void updateWeightsSpecific(double ni);", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "private void updateHubModels() {\n this.hub.setWeight( this.hub.indexOf( this.modelHub1 ) , (Integer)this.jSpinnerModel1.getValue() );\n this.hub.setWeight( this.hub.indexOf( this.modelHub2 ) , (Integer)this.jSpinnerModel2.getValue() );\n this.hub.setWeight( this.hub.indexOf( this.modelHub3 ) , (Integer)this.jSpinnerModel3.getValue() );\n this.modelHub1.setValue( this.jSliderModel1.getValue() );\n this.modelHub2.setValue( this.jSliderModel2.getValue() );\n this.modelHub3.setValue( this.jSliderModel3.getValue() );\n\n this.updateHubHelps( this.modelHub1 , this.jLabelHelp1 );\n this.updateHubHelps( this.modelHub2 , this.jLabelHelp2 );\n this.updateHubHelps( this.modelHub3 , this.jLabelHelp3 );\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "public void update() {\n\t\tif (c.getResamplingFactor() != 1) return;\n\t\trenderer.getVolume().updateData();\n\t}", "public void setWeight(float w) {\n weight = w;\n }", "protected void mutateWeights() {\n\t\t// TODO: Change the way weight mutation works\n\t\tif (Braincraft.gatherStats) {\n\t\t\tArrayList<Integer> mutatedgenes = new ArrayList<Integer>();\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate)) {\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t\t\tmutatedgenes.add(g.innovation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString output = \"weight mutation \" + ID;\n\t\t\tfor (Integer i : mutatedgenes) {\n\t\t\t\toutput += \" \" + i;\n\t\t\t}\n\t\t\tBraincraft.genetics.add(output);\n\t\t} else {\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate))\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t}\n\t\t}\n\t\t// TODO: Report weight mutations to stats\n\t}", "private void setWeight(float weight){\n this.weight = weight;\n }", "public void setWeights() {\n for (Square[] square : squares) {\n for (Square square1 : square) {\n try {\n int i = Integer.parseInt(square1.getText());\n square1.setV(new Vertex(square1.getXcoor(), square1.getYcoor(), i));\n } catch (NumberFormatException e) {\n square1.setV(new Vertex(square1.getXcoor(), square1.getYcoor(), 1));\n }\n }\n }\n }", "public void setWeights(float[] w) {\n _w1D = w;\n _weights = true;\n }", "@Override\n public void setWeight(double w) {\n this.weight = w;\n\n }", "public void setWeight(double w){\n weight = w;\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGraph();\r\n\t\t\r\n\t\tfor (int i = 0; i < entryGraph.size(); i++) {\r\n\t\t\tdrawEntry(entryGraph.get(i), i);\r\n\t\t}\r\n\t}", "public void setWeights(float[][] w) {\n _w2D = w;\n _weights = true;\n }", "@Override\n protected void refreshVisuals() {\n getFigure().updateLabels();\n }", "public void setWeight(float value) {\n this.weight = value;\n }", "public void notifyAlgoUpdateCurrentValue() {\n this.mHwGradualBrightnessAlgo.updateTargetAndRate(this.mTargetValue, this.mRate);\n this.mHwGradualBrightnessAlgo.updateCurrentBrightnessValue((float) this.mCurrentValue);\n }", "public void setWeight(int newWeight) {\n weight = newWeight;\n }", "public void changeVisualization ( )\r\n\t{\r\n\t\thorizontal = !horizontal;\r\n\t\trepaint ( );\r\n\t}", "private void updateUI() {\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n updateText();\n updateChart();\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "public void update(){\n\t\tif (!VisualizerMain.selectedRun.equals(\"\")){\n\t\t\tupdateEpochNum();\n\t\t\tupdateParticles();\n\t\t\tthis.repaint();\n\t\t}\n\t\t\n\t}", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "public void setWeight(int w){\n\t\tweight = w;\n\t}", "public void updateWeights(ScoreModel model) {\n\t\tfor (Edge e : edges) {\n\t\t\te.updateWeight(model, this);\n\t\t}\n\t}", "public void update() {\r\n\t\tthis.removeAll();\r\n\t\tdrawLinesAndLabels(this.getWidth(), this.getHeight());\r\n\t\tdrawNameSurferEntries();\r\n\t}", "public void setWeight(int w) {\n\t\tweight = w;\n\t}", "private void change() {\n\t\tsetChanged();\n\t\t//NotifyObservers calls on the update-method in the GUI\n\t\tnotifyObservers();\n\t}", "private void updateChart() {\n //Declare needed variables\n final DateFormat dateFormat = new SimpleDateFormat(\"dd-MM\", Locale.getDefault());\n final LineChart chart = findViewById(R.id.chartWeight);\n List<Entry> weightEntries = new ArrayList<>();\n mUser.weight.sortListByDate();\n ArrayList<WeightValue> weightHistory = mUser.weight.getWeightHistory();\n\n //Set entries to entry list from weight history list\n for (int i = 0; i < weightHistory.size(); i++) {\n //Get the current weight weight value and intialize the current variables\n WeightValue weightValue = weightHistory.get(i);\n Date date = weightValue.getDate();\n float weight = (float) weightValue.getWeight();\n\n //Add the entries to the entries list\n weightEntries.add(new Entry(date.getTime(), weight));\n }\n\n //Setup XAxis\n XAxis xAxis = chart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n xAxis.setDrawGridLines(false);\n xAxis.setGranularity(1f);\n xAxis.setGranularityEnabled(true);\n xAxis.setLabelCount(weightHistory.size(), false);\n xAxis.setValueFormatter(new IndexAxisValueFormatter() {\n @Override\n public String getFormattedValue(float value) {\n return dateFormat.format(value);\n }\n });\n\n //Setups YAxis\n YAxis rightYAxis = chart.getAxisRight();\n rightYAxis.setEnabled(false);\n\n //Create linedata from the entries list\n final LineDataSet weightDataSet = new LineDataSet(weightEntries, \"Paino\");\n\n //Customize chart\n Description desc = new Description();\n desc.setEnabled(false);\n chart.setDescription(desc);\n chart.setMaxHighlightDistance(20);\n\n weightDataSet.setValueTextSize(10);\n weightDataSet.setColor(Color.BLUE);\n weightDataSet.setFillAlpha(10);\n weightDataSet.setLineWidth(3f);\n weightDataSet.setCircleRadius(4);\n\n\n\n //Shows the values as integers rather than floats\n weightDataSet.setValueFormatter(new ValueFormatter() {\n @Override\n public String getFormattedValue(float value) {\n return String.format(Locale.getDefault(), \"%.1f\", value);\n }\n });\n\n chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {\n @Override\n public void onValueSelected(final Entry e, Highlight h) {\n AlertDialog.Builder builder = new AlertDialog.Builder(WeightActivity.this);\n builder.setTitle(\"Poista arvo\")\n .setMessage(\"Oletko varma?\")\n .setNegativeButton(\"Peruuta\", null)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n weightDataSet.removeEntry(e);\n chart.invalidate();\n\n mUser.weight.removeWeightByDate(e.getX());\n updateText();\n }\n });\n\n AlertDialog alert = builder.create();\n alert.show();\n }\n\n @Override\n public void onNothingSelected() {\n\n }\n });\n\n //Add the values to the chart and intialize it\n LineData weightLineData = new LineData(weightDataSet);\n chart.setData(weightLineData);\n chart.invalidate();\n }", "public void visualChange();", "public void setWeights(double[] w) {\n\t\t\tweights = w;\n\t\t}", "public void setWeight(double weight) {\r\n this.weight = weight;\r\n }", "@Override\r\n\tpublic void setWeight(double weight) {\n\t\t\r\n\t}", "private void updateWeights(Hashtable<NeuralNode, Double> nodeValues, double learnRate, double momentum) {\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\toutput.updateWeights(null, nodeValues, learnRate, momentum);\r\n\t\t}\r\n\t}", "public void update() {\n\tfireContentsChanged(this, 0, getSize());\n }", "private void updateView() {\n model.inlezenHighscore();\n for (int i = 0; i < 10; i++) {\n view.getNaamLabels(i).setText(model.getNaam(i));\n view.getScoreLabels(i).setText(model.getScores(i));\n }\n }", "public void setWeight(double weight) {\n this.weight = weight;\n }", "public void setWeight(double weight){\n\t\tthis.weight = weight;\n\t}", "public void updateGraph(){\n\t\tgraph.update(updatePopulations(), iteration);\n\t\titeration++;\n\t}", "public void setWeight(Double weight) {\n this.weight = weight;\n }", "public void setWeight(float value) {\n\t\t\tthis.weight = value;\n\t\t}", "@Override\n\tpublic void setWeight(final double weight) {\n\n\t}", "void updateControls();", "@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "private void updateView() {\r\n if (this.nodes == null || this.nodes.length > 1\r\n || !this.nodes[0].exists()) {\r\n this.titleBorder.setTitle(\"-\");\r\n this.jzvStat.setStat(null);\r\n this.taUpdate.setText(\"\");\r\n this.taChildData.setText(\"\");\r\n this.jbUpdate.setEnabled(false);\r\n this.jbNewChild.setEnabled(false);\r\n this.jbDelete.setEnabled(this.nodes != null);\r\n } else {\r\n this.titleBorder.setTitle(this.nodes[0].getPath());\r\n this.jzvStat.setStat(this.nodes[0].getStat());\r\n byte[] data = this.nodes[0].getData();\r\n this.taUpdate.setText(new String(data == null ? \"null\".getBytes()\r\n : data));\r\n this.taChildData.setText(\"\");\r\n this.jbUpdate.setEnabled( !this.taUpdate.getText().trim().equals(\"\") );\r\n this.jbNewChild.setEnabled( !this.jtfChildName.getText().trim().equals(\"\") );\r\n this.jbDelete.setEnabled(true);\r\n }\r\n this.repaint();\r\n }", "public void setCurrentWeight(double newWeight) throws Exception {\n\t\tthis.currentWeight = new Weight(currentWeight.getWeightType(), newWeight);\n\t}", "private void updatePanel() {\n\t\tProbeUtilities.updateModelProbePanel();\n\t}", "public void onUpdate()\n\t{\n\t\tchunk.setModelBound(new BoundingBox());\n\t\tchunk.updateModelBound();\n\n\t}", "public void update() {\r\n\t\tdiffuse();\r\n\t\tdecay();\r\n\t}", "public void setWeights(Weight[] weights) {\n this.weights = weights;\n }", "public void setWeight(double weight){\n\t\tthis._weight = weight;\n\t}", "public void addWeight(){\n\t\tweight++;\n\t}", "public void updateHistogram() {\n\n // Dont bother updating histogram if tab not even visible, save resources.\n if (!this.isVisible()) {\n return;\n }\n\n // Initialize imp variable.\n MimsPlus imp = null;\n\n // Get the title of the window currently selected in the combobox.\n // Then get the window associated with that title. \n String title = (String) jComboBox1.getSelectedItem();\n if (title != null) {\n imp = (MimsPlus) windows.get(title);\n }\n\n // Not sure why but sometimes images have NULL image processors.\n // Cant update histogram if it does not have one.\n if (imp == null) {\n return;\n }\n ImageProcessor ip = imp.getProcessor();\n if (ip == null) {\n return;\n }\n\n // Update the sliders.\n contrastAdjuster1.update(imp);\n\n // Get Pixel values.\n int i = 0;\n int width = imp.getWidth();\n int height = imp.getHeight();\n int nbins = 256;\n double[] pixels = new double[width * height];\n double pixelVal, maxVal = 0.0;\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n pixelVal = ip.getPixelValue(x, y);\n pixels[i] = pixelVal;\n if (maxVal < pixelVal) {\n maxVal = pixelVal;\n }\n i++;\n }\n }\n\n // return if no data avaialable\n if (pixels == null) {\n return;\n }\n if (pixels.length == 0) {\n return;\n }\n\n // Setup and plot histogram.\n HistogramDataset dataset = new HistogramDataset();\n dataset.addSeries(\"\", pixels, nbins);\n MimsXYPlot plot = (MimsXYPlot) chart.getPlot();\n plot.setDataset(dataset);\n\n // Show contrast window.\n updateContrastWindow();\n\n // Final plot adjustments. maxVal cannot be zero, or JFreeChart will generate this error:\n // IllegalArgumentException: A positive range length is required: Range[0.0,0.0]\n if (maxVal == 0) {\n maxVal = 0.00001;\n }\n plot.getDomainAxis().setRange(0, maxVal);\n plot.setDomainGridlinesVisible(false);\n chart.fireChartChanged();\n }", "public void updateConicalView();", "@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}", "public void setNewWeights(boolean clearWeights) {\n Random randomEngine = new Random();\n if (clearWeights) {\n for (int i = 0; i <= inputs; ++i) {\n weights[i] = 0.0;\n exWeights[i] = 0.0;\n changes[i] = 0.0;\n }\n }\n else {\n for (int i = 0; i <= inputs; ++i) {\n weights[i] = randomEngine.nextDouble() - 0.5;\n exWeights[i] = 0.0;\n changes[i] = 0.0;\n }\n }\n }", "public void dataChanged() {\n // get latest data\n runs = getLatestRuns();\n wickets = getLatestWickets();\n overs = getLatestOvers();\n\n currentScoreDisplay.update(runs, wickets, overs);\n averageScoreDisplay.update(runs, wickets, overs);\n }", "void updateView();", "void updateView();", "public void update() {\n super.update();\n window win = null;\n for(int i = windows.length-1 ; i >= 0 ; i -= 1 ) {\n win = (window) windows.getSorted(i);\n win.update();\n }\n }", "public static void updateViewSettings() {\n\t\tif(isSensorNetworkAvailable()) {\n\t\t\tinformationFrame.update(selectedSensor);\n\t\t\tviewPort.getGraphicsPainter().repaint();\n\t\t}\n\t}", "private void updateViews() {\n if (mStructure == null || mThermostat == null) {\n return;\n }\n\n display_temp = mThermostat.getTargetTemperatureC();\n Log.v(TAG,\"updateViews: display_temp=\"+display_temp);\n // updates all views\n updateAmbientTempTextView();\n updateMenuItems();\n updateThermostatViews();\n updateControlView();\n\n //update the seekbar progress\n double temp = display_temp;\n mTempSeekbar.setProgress(0);\n display_temp = temp;\n mTempSeekbar.setProgress((int)((display_temp-9)/(32-9)*100));\n }", "public void setWeight(double weight) {\n\t\tthis.weight = weight;\n\t}", "public void update()\n\t{\n\t\tsuper.update();\n\t}", "public void updateGraph(){\n int cont=contador;\n eliminar(0);\n construir(cont);\n }", "private void setBoneWeightForVertex(Integer BoneId, IVertex vertex, Double newWeight) {\n\t\tvalPairList = boneVertexMap.get(BoneId);\n\t\t// Iterate all vertices from this bone\n\t\tfor (ValuePair<IVertex, Double> valPair : valPairList) {\n\t\t\t// If this is the vertex to update\n\t\t\tif (vertex.equals(valPair.getValue1())) {\n\t\t\t\tvalPair.setValue2(newWeight); // Update it.\n\t\t\t\treturn; // Dont need to look further\n\t\t\t}\n\t\t}\n\t}", "abstract void setWeight(int i, int j, Double weight);", "public void addWeight(TextView weight){\n displayedWeights.add(weight);\n }", "protected void refreshVisuals() {\r\n\t\trefreshBendpoints();\r\n\t\tif (getEdge().getValue())\r\n\t\t\tgetEdgeFigure().setForegroundColor(alive);\r\n\t\telse\r\n\t\t\tgetEdgeFigure().setForegroundColor(dead);\r\n\t\t//throw new NullPointerException();\r\n\t}", "public void update()\n {\n tick++;\n if (this.part != null)\n {\n for (UpdatedLabel label : dataLabels)\n {\n label.update();\n }\n int c = 0;\n for (Entry<MechanicalNode, ForgeDirection> entry : part.node.getConnections().entrySet())\n {\n if (entry.getKey() != null)\n {\n this.connections[c].setText(\"Connection\" + c + \": \" + entry.getKey());\n c++;\n }\n }\n for (int i = c; i < connections.length; i++)\n {\n this.connections[i].setText(\"Connection\" + i + \": NONE\");\n }\n }\n }", "void calculateWeights(List<Neuron> connectedNeurons) {\n // neuron_k:weight = neuron_k:weight - this:LearningRate * neuron_k:error * this:output\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n try{\n double currentWeight = neuron.inputWeights.get(this.neuronName);\n double neuronError = neuron.error;\n double newWeight = currentWeight - LEARNING_RATE*neuronError*this.getOutput(); // !!! equation difference\n \n System.out.println(\"this neuronName: \" + this.neuronName + \" that neuron keys: \" + neuron.inputWeights);\n System.out.println(\"Old weight: \" + currentWeight + \" new weight: \" + newWeight);\n \n neuron.inputWeights.put(this.getName(), newWeight);\n }catch (Exception e) {\n System.out.println(this.neuronName + \" : \" + neuron.inputWeights);\n e.printStackTrace();\n System.exit(1);\n }\n }\n }", "public void update() {\n\n difT();\n difXY();\n solveFlow();\n //drawColorFlow();\n }", "public void updateModel() {\n\t\tIterator<Cell> itr = iterator();\n\t\twhile(itr.hasNext()) itr.next().update();\n\t\titr = iterator();\n\t\twhile(itr.hasNext()) {\n\t\t\t(itr.next()).nextGeneration();\n\t\t}\n\t\tupdateGraph();\n\t}", "public ButlerWeights getWeights() {\n\treturn currentWeights;\n }", "public void update(){\r\n\t\t\r\n\t}", "public void updateSamples();", "public void setWeight(String newValue);", "void updateVisualizationSize(\n\t\tint visualizationWidth,\n\t\tint visualizationHeight)\n\t{\n\t\tthis.visualizationWidth = visualizationWidth;\n\t\tthis.visualizationHeight = visualizationHeight;\n\t}", "public void updateBottomWeight(){\r\n\t \tif(this.bottomNode != null)\r\n\t \t{\r\n\t \t\tif( this.bottomNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.bottomWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.bottomNode.isRoad() == true && this.bottomNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.bottomWeight = this.bottomNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.bottomWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "public void correctWeights() {\n double tmp;\n\n for(int i = 0; i < inputs; ++i) {\n //temporary store old value\n tmp = weights[i];\n // correct weight's value using MOMENTUM parameter\n weights[i] += changes[i] + MOMENTUM * (weights[i] - exWeights[i]);\n //store old value in class member\n exWeights[i] = tmp;\n // clear corrections value\n changes[i] = 0.0;\n }\n\n // const input weight correction if const input is enabled\n if (enableConstAddend) {\n // temporary store old value\n tmp = weights[inputs];\n // change weight's value using MOMENTUM parameter\n weights[inputs] += changes[inputs] + MOMENTUM * (weights[inputs] - exWeights[inputs]);\n // store old value\n exWeights[inputs] = tmp;\n // clear value of calculated change\n changes[inputs] = 0.0;\n }\n }", "public void update(){\n\t\tsetChanged();\n\t\trender();\n\t\tprintTimer();\n\t}", "public void setWeight(int weight){\n\t\tthis.weight = weight;\n\t}", "@Override\n\tpublic void updatePanel() {\n\t\tstatTable.setStatTable(getModel().getRowCount(),\n\t\t\t\tgetModel().getRowNames(), getModel().getColumnCount(),\n\t\t\t\tgetModel().getColumnNames());\n\t\tgetModel().updatePanel();\n\t}", "public void recalculateStats(){\n weight = .25f * (shaftMat.getParameter(\"Density\") * length + headMat.getParameter(\"Density\") * .4f);\n sharpness = headMat.getParameter(\"Malleability\") + 1f / headMat.getParameter(\"Durability\"); //Malleable objects can be sharp, as can fragile objects\n// fragility = 1f / (shaftMat.getParameter(\"Durability\") * .5f + headMat.getParameter(\"Durability\") * .5f);\n durability = (shaftMat.getParameter(\"Durability\") * .5f + headMat.getParameter(\"Durability\") * .5f);\n trueness = shaftMat.getParameter(\"Regularity\") + headMat.getParameter(\"Regularity\");\n// length = 2f;\n }", "private void updateSignal() {\n getGlobals().informationSignal =\n getContext().getPrng().gaussian(0,getGlobals().volatilityInfo).sample();\n\n }", "@Override\n public void update() {\n updateHealth();\n updateActiveWeapon();\n updateAmmunition();\n updateWaveCounter();\n updateReloading();\n }", "public void adjustWeightsTest() {\n\t\tboolean[] tempCorrectArray = new boolean[numInstances()];\n\t\tfor (int i = 0; i < tempCorrectArray.length / 2; i++) {\n\t\t\ttempCorrectArray[i] = true;\n\t\t} // Of for i\n\n\t\tdouble tempWeightedError = 0.3;\n\n\t\tadjustWeights(tempCorrectArray, tempWeightedError);\n\n\t\tSystem.out.println(\"After adjusting\");\n\n\t\tSystem.out.println(toString());\n\t}", "public void updateStats(int n1, int n2, int n3, int n4){\n //update values\n this.n1 = n1;\n this.n2 = n2;\n this.n3 = n3;\n this.n4 = n4;\n //repaint graph\n repaint();\n }", "public void updateNetworkWeights(int particleIndex) {\n int x=0;\r\n double[] weights;\r\n // loops through all nodes in first hidden layer, setting weights (there is a weight associated with each input)\r\n for (int j=0; j<layers.get(0); j++) {\r\n weights = new double[numberOfInputs+1];\r\n for (int k=0; k<numberOfInputs+1; k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(0).get(j).setWeights(weights);\r\n }\r\n // loops through all nodes in each subesquent layer, setting weights (there is a weight associated with each node from the layer below\r\n for (int i=1; i<layers.size(); i++) {\r\n for (int j=0; j<layers.get(i); j++) {\r\n weights = new double[layers.get(i-1)+1];\r\n for (int k=0; k<layers.get(i-1); k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(i).get(j).setWeights(weights);\r\n }\r\n }\r\n \r\n }", "public void update() {\r\n\t\t\r\n\t}", "private void updateHubHelps(BoundedRangeModel subModel , JLabel component) {\n DecimalFormat df = new DecimalFormat(\"#00.00\");\n float prc_current = (float)subModel.getValue() / (float)( subModel.getMaximum() - subModel.getMinimum() ) * 100f;\n float prc_total = this.hub.getWeight( this.hub.indexOf( subModel ) ) / this.hub.getTotalWeight() * 100f;\n component.setText( df.format(prc_current) + \" % of \" + df.format(prc_total) + \" %\" );\n }", "public void setGradingWeight(double weight){\n \tgradingWeight = weight;\n }", "@Override\n protected void update()\n {\n final double DENSITY = this.getResources().getDisplayMetrics().scaledDensity;\n final ArrayList<BarChart.SeriesInfo> SERIES = new ArrayList<>();\n\n final Thread LOAD_GRAPH = new Thread() {\n @Override\n public void run() {\n final StatsActivity SELF = StatsActivity.this;\n int idForLegendX = R.string.label_week;\n\n SELF.getSelections();\n\n if( SELF.graphType == GraphType.Yearly ) {\n idForLegendX = R.string.label_year;\n }\n else\n if( SELF.graphType == GraphType.Monthly ) {\n idForLegendX = R.string.label_month;\n }\n\n final String LEGEND_X = SELF.getString( idForLegendX );\n\n SELF.runOnUiThread( () -> {\n switch( SELF.graphType ) {\n case Yearly:\n SELF.calculateDataForYearsStats( SELF.selectedYear, SERIES );\n break;\n case Monthly:\n SELF.calculateDataForMonthsStats( SELF.selectedYear, SERIES );\n break;\n case Weekly:\n SELF.calculateDataForWeeksStats(\n SELF.selectedYear, SELF.selectedMonth, SERIES );\n break;\n default:\n Log.e( LOG_TAG, \"unsupported graph type\" );\n }\n\n final BarChart CHART = new BarChart( DENSITY, SERIES );\n\n CHART.setLegendX( LEGEND_X );\n CHART.setLegendY( settings.getDistanceUnits().toString() );\n CHART.setShowLabels( true );\n SELF.chartView.setScaleType( ImageView.ScaleType.MATRIX );\n SELF.chartView.setImageDrawable( CHART );\n });\n }\n };\n\n LOAD_GRAPH.start();\n }", "public void setWeight (java.lang.Double weight) {\r\n\t\tthis.weight = weight;\r\n\t}", "public void update(){\n \tSystem.out.println(model.toString());\n\t\tnumberofsteps.setText(model.toString());\n\t\tint selectedColor = model.getCurrentSelectedColor();\n\t\t\n\t\t// Update dots\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\t// Assign captured dots to correct colour\n\t\t\t\tif (model.isCaptured(i, j))\n\t\t\t\t\tdots[i][j].setColor(selectedColor);\n\t\t\t}\n\t\t}\n\t\t\n }" ]
[ "0.785274", "0.779088", "0.69761485", "0.6649467", "0.65312773", "0.6490676", "0.6402955", "0.63858974", "0.6344314", "0.62641597", "0.62454945", "0.6233087", "0.6221729", "0.6191297", "0.615513", "0.6144271", "0.6118932", "0.60848004", "0.60787505", "0.60747623", "0.6037193", "0.6032497", "0.60004807", "0.5972299", "0.5970574", "0.5968451", "0.5966845", "0.5964835", "0.5957814", "0.59417117", "0.59248745", "0.5916636", "0.5908592", "0.589359", "0.588091", "0.5878709", "0.5877207", "0.5871746", "0.5866927", "0.5852185", "0.58434254", "0.582973", "0.58243454", "0.5823317", "0.5821508", "0.5816362", "0.58152586", "0.5806342", "0.5786232", "0.57802343", "0.57694405", "0.5766452", "0.5763935", "0.57605106", "0.57539266", "0.5752681", "0.57518446", "0.5749278", "0.57470644", "0.57428956", "0.5742605", "0.5742561", "0.57320106", "0.57320106", "0.5731282", "0.57227325", "0.5715276", "0.571386", "0.57118493", "0.5704763", "0.570425", "0.5699115", "0.5698939", "0.5688811", "0.567642", "0.5672766", "0.56726664", "0.56676793", "0.5654708", "0.564997", "0.56424767", "0.563795", "0.56358486", "0.5627874", "0.56256616", "0.56221676", "0.5617562", "0.5607174", "0.5605205", "0.5602516", "0.55974364", "0.5590669", "0.55859995", "0.5582853", "0.55779904", "0.5576037", "0.55708086", "0.55667776", "0.5565583", "0.55596113" ]
0.8614244
0
change to monitor visualization
private void showMonitorVisualization() { setVisualization(new MonitorVisualization(rootComposite, controller, checklist)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void visualChange();", "public void changeVisualization ( )\r\n\t{\r\n\t\thorizontal = !horizontal;\r\n\t\trepaint ( );\r\n\t}", "private void writeSecondLevelMonitors() {}", "public void addMonitors() {\n\t\t// get graphics environment\n\t\tGraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();\n\t\tGraphicsDevice[] graphicsDevices = graphicsEnvironment.getScreenDevices();\n\t\t// let user choose on which screen to show the capturer, only if more than one is connected\n\t\tif (graphicsDevices.length > 1) {\n\t\t\tbuttonPanel.removeAll();\n\t\t\tJLabel screenLabel = new JLabel(getResourceMap().getString(\"screenLabel.text\"));\n\t\t\tbuttonPanel.add(screenLabel, \"wrap, grow, span\");\n\t\t\t// create buttongroup for selecting monitor\n\t\t\tButtonGroup screenButtonGroup = new ButtonGroup();\n\t\t\tInteger defaultMonitorId = videoCapturerFactory.getMonitorIdForComponent(selectedVideoCapturerName);\n\t\t\t// get the default monitor id for this capturer\n\t\t\tfor (GraphicsDevice graphicsDevice : graphicsDevices) {\n\t\t\t\tString monitorIdString = graphicsDevice.getIDstring();\n\t\t\t\tDisplayMode displayMode = graphicsDevice.getDisplayMode();\n\t\t\t\t// final Rectangle position = graphicsDevice.getDefaultConfiguration().getBounds();\n\t\t\t\tString resolution = displayMode.getWidth() + \"x\" + displayMode.getHeight();\n\t\t\t\tJToggleButton button = new JToggleButton(\"<html><center>\" + monitorIdString + \"<br>\" + resolution + \"</center></html>\");\n\t\t\t\tmonitorIdString = monitorIdString.substring(monitorIdString.length() - 1);\n\t\t\t\tbutton.setActionCommand(monitorIdString);\n\t\t\t\tbutton.addActionListener(new ActionListener() {\n\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tAbstractButton source = (AbstractButton) e.getSource();\n\t\t\t\t\t\tString monitorId = source.getActionCommand();\n\t\t\t\t\t\t// TODO pass position here instead of monitor id..\n\t\t\t\t\t\tfirePropertyChange(SelfContained.MONITOR_ID, selectedMonitorId, selectedMonitorId = monitorId);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t\tbutton.setBackground(Color.WHITE);\n\t\t\t\t// set default screen selection\n\t\t\t\tint monitorId = Integer.parseInt(monitorIdString);\n\t\t\t\tif (defaultMonitorId != null && defaultMonitorId == monitorId) {\n\t\t\t\t\tbutton.setSelected(true);\n\t\t\t\t\tscreenButtonGroup.setSelected(button.getModel(), true);\n\t\t\t\t} else {\n\t\t\t\t\tscreenButtonGroup.setSelected(button.getModel(), false);\n\t\t\t\t}\n\t\t\t\tscreenButtonGroup.add(button);\n\t\t\t\tbuttonPanel.add(button, \"height 70!, width 70::, grow\");\n\t\t\t}\n\t\t\tscreenLabel.setVisible(true);\n\t\t\tbuttonPanel.setVisible(true);\n\t\t}\n\t}", "public void setGraph(){\r\n setDisplay(currentGraph);\r\n }", "private void visualize(guiStatistics statistics) {\r\n\t\tstatistics.pack();\r\n RefineryUtilities.centerFrameOnScreen(statistics);\r\n statistics.setVisible(true);\r\n\r\n\t}", "void setMonitors(int monitors);", "@Override\n public void onScreenUpdated(BufferedImage image) {\n RemoteMachineConfig.SCREEN = image;\n panel1.repaint();\n panel1.setSize(1020,600);\n }", "public void showMetrics() {\n }", "public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }", "public void sliceDisplayChanged() {\n hide();\n for (int idx = 0; idx<nChannels; idx++) {\n Displaysettings.applyDisplaysettings(ini_sources[idx], displaysettings[idx]);\n Displaysettings.applyDisplaysettings(getRegisteredSourcesAtStep(stepBack)[idx], displaysettings[idx]);\n }\n show();\n }", "private void drawGraph() {\n // you can show warning messages now\n imrGuiBean.showWarningMessages(true);\n addGraphPanel();\n setButtonsEnable(true);\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}", "private void setVisualization(Visualization visualization) {\n\t\tremoveVisualization();\n\t\tthis.visualization = visualization;\n\t\tupdateWeights();\n\t\tthis.rootComposite.layout();\n\t}", "@Override\n public void run() {\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }", "public void changeMonitor(long monitor){\n //PROBABLY WRONG --- NEEDS TESTING\n\n //Simply change monitor for fullscreen and borderless, move for windowed\n if(type == Type.FULLSCREEN){\n //Retrieve the monitor and video mode\n monitorID = monitor;\n GLFWVidMode mode = glfwGetVideoMode(monitorID);\n\n glfwSetWindowMonitor(\n handle,\n monitorID,\n 0,\n 0,\n size.x,\n size.y,\n mode.refreshRate()\n );\n }else if(type == Type.BORDERLESS){\n //Retrieve the monitor and video mode\n monitorID = monitor;\n GLFWVidMode mode = glfwGetVideoMode(monitorID);\n\n //Change dimensions to fit new video mode\n position.set(0f, 0f);\n size.set(mode.width(), mode.height());\n\n glfwSetWindowMonitor(\n handle,\n monitorID,\n 0,\n 0,\n mode.width(),\n mode.height(),\n mode.refreshRate()\n );\n }else{\n //Retrieve the top left corner of the monitor\n IntBuffer posX;\n IntBuffer posY;\n try(MemoryStack stack = MemoryStack.stackPush()){\n posX = stack.mallocInt(1);\n posY = stack.mallocInt(1);\n glfwGetMonitorPos(monitor, posX, posY);\n }\n\n //Centre the window on that monitor\n GLFWVidMode mode = glfwGetVideoMode(monitor);\n int newX = posX.get(0) + (mode.width() / 2) - (size.x / 2);\n int newY = posY.get(0) + (mode.height() / 2) - (size.y / 2);\n position.set(newX, newY);\n\n //Move the window and change the field\n glfwSetWindowPos(handle, newX, newY);\n }\n }", "public void updateDisplay() {\n imageCutLevels.updateDisplay();\n }", "void willDisplayUpdate(String change) throws RemoteException;", "public static void monitoring(){\n\t\tWebSelector.click(Xpath.monitoring);\n\t}", "void startStatisticsMonitor();", "private void monitor() {\n monitoringActor.tell(new Monitor(), ActorRef.noSender());\n }", "void msgViewableChanged() {\n resetViewport(start);\n }", "@Override\r\n\tpublic void refreshChart2() {\n\t\tString[] s = new String[categoryStrings.size()];\r\n\t\ts= categoryStrings.toArray(s);\r\n\t\tif(getChartType().equals(\"StepLineChart\")) {\r\n\t\t\tDateAxis xAxis = new DateAxis(\"time\");\r\n\t\t\tValueAxis yAxis = new SymbolAxis(\"status\", s);\r\n\t\t\tXYStepRenderer renderer = new XYStepRenderer();\r\n\t\t\tXYPlot plot = new XYPlot(chartDataset, xAxis, yAxis, renderer);\r\n\t\t\tsetChart(new JFreeChart(null, new Font(\"Tahoma\", 0, 18), plot, true));\r\n\t\t}\r\n\t\t((GridBagLayout)getMonitoringPanel().getLayout()).rowHeights[2] = getMinimumHeight();\r\n\t\tgetMonitoringPanel().setPreferredSize(new Dimension(getMinimumWhidth(), (int) Math.round(getMonitoringPanel().getPreferredSize().getHeight())));\r\n\t\tsetVisible(isVisible());\r\n\t\tgetMonitoringPanel().setVisible(isVisible());\r\n\t\tif (chartPanel != null) \r\n\t\t\tgetMonitoringPanel().remove(chartPanel);\r\n\t\tsetChartPanel(new ChartPanel(chart));\r\n\t\tgetMonitoringPanel().add(chartPanel, new GridBagConstraints(0, 2, 6, 1, 0.0, 0.0,\r\n\t\t\t\tGridBagConstraints.CENTER, GridBagConstraints.BOTH,\r\n\t\t\t\tnew Insets(0, 0, 5, 5), 0, 0));\r\n\t}", "@Override\n public void run() {\n display_.readHistogramControlsStateFromGUI();\n String channelName = (String) axesPositions.get(NDViewer.CHANNEL_AXIS);\n\n if (!channelName.equals(NDViewer.NO_CHANNEL) &&\n displaySettings_.containsChannel(NDViewer.NO_CHANNEL)) {\n // remove the dummy channel\n displaySettings_.removeChannel(NDViewer.NO_CHANNEL);\n }\n\n int bitDepth = display_.getDataSource().getImageBitDepth(axesPositions);\n //Add contrast controls and display settings\n if (!displaySettings_.containsChannel(channelName)) {\n displaySettings_.addChannel(channelName, bitDepth);\n }\n if (!displaySettings_.isCompositeMode()) {\n // set only this new channel active\n for (String cName : stringAxes_.get(NDViewer.CHANNEL_AXIS)) {\n displaySettings_.setActive(channelName, cName.equals(channelName));\n }\n }\n display_.getGUIManager().addContrastControlsIfNeeded(channelName);\n }", "private void setDisplay() {\n\t\tDisplayOpt.add(\"-sd\");\n\t\tDisplayOpt.add(\"/sd\");\n\t\tDisplayOpt.add(\"showdetails\");\n\n\t}", "Lab refresh();", "public void plot(){\n\t\tplot = true;\n\t}", "private void showDisplay() {\n this.display.displayScreen();\n }", "public static void changeScreens() {\r\n\t\tnone = true;\r\n\t\toption1 = false;\r\n\t\toption2 = false;\r\n\t\toption3 = false;\r\n\t\toption4 = false;\r\n\t\toption5 = false;\r\n\t\tbackToRegFromItem = false;\r\n\t\toverItem = false;\r\n\t\toverYes = false;\r\n\t\toverNo = false;\r\n\t\toverNext = false;\r\n\t\toverHealth = false;\r\n\t\toverAlly = false;\r\n\t\toverPummel = false;\r\n\t\toverLaser = false;\r\n\t\titemSelect = false;\r\n\t\tgoBackFromProg = false;\r\n\t\tgoBackFromAlly = false;\r\n\t\toverAnAlly = false;\r\n\t\tgoBackFromAttire = false;\r\n\t\toverAnOutfit = false;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {\n\t\t\r\n\t}", "public void figure() {\n this.isMap = false;\n System.out.println(\"Switch to figure mode\");\n }", "public interface TVisualization{\n\t/**\n\t * Visualize detected beats with lower pitch.\n\t */\n\tpublic void kick();\n\t/**\n\t * Visualize detected beats with high pitch.\n\t */\n\tpublic void hat();\n\t/**\n\t * Visualize detected beats with medium pitch.\n\t */\n\tpublic void snare();\n\t/**\n\t * Draws visualization to the main application.\n\t */\n\tpublic void draw();\n}", "private void actualizarVisor()\n {\n visor.setText(\"\" + calc.getValorEnVisor());\n }", "private void updateHistorgamView(IWorkbenchPart part) {\r\n\t\tif (part instanceof TrackerEditor) {\r\n\t\t\tTracker tracker=TrackerHistogramViewUtils.getTracker();\r\n\t\t\tview.setTracker(tracker);\r\n\t\t\tview.refresh(true);\r\n\t\t}\r\n\t}", "void this_windowActivated() {\n if (m_oOutputBehaviors.savingShortOutputData() == false) {\n m_jShortOutputLabel.setText(\"Not saving summary output\");\n }\n else {\n m_jShortOutputLabel.setText(\"Saving summary output\");\n }\n\n DetailedOutput oOutput = m_oOutputBehaviors.getDetailedOutput();\n if (oOutput.getNumberOfDetailedLiveTreeSettings() == 0 &&\n oOutput.getNumberOfDetailedDeadTreeSettings() == 0 &&\n oOutput.getNumberOfDetailedGridSettings() == 0) {\n m_jDetailedOutputLabel.setText(\"Not saving detailed output\");\n }\n else {\n m_jDetailedOutputLabel.setText(\"Saving detailed output\");\n }\n }", "private void updateGui() {\n final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();\n final TargetProcessThread thread = debugger == null ? null : debugger.getProcessManager().getActiveThread();\n\n final boolean connected = debugger != null && debugger.isConnected();\n final boolean suspended = connected && thread != null;\n\n m_hexView.setEnabled(connected && suspended && m_provider.getDataLength() != 0);\n\n if (connected) {\n m_hexView.setDefinitionStatus(DefinitionStatus.DEFINED);\n } else {\n // m_hexView.setDefinitionStatus(DefinitionStatus.UNDEFINED);\n\n m_provider.setMemorySize(0);\n m_hexView.setBaseAddress(0);\n m_hexView.uncolorizeAll();\n }\n }", "@Override\n public void componentOpened() {\n\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n\n /*\n Create and start JMEVisualization instance\n */\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }\n });\n }", "protected void zoomToPresent(){\n if(xpCursor1 >=0){\n ixDataCursor1 = ixDataShown[xpCursor1];\n }\n if(xpCursor2 >=0){\n ixDataCursor2 = ixDataShown[xpCursor2];\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n if(widgg.timeorg.timeSpread > 100) { widgg.timeorg.timeSpread /=2; }\n else { widgg.timeorg.timeSpread = 100; }\n bPaintAllCmd = true;\n widgg.redraw(100, 200);\n }", "public void vision()\n {\n NIVision.IMAQdxGrab(session, colorFrame, 1);\t\t\t\t\n RETRO_HUE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro hue min\", RETRO_HUE_RANGE.minValue);\n\t\tRETRO_HUE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro hue max\", RETRO_HUE_RANGE.maxValue);\n\t\tRETRO_SAT_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro sat min\", RETRO_SAT_RANGE.minValue);\n\t\tRETRO_SAT_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro sat max\", RETRO_SAT_RANGE.maxValue);\n\t\tRETRO_VAL_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro val min\", RETRO_VAL_RANGE.minValue);\n\t\tRETRO_VAL_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro val max\", RETRO_VAL_RANGE.maxValue);\n\t\tAREA_MINIMUM = SmartDashboard.getNumber(\"Area min %\");\n\t\t//MIN_RECT_WIDTH = SmartDashboard.getNumber(\"Min Rect Width\", MIN_RECT_WIDTH);\n\t\t//MAX_RECT_WIDTH = SmartDashboard.getNumber(\"Max Rect Width\", MAX_RECT_WIDTH);\n\t\t//MIN_RECT_HEIGHT = SmartDashboard.getNumber(\"Min Rect Height\", MIN_RECT_HEIGHT);\n\t\t//MAX_RECT_HEIGHT= SmartDashboard.getNumber(\"Max Rect Height\", MAX_RECT_HEIGHT);\n\t\t\n\t\t//SCALE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Scale Range Min\");\n\t\t//SCALE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Scale Range Max\");\n\t\t//MIN_MATCH_SCORE = (int)SmartDashboard.getNumber(\"Min Match Score\");\n //Look at the color frame for colors that fit the range. Colors that fit the range will be transposed as a 1 to the binary frame.\n\t\t\n\t\tNIVision.imaqColorThreshold(binaryFrame, colorFrame, 255, ColorMode.HSV, RETRO_HUE_RANGE, RETRO_SAT_RANGE, RETRO_VAL_RANGE);\n\t\t//Send the binary image to the cameraserver\n\t\tif(cameraView.getSelected() == BINARY)\n\t\t{\n\t\t\tCameraServer.getInstance().setImage(binaryFrame);\n\t\t}\n\n\t\tcriteria[0] = new NIVision.ParticleFilterCriteria2(NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA, AREA_MINIMUM, 100.0, 0, 0);\t\t\n\t\t\n NIVision.imaqParticleFilter4(binaryFrame, binaryFrame, criteria, filterOptions, null);\n\n // NIVision.RectangleDescriptor rectangleDescriptor = new NIVision.RectangleDescriptor(MIN_RECT_WIDTH, MAX_RECT_WIDTH, MIN_RECT_HEIGHT, MAX_RECT_HEIGHT);\n// \n// //I don't know\n// NIVision.CurveOptions curveOptions = new NIVision.CurveOptions(NIVision.ExtractionMode.NORMAL_IMAGE, 0, NIVision.EdgeFilterSize.NORMAL, 0, 1, 1, 100, 1,1);\n// NIVision.ShapeDetectionOptions shapeDetectionOptions = new NIVision.ShapeDetectionOptions(1, rectAngleRanges, SCALE_RANGE, MIN_MATCH_SCORE);\n// NIVision.ROI roi = NIVision.imaqCreateROI();\n//\n// NIVision.DetectRectanglesResult result = NIVision.imaqDetectRectangles(binaryFrame, rectangleDescriptor, curveOptions, shapeDetectionOptions, roi);\n// //Dummy rectangle to start\n// \n// NIVision.RectangleMatch bestMatch = new NIVision.RectangleMatch(new PointFloat[]{new PointFloat(0.0, 0.0)}, 0, 0, 0, 0);\n// \n// //Find the best matching rectangle\n// for(NIVision.RectangleMatch match : result.array)\n// {\n// \tif(match.score > bestMatch.score)\n// \t{\n// \t\tbestMatch = match;\n// \t}\n// }\n// SmartDashboard.putNumber(\"Rect height\", bestMatch.height);\n// SmartDashboard.putNumber(\"Rect Width\", bestMatch.width);\n// SmartDashboard.putNumber(\"Rect rotation\", bestMatch.rotation);\n// SmartDashboard.putNumber(\"Rect Score\", bestMatch.score);\n \n //Report how many particles there are\n\t\tint numParticles = NIVision.imaqCountParticles(binaryFrame, 1);\n\t\tSmartDashboard.putNumber(\"Masked particles\", numParticles);\n\t\t\n \n\t\tif(numParticles > 0)\n\t\t{\n\t\t\t//Measure particles and sort by particle size\n\t\t\tVector<ParticleReport> particles = new Vector<ParticleReport>();\n\t\t\tfor(int particleIndex = 0; particleIndex < numParticles; particleIndex++)\n\t\t\t{\n\t\t\t\tParticleReport par = new ParticleReport();\n\t\t\t\tpar.Area = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA);\n\t\t\t\tpar.AreaByImageArea = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA);\n\t\t\t\tpar.BoundingRectTop = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_TOP);\n\t\t\t\tpar.BoundingRectLeft = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT);\n\t\t\t\tpar.BoundingRectHeight = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_HEIGHT);\n\t\t\t\tpar.BoundingRectWidth = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH);\n\t\t\t\tparticles.add(par);\n\n\t\t\t}\n\t\t\tparticles.sort(null);\n\n\t\t\t//This example only scores the largest particle. Extending to score all particles and choosing the desired one is left as an exercise\n\t\t\t//for the reader. Note that this scores and reports information about a single particle (single L shaped target). To get accurate information \n\t\t\t//about the location of the tote (not just the distance) you will need to correlate two adjacent targets in order to find the true center of the tote.\n//\t\t\tscores.Aspect = AspectScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Aspect\", scores.Aspect);\n//\t\t\tscores.Area = AreaScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Area\", scores.Area);\n//\t\t\tboolean isTote = scores.Aspect > SCORE_MIN && scores.Area > SCORE_MIN;\n//\n\t\t\tParticleReport bestParticle = particles.elementAt(0);\n\t\t NIVision.Rect particleRect = new NIVision.Rect((int)bestParticle.BoundingRectTop, (int)bestParticle.BoundingRectLeft, (int)bestParticle.BoundingRectHeight, (int)bestParticle.BoundingRectWidth);\n\t\t \n\t\t //NIVision.imaqOverlayRect(colorFrame, particleRect, new NIVision.RGBValue(0, 0, 0, 255), DrawMode.PAINT_VALUE, \"a\");//;(colorFrame, colorFrame, particleRect, DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 20);\n\t\t NIVision.imaqDrawShapeOnImage(colorFrame, colorFrame, particleRect, NIVision.DrawMode.DRAW_VALUE, ShapeMode.SHAPE_RECT, 0.0f);\n\t\t SmartDashboard.putNumber(\"Rect Top\", bestParticle.BoundingRectTop);\n\t\t SmartDashboard.putNumber(\"Rect Left\", bestParticle.BoundingRectLeft);\n\t\t SmartDashboard.putNumber(\"Rect Width\", bestParticle.BoundingRectWidth);\n\t\t SmartDashboard.putNumber(\"Area by image area\", bestParticle.AreaByImageArea);\n\t\t SmartDashboard.putNumber(\"Area\", bestParticle.Area);\n\t\t double bestParticleMidpoint = bestParticle.BoundingRectLeft + bestParticle.BoundingRectWidth/2.0;\n\t\t double bestParticleMidpointAimingCoordnates = pixelCoordnateToAimingCoordnate(bestParticleMidpoint, CAMERA_RESOLUTION_X);\n\t\t angleToTarget = aimingCoordnateToAngle(bestParticleMidpointAimingCoordnates, VIEW_ANGLE);\n\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\tangleToTarget = 0.0;\n\t\t}\n\n if(cameraView.getSelected() == COLOR)\n {\n \tCameraServer.getInstance().setImage(colorFrame);\n }\n\t SmartDashboard.putNumber(\"Angle to target\", angleToTarget);\n\n }", "public void displayServoGrid(int color){\n\t\tfloat offX = (usingCanvas())?(canvasSize[0]/180f):(screenSize[0]/180f);\n\t\tfloat offY = (usingCanvas())?(canvasSize[1]/180f):(screenSize[1]/180f);\n\t\tint w = (usingCanvas())?canvasSize[0]:screenSize[0];\n\t\tint h = (usingCanvas())?canvasSize[1]:screenSize[1];\n\n\t\tparent.stroke(color);\n\t\tparent.strokeWeight(1);\n\n\t\t//considering servo X with 180 degrees TODO should load pointerDevice servorange[0]\n\t\tfor(int i = 1; i <= 180; i++){\n\t\t\tfloat x = (float) (i* offX);\n\t\t\tfloat y = i*offY;\n\t\t\tparent.line(x, 0, x, h);\n\t\t\tparent.line(0, y, w, y);\n\t\t\tif(i == 90){\n\t\t\t\tparent.line(x, 0, x, h);\n\t\t\t\tparent.line(0, y, w, y);\n\t\t\t}\n\t\t}\n\t}", "public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}", "private static void displayLog() {\n if (!consoleDisplayed) {\n splitter.setDividerLocation(defaultSliderPosition);\n consoleDisplayed=true;\n }\n }", "@Override\n public void changed(ChangeEvent event, Actor actor) {\n game.changeScreen(RPGMain.DEBUG);\n }", "@Override\n public void changed(ChangeEvent event, Actor actor) {\n game.changeScreen(RPGMain.DEBUG);\n }", "public SimpleMonitor(Container container, Device device) throws IOException\r\n {\r\n this.container = container;\r\n this.device = device;\r\n \r\n this.container.setLayout(new BoxLayout(this.container, BoxLayout.Y_AXIS));\r\n \r\n this.icon = new JLabel(Utils.getIcon(\"cross_48.png\"));\r\n Box b1 = Box.createHorizontalBox();\r\n b1.add(this.icon);\r\n \r\n this.time = new JLabel(\"?\");\r\n this.time.setForeground(red);\r\n Box b2 = Box.createHorizontalBox();\r\n b2.add(this.time);\r\n \r\n this.time.setFont(font);\r\n this.time.setText(\"?\");\r\n this.time.setForeground(red);\r\n try {\r\n this.icon.setIcon(Utils.getIcon(\"cross_48.png\"));\r\n } catch (IOException ex) {\r\n Logger.getLogger(SimpleMonitor.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n this.container.add(b1);\r\n this.container.add(b2);\r\n \r\n \r\n \r\n JLabel stHeader = new JLabel (\"Statistics\");\r\n stHeader.setFont(new Font(\"sans-serif\", Font.BOLD, 16));\r\n Box b3 = Box.createHorizontalBox();\r\n b3.add(stHeader);\r\n this.container.add(b3);\r\n \r\n JLabel gL = new JLabel(\"< 100 ms : \");\r\n gL.setForeground(green);\r\n this.goodLabel = new JLabel();\r\n this.goodLabel.setForeground(green);\r\n Box b4 = Box.createHorizontalBox();\r\n b4.add(gL);\r\n b4.add(this.goodLabel);\r\n this.container.add(b4);\r\n \r\n JLabel rL = new JLabel(\">= 100 ms : \");\r\n rL.setForeground(yellow);\r\n this.reachableLabel = new JLabel();\r\n this.reachableLabel.setForeground(yellow);\r\n Box b5 = Box.createHorizontalBox();\r\n b5.add(rL);\r\n b5.add(this.reachableLabel);\r\n this.container.add(b5);\r\n \r\n JLabel uL = new JLabel(\"Unreachable : \");\r\n uL.setForeground(red);\r\n this.unreachableLabel = new JLabel();\r\n this.unreachableLabel.setForeground(red);\r\n Box b6 = Box.createHorizontalBox();\r\n b6.add(uL);\r\n b6.add(this.unreachableLabel);\r\n this.container.add(b6);\r\n \r\n \r\n }", "private void reportUIChange() {\r\n\t\tif (messengerToUI != null) {\r\n\t\t\ttry {\r\n\t\t\t\tmessengerToUI.send(Message.obtain(null, DRIVER2UI_DEV_STATUS));\r\n\t\t\t} catch (RemoteException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void updateHistogram() {\n\n // Dont bother updating histogram if tab not even visible, save resources.\n if (!this.isVisible()) {\n return;\n }\n\n // Initialize imp variable.\n MimsPlus imp = null;\n\n // Get the title of the window currently selected in the combobox.\n // Then get the window associated with that title. \n String title = (String) jComboBox1.getSelectedItem();\n if (title != null) {\n imp = (MimsPlus) windows.get(title);\n }\n\n // Not sure why but sometimes images have NULL image processors.\n // Cant update histogram if it does not have one.\n if (imp == null) {\n return;\n }\n ImageProcessor ip = imp.getProcessor();\n if (ip == null) {\n return;\n }\n\n // Update the sliders.\n contrastAdjuster1.update(imp);\n\n // Get Pixel values.\n int i = 0;\n int width = imp.getWidth();\n int height = imp.getHeight();\n int nbins = 256;\n double[] pixels = new double[width * height];\n double pixelVal, maxVal = 0.0;\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n pixelVal = ip.getPixelValue(x, y);\n pixels[i] = pixelVal;\n if (maxVal < pixelVal) {\n maxVal = pixelVal;\n }\n i++;\n }\n }\n\n // return if no data avaialable\n if (pixels == null) {\n return;\n }\n if (pixels.length == 0) {\n return;\n }\n\n // Setup and plot histogram.\n HistogramDataset dataset = new HistogramDataset();\n dataset.addSeries(\"\", pixels, nbins);\n MimsXYPlot plot = (MimsXYPlot) chart.getPlot();\n plot.setDataset(dataset);\n\n // Show contrast window.\n updateContrastWindow();\n\n // Final plot adjustments. maxVal cannot be zero, or JFreeChart will generate this error:\n // IllegalArgumentException: A positive range length is required: Range[0.0,0.0]\n if (maxVal == 0) {\n maxVal = 0.00001;\n }\n plot.getDomainAxis().setRange(0, maxVal);\n plot.setDomainGridlinesVisible(false);\n chart.fireChartChanged();\n }", "private void updateGUIStatus() {\r\n\r\n }", "public ScreenMonitor(){\n this(Configuration.SCREEN_MONITOR_UPDATE_DELAY,\n\t \t\tConfiguration.SCREEN_MONITOR_LOGS_SIZE, \n\t \t\tConfiguration.SCREEN_MONITOR_LINE_SEPERATOR,\n\t \t\tConfiguration.SCREEN_MONITOR_DATA_MEMORY,\n\t \t\tConfiguration.SCREEN_MONITOR_DATA_POWER);\n }", "private void switchMonitor(CompoundButton monitor, boolean isChecked) {\n EditText text = (EditText) findViewById(R.id.statusBox);\n\n if (isChecked && !serviceStarted) {\n text.setText(\"\");\n writeDeviceInfo();\n updateShareIntent();\n startLoggerService();\n } else if (!isChecked && serviceStarted) {\n stopLoggerService();\n updateShareIntent();\n }\n }", "@Override\n\tprotected void UpdateUI() {\n\t\tDisplayFuelData(AverageFuelRate, LatestFuelConsumed);\n\t\t\n\t\tif(bCursurIndex == false && ParentActivity.ScreenIndex == Home.SCREEN_STATE_MENU_MONITORING_FUELHISTORY_GENERALRECORD)\n\t\t\tCursurDisplay(CursurIndex);\n\t}", "public void display() {\r\n\t\tsetVisible(true);\r\n\t}", "public Visualize() {\n initComponents();\n \n }", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "private void startMonitoring() {\n executors.startMetrics(monitoring);\n reporter = JmxReporter.forRegistry(monitoring).inDomain(getJmxDomain()).build();\n reporter.start();\n }", "public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}", "@Override\r\n\tpublic void run(final TaskMonitor taskMonitor) {\n\t\ttaskMonitor.setTitle(\"My Edge View Task\");\r\n\t\t\r\n\t\ttaskMonitor.setProgress(0.1);\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// Do something here with the view\r\n\t\t\t\r\n\t\t\tThread.sleep(4000);\r\n\t\t}\r\n\t\tcatch ( InterruptedException e){\r\n\t\t}\r\n\t\ttaskMonitor.setProgress(1.0);\r\n }", "public VerticalServerMetrics on() {\n serverIcon.getElement().getStyle().setOpacity(1);\n mainPanel.getElement().getStyle().setOpacity(1);\n toolTipDefaultText();\n isOff = false;\n return this;\n }", "@Override\n\tpublic void doPaint(Matrix m) {\n\t\tSystem.out.println(\"在windows操作系统中显示图像\");\n\t}", "private void showStacksVisualization() {\n\t\tsetVisualization(new StackVisualization(rootComposite, controller, checklist));\n\t}", "public void displayTwin(SVGElementModel model, boolean value) {\n \t\tif (model != modelGroup) {\n \t\t\tOMSVGStyle style = model.getTwin().getStyle().cast();\n \t\t\tif (style != null) {\n \t\t\t\tif (value) {\n \t\t\t\t\tstyle.setSVGProperty(SVGConstants.CSS_VISIBILITY_PROPERTY, SVGConstants.CSS_VISIBLE_VALUE);\n //\t\t\t\t\tstyle.setSVGProperty(SVGConstants.CSS_POINTER_EVENTS_PROPERTY, SVGConstants.CSS_NONE_VALUE);\n \t\t\t\t} else {\n \t\t\t\t\tstyle.clearSVGProperty(SVGConstants.CSS_VISIBILITY_PROPERTY);\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public void initMonitor()\n {\n monitor.stop();\n monitor = new Timeline(new KeyFrame(Duration.millis(100000 / speed), ae ->\n {\n if(lastScore >= score)\n {\n nng.updateFitnessOfCurrent(score);\n loadStart();\n }\n lastScore = score;\n }));\n monitor.setCycleCount(Animation.INDEFINITE);\n if(currentPlayer.equals(\"Trening\"))\n monitor.play();\n }", "public void updateConicalView();", "@Override\n\tprotected void UpdateUI() {\n\t\tFineModulationDisplay(FineModulation);\n\t\tAutoGreaseDisplay(AutoGrease);\n\t\tQuickcouplerDisplay(Quickcoupler);\n\t\tRideControlDisplay(RideControl);\n\t\tBeaconLampDisplay(BeaconLamp);\n\t\tMirrorHeatDisplay(MirrorHeat);\n//\t\tFNKeyDisplay(ParentActivity.LockEntertainment);\n\t}", "public EclipseToOrcProgressAdapter(final IProgressMonitor monitor) {\n prgrsMntr = SubMonitor.convert(monitor);\n }", "public DisplayThread(ClientMonitor m, GUI gui){\n\t\tmonitor = m;\n\t\tthis.gui = gui;\n\t}", "private void finalScreen() {\r\n\t\tdisplay.setLegend(GAME_OVER);\r\n\t\tdisplay.removeKeyListener(this);\r\n\t}", "public static void updateViewSettings() {\n\t\tif(isSensorNetworkAvailable()) {\n\t\t\tinformationFrame.update(selectedSensor);\n\t\t\tviewPort.getGraphicsPainter().repaint();\n\t\t}\n\t}", "public void display() {\n startPreview();\n }", "public synchronized void setupHistoWindows() {\r\n\t\tif (log.isLoggable(Level.INFO)) log.log(Level.INFO, String.format(\"started\")); //$NON-NLS-1$\r\n\t\tthis.histoSet = HistoSet.getInstance();\r\n\t\tthis.histoSet.initialize();\r\n\r\n\t\tif (this.histoGraphicsTabItem != null) this.resetGraphicsWindowHeaderAndMeasurement();\r\n\r\n\t\tthis.setHistoGraphicsTabItemVisible(this.settings.isHistoActive());\r\n\t\tthis.setHistoTableTabItemVisible(this.settings.isHistoActive());\r\n\t\tif (this.settings.isHistoActive()) {\r\n\t\t\tthis.updateHistoTabs(RebuildStep.A_HISTOSET, true);\r\n\t\t}\r\n\t}", "public void plotAction() {\n final PlotProperties props = new PlotProperties();\n addPlotRegister(props);\n\n final PlotManager pm = this.manager.getPlotManager();\n pm.showPlotUI(props);\n }", "private void graphStage(Efactfile emp, Group grp, Stage stage) {\n String windowID = \"FFWindow\" + Integer.toString(controller.size());\n Date min = controller.getDateFrom(0);\n Date max = controller.getDateTo(0);\n controller.addPair(windowID, min, max); \n int winID = controller.size()-1;\n String name;\n if (emp == null) {\n controller.assignGroup(grp, winID);\n name = grp.name;\n \n } else {\n controller.assignEmployee(emp, winID);\n name = emp.employee;\n }\n \n ScrollPane unused = new ScrollPane(); //Just to pass an empty parameter where null is not permitted. It should not be displayed.\n \n Scene scene = new Scene(graphScene(emp, grp, winID, stage, unused), 680, 690);\n scene.getStylesheets().add(css2); \n stage.setResizable(false);\n \n stage.setTitle(\"Line Chart Viewer: \" + name);\n stage.setScene(scene);\n stage.show();\n }", "public void init(MonitorControl control) {\n this.control = control;\n setTitle(\"JMarkets Admin Interface\");\n \n logMonitor = new LoggingMonitor();\n logMonitor.setPreferredSize(relativeSize(0.6f, 0.4f));\n \n topPanel = new JPanel();\n topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.X_AXIS));\n \n constructClientsPanel(10);\n constructButtonPanel();\n constructChartPanel();\n constructInfoPanel();\n constructTitlePanel();\n constructMetricsPanel();\n \n getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));\n \n getContentPane().add(titlePanel);\n getContentPane().add(infoPanel);\n \n topPanel.add(chartPanel);\n topPanel.setPreferredSize(relativeSize(0.85f, 0.42f));\n \n getContentPane().add(topPanel);\n \n JPanel bottomPanel = new JPanel();\n bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS));\n bottomPanel.add(logMonitor);\n \n JPanel bottomRightPanel = new JPanel();\n bottomRightPanel.setLayout(new BoxLayout(bottomRightPanel, BoxLayout.Y_AXIS));\n bottomRightPanel.add(metricsPanel);\n bottomRightPanel.add(buttonPanel);\n \n bottomPanel.add(bottomRightPanel);\n bottomPanel.setPreferredSize(relativeSize(0.85f, 0.4f));\n \n getContentPane().add(bottomPanel);\n \n pack();\n centerOnScreen();\n setVisible(true);\n }", "public void paintWheel() {\n \t\n //initialColor is the initially-selected color to be shown in the rectangle on the left of the arrow.\n //for example, 0xff000000 is black, 0xff0000ff is blue. Please be aware of the initial 0xff which is the alpha.\n AmbilWarnaDialog dialog = new AmbilWarnaDialog(c, currentColor, new OnAmbilWarnaListener() {\n \n // Executes, when user click Cancel button\n @Override\n public void onCancel(AmbilWarnaDialog dialog){\n }\n \n // Executes, when user click OK button\n @Override\n public void onOk(AmbilWarnaDialog dialog, int color) {\n \t\n \tcurrentColor=color;\n \t//convert RGB values to float(0-1) for OpenGL use\n \tfloat r=(float)Color.red(color)/255;\n \tfloat g=(float)Color.green(color)/255;\n \tfloat b=(float)Color.blue(color)/255;\n \t\n \tsetModelColor(r,g,b);\n }\n });\n dialog.show();\n }", "private void changeToPhotoIdleView(boolean bl) {\n this.changeLayoutTo(DefaultLayoutPattern.PREVIEW);\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.changeScreenButtonImage(BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY, false);\n if (bl) {\n this.mFocusRectangles.clearExceptTouchFocus();\n } else {\n this.mFocusRectangles.onUiComponentRemoved();\n }\n this.mFocusRectangles.onRecordingStop();\n if (this.mCameraDevice.getCameraId() == 0) {\n super.setSceneIndicatorVisibleAllNotificationIndicators(1);\n }\n this.getBaseLayout().showLeftIconContainer();\n this.setOrientation(this.getOrientation());\n }", "protected void refreshVisuals() {\r\n\t\trefreshBendpoints();\r\n\t\tif (getEdge().getValue())\r\n\t\t\tgetEdgeFigure().setForegroundColor(alive);\r\n\t\telse\r\n\t\t\tgetEdgeFigure().setForegroundColor(dead);\r\n\t\t//throw new NullPointerException();\r\n\t}", "public void redisplay();", "public MultiMonitorDialog(java.awt.Frame parent, boolean modal,java.awt.GraphicsDevice[] gds, int current)\n {\n super(parent, modal);\n \n javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();\n javax.swing.JList jList1 = new javax.swing.JList();\n javax.swing.JLabel jL = new javax.swing.JLabel(Localization.Texts[139]+\".\");\n javax.swing.JButton button = new javax.swing.JButton(\"OK\");\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n jScrollPane1.setViewportView(jList1);\n \n getContentPane().setLayout(new javax.swing.BoxLayout(this.getContentPane(),javax.swing.BoxLayout.Y_AXIS));\n this.add(jL);\n this.add(jScrollPane1);\n this.add(button);\n\n this.setTitle(Localization.Texts[139]);\n javax.swing.DefaultListModel<String> listModel = new javax.swing.DefaultListModel<>();\n StringBuilder sb=new StringBuilder (200);\n for (int i=0;i<gds.length;i++) // show description of all monitors\n {\n sb.setLength(0); // nothing yet\n java.awt.GraphicsDevice device = gds[i];\n java.awt.GraphicsConfiguration gd=device.getDefaultConfiguration();\n // sb.append(count).append(\" : \").append(device.getIDstring()).append (\" \");\n sb.append(i).append(\" : \");\n java.awt.Rectangle bounds = gd.getBounds();\n sb.append(bounds.width).append(\" X \").append(bounds.height).append(Localization.Texts[140]);\n sb.append(bounds.x).append(\" X \").append(bounds.y);\n listModel.addElement(sb.toString());\n } \n \n jList1.setModel(listModel);\n javax.swing.ListSelectionModel lsm = jList1.getSelectionModel();\n lsm.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n jList1.setSelectedIndex(current);\n jList1.addListSelectionListener(this);\n \n pack();\n final javax.swing.AbstractAction escapeAction = new javax.swing.AbstractAction() \n {\n @Override\n public void actionPerformed(java.awt.event.ActionEvent ae) \n {\n dispose(); // this is called when user hits ESC\n }\n };\n\n getRootPane().getInputMap(javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW)\n .put(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0), \"ESCAPE_KEY\");\n getRootPane().getActionMap().put(\"ESCAPE_KEY\", escapeAction);\n \n button.addActionListener (new java.awt.event.ActionListener()\n {\n @Override\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n dispose();\n }\n });\n }", "public void recallPaint() { advw.showResearchersPanel();}", "public synchronized void monitor(final MaestroMonitor monitor) {\n monitored.add(monitor);\n }", "@Override\r\n\t\t\tpublic void monitor()\r\n\t\t\t{\n\t\t\t\twhile(true)\r\n\t\t\t\t{\r\n\t\t\t\t\tRandom rm= new Random();\r\n\t\t\t\t\tint bp=rm.nextInt(200);\r\n\t\t\t\t\tSystem.out.println(bp);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(100);\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\tif(bp>140)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"High BP\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "boolean usesVisualizationStyles();", "public void outputVisualObjects ()\n\t{\n\t\toutput (\"\\n> (visual-objects)\\n\");\n\t\tif (model!=null) model.outputVisualObjects();\n\t}", "public void setOutputsAreSameVis(boolean v){\r\n OutputsAreSame.setVisible(v);\r\n }", "public void onDisplay() {\n\n\t}", "private void viewConfiguration(String table) {\n if (view != null) {\n frame.getContentPane().remove(view);\n }\n if (scrollPane != null) {\n frame.getContentPane().remove(scrollPane);\n }\n\n int imageWidth, imageHeight;\n\n // render image\n if (config.useBlankImage()) {\n imageWidth = config.getImageWidth();\n imageHeight = config.getImageHeight();\n canvas = new ZImageCanvas(imageWidth, imageHeight);\n }\n else {\n ImageIcon icon = new ImageIcon(config.getImageName(), config.getImageName());\n Image base = icon.getImage();\n imageHeight = base.getHeight(null);\n imageWidth = base.getWidth(null);\n canvas = new ZImageCanvas(base);\n }\n\n // render surrounding rectangle\n ZLayerGroup layer = canvas.getLayer();\n ZLine line = new ZLine(config.getMinimumPixelX(), config.getMinimumPixelY(), \n config.getMaximumPixelX(), config.getMinimumPixelY());\n ZVisualLeaf leaf = new ZVisualLeaf(line);\n layer.addChild(leaf);\n line = new ZLine(config.getMinimumPixelX(), config.getMinimumPixelY(), \n config.getMinimumPixelX(), config.getMaximumPixelY());\n leaf = new ZVisualLeaf(line);\n layer.addChild(leaf);\n line = new ZLine(config.getMaximumPixelX(), config.getMinimumPixelY(), \n config.getMaximumPixelX(), config.getMaximumPixelY());\n leaf = new ZVisualLeaf(line);\n layer.addChild(leaf);\n line = new ZLine(config.getMinimumPixelX(), config.getMaximumPixelY(), \n config.getMaximumPixelX(), config.getMaximumPixelY());\n leaf = new ZVisualLeaf(line);\n layer.addChild(leaf);\n\n // render the static motes\n for (Enumeration e=motes.elements(); e.hasMoreElements(); ) {\n leaf = new ZVisualLeaf((Mote)e.nextElement());\n layer.addChild(leaf);\n }\n\n JPanel main = new JPanel(new BorderLayout());\n\n // add scroll pane\n int x=0, y = 0;\n if (imageWidth > SCROLL_WIDTH) {\n x = SCROLL_WIDTH;\n }\n else {\n x = imageWidth;\n }\n\n if (imageHeight > SCROLL_HEIGHT) {\n y = SCROLL_HEIGHT;\n }\n else {\n y = imageHeight;\n }\n\n scrollPane = new ZScrollPane(canvas);\n\n scrollPane.setPreferredSize(new Dimension(x+20, y+20));\n frame.getContentPane().add(scrollPane, BorderLayout.CENTER);\n\n view = new JPanel(new GridLayout(0,3));\n view.add(new JLabel(\" X Position \"));\n view.add(new JLabel(\" Y Position \"));\n view.add(new JLabel(\" Mote ID \"));\n xpos = new JLabel (\" 0.0 \");\n ypos = new JLabel (\" 0.0 \");\n moteId = new JLabel(\" ID \");\n view.add(xpos);\n view.add(ypos);\n view.add(moteId);\n frame.getContentPane().add(view, BorderLayout.EAST);\n\n frame.pack();\n\n formatter = new DecimalFormat(\"###.##\");\n\n // create all the event handlers\n panEventHandler = new ZPanEventHandler(canvas.getCameraNode());\n zoomEventHandler = new ZoomEventHandler(canvas.getCameraNode());\n addEventHandler = new AddEventHandler(canvas, this, this, imageWidth, imageHeight, motes, frame);\n moveEventHandler = new MoveEventHandler(canvas, this, imageWidth, imageHeight, true);\n removeEventHandler = new RemoveEventHandler(canvas, canvas.getLayer(), motes, this);\n autoEventHandler = new AutoEventHandler(canvas, motes, imageWidth, imageHeight);\n \n // set the zoom and move event handlers to active\n zoomEventHandler.setActive(true);\n moveEventHandler.setActive(true);\n\n setMode(ADD_MODE);\n/*\n imageWithGrid = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);\n Graphics g = imageWithGrid.createGraphics();\n g.drawImage(base, 0, 0, null);\n g.setColor(Color.black);\n \n double xdist = Math.abs(config.getMaximumRealX() - config.getMinimumRealX());\n double pxdist = (double)Math.abs((config.getMaximumPixelX() - config.getMinimumPixelX()));\n double xRatio = pxdist/xdist;\n double minX = (double)Math.min(config.getMinimumPixelX(), config.getMaximumPixelX());\n double maxX = (double)Math.max(config.getMinimumPixelX(), config.getMaximumPixelX());\n for (double i=minX; i<=maxX; i+=(xRatio*GRID_DISTANCE)) {\n g.drawLine((int)i,config.getMinimumPixelY(),(int)i,config.getMaximumPixelY());\n }\n g.drawLine(config.getMaximumPixelX(), config.getMinimumPixelY(), config.getMaximumPixelX(), config.getMaximumPixelY());\n\n double ydist = Math.abs(config.getMaximumRealY() - config.getMinimumRealY());\n double pydist = (double)Math.abs((config.getMaximumPixelY() - config.getMinimumPixelY()));\n double yRatio = pydist/ydist;\n double minY = (double)Math.min(config.getMinimumPixelY(), config.getMaximumPixelY());\n double maxY = (double)Math.max(config.getMinimumPixelY(), config.getMaximumPixelY());\n for (double i=minY; i<=maxY; i+=(yRatio*GRID_DISTANCE)) {\n g.drawLine(config.getMinimumPixelX(),(int)i,config.getMaximumPixelX(),(int)i);\n }\n g.drawLine(config.getMinimumPixelX(), config.getMaximumPixelY(), config.getMaximumPixelX(), config.getMaximumPixelY());\n*/\n }", "@Override\n protected void refreshVisuals() {\n getFigure().updateLabels();\n }", "private void makeGUIVisible(){\n gameState = GameState.LOAD;\n notifyObservers();\n }", "public void displayGraph() {\r\n\t\tgraph.display();\r\n\t}", "@Override\n public void handle(ActionEvent t) \n {\n \tstage.setScene(PerformanceReportUI.create(stage));\n }", "public void statsAction() {\n StatsWin newWindow = getSelectedCell().mkStatsWin();\n WindowUtils.avoidParent(newWindow, parentFrame);\n watchers.add(newWindow);\n }", "private void setDisplay(Graph graph){\r\n\r\n if(currentGraph!=null) {\r\n resetHintButtons();\r\n int v=graph.getVertices();\r\n if(v<=10){\r\n Parameters.maxPushOf=30;\r\n }\r\n if(10<v&&v<=20){\r\n Parameters.maxPushOf=20;\r\n }\r\n if(20<v&&v<=30){\r\n Parameters.maxPushOf=10;\r\n }\r\n if(30<v&&v<=40){\r\n Parameters.maxPushOf=9;\r\n }\r\n if(v>40){\r\n Parameters.maxPushOf=8;\r\n }\r\n upper1Label.setText(\"\");\r\n upper2Label.setText(\"\");\r\n upper3Label.setText(\"\");\r\n\r\n if (timer != null) {\r\n timer.stop();\r\n }\r\n\t //for the second gamemode (fixed time):\r\n if (gamemode == 2) {\r\n double time = currentGraph.getVertices()*10;\r\n timing = (int) time;\r\n timer = new Timeline(new KeyFrame(Duration.seconds(1), event -> {\r\n timing--;\r\n upper3Label.setText(\"Time: \"+Double.toString(timing));\r\n }));\r\n\r\n timer.setCycleCount((int) time);\r\n timer.setOnFinished(event -> {\r\n timing = 0;\r\n timerUp();\r\n });\r\n timer.play();\r\n\r\n }\r\n clear();\r\n double myWidth = canvas.getWidth();\r\n double myHeight = canvas.getHeight();\r\n System.out.println(myWidth + \" \" + myHeight);\r\n ArrayList<Dot> list = graph.getList();\r\n Random random = new Random();\r\n for (int i = 0; i < list.size(); i++) {\r\n int x = random.nextInt((int) Math.round(myWidth / 4)) + (int) Math.round((myWidth / 2) - myWidth / 8);\r\n int y = random.nextInt((int) Math.round(myHeight / 4)) + (int) Math.round((myHeight / 2) - myHeight / 8);\r\n list.get(i).setPosition(new Position(x, y));\r\n list.get(i).setParent(this);\r\n if (gamemode == 3) {\r\n list.get(i).gameMode = 3;\r\n list.get(i).removeMain();\r\n }\r\n //list.get(i).setOnAction(graphHandeler);\r\n list.get(i).getStyleClass().add(\"graphButton\");\r\n pane.getChildren().add(list.get(i));\r\n }\r\n Timeline timeline = new Timeline(new KeyFrame(Duration.millis(1), ev -> {\r\n canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n ArrayList<Position> positionArrayList = new ArrayList();\r\n for (int i = 0; i < list.size(); i++) {\r\n Dot d = list.remove(i);\r\n positionArrayList.add(d.calculateVectors(list, d.giveList(), canvas.getWidth(), canvas.getHeight()));\r\n list.add(i, d);\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n list.get(i).setPosition(positionArrayList.get(i));\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n printDot(list.get(i), true);\r\n printDot(list.get(i), false);\r\n }\r\n }));\r\n timeline.setCycleCount(Parameters.trys);\r\n timeline.play();\r\n if (gamemode == 3) {\r\n list.get(0).getChildren().add(list.get(0).hBox);\r\n\t\thintButtonClick(hintButton5);\r\n \thintButtonClick(hintButton7);\r\n }\r\n }\r\n\r\n }", "@Override\r\npublic void setOnScreen(boolean os) {\n}", "@Override\n\tpublic void run() {\n\t\tDisplay.getCurrent().getActiveShell().setMinimized(true);\n\t}", "boolean isMonitoring();", "boolean isMonitoring();", "private void setupVisualizerFxAndUi() {\n mVisualizer = new Visualizer(0); // Using system audio session ID\n mVisualizer.setEnabled(false);\n mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1] );\n mVisualizer.setScalingMode(SCALING_MODE_AS_PLAYED);//SCALING_MODE_NORMALIZED);//\n mVisualizer.setDataCaptureListener(\n new Visualizer.OnDataCaptureListener() {\n public void onWaveFormDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n // mVisualizerView.updateVisualizer(bytes);\n }\n\n public void onFftDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n //mVisualizerView.updateVisualizer(bytes);\\\n if(debugModeOn) {\n debugViewModel.update(bytes);\n }\n // Do nothing for now\n }\n }, Visualizer.getMaxCaptureRate()-1 , false, true);\n }", "public void majGui(){\n gui.reset();\n ArrayList<Ball> ballsArray = balls.getBalls();\n for (Ball b: ballsArray){\n Vector location = b.getLocation();\n gui.addGraphicalElement(\n new Oval(\n (int) location.x, (int) location.y, Color.decode(\"#FF77b4\"), Color.decode(\"#00FF48\"), 50));\n }\n }", "public interface MonitorUI {\n\n void displayUI();\n}", "public void display2() { // for drag action -> color change\n stroke (255);\n fill(0,255,255);\n ellipse (location.x, location.y, diameter, diameter);\n }" ]
[ "0.6378907", "0.62740296", "0.6263344", "0.6242452", "0.60799783", "0.58546543", "0.5837874", "0.58086467", "0.58017135", "0.5792941", "0.57506967", "0.5733594", "0.573131", "0.57219386", "0.5715976", "0.5709536", "0.5684842", "0.56732506", "0.56613547", "0.56551296", "0.564855", "0.5644865", "0.563355", "0.56177473", "0.56173235", "0.55817795", "0.5534316", "0.5529267", "0.551619", "0.5514524", "0.55132514", "0.55092007", "0.55009425", "0.54984224", "0.54976976", "0.54962224", "0.54939264", "0.54774535", "0.5468396", "0.5462965", "0.5451761", "0.5439714", "0.5434886", "0.5434886", "0.54319316", "0.54318845", "0.54214495", "0.5419609", "0.54178", "0.54162", "0.54066694", "0.5405836", "0.54053414", "0.5402032", "0.539514", "0.53886175", "0.5388536", "0.5387148", "0.53859544", "0.5370179", "0.5370152", "0.535782", "0.53493166", "0.5347768", "0.5340475", "0.53277856", "0.5325818", "0.532529", "0.53231037", "0.5322672", "0.53150946", "0.5313518", "0.53083456", "0.53044254", "0.52950764", "0.52926975", "0.52879894", "0.52869725", "0.52867687", "0.52652526", "0.525756", "0.52557963", "0.52552354", "0.52548337", "0.5248241", "0.524386", "0.5241141", "0.5240459", "0.5239718", "0.5236716", "0.5236689", "0.52364284", "0.5227158", "0.5222823", "0.52205", "0.52205", "0.521977", "0.5218652", "0.5218316", "0.5215189" ]
0.7963552
0
change to stacks visualization
private void showStacksVisualization() { setVisualization(new StackVisualization(rootComposite, controller, checklist)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void MakeStacked() {\n\t\tStackedButton = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(\n\t\t\t\t GetStackedAreaChartImage())));\n\t\tStackedButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Stacked Area Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(StackedButton);\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}", "private void initStackPanes() {\n\t\tstackPanes=new ArrayList<StackPane>();\n\t\tstackPanes.add(c0);\n\t\tstackPanes.add(c1);\n\t\tstackPanes.add(c2);\n\t\tstackPanes.add(c3);\n\t\tstackPanes.add(c4);\n\t\tstackPanes.add(c5);\n\t\tstackPanes.add(c6);\n\t\tstackPanes.add(c7);\n\t\tstackPanes.add(c8);\n\t\tstackPanes.add(c9);\n\t\tstackPanes.add(c10);\n\t\tstackPanes.add(c11);\n\t\tstackPanes.add(c12);\n\t\tstackPanes.add(c13);\n\t\tstackPanes.add(c14);\n\t\tstackPanes.add(c15);\n\t\tstackPanes.add(c16);\n\t\tstackPanes.add(c17);\n\t\tstackPanes.add(c18);\n\t\tstackPanes.add(c19);\n\t\tstackPanes.add(c20);\n\t\tstackPanes.add(c21);\n\t\tstackPanes.add(c22);\n\t\tstackPanes.add(c23);\n\t\tstackPanes.add(c24);\n\t\tstackPanes.add(c25);\n\t\tstackPanes.add(c26);\n\t\tstackPanes.add(c27);\n\t\tstackPanes.add(c28);\n\t\tstackPanes.add(c29);\n\t\tstackPanes.add(c30);\n\t\tstackPanes.add(c31);\n\t\tstackPanes.add(c32);\n\t\tstackPanes.add(c33);\n\t\tstackPanes.add(c34);\n\t\tstackPanes.add(c35);\n\t\tstackPanes.add(c36);\n\t\tstackPanes.add(c37);\n\t\tstackPanes.add(c38);\n\t\tstackPanes.add(c39);\n\t\tstackPanes.add(c40);\n\t\tstackPanes.add(c41);\n\t\tstackPanes.add(c42);\n\t\tstackPanes.add(c43);\n\t\tstackPanes.add(c44);\n\t\tstackPanes.add(c45);\n\t\tstackPanes.add(c46);\n\t\tstackPanes.add(c47);\n\t}", "public void drawOverview()\n\t{\n\t\tstackRows = (int)Math.ceil(stacks.size()/9.f);\n\t\tfor(int y = 0; y < 6; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 9; x++)\n\t\t\t{\t\t\n\t\t\t\t\tint slotIndex = x+9*y;\n\t\t\t\t\tint stackIndex = x+9*(y+scrollOffset);\n\t\t\t\t\t//System.out.println(slotIndex);\n\t\t\t\t\tSlot slot = new Slot(inventory,slotIndex, x*24, y*18);\t\t\t\t\n\t\t\t\t\tthis.addSlotToContainer(slot);\n\t\t\t\t\t\n\t\t\t\t\tif(stackIndex < stacks.size())\n\t\t\t\t\t\tslot.putStack(stacks.get(stackIndex));\n\t\t\t\t\telse\n\t\t\t\t\t\tslot.putStack(null);\n\t\t\t}\n\t\t}\n\t\t/*int i =0;\n\t\tfor(ItemStack stack : stacks)\n\t\t{\n\t\t\tthis.inventorySlots.get(i).putStack(stack);\n\t\t\t\n\t\t\ti++;\n\t\t}*/\n\t\t//this.inventoryItemStacks = stacks;\n\t}", "public void displayStacks(ArrayList<ArrayList<PositionInBoard>> listOfStacks){\n\n for(int i = 0; i< listOfStacks.size(); i++){\n stackPanels[i].removeAll();\n ArrayList<PositionInBoard> aStack = listOfStacks.get(i);\n\n for (PositionInBoard position : aStack){\n stackPanels[i].add(new JLabel(\"\" + position));\n }\n }\n }", "public GMap<Integer, Stack> getStacks();", "public void setStacks(GMap<Integer, Stack> stacks);", "@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}", "LevelStacks() {\n stacks = new ArrayList<>();\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 void displayStack(){\n if(!empty()){\n System.out.println(\"\\n---Stack---\");\n \n int i= this.maxLength-1;\n ParsedToken[] ptCopy = new ParsedToken[this.maxLength];\n \n /* Display and copy depop values */\n while(!empty()){\n ptCopy[i] = pop();\n System.out.println(\"| \"+ptCopy[i]+\" |\");\n i--;\n }\n /* Recopy values into the original stack */\n while(i<this.maxLength-1){\n push(ptCopy[++i]);\n }\n }else{\n System.out.println(\"\\nEmpty Stack : Nothing to display\\n\");\n }\n }", "public void toStackMode() {\n\t\t// TODO Write me!\n\n\t}", "public void display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\n }\n }", "@SubL(source = \"cycl/stacks.lisp\", position = 1818) \n public static final SubLObject create_stack() {\n return clear_stack(make_stack(UNPROVIDED));\n }", "RenderStack getRenderStack();", "public void printStack(){\n\t\tswitch (type) {\n\t\tcase 's' : {\n\t\t\tSystem.out.print(\"[XX]\");\n\t\t}\n\t\tbreak;\n\t\tcase 'w' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\tcase 't' : {\n\t\t\tStack<Card> temp = new Stack<Card>();\n\t\t\tCard currentCard = null;\n\t\t\tString fullStack = \"\";\n\t\t\twhile(!this.isEmpty()){\n\t\t\t\ttemp.push(this.pop());\n\t\t\t}\n\t\t\twhile(!temp.isEmpty()){\n\t\t\t\tcurrentCard = temp.pop();\n\t\t\t\tfullStack += currentCard.isFaceUp() ? currentCard.toString() : \"[XX]\";\n\t\t\t\tthis.push(currentCard);\n\t\t\t}\n\t\t\tSystem.out.println(fullStack);\n\t\t}\n\t\tbreak;\n\t\tcase 'f' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\t}\n\t}", "@Override\n\t\t\tpublic void recalculateStack() {\n\t\t\t\tif ( game.getGameMode().allowTeamSelection() )\n\t\t\t\t{\n\t\t\t\t\tItemStack stack = new ItemStack(Material.DIODE);\n\t\t\t\t\tsetNameAndLore(stack, \"Allow team selection\", \"When enabled, players will be\", \"able to choose their own teams.\", \"When disabled, teams will be\", \"allocated randomly.\");\n\t\t\t\t\t\n\t\t\t\t\tif ( teamSelectionEnabled )\n\t\t\t\t\t\tstack = KillerMinecraft.instance.craftBukkit.setEnchantmentGlow(stack);\n\t\t\t\t\t\n\t\t\t\t\tsetStack(stack);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tsetStack(null);\n\t\t\t}", "void setStack(int[][][] add);", "public void setStack(String stack);", "public String getStack();", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Fixed Stack\");\r\n\t\t\r\n\t}", "public void fill()\n\t{\n\t\tColor[] colors = Color.values();\n\t\tFigure rf;\n\t\ton_stack.clear();\n\t\t\n\t\t// create regular rummikub figures\n\t\tfor (int n=1;n<14;n++)\n\t\t{\n\t\t\tfor(int c=0;c<4;c++)\n\t\t\t{\n\t\t\t\trf = new Figure();\n\t\t\t\trf.setColor(colors[c]);\n\t\t\t\ttry {\n\t\t\t\t\trf.setNumber(n);\n\t\t\t\t\trf.setInstance(1);\n\t\t\t\t} catch (GeneralException e) {\n\t\t\t\t}\n\t\t\t\trf.setPlacement(Placement.ON_STACK);\n\t\t\t\tthis.on_stack.add(rf);\n\t\t\t\t\n\t\t\t\trf = new Figure();\n\t\t\t\trf.setColor(colors[c]);\n\t\t\t\ttry {\n\t\t\t\t\trf.setNumber(n);\n\t\t\t\t\trf.setInstance(2);\n\t\t\t\t} catch (GeneralException e) {\n\t\t\t\t}\n\t\t\t\trf.setPlacement(Placement.ON_STACK);\n\t\t\t\tthis.on_stack.add(rf);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// create jokers\n\t\trf = new Figure();\n\t\ttry {\n\t\t\trf.setInstance(3);\n\t\t} catch (GeneralException e) {\n\t\t}\n\t\tthis.on_stack.add(rf);\n\t\trf = new Figure();\n\t\ttry {\n\t\t\trf.setInstance(4);\n\t\t} catch (GeneralException e) {\n\t\t}\n\t\tthis.on_stack.add(rf);\n\t\t\n\t}", "public StackAnalysesView() {\n\t\tsuper(\"Stack Analyses\");\n\t\tinternalBrowser = new InternalBrowser(new DefaultShell());\n\t}", "public static void main(String[] args) {\n\t\tintStack stack = new intStack();\n\t\t\n\t\t//pushing values into intStack\n\t\tfor(int i =0; i<5; i++){\n\t\t\tstack.push(i*3);\n\t\t}\n\t\t//reading back values\n\t\tstack.show();\n\t\tSystem.out.println();\n\t\t\n\t\t//popping values & showing stack after each iteration\n\t\tfor(int j =0; j<5; j++){\n\t\t\tstack.pop();\n\t\t\tstack.show();\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t\n// working with MotorcycleStack\n\t\t\n\t\tMotorcycleStack motoStack = new MotorcycleStack();\n\t\tMotorcycles moto1 = new Motorcycles(\"Suzuki\", \"dr650\", 650);\n\t\tMotorcycles moto2 = new Motorcycles(\"Kawasaki\", \"klr650\", 650);\n\t\tMotorcycles moto3 = new Motorcycles(\"Suzuki\", \"drz400\", 400);\n\t\t\n\t\tmotoStack.push(moto1);\n\t\tmotoStack.display();\n\t\tmotoStack.push(moto2);\n\t\tmotoStack.display();\n\t\tmotoStack.push(moto3);\n\t\tmotoStack.display();\n\t\t\n\t\tif(!motoStack.isEmpty()){\n\t\t\tSystem.out.println(motoStack.pop());\n\t\t\tSystem.out.println(motoStack.pop());\n\t\t}\n\n\n\t}", "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}", "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}", "public void resetStack() {\n\t\tmCurrentViewIndex = 0;\n\t\tremoveAllViewsInLayout();\n\t\trequestLayout();\n\t}", "void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}", "void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}", "void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}", "void dump_stacks(int count)\r\n{\r\nint i;\r\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\r\n for (i=0;i<count;i++)\r\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\r\n System.out.println(\"======================\");\r\n}", "public Figure drawFromStack()\n\t{\n\t\tif (this.on_stack.size() > 0)\n\t\t{\n\t\t Random r = new Random();\n\t\t Figure rf = this.on_stack.get(r.nextInt(this.on_stack.size()));\n\t\t this.on_stack.remove(rf);\n\t\t rf.setPlacement(Placement.ON_SHELF);\n\t\t return rf;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public void stack()\r\n\t{\r\n\t\tfor(Character c: stack)\r\n\t\t{\r\n\t\t\tSystem.out.println(c);\r\n\t\t}\r\n\t}", "public String GetStackedAreaChartImage() {\n\t\treturn m_StackedAreaChartImage;\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}", "void dump_stacks(int count)\n {\n int i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n }", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Dynamic Stack\");\r\n\t}", "void setStack(JainTcapStack stack);", "protected ItemStack createStackedBlock(int par1) {\n\t\treturn new ItemStack(this.blockID, 1, par1);\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 }", "public CustomStack() {\n this.myCustomStack = new Object[10]; //array starts with 10 spaces, all empty\n numElements = 0; //stack starts with zero elements\n\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 }", "public void setStack(int slot, Stack stack);", "Stack(int sizeYouWantYourDataStuctureToBe){\n stackArray = new int [sizeYouWantYourDataStuctureToBe];\n }", "private static void printStack(ArrayList<Box> listOfBoxes, int[] stackOrderArr, int[] max){\r\n int position = max[2];\r\n int i = 0;\r\n while(i != max[0]) {\r\n System.out.println(listOfBoxes.get(position));\r\n i += listOfBoxes.get(position).weight;\r\n position = stackOrderArr[position];\r\n }\r\n\r\n System.out.println(\"\\nHeaviest stack weight: \" + max[0]);\r\n System.out.println(\"Stack height: \" + max[1]);\r\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 }", "final boolean init_stacks()\n {\n stateptr = -1;\n val_init();\n return true;\n }", "@Override\r\n\tpublic ItemStack getDisplayStack(World world, int x, int y, int z, int meta, TileEntity te) \r\n\t{\r\n\t\treturn null;\r\n\t}", "public DefaultRenderStack(DefaultRenderStack prototype) {\n stack = new ArrayDeque<>(requireNonNull(prototype).stack);\n }", "void clear() {\n stacks.clear();\n }", "@Override\n\tpublic String toString() {\n\t\tString result = \"\";\n\t\t\n\t\tfor(int i = 0; i < top; i++) {\n\t\t\tresult = result + stack[i].toString() + \"\\n\";\t//shouldn't it start at max --> 0 since its a stack\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public Stacked(){\n count = 0;\n stackArray = (E[]) new Object[START_CAP];\n }", "public void printStack(){\n Stack<Integer> tempStack = new Stack<>();\n if (numStack.empty()==true){\n System.out.println(Integer.MIN_VALUE);\n }\n else{\n while (numStack.empty() == false){\n tempStack.push(numStack.peek());\n numStack.pop();\n }\n while (tempStack.empty() == false){\n int i = tempStack.peek();\n System.out.println(i);\n tempStack.pop();\n numStack.push(i);\n } \n }\n }", "public void assignStackOrdering(SurfaceControl.Transaction t) {\n int layer;\n int layer2;\n SurfaceControl surfaceControl;\n SurfaceControl surfaceControl2;\n int HOME_STACK_STATE = 0;\n int layer3 = 0;\n int layerForAnimationLayer = 0;\n int layerForBoostedAnimationLayer = 0;\n int layerForHomeAnimationLayer = 0;\n boolean isInHwFreeFormAnimation = false;\n int layerForHwFreeFormAnimationLayer = 0;\n int layerForHwFreeFormAnimationImeLayer = 0;\n int layerForBoostedHwFreeFormAnimationLayer = 0;\n int state = 0;\n while (state <= 2) {\n int i = 0;\n while (i < this.mChildren.size()) {\n TaskStack s = (TaskStack) this.mChildren.get(i);\n boolean notFreeform = s.isAlwaysOnTop() && HwFreeFormUtils.isFreeFormEnable() && !s.inFreeformWindowingMode() && !s.inHwFreeFormWindowingMode();\n if ((state != 0 || s.isActivityTypeHome()) && ((state != 1 || (!s.isActivityTypeHome() && !notFreeform && !s.inHwFreeFormMoveBackState())) && (state != 2 || s.isAlwaysOnTop() || s.inHwFreeFormMoveBackState()))) {\n int layer4 = layer3 + 1;\n s.assignLayer(t, layer3);\n if ((s.inSplitScreenWindowingMode() || s.inHwSplitScreenWindowingMode() || s.inHwMagicWindowingMode()) && s.isVisible() && (surfaceControl2 = this.mSplitScreenDividerAnchor) != null) {\n t.setLayer(surfaceControl2, layer4);\n layer4++;\n }\n if (s.isTaskAnimating() || s.isAppAnimating()) {\n if (state != 2) {\n int layer5 = layer4 + 1;\n layerForAnimationLayer = layer4;\n layerForHwFreeFormAnimationLayer = layerForAnimationLayer;\n if (!s.inHwMagicWindowingMode() || !s.isVisible() || (surfaceControl = this.mSplitScreenDividerAnchor) == null) {\n layer4 = layer5;\n } else {\n t.setLayer(surfaceControl, layer5);\n layer4 = layer5 + 1;\n }\n } else if (s.inHwFreeFormWindowingMode() && s.isAlwaysOnTop()) {\n int layer6 = layer4 + 1;\n layerForHwFreeFormAnimationLayer = layer4;\n layer4 = layer6 + 1;\n layerForHwFreeFormAnimationImeLayer = layer6;\n isInHwFreeFormAnimation = true;\n }\n }\n if (s.inHwFreeFormWindowingMode() && s.getTopChild() != null && ((Task) s.getTopChild()).isHwFreeFormScaleAnimating()) {\n layerForAnimationLayer = layer4;\n layerForHwFreeFormAnimationLayer = layerForAnimationLayer;\n layer4++;\n }\n layer2 = 2;\n if (state != 2) {\n layer = layer4 + 1;\n layerForBoostedAnimationLayer = layer4;\n layerForBoostedHwFreeFormAnimationLayer = layerForBoostedAnimationLayer;\n } else if (!s.inHwFreeFormWindowingMode() || !s.isAlwaysOnTop()) {\n layer = layer4;\n } else {\n layer = layer4 + 1;\n layerForBoostedHwFreeFormAnimationLayer = layer4;\n }\n } else {\n layer = layer3;\n layer2 = 2;\n }\n i++;\n layer3 = layer;\n HOME_STACK_STATE = HOME_STACK_STATE;\n }\n if (state == 0) {\n layerForHomeAnimationLayer = layer3;\n layer3++;\n }\n state++;\n HOME_STACK_STATE = HOME_STACK_STATE;\n }\n SurfaceControl surfaceControl3 = this.mAppAnimationLayer;\n if (surfaceControl3 != null) {\n t.setLayer(surfaceControl3, layerForAnimationLayer);\n }\n SurfaceControl surfaceControl4 = this.mBoostedAppAnimationLayer;\n if (surfaceControl4 != null) {\n t.setLayer(surfaceControl4, layerForBoostedAnimationLayer);\n }\n SurfaceControl surfaceControl5 = this.mAppHwFreeFormAnimationLayer;\n if (surfaceControl5 != null) {\n t.setLayer(surfaceControl5, layerForHwFreeFormAnimationLayer);\n updateImeLayer(isInHwFreeFormAnimation, t, layerForHwFreeFormAnimationImeLayer);\n }\n SurfaceControl surfaceControl6 = this.mBoostedHwFreeFormAnimationLayer;\n if (surfaceControl6 != null) {\n t.setLayer(surfaceControl6, layerForBoostedHwFreeFormAnimationLayer);\n }\n SurfaceControl surfaceControl7 = this.mHomeAppAnimationLayer;\n if (surfaceControl7 != null) {\n t.setLayer(surfaceControl7, layerForHomeAnimationLayer);\n }\n }", "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}", "static void showPush(Stack<String> stack, String str) {\n\t\tstack.push(str);\n\t\tSystem.out.println(\"push(\" + str + \")\");\n\t\tSystem.out.println(\"Stack: \" + stack);\n\t}", "public void popAllStacks(){\n // if top is lost then all elements are lost.\n top = null;\n }", "public static void main(String[] args) {\n\t\tGenericStack<String> myStringStack = new GenericStack<>();// Declearing a GenericStack object\n\t\t\n\t\t// Places string literals into the GenericStack object \n\t\tmyStringStack.push(\"Apple\");\n\t\tmyStringStack.push(\"Pie\");\n\t\tmyStringStack.push(\"Is\");\n\t\tmyStringStack.push(\"Good\");\n\t\tmyStringStack.push(\"By\");\n\t\tmyStringStack.push(\"Itself\");\n\t\tmyStringStack.push(\"But\");\n\t\tmyStringStack.push(\"Better\");\n\t\tmyStringStack.push(\"With\");\n\t\tmyStringStack.push(\"Icecream\");\n\t\t\n\t\tmyStringStack.toString();// Display the object \n\t\t\n\t\t// Remove string literals from the object \n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\t\n\t\tmyStringStack.toString();// Display the object\n\t\t\n\t\tGenericStack<Integer> myIntStack = new GenericStack<>();// Declearing another GenericStack object\n\t\t\n\t\tfor(int i = 0; i <= 10; i++) {\n\t\t\tmyIntStack.push(i); // Filling the Integer \"stack\"\n\t\t}\n\t\t\n\t\tmyIntStack.toString(); // Display the object \n\t\t\n\t\t// Removing Integer objects from the GenericStack object myIntStack\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\n\t\t\n\t\tmyIntStack.toString();// Display the object\n\t}", "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}", "MyStack(){\r\n\t\tsuper();\r\n\t}", "@Override\n public void push(E z){\n if(isFull()){\n expand();\n System.out.println(\"Stack expanded by \"+ expand+ \" cells\");\n }\n stackArray[count] = z;\n count++;\n }", "@Override\n public String toString() {\n \tString retString = \"Stack[\";\n \tfor(int i = 0; i < stack.size() - 1; i++) // append elements up to the second to last onto the return string\n \t\tretString += stack.get(i) + \", \";\n \tif(stack.size() > 0)\n \t\tretString += stack.get(stack.size() - 1); // append final element with out a comma after it\n \tretString += \"]\";\n \treturn retString;\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 }", "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}", "@JSProperty(\"reversedStacks\")\n boolean getReversedStacks();", "public void printStack(int stackNo){\n\t\tint begin = stackStarts[stackNo-1];\n\t\tfor (int i = begin; i < begin + stackTops[stackNo-1]; i++)\n\t\t\t\tSystem.out.print(stacks[i] + \" \");\n\t\tSystem.out.println();\n\t}", "private static Object[] formatShapedGrid(Object[] itemStacksRaw, int width, int height) {\n int rawIndex = 0;\n Object[] itemStacks = new Object[9];\n for(int y = 0; y < height; y++) {\n for(int x = 0; x < width; x++) {\n itemStacks[y * 3 + x] = itemStacksRaw[rawIndex++];\n if(rawIndex >= itemStacksRaw.length) break;\n }\n if(rawIndex >= itemStacksRaw.length) break;\n }\n return itemStacks;\n }", "public void display() {\n\t\ttree.resize(30,50);\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree,25,i);\n\t\t}\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree, 575, i);\n\t\t}\n\t}", "public void setHasStacking(boolean bool) {\n this.hasStacking = bool;\n }", "default ItemStack addStack(ItemStack stack) {\n for (IInventoryAdapter inv : this) {\n InventoryManipulator im = InventoryManipulator.get(inv);\n stack = im.addStack(stack);\n if (InvTools.isEmpty(stack))\n return InvTools.emptyStack();\n }\n return stack;\n }", "final boolean init_stacks()\r\n{\r\n stateptr = -1;\r\n val_init();\r\n return true;\r\n}", "public boolean isStackable() {\r\n\t\treturn stackable;\r\n\t}", "public MinStack() {\n st = new Stack<>();\n }", "public void print(){\n for(int i = 0; i < numElements; i++){\n System.out.print(myCustomStack[i] + \" \");\n }\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}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "@VisibleForTesting\n public WindowList<TaskStack> getStacks() {\n return this.mTaskStackContainers.mChildren;\n }", "LevelStacks(LevelStacks<E> other) {\n this.stacks = new ArrayList<>(other.stacks.size());\n for (int i = 0; i < other.stacks.size(); i++) {\n stacks.add(other.get(i));\n }\n }", "private void solveVStackedBar(StackedBarSymbol stackedBar) {\n if (getHost() == null || getHost().getProjection() == null) {\n return;\n }\n stackedBar.setHost(getHost());\n stackedBar.normalize();\n Projection w2d = getHost().getProjection();\n Point2D p2dUser = null;\n if (stackedBar.isAscent()) {\n p2dUser = new Point2D.Double(0, stackedBar.getBase()\n + stackedBar.getValue());\n }\n if (stackedBar.isDescent()) {\n p2dUser = new Point2D.Double(0, stackedBar.getBase()\n - stackedBar.getValue());\n }\n if (!stackedBar.isValueSet()) {\n throw new IllegalArgumentException(\n \"stacked bar symbol ascent or descent value should be supplied.\");\n }\n if (!stackedBar.isBaseSet()) {\n throw new IllegalArgumentException(\n \"stacked bar symbol base value should be supplied.\");\n }\n\n Point2D p2ddevice = w2d.userToPixel(p2dUser);\n\n Point2D p2dUserBase = new Point2D.Double(0, stackedBar.getBase());\n Point2D p2ddeviceBase = w2d.userToPixel(p2dUserBase);\n\n double x = getComponentXLocation(stackedBar);\n double y = p2ddevice.getY();\n if (stackedBar.isAscent()) {\n y = p2ddevice.getY();\n }\n if (stackedBar.isDescent()) {\n y = p2ddeviceBase.getY();\n }\n\n double width = stackedBar.getThickness();\n double height = Math.abs(p2ddeviceBase.getY() - p2ddevice.getY());\n\n if (stackedBar.getMorpheStyle() == MorpheStyle.Round) {\n double round = stackedBar.getRound();\n if (stackedBar.isAscent()) {\n GeneralPath barPath = new GeneralPath();\n barPath.moveTo(x, y + round);\n barPath.lineTo(x, y + height);\n barPath.lineTo(x + width, y + height);\n barPath.lineTo(x + width, y + round);\n barPath.quadTo(x + width, y, x + width - round, y);\n barPath.lineTo(x + round, y);\n barPath.quadTo(x, y, x, y + round);\n barPath.closePath();\n stackedBar.setBarShape(barPath);\n }\n else if (stackedBar.isDescent()) {\n GeneralPath barPath = new GeneralPath();\n barPath.moveTo(x, y);\n barPath.lineTo(x, y + height - round);\n barPath.quadTo(x, y + height, x + round, y + height);\n barPath.lineTo(x + width - round, y + height);\n barPath.quadTo(x + width, y + height, x + width, y + height\n - round);\n barPath.lineTo(x + width, y);\n barPath.closePath();\n stackedBar.setBarShape(barPath);\n }\n }\n else if (stackedBar.getMorpheStyle() == MorpheStyle.Rectangle) {\n\n Rectangle2D barRec = new Rectangle2D.Double(x, y, width, height);\n stackedBar.setBarShape(barRec);\n }\n\n List<Stack> stacks = stackedBar.getStacks();\n\n int count = 0;\n for (Stack stack : stacks) {\n\n // data from host stacked bar\n stack.setThickness(stackedBar.getThickness());\n stack.setBase(stackedBar.getStackBase(stack));\n stack.setNature(stackedBar.getNature());\n stack.setBarFill(stackedBar.getBarFill());\n\n if (stackedBar.isAscent()) {\n stack.setAscentValue(stack.getNormalizedValue());\n }\n else if (stackedBar.isDescent()) {\n stack.setDescentValue(stack.getNormalizedValue());\n }\n\n Point2D stackedp2dUser = null;\n if (stackedBar.isAscent()) {\n stackedp2dUser = new Point2D.Double(0,\n stackedBar.getStackBase(stack)\n + stack.getNormalizedValue());\n }\n else if (stackedBar.isDescent()) {\n stackedp2dUser = new Point2D.Double(0,\n stackedBar.getStackBase(stack)\n - stack.getNormalizedValue());\n }\n\n Point2D stackedp2ddevice = w2d.userToPixel(stackedp2dUser);\n\n Point2D stackedp2dUserBase = new Point2D.Double(0,\n stackedBar.getStackBase(stack));\n Point2D stackedp2ddeviceBase = w2d.userToPixel(stackedp2dUserBase);\n\n double stackedx = getComponentXLocation(stackedBar);\n double stackedy = stackedp2ddevice.getY();\n if (stackedBar.isAscent()) {\n stackedy = stackedp2ddevice.getY();\n }\n if (stackedBar.isDescent()) {\n stackedy = stackedp2ddeviceBase.getY();\n }\n double stackedwidth = stackedBar.getThickness();\n double stackedheight = Math.abs(stackedp2ddeviceBase.getY()\n - stackedp2ddevice.getY());\n\n if (stackedBar.getMorpheStyle() == MorpheStyle.Round) {\n if (count == stacks.size() - 1) {\n double round = stackedBar.getRound();\n GeneralPath barPath = new GeneralPath();\n if (stackedBar.isAscent()) {\n barPath.moveTo(stackedx, stackedy + round);\n barPath.lineTo(stackedx, stackedy + stackedheight);\n barPath.lineTo(stackedx + stackedwidth, stackedy\n + stackedheight);\n barPath.lineTo(stackedx + stackedwidth, stackedy\n + round);\n barPath.quadTo(stackedx + stackedwidth, stackedy,\n stackedx + stackedwidth - round, stackedy);\n barPath.lineTo(stackedx + round, stackedy);\n barPath.quadTo(stackedx, stackedy, stackedx, stackedy\n + round);\n barPath.closePath();\n }\n else if (stackedBar.isDescent()) {\n barPath.moveTo(stackedx, stackedy);\n barPath.lineTo(stackedx, stackedy + stackedheight\n - round);\n barPath.quadTo(stackedx, stackedy + stackedheight,\n stackedx + round, stackedy + stackedheight);\n barPath.lineTo(stackedx + stackedwidth - round,\n stackedy + stackedheight);\n barPath.quadTo(stackedx + stackedwidth, stackedy\n + stackedheight, stackedx + stackedwidth,\n stackedy + stackedheight - round);\n barPath.lineTo(stackedx + stackedwidth, stackedy);\n barPath.closePath();\n }\n stack.setBarShape(barPath);\n }\n else {\n Rectangle2D barRec = new Rectangle2D.Double(stackedx,\n stackedy, stackedwidth, stackedheight);\n stack.setBarShape(barRec);\n }\n }\n else if (stackedBar.getMorpheStyle() == MorpheStyle.Rectangle) {\n Rectangle2D barRec = new Rectangle2D.Double(stackedx, stackedy,\n stackedwidth, stackedheight);\n stack.setBarShape(barRec);\n }\n\n count++;\n }\n }", "static void showPop(Stack<String> stack) {\n\t\tSystem.out.println(\"pop -> \" + stack.pop());\n\t\tSystem.out.println(\"Stack: \" + stack);\n\t}", "public static void printStack(Stack<Integer> s) {\n\t\t// Creates a new stack\n\t\tStack<Integer> temp = new Stack<Integer>();\n\n\t\twhile (!s.isEmpty()) {\n\t\t\t// sets data to the num contained in the node that is being pop\n\t\t\tint data = s.pop();\n\n\t\t\t//Prints out the number\n\t\t\tSystem.out.println(data);\n\t\t\ttemp.push(data);\n\t\t}\n\n\t\t\t//resets s to its original list\n\t\twhile (!temp.isEmpty()) {\n\t\t\ts.push(temp.pop());\n\t\t}\n\n\t}", "public void setType(Material mat) {\n\t\tthis.stack.setType(mat);\n\t}", "public static final SubLObject setup_stacks_file() {\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_stack$.getGlobalValue(), Symbols.symbol_function($sym7$STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym8$STACK_STRUC_NUM, $sym9$_CSETF_STACK_STRUC_NUM);\n Structures.def_csetf($sym10$STACK_STRUC_ELEMENTS, $sym11$_CSETF_STACK_STRUC_ELEMENTS);\n Equality.identity($sym0$STACK);\n access_macros.register_macro_helper($sym24$DO_STACK_ELEMENTS_STACK_ELEMENTS, $sym25$DO_STACK_ELEMENTS);\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_locked_stack$.getGlobalValue(), Symbols.symbol_function($sym36$LOCKED_STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym37$LOCKED_STACK_STRUC_LOCK, $sym38$_CSETF_LOCKED_STACK_STRUC_LOCK);\n Structures.def_csetf($sym39$LOCKED_STACK_STRUC_STACK, $sym40$_CSETF_LOCKED_STACK_STRUC_STACK);\n Equality.identity($sym29$LOCKED_STACK);\n return NIL;\n }", "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}", "public void pop() {\n System.out.print(stack1.pop());\n }", "public void setStack(int id){\n\t\tStackID = id;\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 }", "@Override\r\n public void actionPerformed(ActionEvent e) {\n System.out.println(popped_points+ \"++++++++++++++++++++++\");\r\n int x1_r = popped_points.get(0);\r\n int y1_r = popped_points.get(1);\r\n int x2_r = popped_points.get(2);\r\n int y2_r = popped_points.get(3);\r\n\r\n switch (popped_shape){\r\n case \"rec\":\r\n g.setColor(popped_color);\r\n int[] start_points = start_point(x1_r, y1_r,x2_r,y2_r);\r\n g.drawRect(start_points[0], start_points[1], Math.abs(x2_r-x1_r), Math.abs(y2_r-y1_r));\r\n canvas.repaint();\r\n\r\n// System.out.println(rec_colors);\r\n// System.out.println(rec_points);\r\n// System.out.println(progress_stack);\r\n\r\n //store this shape in regular stack\r\n rec_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n rec_points.add(popped_points.get(i));\r\n }\r\n\r\n// System.out.println(rec_colors);\r\n System.out.println(rec_points+\"++++++++++++++++++++++++++++++++\");\r\n// System.out.println(progress_stack);\r\n\r\n break;\r\n case \"squ\":\r\n g.setColor(popped_color);\r\n start_points = start_point(x1_r, y1_r,x2_r,y2_r);\r\n g.drawRect(start_points[0], start_points[1], Math.abs(x2_r-x1_r), Math.abs(x2_r-x1_r));\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n squ_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n squ_points.add(popped_points.get(i));\r\n }\r\n\r\n break;\r\n\r\n case \"ell\":\r\n g.setColor(popped_color);\r\n start_points = start_point(x1_r, y1_r,x2_r,y2_r);\r\n g.drawOval(start_points[0], start_points[1], Math.abs(x2_r-x1_r), Math.abs(y2_r-y1_r));\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n ell_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n ell_points.add(popped_points.get(i));\r\n }\r\n break;\r\n\r\n case \"cir\":\r\n g.setColor(popped_color);\r\n start_points = start_point(x1_r, y1_r,x2_r,y2_r);\r\n g.drawOval(start_points[0], start_points[1], Math.abs(x2_r-x1_r), Math.abs(x2_r-x1_r));\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n cir_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n cir_points.add(popped_points.get(i));\r\n }\r\n\r\n break;\r\n\r\n case \"str\":\r\n g.setColor(popped_color);\r\n g.drawLine(x1_r, y1_r, x2_r, y2_r);\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n str_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n str_points.add(popped_points.get(i));\r\n }\r\n\r\n break;\r\n\r\n case \"handdraw\":\r\n g.setColor(popped_color);\r\n int line_num = popped_points.size()/2-1;\r\n for (int i = 0; i < line_num; i++) {\r\n int begin_index = i*2;\r\n g.drawLine(popped_points.get(begin_index),popped_points.get(begin_index+1),popped_points.get(begin_index+2),popped_points.get(begin_index+3));\r\n }\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n handdraw_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n handdraw_points.add(popped_points.get(i));\r\n }\r\n handdraw_points.add(-1);\r\n\r\n break;\r\n\r\n case \"poly\":\r\n g.setColor(popped_color);\r\n line_num = popped_points.size()/2-1;\r\n for (int i = 0; i < line_num; i++) {\r\n int begin_index = i*2;\r\n g.drawLine(popped_points.get(begin_index),popped_points.get(begin_index+1),popped_points.get(begin_index+2),popped_points.get(begin_index+3));\r\n }\r\n canvas.repaint();\r\n\r\n //store this shape in regular stack\r\n for (int i = 0; i < popped_points.size()/2; i++) {\r\n poly_colors.add(popped_color);\r\n progress_stack.add(popped_shape);\r\n }\r\n\r\n poly_points.add(-1);\r\n for (int i = 0; i < popped_points.size(); i++) {\r\n poly_points.add(popped_points.get(i));\r\n }\r\n break;\r\n\r\n }\r\n\r\n /*//repaint last shape in stack\r\n String last_shape = progress_stack.get(progress_stack.size()-1);\r\n if(last_shape.equals(\"rec\")){\r\n //rectangle repaint\r\n repaint_shapes(\"rec\", rec_colors, rec_points);\r\n }\r\n if(last_shape.equals(\"cir\")){\r\n //circle repaint\r\n repaint_shapes(\"cir\", cir_colors, cir_points);\r\n }\r\n if(last_shape.equals(\"squ\")){\r\n //square repaint\r\n repaint_shapes(\"squ\", squ_colors, squ_points);\r\n }\r\n if(last_shape.equals(\"ell\")){\r\n //ellipse repaint\r\n repaint_shapes(\"ell\", ell_colors, ell_points);\r\n }\r\n if(last_shape.equals(\"str\")){\r\n //straight line repaint\r\n repaint_shapes(\"str\", str_colors, str_points);\r\n }\r\n if(last_shape.equals(\"poly\")){\r\n //polygon repaint\r\n ArrayList<Integer> separate_index = get_separate_index(poly_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n\r\n //other shapes\r\n for (int j = 0; j < separate_index.size()-1; j++) {\r\n Color polygon_color = poly_colors.get(j);\r\n //each shape repaint\r\n int begin_index = separate_index.get(j);\r\n int end_index = separate_index.get(j+1);\r\n\r\n //get polygon points arraylist\r\n for (int k = (begin_index+1); k < end_index; k++) {\r\n points.add(poly_points.get(k));\r\n\r\n }\r\n System.out.println(points);\r\n\r\n //repaint one polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int k = 0; k < line_num; k++) {\r\n int begin_point = k*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(polygon_color);\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n }\r\n points.clear();\r\n }\r\n\r\n //the last polygon\r\n //get last shape points arraylist\r\n int index = separate_index.get(separate_index.size()-1);\r\n for (int j = index+1; j < poly_points.size(); j++) {\r\n points.add(poly_points.get(j));\r\n }\r\n System.out.println(points);\r\n //using points to repaint polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int j = 0; j < line_num; j++) {\r\n int begin_point = j*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(poly_colors.get(poly_colors.size()-1));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n }\r\n }\r\n\r\n if(last_shape.equals(\"handdraw\")){\r\n //freehand drawing repaint\r\n if(handdraw_colors.size()>0){\r\n //repaint all handdraw\r\n ArrayList<Integer> separate_index = get_separate_index(handdraw_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n for (int i = 0; i < handdraw_colors.size(); i++) {\r\n //each handdraw\r\n //take all points in one draw\r\n if(i == 0){\r\n //first draw\r\n int begin_index = 0;\r\n int end_index = separate_index.get(i);\r\n //get all points in first drawing\r\n for (int j = begin_index; j < end_index; j++) {\r\n points.add(handdraw_points.get(j));\r\n }\r\n //repaint first drawing\r\n System.out.println(points);\r\n\r\n int line_num = points.size()/2 - 1;\r\n for (int j = 0; j < line_num; j++) {\r\n //draw each short line\r\n begin_index = j*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n points.clear();\r\n\r\n }else{\r\n //draw other handdraws\r\n for (int j = 0; j < handdraw_colors.size()-1; j++) {\r\n //draw each drawing\r\n\r\n int begin_index = separate_index.get(j)+1;\r\n int end_index = separate_index.get(j+1);\r\n //get all points in one drawing\r\n for (int k = begin_index; k < end_index; k++) {\r\n points.add(handdraw_points.get(k));\r\n }\r\n System.out.println(points);\r\n\r\n //repaint drawing\r\n int line_num = points.size()/2 - 1;\r\n for (int k = 0; k < line_num; k++) {\r\n //each line\r\n begin_index = k*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n\r\n points.clear();\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }*/\r\n\r\n\r\n }", "public DraggableBehavior setStack(String stack)\n\t{\n\t\tthis.options.putLiteral(\"stack\", stack);\n\t\treturn this;\n\t}", "private void buildOutStack() {\n this.outputStack[0] = new java.util.ArrayList<String>();\n this.outputStack[1] = new java.util.ArrayList<String>();\n this.outputStack[2] = new java.util.ArrayList<String>();\n this.outputStack[3] = new java.util.ArrayList<String>();\n JTVProg.logPrint(this, 3, \"подготовка выпуска по каналам\");\n for (Integer currentRIndex = 1; currentRIndex < this.getSetSize() + 1; currentRIndex++) {\n chProcUnit currentProc = this.getUnit(currentRIndex);\n if (currentProc.chStored.length() > maxLength) {\n java.util.ArrayList<String> splittedStored = this.textSplit(currentProc.chStored);\n String chHeader = this.pickHead(currentProc.chStored);\n java.util.ListIterator<String> splitIter = splittedStored.listIterator();\n Integer currentSplitIndex = 1;\n while (splitIter.hasNext()) {\n String currentSplitText = splitIter.next();\n this.outputStack[0].add(\"БЛ-\" + currentSplitIndex + \":\" + chHeader);\n if (currentSplitIndex == 1) {\n this.outputStack[1].add(currentSplitText.replace(chHeader, \"БЛ-\" + currentSplitIndex + \":\" + chHeader).trim());\n } else {\n this.outputStack[1].add(\"БЛ-\" + currentSplitIndex + \":\" + chHeader + lineSeparator + lineSeparator + currentSplitText.trim());\n }\n ++currentSplitIndex;\n }\n }\n else {\n this.outputStack[0].add(currentProc.chName);\n this.outputStack[1].add(currentProc.chStored.trim());\n }\n }\n JTVProg.logPrint(this, 3, \"подготовка выпуска по дням\");\n for (Integer dayFileIndex = 0; dayFileIndex < outDays.length; dayFileIndex++) {\n java.io.File currDayFile = this.outDays[dayFileIndex];\n String dayContent = this.getFileContent(currDayFile).trim();\n if (dayContent.length() > maxLength) {\n java.util.ArrayList<String> splittedDay = this.textSplit(dayContent);\n String dayHeader = this.pickHead(dayContent);\n java.util.ListIterator<String> splitIter = splittedDay.listIterator();\n Integer currentSplitIndex = 1;\n while (splitIter.hasNext()) {\n String currentSplitText = splitIter.next();\n this.outputStack[2].add(\"БЛ-\" + currentSplitIndex + \":\" + dayHeader);\n if (currentSplitIndex == 1) {\n this.outputStack[3].add(currentSplitText.replace(dayHeader, \"БЛ-\" + currentSplitIndex + \":\" + dayHeader));\n } else {\n this.outputStack[3].add(\"БЛ-\" + currentSplitIndex + \":\" + dayHeader + lineSeparator + lineSeparator + currentSplitText);\n }\n ++currentSplitIndex;\n }\n }\n else {\n this.outputStack[2].add(this.pickHead(dayContent));\n this.outputStack[3].add(dayContent);\n }\n }\n }", "@JSProperty(\"reversedStacks\")\n void setReversedStacks(boolean value);", "public void onStackWindowingModeChanged(TaskStack stack) {\n removeStackReferenceIfNeeded(stack);\n addStackReferenceIfNeeded(stack);\n if (stack == this.mPinnedStack && getTopStack() != stack) {\n positionChildAt(Integer.MAX_VALUE, stack, false);\n }\n }", "@Override\n public Pane visualization() {\n //TODO: this will be replaced with the correct addition visualizer\n HBox layout = new HBox();\n layout.setSpacing(0);\n layout.setAlignment(Pos.TOP_LEFT);\n Visualizer vis = new AdditionVisualizer();\n layout.getChildren().addAll(left.visualization(), vis.drawString(this.getValue()), right.visualization());\n return layout;\n }", "public StackInterface Stack() { return mStack; }", "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\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}", "@Override\r\n\tpublic void pop() {\n\t\tSystem.out.println(\"Pop logic for Fixed Stack\");\r\n\t}", "public boolean canStack() {\n return this.hasStacking;\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}" ]
[ "0.69551194", "0.6201917", "0.61318785", "0.6096627", "0.6074161", "0.605448", "0.6021796", "0.5910873", "0.5909273", "0.58938795", "0.587705", "0.5870149", "0.58434176", "0.5820072", "0.5780173", "0.5738934", "0.57333046", "0.5717371", "0.57077384", "0.5694802", "0.5659151", "0.56290364", "0.56125885", "0.5583414", "0.55720925", "0.5494455", "0.5481719", "0.54761773", "0.54761773", "0.54761773", "0.5475863", "0.5474862", "0.54721475", "0.5468886", "0.54548585", "0.54527235", "0.54348385", "0.5430362", "0.5424141", "0.54142606", "0.54065824", "0.5390684", "0.5385286", "0.5351361", "0.53396386", "0.533897", "0.53269064", "0.5322338", "0.53197235", "0.53147435", "0.5311213", "0.5303126", "0.52845", "0.52819175", "0.5268125", "0.5264383", "0.5260062", "0.5260007", "0.5259487", "0.5241753", "0.52415675", "0.5234458", "0.52308303", "0.52296215", "0.5224922", "0.5211381", "0.5209197", "0.5204302", "0.51971835", "0.5190499", "0.51866287", "0.5176712", "0.51765394", "0.5169873", "0.5164488", "0.5164488", "0.5164488", "0.5161275", "0.5159775", "0.51491654", "0.5147476", "0.513446", "0.513", "0.51250786", "0.51236105", "0.5116594", "0.51151663", "0.51140666", "0.5097326", "0.50865966", "0.5086477", "0.508605", "0.5082696", "0.50775385", "0.5076599", "0.5075879", "0.50729084", "0.5064045", "0.5061679", "0.5061111" ]
0.80490047
0
set the current visualization and update the UI
private void setVisualization(Visualization visualization) { removeVisualization(); this.visualization = visualization; updateWeights(); this.rootComposite.layout(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setGraph(){\r\n setDisplay(currentGraph);\r\n }", "@Override\n public void run() {\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }", "public void setVisualization(Visualization viz) {\n\t\tm_viz = viz;\n\t}", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "public void changeVisualization ( )\r\n\t{\r\n\t\thorizontal = !horizontal;\r\n\t\trepaint ( );\r\n\t}", "@Override\n protected void refreshVisuals() {\n getFigure().updateLabels();\n }", "public void visualChange();", "public Visualize() {\n initComponents();\n \n }", "public void updateConicalView();", "private void showMonitorVisualization() {\n\t\tsetVisualization(new MonitorVisualization(rootComposite, controller, checklist));\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "public void update(){\n\t\tif (!VisualizerMain.selectedRun.equals(\"\")){\n\t\t\tupdateEpochNum();\n\t\t\tupdateParticles();\n\t\t\tthis.repaint();\n\t\t}\n\t\t\n\t}", "private void updateGraph() {\n if (centerBox.getChildren().size() > 0) {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().set(0, this.drawGraph());\n } else {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().add(this.drawGraph());\n }\n }", "public void UpdateView(){\n\t\tStageArray[CurrentStage].Update();\r\n\t\t//updateUI will activate the Draw function\r\n\t\tStageArray[CurrentStage].updateUI();\r\n\t\t//this completely refreshes totalGUI and removes and mouse listener it had\r\n\t\tif(CardMain.frame.getContentPane()!=StageArray[CurrentStage]){\r\n\t\t\tCardMain.frame.setContentPane(StageArray[CurrentStage]);\r\n\t\t}\r\n\t}", "private void update() {\n\t\tif (needsPreview) return; // gonna happen soon anyway\n\n\t\tTask<Image> task = new Task<Image>() {\n\t\t\t@Override\n\t\t\tprotected Image call() {\n\t\t\t\treturn plotter.get().getOutput();\n\t\t\t}\n\t\t};\n\t\ttask.setOnSucceeded(event -> showImg(task.getValue()));\n\n\t\tThread th = new Thread(task);\n\t\tth.setDaemon(true);\n\t\tth.start();\n\n\t}", "private void actualizarVisor()\n {\n visor.setText(\"\" + calc.getValorEnVisor());\n }", "public void updateGraphView(GraphModel graphModel) {\r\n this.graphModel = graphModel;\r\n remove(chartPanel);\r\n XYDataset dataSet = createDataSet();\r\n chart = createChart(dataSet);\r\n chartPanel = new ChartPanel(chart);\r\n add(chartPanel);\r\n setVisible(true);\r\n }", "@Override\n public void componentOpened() {\n\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n\n /*\n Create and start JMEVisualization instance\n */\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }\n });\n }", "public Visualizador() {\n initComponents();\n inicializar();\n }", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "public void updateUI(){}", "private void drawGraph() {\n // you can show warning messages now\n imrGuiBean.showWarningMessages(true);\n addGraphPanel();\n setButtonsEnable(true);\n }", "private void updateGui() {\n final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();\n final TargetProcessThread thread = debugger == null ? null : debugger.getProcessManager().getActiveThread();\n\n final boolean connected = debugger != null && debugger.isConnected();\n final boolean suspended = connected && thread != null;\n\n m_hexView.setEnabled(connected && suspended && m_provider.getDataLength() != 0);\n\n if (connected) {\n m_hexView.setDefinitionStatus(DefinitionStatus.DEFINED);\n } else {\n // m_hexView.setDefinitionStatus(DefinitionStatus.UNDEFINED);\n\n m_provider.setMemorySize(0);\n m_hexView.setBaseAddress(0);\n m_hexView.uncolorizeAll();\n }\n }", "public void setNewGraph() {\n\tresetHints();\r\n Random random = new Random();\r\n if (graphMode == 1) {\r\n if (selectedSize == 1) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.smallGraph) + 1, -1);\r\n }\r\n if (selectedSize == 2) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.middleGraph - myInformation.smallGraph) + myInformation.smallGraph + 1, -1);\r\n }\r\n if (selectedSize == 3) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.bigGraph - myInformation.middleGraph) + myInformation.middleGraph + 1, -1);\r\n }\r\n }\r\n if (graphMode == 2) {\r\n currentGraph = chromaticManager.calculate(myGraph);\r\n }\r\n if (graphMode == 3) {\r\n try {\r\n stackPane.getChildren().removeAll(textFieldHBox, backPane);\r\n myVertices = Integer.parseInt(textFieldVertices.getText());\r\n myEdges = Integer.parseInt(textFieldEdges.getText());\r\n currentGraph = chromaticManager.calculate(myVertices, myEdges);\r\n setDisplay(currentGraph);\r\n } catch (NumberFormatException e) {\r\n\r\n }\r\n }\r\n threadPoolExecutor.execute(() -> {\r\n NewForce newForce = new NewForce();\r\n currentGraph.setCNumer(newForce.doNewForce(currentGraph,currentGraph.getUpperBound(),currentGraph.getLowerBound()));\r\n });\r\n }", "private void setGUI()\r\n\t{\r\n\t\tbubblePB = setProgressBar(bubblePB);\r\n\t\tinsertionPB = setProgressBar(insertionPB);\r\n\t\tmergePB = setProgressBar(mergePB);\r\n\t\tquickPB = setProgressBar(quickPB);\r\n\t\tradixPB = setProgressBar(radixPB);\r\n\t\t\r\n\t\tsetLabels();\r\n\t\tsetPanel();\r\n\t\tsetLabels();\r\n\t\tsetFrame();\r\n\t}", "Lab refresh();", "void updateVisualizationSize(\n\t\tint visualizationWidth,\n\t\tint visualizationHeight)\n\t{\n\t\tthis.visualizationWidth = visualizationWidth;\n\t\tthis.visualizationHeight = visualizationHeight;\n\t}", "@Override\n public void updateView() {\n if (!model.isDrawStarted() && !previewCurve.isDisabled()) {\n previewCurve.setVisible(false);\n previewCurve.setDisable(true);\n }\n\n // determine whether the select widgets is displayed\n DrawModes mode = model.getDrawMode();\n switch (mode) {\n case SELECT:\n case DRAW:\n case POINT:\n BezierCurve selectedCurve = model.getSelectedCurve();\n if (selectedCurve != null) {\n displayWidgets = true;\n } else {\n displayWidgets = false;\n }\n break;\n case ERASE:\n displayWidgets = false;\n break;\n\n }\n // reset children\n this.getChildren().clear();\n this.getChildren().addAll(model.getCurves());\n if (mode == DrawModes.DRAW) {\n this.getChildren().add(previewCurve);\n if (previewCurve.isVisible()) {\n this.getChildren().addAll(previewCurve.getDisplayedWidgets());\n }\n }\n if (displayWidgets) {\n addPointsToChildren(model.getSelectedCurve(), Direction.BOTH);\n }\n updateSize();\n }", "public static void updateViewSettings() {\n\t\tif(isSensorNetworkAvailable()) {\n\t\t\tinformationFrame.update(selectedSensor);\n\t\t\tviewPort.getGraphicsPainter().repaint();\n\t\t}\n\t}", "protected void refreshVisuals() {\r\n\t\trefreshBendpoints();\r\n\t\tif (getEdge().getValue())\r\n\t\t\tgetEdgeFigure().setForegroundColor(alive);\r\n\t\telse\r\n\t\t\tgetEdgeFigure().setForegroundColor(dead);\r\n\t\t//throw new NullPointerException();\r\n\t}", "@Override\r\n public void updateUI() {\r\n }", "public void update()\n\t{\n\t\tGViewMapManager gViewMapManager = this.guiController.getCurrentStyleMapManager();\n\t\tLayout layout = gViewMapManager.getLayout();\n\n\t\tswitch (layout)\n\t\t{\n\t\t\tcase LINEAR:\n\t\t\t\tthis.linear.setSelected(true);\n\t\t\t\tbreak;\n\t\t\tcase CIRCULAR:\n\t\t\t\tthis.circular.setSelected(true);\n\t\t\t\tbreak;\n default:\n break;\n\t\t}\n\t}", "public void updateDisplay() {\n imageCutLevels.updateDisplay();\n }", "private void setUI () {\n currentIndex = INITIAL_INDEX;\n setImagemAtual(currentIndex);\n mFoto.setColorFilter(Color.BLUE, PorterDuff.Mode.LIGHTEN);\n\n mCarregandoBarra.setVisibility(View.GONE);\n mCarregandoImagem.setVisibility(View.GONE);\n }", "public void apply() {\n\n if( this.vgcomponent instanceof VisualVertex ) {\n String selectedShape = (String) this.shapeList.getSelectedItem();\n Rectangle2D bounds = this.vgcomponent.getGeneralPath().getBounds2D();\n\n if( selectedShape.equals( \"Rectangle\")) {\n Rectangle2D rect = new Rectangle2D.Double(\n bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight());\n this.vgcomponent.setGeneralPath( rect.getPathIterator( null ) );\n }\n else if( selectedShape.equals( \"RoundedRectangle\")) {\n RoundRectangle2D rect = new RoundRectangle2D.Double(\n bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight(),\n 10, 10 );\n this.vgcomponent.setGeneralPath( rect.getPathIterator( null ) );\n }\n else if( selectedShape.equals( \"Ellipse\")) {\n Ellipse2D ellipse = new Ellipse2D.Double(\n bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight());\n this.vgcomponent.setGeneralPath( ellipse.getPathIterator( null ) );\n }\n }\n\n this.vgcomponent.setFillcolor( this.fillColor.getColor() );\n this.vgcomponent.setOutlinecolor( this.outlineColorButton.getColor() );\n\n this.pathPanelList.setGeneralPath( this.vgcomponent.getGeneralPath() );\n this.pathPanelList.setOutlineColor( this.vgcomponent.getOutlinecolor() );\n }", "public Visualization getVisualization() {\r\n return this.vis;\r\n }", "public GraphController(GUI view){\r\n\t\tview.setGvWindowListener(new GvWindowListener(){\r\n\t\t\tpublic void buttonClicked(GraphingEvent ge){\r\n\t\t\t\tmodel = ge.getDJAI_GV();\r\n\t\t\t\tmodel.setDate(ge.getDJAI_GV().getDate());\r\n\t\t\t\tmodel.setValue(ge.getDJAI_GV().getValue());\r\n\t\t\t\tSystem.out.println(ge.getSource());\r\n\t\t\t\t\r\n\t\t\t\tData = new ArrayList<String>();\r\n\t\t\t\tData = DataSaver.dowArray_C;\r\n\t\t\t\t\r\n\t\t\t\tvalue = new double[Data.size()];\r\n\t\t\t\t\r\n\t\t\t\tfor(int i = 0; i < Data.size(); i++){\r\n\t\t\t\t\tvalue[i] = Double.parseDouble(Data.get(i).substring(10));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tParent root;\r\n\t\t\t\tStage stage = new Stage();\r\n\t\t\t\tstage.setTitle(\"Graph Data\");\r\n\t\t\t\t\r\n\t\t\t\tfinal CategoryAxis xAxis = new CategoryAxis();\r\n\t\t\t final NumberAxis yAxis = new NumberAxis();\r\n\t\t\t xAxis.setLabel(\"Number of Month\");\r\n\t\t\t final LineChart<String, Number> lineChart = new LineChart<String, Number>(\r\n\t\t\t xAxis, yAxis);\t\t \r\n\t\t\t xAxis.setLabel(\"Date\");\r\n\t\t\t xAxis.setTickMarkVisible(false);\r\n\t\t\t \r\n\t\t\t yAxis.setLabel(\"DJAI Value\");\r\n\t\t\t yAxis.setAutoRanging(false);\r\n\t\t\t yAxis.setTickMarkVisible(false);\r\n\t\t\t yAxis.setUpperBound(20000);\r\n\t\t\t yAxis.setLowerBound(6000);\r\n\t\t\t yAxis.setTickUnit(2000);\r\n\t\t\t yAxis.setMinorTickCount(14);\r\n\t\t\t XYChart.Series<String, Number> series = new XYChart.Series<String, Number>();\r\n\t\t\t series.setName(\"DJAI Chart \");\r\n\t\t\t\r\n\t\t\t for(int i = 0; i < Data.size(); i++){\r\n\t\t\t \tseries.getData().add(new XYChart.Data<String, Number>(Data.get(i).substring(0, 10),\r\n\t\t\t \t\t\t\t\t\t \t\t\t\t\t\t\t\t value[i]));\r\n\t\t\t }\r\n\t\t\t lineChart.setCreateSymbols(false);\r\n\t\t\t lineChart.getData().add(series);\r\n\t\t\t\tlineChart.isResizable();\r\n\t\t\t Scene scene = new Scene(lineChart,14000,600);\r\n\t\t\t stage.setScene(scene);\r\n\t\t\t\tstage.show();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void initView() {\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerGraz.refresh(true);\r\n\t\tviewerKapfenberg.refresh(true);\r\n\t\tviewerLeoben.refresh(true);\r\n\t\tviewerMariazell.refresh(true);\r\n\t\tviewerWien.refresh(true);\r\n\t}", "@Override\n public void run() {\n display_.readHistogramControlsStateFromGUI();\n String channelName = (String) axesPositions.get(NDViewer.CHANNEL_AXIS);\n\n if (!channelName.equals(NDViewer.NO_CHANNEL) &&\n displaySettings_.containsChannel(NDViewer.NO_CHANNEL)) {\n // remove the dummy channel\n displaySettings_.removeChannel(NDViewer.NO_CHANNEL);\n }\n\n int bitDepth = display_.getDataSource().getImageBitDepth(axesPositions);\n //Add contrast controls and display settings\n if (!displaySettings_.containsChannel(channelName)) {\n displaySettings_.addChannel(channelName, bitDepth);\n }\n if (!displaySettings_.isCompositeMode()) {\n // set only this new channel active\n for (String cName : stringAxes_.get(NDViewer.CHANNEL_AXIS)) {\n displaySettings_.setActive(channelName, cName.equals(channelName));\n }\n }\n display_.getGUIManager().addContrastControlsIfNeeded(channelName);\n }", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "public void setGUI(GUIView imView) {\n\t\tthis.viewer = imView;\n\t}", "public void drawGraph(){\n this.post(new Runnable(){\n @Override\n public void run(){\n removeAllSeries();\n addSeries(xySeries);\n addSeries(currentPoint);\n //addSeries(currentPoint);\n }\n });\n }", "public void onSelected(IFramework framework) {\r\n this.framework = framework;\r\n setData(framework.getData());\r\n setAntiAliasing(framework.getDisplayMenu().isAntiAliasing());\r\n Object userObject = framework.getUserObject();\r\n if (userObject!=null){\r\n\t if (userObject instanceof CentroidUserObject) {\r\n\t setClusterIndex(((CentroidUserObject)userObject).getClusterIndex());\r\n\t setMode(((CentroidUserObject)userObject).getMode());\r\n\t } else {\r\n\t //\tsetClusterIndex(((Integer)userObject).intValue());\r\n\t setMode(((Integer)userObject).intValue());\r\n\t }\r\n }\r\n updateValues(getCluster());\r\n this.maxValue = framework.getDisplayMenu().getMaxRatioScale();\r\n this.minValue = framework.getDisplayMenu().getMinRatioScale();\r\n this.midValue = framework.getDisplayMenu().getMidRatioValue();\r\n CentroidViewer.posColorImage = framework.getDisplayMenu().getPositiveGradientImage();\r\n CentroidViewer.negColorImage = framework.getDisplayMenu().getNegativeGradientImage();\r\n useDoubleGradient = framework.getDisplayMenu().getUseDoubleGradient();\r\n this.setGradient(framework.getDisplayMenu().getColorGradientState());\r\n // repaint put in in case onSelected called by refreshCurrentViewer() method\r\n repaint();\r\n }", "private void setupVisualizerFxAndUi() {\n mVisualizer = new Visualizer(0); // Using system audio session ID\n mVisualizer.setEnabled(false);\n mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1] );\n mVisualizer.setScalingMode(SCALING_MODE_AS_PLAYED);//SCALING_MODE_NORMALIZED);//\n mVisualizer.setDataCaptureListener(\n new Visualizer.OnDataCaptureListener() {\n public void onWaveFormDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n // mVisualizerView.updateVisualizer(bytes);\n }\n\n public void onFftDataCapture(\n Visualizer visualizer,\n byte[] bytes,\n int samplingRate) {\n //mVisualizerView.updateVisualizer(bytes);\\\n if(debugModeOn) {\n debugViewModel.update(bytes);\n }\n // Do nothing for now\n }\n }, Visualizer.getMaxCaptureRate()-1 , false, true);\n }", "private void runForMode() {\n\t\tFXMLLoader loader = new FXMLLoader(Chart.class.getResource(\"Chart.fxml\"));\n try {\n \t\n \tVitalModel myPrivateModel=null;\n \tmyPrivateModel=new VitalModelImpl(dlm, numeric);\n \tVitalSign bothBP=VitalSign.BothBP;\n \tVital vitalForChart=bothBP.addToModel(myPrivateModel);\n \t\n \t\n \tParent node = loader.load();\n Chart chart = loader.getController();\n// Vital[] vitalForChart=new Vital[1];\n// VitalSign bothBP=VitalSign.BothBP;\n// boolean[] found=new boolean[1];\n// //Run through the Vitals in the VitalModel,\n// //and check if the one we want is already in the model.\n// vitalModel.forEach( v-> {\n// \tif(v.getLabel().equals(bothBP.label)) {\n// \t\tfound[0]=true;\n// \t\tvitalForChart[0]=v;\n// \t}\n// });\n// if( ! found[0] ) {\n// \tvitalForChart[0]=bothBP.addToModel(vitalModel);\n// }\n// for(String s : vitalForChart[0].getMetricIds()) {\n// \tSystem.err.println(\"metricid for vitalForChart is \"+s);\n// }\n \n \n long now = System.currentTimeMillis();\n now -= now % 1000;\n dateAxis=new DateAxis(new Date(now - interval), new Date(now));\n// dateAxis.setLowerBound();\n// dateAxis.setUpperBound();\n dateAxis.setAutoRanging(false);\n dateAxis.setAnimated(false);\n \n timeline = new Timeline(new KeyFrame(new Duration(1000.0), this));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n \n \n //chart.setModel(vitalForChart[0], dateAxis);\n chart.setModel(vitalForChart, dateAxis);\n bpGraphBox.getChildren().add(node);\n } catch (Exception e) {\n \te.printStackTrace();\n }\n\t\t//bpGraphBox.getChildren().add();\n Device pump=pumps.getSelectionModel().getSelectedItem();\n NumericFx[] flowRateFromSelectedPump=new NumericFx[1];\n numeric.forEach( n -> {\n \tif( n.getUnique_device_identifier().equals(pump.getUDI()) && n.getMetric_id().equals(FLOW_RATE)) {\n \t\t//This is the flow rate from the pump we want\n \t\tSystem.err.println(\"Found numeric for matching pump\");\n \t\tflowRateFromSelectedPump[0]=n;\n \t}\n });\n \n Device monitor=bpsources.getSelectionModel().getSelectedItem();\n sampleFromSelectedMonitor=new SampleArrayFx[1];\n samples.forEach( s -> {\n \tif(s.getUnique_device_identifier().equals(monitor.getUDI()) && s.getMetric_id().equals(ARTERIAL)) {\n \t\tsampleFromSelectedMonitor[0]=s;\n \t}\n });\n \n lastPumpUpdate.textProperty().bind(Bindings.format(\"Last pump update %s\", flowRateFromSelectedPump[0].presentation_timeProperty()));\n lastBPUpdate.textProperty().bind(Bindings.format(\"Last BP update %s\", sampleFromSelectedMonitor[0].presentation_timeProperty()));\n\t\tif(openRadio.isSelected()) {\n\t\t\t\n\t\t} else {\n\t\t\tclosedLoopAlgo();\n\t\t}\n\t\tAppConfig appConfig=new AppConfig();\n\t\tappConfig.mode=openRadio.isSelected() ? 0 : 1;\n\t\tappConfig.target_sys=(int)targetSystolic.getValue();\n\t\tappConfig.target_dia=(int)targetDiastolic.getValue();\n\t\tappConfig.sys_alarm=(int)systolicAlarm.getValue();\n\t\tappConfig.dia_alarm=(int)diastolicAlarm.getValue();\n\t\tappConfig.bp_udi=monitor.getUDI();\n\t\tappConfig.pump_udi=pump.getUDI();\n\t\tdouble rate=(double)infusionRate.getValue();\n\t\tappConfig.inf_rate=(float)rate;\n\t\tappConfig.writeToDb();\n\t\tstartBPUpdateAlarmThread();\n\t\tstartBPValueMonitor();\n\t}", "private void setGeometry() {\n this.setCullHint(Spatial.CullHint.Dynamic);\n this.setLocalTranslation(realPosition);\n //attach geometry to this object\n // mat.setColor(\"Color\", colors[r.nextInt(colors.length)]);\n if (!companyTextures.containsKey(this.company)) {\n mat.setTexture(\"ColorMap\", Colors.get(r.nextInt(Colors.size())));\n } else {\n mat.setTexture(\"ColorMap\", companyTextures.get(this.company));\n }\n geom.setMaterial(mat);\n this.attachChild(geom.clone());\n }", "private void updateUI() {\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n updateText();\n updateChart();\n }", "void updateControls();", "void updateView();", "void updateView();", "public void refresh() {\n if (currentClient != null) {\n Page page = currentClient.getCurrentPage();\n if (page != null) {\n root.setCenter(page.getRoot());\n } else {\n root.setCenter(null);\n }\n }else{\n if (page != null) {\n root.setCenter(page.getRoot());\n } else {\n root.setCenter(null);\n }\n }\n root.setPrefWidth(1280);\n root.setPrefHeight(720);\n root.setTop(clientBar.getRoot());\n root.setRight(null); // remove any errors\n //this.mainStage.setScene(scene);\n mainStage.show();\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "public void refresh() {\n\t\tthis.viewer.refresh();\n\t}", "public void setCurrentView(@NonNull SliceChildView currentView) {\n removeView(mCurrentView);\n mCurrentView = currentView;\n mCurrentView.setPolicy(mViewPolicy);\n addView(mCurrentView, getChildLp(mCurrentView));\n applyConfigurations();\n }", "private void visualize(guiStatistics statistics) {\r\n\t\tstatistics.pack();\r\n RefineryUtilities.centerFrameOnScreen(statistics);\r\n statistics.setVisible(true);\r\n\r\n\t}", "public void update() {\r\n setVisible(false);\r\n daySelector.paintCalendarPane(currentDate);\r\n if (showMonthSelector) {\r\n String yearString = \" \" + currentDate.get(java.util.Calendar.YEAR);\r\n monthSelector.setMonthName(getMonthSelectorStyle().getMonthName(\r\n currentDate.get(java.util.Calendar.MONTH)) + yearString);\r\n }\r\n setVisible(true);\r\n }", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "private void setDisplay(Graph graph){\r\n\r\n if(currentGraph!=null) {\r\n resetHintButtons();\r\n int v=graph.getVertices();\r\n if(v<=10){\r\n Parameters.maxPushOf=30;\r\n }\r\n if(10<v&&v<=20){\r\n Parameters.maxPushOf=20;\r\n }\r\n if(20<v&&v<=30){\r\n Parameters.maxPushOf=10;\r\n }\r\n if(30<v&&v<=40){\r\n Parameters.maxPushOf=9;\r\n }\r\n if(v>40){\r\n Parameters.maxPushOf=8;\r\n }\r\n upper1Label.setText(\"\");\r\n upper2Label.setText(\"\");\r\n upper3Label.setText(\"\");\r\n\r\n if (timer != null) {\r\n timer.stop();\r\n }\r\n\t //for the second gamemode (fixed time):\r\n if (gamemode == 2) {\r\n double time = currentGraph.getVertices()*10;\r\n timing = (int) time;\r\n timer = new Timeline(new KeyFrame(Duration.seconds(1), event -> {\r\n timing--;\r\n upper3Label.setText(\"Time: \"+Double.toString(timing));\r\n }));\r\n\r\n timer.setCycleCount((int) time);\r\n timer.setOnFinished(event -> {\r\n timing = 0;\r\n timerUp();\r\n });\r\n timer.play();\r\n\r\n }\r\n clear();\r\n double myWidth = canvas.getWidth();\r\n double myHeight = canvas.getHeight();\r\n System.out.println(myWidth + \" \" + myHeight);\r\n ArrayList<Dot> list = graph.getList();\r\n Random random = new Random();\r\n for (int i = 0; i < list.size(); i++) {\r\n int x = random.nextInt((int) Math.round(myWidth / 4)) + (int) Math.round((myWidth / 2) - myWidth / 8);\r\n int y = random.nextInt((int) Math.round(myHeight / 4)) + (int) Math.round((myHeight / 2) - myHeight / 8);\r\n list.get(i).setPosition(new Position(x, y));\r\n list.get(i).setParent(this);\r\n if (gamemode == 3) {\r\n list.get(i).gameMode = 3;\r\n list.get(i).removeMain();\r\n }\r\n //list.get(i).setOnAction(graphHandeler);\r\n list.get(i).getStyleClass().add(\"graphButton\");\r\n pane.getChildren().add(list.get(i));\r\n }\r\n Timeline timeline = new Timeline(new KeyFrame(Duration.millis(1), ev -> {\r\n canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n ArrayList<Position> positionArrayList = new ArrayList();\r\n for (int i = 0; i < list.size(); i++) {\r\n Dot d = list.remove(i);\r\n positionArrayList.add(d.calculateVectors(list, d.giveList(), canvas.getWidth(), canvas.getHeight()));\r\n list.add(i, d);\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n list.get(i).setPosition(positionArrayList.get(i));\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n printDot(list.get(i), true);\r\n printDot(list.get(i), false);\r\n }\r\n }));\r\n timeline.setCycleCount(Parameters.trys);\r\n timeline.play();\r\n if (gamemode == 3) {\r\n list.get(0).getChildren().add(list.get(0).hBox);\r\n\t\thintButtonClick(hintButton5);\r\n \thintButtonClick(hintButton7);\r\n }\r\n }\r\n\r\n }", "@FXML\n private void updateGUI(){\n\n spriteImage.setImage(new Image(Main.gang.getCarSpriteURL()));\n\n // updating labels\n distanceLabel.setText(\"Travelled: \"+ Main.gang.getDistance() +\"Mi\");\n conditionsLabel.setText(\"Health Cond: \"+ Main.gang.getHealthConditions());\n daysLabel.setText(\"Days: \"+ Main.gang.getDays());\n\n if (Main.gang.isMoving()) {\n setOutBtn.setText(\"Speedup\");\n statusLabel.setText(\"Status: Moving\");\n } else {\n setOutBtn.setText(\"Set out\");\n statusLabel.setText(\"Status: Resting\");\n }\n }", "@Override\n public void run() {\n signalPanel.clearChartAndResetDataLists();\n signalPanel.getChart().initSeriesLists(seriesCount); // inicjacja list\n signalPanel.getChart().setAutoRangeAxisY(true);\n zoomMode1.setSelected(true);\n }", "public void fullRenderRefresh() {\n gameChanged = true;\n visionChanged = true;\n backgroundChanged = true;\n selectionChanged = true;\n movementChanged = true;\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "public Onview() {\r\n initComponents();\r\n loadDisplayScreen();\r\n jcbX_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbX_Axis.setEnabled(false);\r\n jcbY_Axis.setModel(new DefaultComboBoxModel(new String[]{}));\r\n jcbY_Axis.setEnabled(false);\r\n setResizable(false);\r\n }", "public static void update(){\n\t\t\n\t\tgraphFrame.setColor(color);\n\t}", "public void apply() {\n this.vgcomponent.setFont( this.fontchooser.getSelectedFont() );\n this.vgcomponent.setFontcolor( this.fontcolor.getColor() );\n\n if( this.vgcomponent instanceof VisualEdge ) {\n VisualEdge vEdge = (VisualEdge) this.vgcomponent;\n vEdge.getEdge().setFollowVertexLabel( this.followLabel.isSelected() );\n if( !this.followLabel.isSelected() ) {\n vEdge.getEdge().setLabel( this.textarea.getText() );\n }\n }\n else {\n this.vgcomponent.setLabel( this.textarea.getText() );\n }\n }", "@Override\n public void updateUI() {\n setUI(SubstanceRibbonGalleryUI.createUI(this));\n }", "public void update(){\n \tSystem.out.println(model.toString());\n\t\tnumberofsteps.setText(model.toString());\n\t\tint selectedColor = model.getCurrentSelectedColor();\n\t\t\n\t\t// Update dots\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\t// Assign captured dots to correct colour\n\t\t\t\tif (model.isCaptured(i, j))\n\t\t\t\t\tdots[i][j].setColor(selectedColor);\n\t\t\t}\n\t\t}\n\t\t\n }", "@Override\r\n\tpublic void refreshChart2() {\n\t\tString[] s = new String[categoryStrings.size()];\r\n\t\ts= categoryStrings.toArray(s);\r\n\t\tif(getChartType().equals(\"StepLineChart\")) {\r\n\t\t\tDateAxis xAxis = new DateAxis(\"time\");\r\n\t\t\tValueAxis yAxis = new SymbolAxis(\"status\", s);\r\n\t\t\tXYStepRenderer renderer = new XYStepRenderer();\r\n\t\t\tXYPlot plot = new XYPlot(chartDataset, xAxis, yAxis, renderer);\r\n\t\t\tsetChart(new JFreeChart(null, new Font(\"Tahoma\", 0, 18), plot, true));\r\n\t\t}\r\n\t\t((GridBagLayout)getMonitoringPanel().getLayout()).rowHeights[2] = getMinimumHeight();\r\n\t\tgetMonitoringPanel().setPreferredSize(new Dimension(getMinimumWhidth(), (int) Math.round(getMonitoringPanel().getPreferredSize().getHeight())));\r\n\t\tsetVisible(isVisible());\r\n\t\tgetMonitoringPanel().setVisible(isVisible());\r\n\t\tif (chartPanel != null) \r\n\t\t\tgetMonitoringPanel().remove(chartPanel);\r\n\t\tsetChartPanel(new ChartPanel(chart));\r\n\t\tgetMonitoringPanel().add(chartPanel, new GridBagConstraints(0, 2, 6, 1, 0.0, 0.0,\r\n\t\t\t\tGridBagConstraints.CENTER, GridBagConstraints.BOTH,\r\n\t\t\t\tnew Insets(0, 0, 5, 5), 0, 0));\r\n\t}", "private void updateUi() {\n this.tabDetail.setDisable(false);\n this.lblDisplayName.setText(this.currentChild.getDisplayName());\n this.lblPersonalId.setText(String.format(\"(%s)\", this.currentChild.getPersonalId()));\n this.lblPrice.setText(String.format(\"%.2f\", this.currentChild.getPrice()));\n this.lblAge.setText(String.valueOf(this.currentChild.getAge()));\n this.dtBirthDate.setValue(this.currentChild\n .getBirthDate()\n .toInstant()\n .atZone(ZoneId.systemDefault())\n .toLocalDate());\n this.lblWeight.setText(String.format(\"%.1f kg\", this.currentChild.getWeight()));\n this.sldWeight.setValue(this.currentChild.getWeight());\n this.checkboxTrueRace.setSelected(!this.currentChild.isRace());\n this.imgChildProfile.setImage(this.currentChild.getAvatar());\n if (this.currentChild.getGender().equals(GenderType.MALE)){\n this.imgSex.setImage(FileUtils.loadImage(\"assets/image/gender/boy.png\"));\n this.lblSex.setText(\"Male\");\n }\n else {\n this.imgSex.setImage(FileUtils.loadImage(\"assets/image/gender/girl.png\"));\n this.lblSex.setText(\"Female\");\n }\n if (this.currentChild.isVirginity()){\n this.imgVirginity.setImage(FileUtils.loadImage(\"assets/image/virginity/virgin.png\"));\n this.lblVirginity.setText(\"Virgin\");\n }\n else {\n this.imgVirginity.setImage(FileUtils.loadImage(\"assets/image/virginity/not-virgin.png\"));\n this.lblVirginity.setText(\"Not Virgin\");\n }\n\n // TODO [assignment2] nastavit obrazek/avatar ditete v karte detailu\n // TODO [assignment2] nastavit spravny obrazek pohlavi v karte detailu\n // TODO [assignment2] nastavit spravny obrazek virginity atribut v v karte detailu\n }", "private void updateGUIStatus() {\r\n\r\n }", "public void plot(){\n\t\tplot = true;\n\t}", "public void render() {\n this.canvas.repaint();\n }", "private void refreshUI(){\r\n\t\t//update text fields\r\n\t\tConfiguration conf = m_Categorizer.Configuration();\r\n\t\tm_MCSTf.setText(String.valueOf(conf.getMCSScore()));\r\n\t\tm_RelScoreTf.setText(String.valueOf(conf.getRelevanceWeight()));\r\n\t\tm_CohScoreTf.setText(String.valueOf(conf.getCoherenceWeight()));\r\n\t\tm_KeyTf.setText(String.valueOf(conf.getKeywordsWeight()));\r\n\t\tm_CatConfTf.setText(String.valueOf(conf.getCategoryConfidenceWeight()));\r\n\t\tm_RepeatTf.setText(String.valueOf(conf.getRepeatedConceptWeight()));\r\n\t\tm_MinCatsTf.setText(String.valueOf(conf.getMinOutputCategories()));\r\n\t\tm_MaxCatsTf.setText(String.valueOf(conf.getMaxOutputCategories()));\r\n\t\tm_MinCatScoreTf.setText(String.valueOf(conf.getMinScore()));\r\n\t\t//refresh tables\r\n\t\tm_DatasetTable.refresh();\r\n\t\tm_ConceptTable.refresh();\r\n\t\t//refresh statistics window\r\n\t\tm_StatisticsWindow.refresh();\r\n\t\t//refresh filter choicebox\r\n\t\tupdateFilterChoiceBox();\r\n\t}", "public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }", "void setVisualizationType(MapVisualizationType visType);", "@Override\n protected void update()\n {\n final double DENSITY = this.getResources().getDisplayMetrics().scaledDensity;\n final ArrayList<BarChart.SeriesInfo> SERIES = new ArrayList<>();\n\n final Thread LOAD_GRAPH = new Thread() {\n @Override\n public void run() {\n final StatsActivity SELF = StatsActivity.this;\n int idForLegendX = R.string.label_week;\n\n SELF.getSelections();\n\n if( SELF.graphType == GraphType.Yearly ) {\n idForLegendX = R.string.label_year;\n }\n else\n if( SELF.graphType == GraphType.Monthly ) {\n idForLegendX = R.string.label_month;\n }\n\n final String LEGEND_X = SELF.getString( idForLegendX );\n\n SELF.runOnUiThread( () -> {\n switch( SELF.graphType ) {\n case Yearly:\n SELF.calculateDataForYearsStats( SELF.selectedYear, SERIES );\n break;\n case Monthly:\n SELF.calculateDataForMonthsStats( SELF.selectedYear, SERIES );\n break;\n case Weekly:\n SELF.calculateDataForWeeksStats(\n SELF.selectedYear, SELF.selectedMonth, SERIES );\n break;\n default:\n Log.e( LOG_TAG, \"unsupported graph type\" );\n }\n\n final BarChart CHART = new BarChart( DENSITY, SERIES );\n\n CHART.setLegendX( LEGEND_X );\n CHART.setLegendY( settings.getDistanceUnits().toString() );\n CHART.setShowLabels( true );\n SELF.chartView.setScaleType( ImageView.ScaleType.MATRIX );\n SELF.chartView.setImageDrawable( CHART );\n });\n }\n };\n\n LOAD_GRAPH.start();\n }", "public void refresh() {\r\n\t\tneeds.setText(needs());\r\n\t\tproduction.setText(production());\r\n\t\tjobs.setText(jobs());\r\n\t\tmarketPrices.setText(marketPrices());\r\n\t\tmarketSellAmounts.setText(marketSellAmounts());\r\n\t\tmarketBuyAmounts.setText(marketBuyAmounts());\r\n\t\tcompanies.setText(companies());\r\n\t\tmoney.setText(money());\r\n\t\ttileProduction.setText(tileProduction());\r\n\t\tcapital.setText(capital());\r\n\t\thappiness.setText(happiness());\r\n\t\tland.setText(land());\r\n\t\t//ArrayList of Agents sorted from lowest to highest in money is retrieved from Tile\r\n\t\tagents=tile.getAgentsByMoney();\r\n\t\tgui3.refresh();\r\n\t\tsliderPerson.setText(\"\"+agents.get(slider.getValue()).getMoney());\r\n\t\ttick.setText(tick());\r\n\t\tthis.pack();\r\n\t}", "@Override\n public void onAnimationEnd(Animation animation) {\n setVisualState();\n }", "@Override protected void startup() {\n BlaiseGraphicsTestFrameView view = new BlaiseGraphicsTestFrameView(this);\n canvas1 = view.canvas1;\n root1 = view.canvas1.getGraphicRoot();\n canvas1.setSelectionEnabled(true);\n show(view);\n }", "public void draw()\r\n\t\t{\r\n\t\tfor(PanelStationMeteo graph: graphList)\r\n\t\t\t{\r\n\t\t\tgraph.repaint();\r\n\t\t\t}\r\n\t\t}", "public void updateUI() {\n\t\tgetLoaderManager().restartLoader(0, null, this);\n\t}", "public void updateScene() {\n\t\t// check whether updates should be stopped\n\t\tif (simulation.isTerminated()) { \n\t\t\ttimeline.stop();\n\t\t\tsimulation.exit();\n\t\t} else {\n\t\t\t// first update the elements coordinates\n\t\t\ttry {\n\t\t\t\tsimulation.update();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Simulation> Non-critical error: Couldn't communicate with Server.\");\n\t\t\t}\n\n\t\t\t// then update the scene graph (in a rather brutal way)\n\t\t\troot.getChildren().clear();\n\t\t\troot.getChildren().addAll(simulation.getElements());\n\t\t}\n\t}", "private void updatePanel() {\n\t\tProbeUtilities.updateModelProbePanel();\n\t}", "public void update() {\n\n\t\tdisplay();\n\t}", "private void setImageOnGUI() {\n\n // Capture position and set to the ImageView\n if (AppConstants.fullScreenBitmap != null) {\n fullScreenSnap.setImageBitmap(AppConstants.fullScreenBitmap);\n }\n\n }", "void reconfigure() {\n computePosition(_primaryPlot.getScreenCoords(findCurrentCenterPoint()), false);\n }", "private void makeGUIVisible(){\n gameState = GameState.LOAD;\n notifyObservers();\n }", "public void sliceDisplayChanged() {\n hide();\n for (int idx = 0; idx<nChannels; idx++) {\n Displaysettings.applyDisplaysettings(ini_sources[idx], displaysettings[idx]);\n Displaysettings.applyDisplaysettings(getRegisteredSourcesAtStep(stepBack)[idx], displaysettings[idx]);\n }\n show();\n }", "private void updateGUI() {\n\t\tsfrDlg.readSFRTableFromCPU();\n\t\tsourceCodeDlg.updateRowSelection(cpu.PC);\n\t\tsourceCodeDlg.getCyclesLabel().setText(\"Cycles count : \" + cpu.getCyclesCount());\n\t\tdataMemDlg.fillDataMemory();\n\t\t//ioPortsDlg.fillIOPorts();\t\t\n\t\tIterator iter = seg7DlgList.iterator();\n\t\twhile(iter.hasNext())\n\t\t\t((GUI_7SegDisplay)iter.next()).drawSeg();\n\t}", "public void refreshUI(){\n\n // disable/endable certain UI elements depending on mode\n this.setModeUI();\n\n if (this.inManualMode == false){ this.automaticModeChecks(); }\n\n /**\n * @bug When selected a train from a TCDispatchedTrainsFrame, a NullPointerException is thrown.\n *\n */\n if (this.isUtilityFailure()){ this.vitalsButton.setForeground(Color.red); } // change to red\n else if (this.isUtilityFailure() == false){this.vitalsButton.setForeground(new Color(0,0,0));}\n\n // checks so that the doors can't open doors if moving..\n if (this.canOpenDoors()){ this.enableOpeningDoors(); }\n\n else{ // shut the doors if moving\n this.disableOpeningDoors();\n if (this.selectedTrain.getLeftDoor() != -1){ this.selectedTrain.setLeftDoor(0); }\n if (this.selectedTrain.getRightDoor() != -1){ this.selectedTrain.setRightDoor(0); }\n }\n\n // set utility stuff based on train information\n this.refreshAC();\n this.refreshHeat();\n this.refreshLights();\n this.refreshLeftDoors();\n this.refreshRightDoors();\n }", "private void setVisualState() {\n\n // STATE: station loading\n if (isAdded() && mThisStation != null && mPlaybackState == PLAYBACK_STATE_LOADING_STATION) {\n // change playback button image to stop\n mPlaybackButton.setImageResource(R.drawable.smbl_stop);\n // change playback indicator and metadata views\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_loading_24dp);\n mStationMetadataView.setText(R.string.descr_station_stream_loading);\n mStationDataSheetMetadata.setText(R.string.descr_station_stream_loading);\n // show metadata views\n mStationMetadataView.setVisibility(View.VISIBLE);\n mStationMetadataView.setSelected(true);\n mStationDataSheetMetadataLayout.setVisibility(View.VISIBLE);\n displayExtendedMetaData(mThisStation);\n }\n // STATE: playback started\n else if (isAdded() && mThisStation != null && mPlaybackState == PLAYBACK_STATE_STARTED) {\n // change playback button image to stop\n mPlaybackButton.setImageResource(R.drawable.smbl_stop);\n // change playback indicator and metadata views\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_started_24dp);\n mStationMetadataView.setText(mThisStation.getMetadata());\n mStationDataSheetMetadata.setText(mThisStation.getMetadata());\n // show metadata views\n mStationMetadataView.setVisibility(View.VISIBLE);\n mStationMetadataView.setSelected(true);\n mStationDataSheetMetadataLayout.setVisibility(View.VISIBLE);\n displayExtendedMetaData(mThisStation);\n }\n // STATE: playback stopped\n else if (isAdded()) {\n // change playback button image to play\n mPlaybackButton.setImageResource(R.drawable.smbl_play);\n // change playback indicator\n mPlaybackIndicator.setBackgroundResource(R.drawable.ic_playback_indicator_stopped_24dp);\n // hide metadata views\n mStationMetadataView.setVisibility(View.GONE);\n mStationDataSheetMetadataLayout.setVisibility(View.GONE);\n mStationDataSheetMimeTypeLayout.setVisibility(View.GONE);\n mStationDataSheetChannelCountLayout.setVisibility(View.GONE);\n mStationDataSheetSampleRateLayout.setVisibility(View.GONE);\n mStationDataSheetBitRateLayout.setVisibility(View.GONE);\n }\n }", "private void removeVisualization() {\n\t\tif(this.visualization != null) {\n\t\t\tthis.visualization.dispose();\n\t\t}\n\t}", "public void updateDrawing() {\n\n\t\tdrawingContainer.setDrawing(controller.getDrawing());\n\t\tscrollpane.setPreferredSize(new Dimension(drawingContainer\n\t\t\t\t.getPreferredSize().width + 100, drawingContainer\n\t\t\t\t.getPreferredSize().height + 100));\n\t\tpack();\n\t\trepaint();\n\t}", "private void initGUI(){\n\t\tsetLayout(new BoxLayout(this, BoxLayout.Y_AXIS));\n\t\tDefaultPieDataset dataset = new DefaultPieDataset();// use to set value of pie chart\n\t\tdataset.setValue(\"Bandwidth\",0);//set initial result of the Bandwidth\n\t\tdataset.setValue(\"Signal To Noise\",0);//set initial result of the Signal To Noise\n\t\tdataset.setValue(\"Max Data Rate\",0);//set initial result of the max data rate\n\t\tsetMaxDataRateLBL(dataset); //Set the content of initial result of max data rate \n\t\tJFreeChart pieChart = ChartFactory.createPieChart(\"Shannons Theorem\", dataset, true,true,false);\n\t\t//pie plot use to multiply the pattern and display of pie chart\n\t\tPiePlot plot = (PiePlot)pieChart.getPlot();\n\t\tplot.setLabelFont(new Font(\"SansSerif\", Font.PLAIN, 12));\n //show the message if there is no data available\n\t\tplot.setNoDataMessage(\"No data available\");\n \n // make the result show the numbers on the pie chart\n plot.setLabelGenerator(new StandardPieSectionLabelGenerator(\"{0}: {1} ({2})\", new DecimalFormat(\"0\"), new DecimalFormat(\"0%\")));\n plot.setCircular(false);\n plot.setLabelGap(0.02);\n\t\tChartPanel cp = new ChartPanel(pieChart); //use to put pie chart into JPanel \n\t\tadd(cp);\n\t\tadd(createResult());\n\t}", "@Override\n public void updateUI() {\n setUI(new RangeSliderUI(this));\n // Update UI for slider labels. This must be called after updating the\n // UI of the slider. Refer to JSlider.updateUI().\n updateLabelUIs();\n }", "@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}", "public GUIView() {\n initComponents();\n setMaxThreads();\n setCountOfElements(1);\n setCountOfThreads(1);\n this.isReadyForCalculation = false;\n }" ]
[ "0.7204222", "0.68469405", "0.67810625", "0.668789", "0.66752684", "0.6580093", "0.65581334", "0.6447869", "0.6363264", "0.6286964", "0.6213325", "0.620368", "0.617718", "0.61474574", "0.6130369", "0.6116679", "0.6084683", "0.60660255", "0.606475", "0.6034098", "0.6012256", "0.598761", "0.59817946", "0.59721816", "0.5959441", "0.59514153", "0.5947907", "0.5943084", "0.5915645", "0.591456", "0.59136015", "0.59083134", "0.59077907", "0.5892128", "0.5867264", "0.58575666", "0.58433414", "0.5831405", "0.5828183", "0.58145994", "0.57858175", "0.5781439", "0.577892", "0.57608896", "0.5760214", "0.5754378", "0.57504004", "0.5749618", "0.57487625", "0.57487625", "0.5733491", "0.5711365", "0.5711365", "0.5711365", "0.56964207", "0.5694821", "0.56827164", "0.5666945", "0.56654984", "0.5665181", "0.5664068", "0.56638074", "0.5659869", "0.56587535", "0.56533086", "0.564335", "0.5643176", "0.56365865", "0.56345713", "0.5624757", "0.56172043", "0.56107914", "0.56047213", "0.56039613", "0.5602895", "0.56019366", "0.55966604", "0.5591946", "0.5585315", "0.55768436", "0.556366", "0.5558653", "0.55527854", "0.554954", "0.5547288", "0.5540919", "0.5539504", "0.55327415", "0.5525811", "0.55237854", "0.55235666", "0.5511425", "0.55111563", "0.5511065", "0.5507884", "0.5505004", "0.5504911", "0.54945433", "0.54936916", "0.5491705" ]
0.76053506
0
remove the current visualization from the UI
private void removeVisualization() { if(this.visualization != null) { this.visualization.dispose(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void componentClosed() {\n /*\n Stop JMEVisualization instance and remove jmeCanvas from panel\n */\n jmeVisualization.stop();\n getVisualizationPanel().remove(jmeCanvas);\n getVisualizationPanel().revalidate();\n }", "public void removeContent() {\n try {\n content.remove(neuralNetAndDataSet);\n content.remove(trainingController);\n JMEVisualizationTopComponent.this.requestActive();\n } catch (Exception ex) {\n }\n }", "@Override\n protected void unregisterVisuals() {\n Map visualPartMap = this.getViewer().getVisualPartMap();\n visualPartMap.remove(getFigure().getLabel());\n visualPartMap.remove(getFigure().getCheckBox());\n super.unregisterVisuals();\n }", "@Override\r\n public void removeFromView() {\r\n currentAnimation.stop();\r\n super.removeFromView();\r\n }", "public void cleanup() {\n mParentLayout.removeView(mContainer);\n mControlsVisible.clear();\n }", "void detachFromGraphView();", "void clearButton_actionPerformed(ActionEvent e) {\n clearPlot(true);\n }", "@Override\n\tpublic void hide() {\n\t\thits.remove();\n\t\ttimeLeft.remove();\n\t\tdarken.remove();\n\t\tcontainer.remove();\n\t\ttimer = null;\n\t\ttrainingBag = null;\n\t}", "private void destroyDisplayEditOverlay() {\n\t}", "public abstract void removedFromWidgetTree();", "@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}", "public void removePeonStatusPane() {\n\t\tContextAreaHandler.getInstance().clearContext();\n\t}", "public void removeAllPlots() {\r\n plots.clear();\r\n repaint();\r\n }", "public void removePanel() \n\t{\n\t\tgame.remove(this);\n\t}", "public void RemoveAllGraphs() {\n EquationCardLayout.removeAll();\n lineGraphs.clear();\n CurrentEQ = \"\";\n EQNum = 0;\n AddNewGraph();\n Canvas.removeAll();\n Canvas.repaint();\n }", "public void removeOverlay() {\n MimsPlus[] openImages = ui.getAllOpenImages();\n for (MimsPlus image : openImages) {\n for (Roi roi : rois) {\n Overlay overlay = image.getGraphOverlay();\n int index = overlay.getIndex(roi.getName() + graphID);\n if (index > -1) {\n overlay.remove(index);\n }\n image.setOverlay(overlay);\n }\n }\n }", "public void clearFilmPanel(){\n\t\tfilmContents.removeAll();\n\t}", "public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }", "@Override\n public void run() {\n signalPanel.clearChart();\n }", "public void clear(){\r\n canvas.getGraphicsContext2D().clearRect(canvas.getWidth(),canvas.getHeight(),1,1);\r\n pane.getChildren().clear();\r\n }", "private void eraseContainer() {\r\n\t\tfor (Component comp:this.getComponents()) {\r\n\t\t\tcomp.setVisible(false);\r\n\t\t}\r\n\t}", "public void removeButton() {\n pan.remove(playButton);\n }", "public void panelGone() {\n\t\tdisplayPanel.removeImage(this);\r\n\r\n\t}", "public void supprimerJoueur() {\n cercle.setStroke(Color.TRANSPARENT);\n isVisible = false;\n }", "public void run() {\n viewerManagerFrame.removeViewer(viewer);\n }", "public void destroy() {\n renderer.destroy();\n }", "public void removeFromRoot(){\n Main.getRootPlayGround().getChildren().remove(imageView);\n }", "public void removeNow() {\n if (mView != null) {\n WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);\n wm.removeView(mView);\n }\n }", "private void removeObject() {\n\t\tif(this.curr_obj != null) {\n this.canvas.uRemove(this.curr_obj);\n\t\t\tthis.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n\n this.curr_obj = null;\n }\n\t}", "@FXML\n void removeFreeze() {\n generalTextArea.clear();\n clearEverything();\n enableRemove();\n }", "public void removePlot(WebPlot p, boolean freeResources) {\n p.freeResources();\n WebPlot primary= getPrimaryPlot();\n p.getPlotGroup().removePlotView(this);\n _plots.remove(p);\n ScrollInfo sInfo= _scrollInfo.get(p);\n if (sInfo!=null) {\n _scrollInfo.remove(p);\n }\n if (p == primary) {\n setPrimaryPlot(_plots.size() > 0 ? _plots.get(0) : null);\n }\n fireStatusChanged(StatusChangeType.REMOVED,p );\n\n if (freeResources) freePlotResources(p);\n\n }", "@Override\n public void undo(){\n this.parent.getSelectedArea().clear();\n }", "private synchronized void clearCanvasAndChart() {\n this.getLiveContext().clearRect(0, 0, this.getLiveCanvas().getWidth(), this.getLiveCanvas().getHeight());\n this.getxSeries().getData().clear();\n this.getySeries().getData().clear();\n }", "@Override\n\tpublic void clearStage() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\tgeneralServices.getCallbackApi().removeReplayOpsPopupMenuItem(\n\t\t\t\tshowSc2ConverterForPatternMiningItemHandler);\n\t}", "private void unSelect() {\n /** if we had some object selected we need to delete it's Transformation Points. */\n if(this.action.isSelect() && this.curr_obj != null) {\n this.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n this.curr_obj = null;\n\n /** if we were in the middle of a text operation, we have to remove the TextBox and set the text to it's last version*/\n } else if(this.action.isText()) {\n int size = Integer.parseInt(currentFontSize.getItemText(currentFontSize.getSelectedIndex()));\n\n curr_obj = new Text(editor.getText());\n ((Text)curr_obj).setFont(currFont);\n addTextObject(curr_obj, (int)aux_obj.getX() + (int)((1.0/4.0)*size), (int)aux_obj.getY()+ (size) + (int)((1.0/4.0)*size));\n\n aux_obj = null;\n curr_obj = null;\n apanel.remove(editor);\n editor = null;\n action.setAction(Action.TEXTBOX);\n }\n }", "public void actionPerformed(ActionEvent e)\n\t{\n\t\tview.removeButton();\n\t}", "public void onDetachedFromWindow() {\n super.onDetachedFromWindow();\n SvgViewManager.dropSvgView(this);\n }", "void figureRemovedAt(Location loc);", "public void erase() {\n if (r.isVisible()) {\n Canvas canvas = Canvas.getCanvas();\n canvas.erase(r);\n }\n }", "private void m125722q() {\n if (this.f88309g != null) {\n this.f88309g.removeAllViews();\n }\n }", "public void removeRepresentations()\r\n\t{\n\t}", "@Override\n\tpublic void unsetVisible() {\n\t\tviewer.setVisible(false);\n\t\tscrollbar.setVisible(false);\n\t}", "private void clearPainting()\r\n\t{\r\n\t\tdockableDragPainter.clear();\r\n\t}", "public void clearLeadUI() {\n\t\tfor (JLabel item : leadList) {\n\t\t\testimationGame.getContentPane().remove(item);\n\t\t}\n\t\tleadList.clear();\n\t}", "void clearAnimatorPanel();", "public void removeAllComponents();", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "private void resetPieChart() {\n diagramBox.getChildren().clear();\n }", "public void removeLayer(int index){\n history.removeIndex(index);\n historyValues.removeIndex(index);\n }", "@Override\r\n\tpublic void unexecute() {\n\t\t\r\n\t\tCollections.swap(model.getListOfShapes(), model.getListOfShapes().size()-1, i); \r\n\t\t\r\n\t\t/*if(print == true) {\r\n\t\t\t\r\n\t\t\tFrame.textArea.append(\"UNDO >>> Bring to back: \" + s +\"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tprint = true;*/\r\n\t\r\n\t\t\r\n\t}", "public void removeWizard() {\n\t\tyellowWizard = null;\n\t\tplayer.getHintIconsManager().removeAll();\n\t\tplayer.WizardUsed = true;\n\t}", "public void remove() {\n\t\tstopFloating();\t\n\t\tPacketHandler.toggleRedTint(player, false);\n\t\tplayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 30, 1));\n\t\tplayer.stopSound(Sound.MUSIC_DISC_CHIRP);\n\t\tcleanTasks();\n\t\tactiveScenarios.remove(player.getUniqueId());\n\t}", "public void clearScreen() \n\t{\n\t\tthis.myLineView.clearScreen();\n\t}", "@Override\n\tpublic void destroy() {\n\t\tif(!isVisible())\n\t\t{\n\t\t\tSystem.out.println(\"敌机销毁\");\n\t\t}\n\t}", "void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }", "public void clearDisplay() {\n placeHolder.getChildren().clear();\n }", "public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }", "void removeComponents()\n {\n JPanel panel = Simulator.getInstance().getPanel(1);\n JLayeredPane jl = (JLayeredPane)panel.getComponent(0);\n Component[] comps = jl.getComponentsInLayer(JLayeredPane.PALETTE_LAYER.intValue());\n int size = comps.length;\n int i=0;\n while(i<size)\n {\n jl.remove(comps[i]);\n i++;\n } \n }", "public void removePlotData() {\n\t\tif (xySeries != null) {\n\t\t\tfor (int i = 0; i < xySeries.length; i++) {\n\t\t\t\tif (xySeries[i] != null) {\n\t\t\t\t\txySeries[i].clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tseriesCount = 0;\n\t\txySeries = new XYSeries[seriesCount + 1];\n\t}", "@Override\r\n\tpublic void onClosed() {\n\t\tmSlidingLayer.removeAllViews();\r\n\t}", "private void removeProgressView() {\n if (progressView == null) return;\n\n removeView(progressView);\n TurbolinksLog.d(\"Progress view removed\");\n }", "public void dropview() {\n\t\tthis.remove(scrollPane);\n\t}", "public void clear()\r\n {\r\n throw new RuntimeException(\"Cannot modify the display data.\");\r\n }", "public void actionPerformed(ActionEvent e) {\r\n\t\t\tinstr.setText(\"Previous content is removed.\");\r\n\t\t\tcanvas.arr = new int[8];\r\n\t\t\tcanvas.annotations.clear();\r\n\t\t\tcanvas.repaint();\r\n\t\t}", "public void removeTestCase(){\n\t\tgetSelectedPanel().removeSelectedTestCase(); \n\t}", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void remove() {\n super.remove();\n }", "public void freeResources() {\n borderPane = null;\n }", "private void erase()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.erase(this);\n }", "public void onDestroy(Context context) {\n runtimeComponentMap.remove(context);\n\n ViewInspectorToolbar toolbarInstance = toolbarMap.get(context);\n if (toolbarInstance != null) windowManager.removeViewImmediate(toolbarInstance);\n }", "private void resetGUI() {\n leftVBox.getChildren().clear();\n rightVBox.getChildren().clear();\n connectionsPane.getChildren().clear();\n }", "public void undo() {\n compositionManager.ungroup(group);\n }", "public void remove() {\r\n super.remove();\r\n }", "@Override\n public void onDone() {\n mOverlay.remove(mEyesGraphic);\n }", "void removeLayer(int whichLayer);", "@Override\n protected void onCleared() {\n super.onCleared();\n presenter.clearView();\n }", "@Override\n protected void onCleared() {\n super.onCleared();\n presenter.clearView();\n }", "public void removeGraphic(int id)\n\t{\n\t\tgetObject().removeGraphic(id);\n\t\treturn;\n\t}", "void unsetControlPosition();", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n userProcessContainer.remove(this);\n CardLayout cardLayout = (CardLayout) userProcessContainer.getLayout();\n cardLayout.previous(userProcessContainer);\n }", "private void clearAndHide()\n\t{\n\t\ttabbedPane.removeAll();\n\t\tcount = 0;\n\t\thide();\n\t}", "private void unmountSlider() {\n if (slider != null) {\n sliderPane.getChildren().remove(slider);\n }\n }", "public void removeSelection() {\n this.selection = null;\n }", "public void clear() {\n super.clear();\n locationToWidget.clear();\n widgetToCaptionWrapper.clear();\n }", "private void backButtonMouseClicked(MouseEvent e) {\n Container container = this.getParent();\n container.remove(this);\n GameMap gameMap = gameEngine.getGameState().getGameMapObject();\n gameMap.deleteObserver(this);\n parent.setVisible(true);\n }", "private void cancelAction() {\n\t\tparent.tabbedView.remove(this);\n\t\tparent.repaint();\n\t}", "private void clear() {\n activeUser = null;\n socialNetwork = new SocialNetwork();\n userList.getItems().clear();\n if (centerBox.getChildren().size() > 0) {\n this.graphPane = new Pane();\n this.graphPane.setPrefSize(500, 500);\n centerBox.getChildren().set(0, this.drawGraph());\n } else {\n this.graphPane = new Pane();\n this.graphPane.setPrefSize(500, 500);\n centerBox.getChildren().add(this.drawGraph());\n }\n ((Labeled) ((VBox) statsBox.getChildren().get(0)).getChildren().get(1)).setText(\"\");\n updateCounts();\n }", "private void leaveRenderGroups() {\r\n if (onePageDataModel.page != null) {\r\n for (CustomerBean uiCustomerBean : uiCustomerBeans) {\r\n renderManager.getOnDemandRenderer(uiCustomerBean.getCustomer().getCustomernumber().toString()).remove(this);\r\n }\r\n }\r\n }", "public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }", "public void deleteSelection() {\r\n /* Delete the node */\r\n try {\r\n deleteNode();\r\n } catch (NullPointerException e1) {\r\n }\r\n /* Delete the edge */\r\n try {\r\n deleteEdge();\r\n } catch (NullPointerException e2) {\r\n }\r\n /* Reload the scroll */\r\n scrollPane().doLayout();\r\n }", "@Override\npublic void removeFromParentUIContainer() {\n\t\n}", "public void destruction()\n\t{\n\t\tremove();\n\t}", "private void removeIndicator() {\n\n int indicatorToRemove;\n\n if (mCurrentlySelectedIndicator == mCurrentAdapterSize - 1) {\n indicatorToRemove = mCurrentlySelectedIndicator - 1;\n } else {\n indicatorToRemove = mCurrentlySelectedIndicator + 1;\n }\n\n // Remove from view\n View view = getChildAt(indicatorToRemove);\n if (view != null) {\n removeView(view);\n }\n }", "public void removeCurrent( )\n {\n // Implemented by student.\n }" ]
[ "0.6952454", "0.69187534", "0.6889426", "0.67529374", "0.6700231", "0.66338164", "0.65698344", "0.65430546", "0.64428526", "0.6423583", "0.64192784", "0.64144826", "0.63858", "0.6376631", "0.6357733", "0.6352359", "0.63437045", "0.63366", "0.6332908", "0.6323215", "0.62910444", "0.62791944", "0.62749565", "0.62732387", "0.6255256", "0.6242343", "0.622725", "0.6210468", "0.62070006", "0.62007046", "0.61979645", "0.61814636", "0.617464", "0.6171449", "0.61675614", "0.6167128", "0.6153169", "0.61423284", "0.6112555", "0.6109278", "0.61047703", "0.6100616", "0.60971016", "0.60858744", "0.6081761", "0.6077607", "0.6076887", "0.60767984", "0.6075584", "0.60650074", "0.6037607", "0.60262424", "0.60251456", "0.6023449", "0.60203767", "0.6007756", "0.6003575", "0.6000769", "0.599953", "0.59979814", "0.59879744", "0.5984695", "0.59778684", "0.5969569", "0.5952455", "0.5951396", "0.5949464", "0.5949464", "0.5949464", "0.5949464", "0.5949464", "0.5949464", "0.5949464", "0.5948134", "0.5939489", "0.59389293", "0.5932875", "0.5929828", "0.59275335", "0.59249264", "0.5921269", "0.59198356", "0.59198356", "0.5910461", "0.59057415", "0.590526", "0.58971226", "0.5896166", "0.58928406", "0.58907294", "0.58873814", "0.58864385", "0.5875926", "0.5872909", "0.5868461", "0.5868317", "0.58600825", "0.5859548", "0.58589077", "0.5858905" ]
0.8531417
0
Fetches Casa Account Balance for selected Casa Account You should map balance inside CasaAccountSelected object along with accountId which is required
public ResponseEntity<AccountBalanceResponse> getCasaAccountBalanceResponseEntity(String customerId, String accountId, String accessToken) { AccountBalanceResponse accountBalanceResponse = new AccountBalanceResponse(); try { HttpResponse<String> apiResponse = Unirest.get(propertyUtil .getAPIUrl(com.activeai.integration.banking.api.constants.PropertyConstants.CASA_ACCOUNT_BALANCE_API_END_POINT, customerId, accountId)).header(APIConstants.CACHE_CONTROL, APIConstants.NO_CACHE).asString(); ApplicationLogger.logInfo( MessageConstants.API_RESPONSE_STATUS + apiResponse.getStatus() + MessageConstants.AND_RESPONSE_STATUS_TEXT + apiResponse.getStatusText(), this.getClass()); if (StringUtils.isNotEmpty(apiResponse.getBody())) { ApplicationLogger.logInfo("Casa Account Balance Response Body Before Transformation :" + apiResponse.getBody(), this.getClass()); accountBalanceResponse = accountsResponseMapper.getManipulatedCasaAccountsBalanceResponse(apiResponse.getBody()); ApplicationLogger.logInfo("Casa Account Balance Response Body After Transformation :" + accountBalanceResponse, this.getClass()); } return ResponseEntity.ok(accountBalanceResponse); } catch (UnirestException e) { ApplicationLogger.logError(MessageFormat .format(ERROR_MESSAGE_FORMAT, com.activeai.integration.banking.api.constants.MessageConstants.API_FAILURE_MESSAGE, this.getClass().getName(), ExceptionUtils.getStackTrace(e))); } catch (Exception e) { ApplicationLogger.logError(MessageFormat .format(ERROR_MESSAGE_FORMAT, com.activeai.integration.banking.api.constants.MessageConstants.EXCEPTION_MESSAGE, this.getClass().getName(), ExceptionUtils.getStackTrace(e))); } accountBalanceResponse.setResult(propertyUtil .frameErrorResponse(com.activeai.integration.banking.api.constants.MessageConstants.INTERNAL_SERVER_ERROR, APIConstants.INTERNAL_SERVER_ERROR, 500)); return ResponseEntity.ok(accountBalanceResponse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getBalance( Integer account_id ){\r\n\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"account_id\", String.valueOf(account_id));\r\n String url = API_DOMAIN + ACCOUNT_EXT + GET_BALANCE;\r\n this.makeVolleyRequest( url, params );\r\n }", "@Override\n public ResponseEntity<ResponseAccountBalance> getAccountBalanceById(String accountId) {\n\n final String url = \"https://sandbox.platfr.io/api/gbs/banking/v2/accounts/\"+accountId+\"/balance\";\n //=======================================================================\n //============================= HEADER ==================================\n //=======================================================================\n HttpHeaders requestHeaders = new HttpHeaders();\n requestHeaders.setContentType(MediaType.APPLICATION_JSON);\n requestHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));\n requestHeaders.set(\"Auth-Schema\",\"S2S\");\n\n HttpEntity<AccountBalance> entity = new HttpEntity<>(requestHeaders);\n // Send request with GET method, and Headers.\n return restTemplate.exchange(url,HttpMethod.GET, entity, ResponseAccountBalance.class);\n\n }", "@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}", "@Test\n public void getBaasPortfolioBalanceUsingGetTest() throws ApiException {\n UUID nucleusPortfolioId = null;\n LocalDate endDate = null;\n LocalDate startDate = null;\n BaasBalanceVO response = api.getBaasPortfolioBalanceUsingGet(nucleusPortfolioId, endDate, startDate);\n\n // TODO: test validations\n }", "public AccountDto getBalanceFor(UUID accountId) {\n Account account = repository.getAccount(accountId);\n return getAccountDtoFor(account);\n }", "public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}", "public Integer getAccountBalance(int account_id){\n Account a = cache.get(account_id);\n if(a != null) return a.getBalance();\n\n try (\n Statement s = rawDataSource.getConnection().createStatement();\n ResultSet res = s.executeQuery(\n \"SELECT BALANCE FROM ACCOUNTS WHERE ACCOUNT_ID = \" + account_id)) {\n\n if (res.next())\n return res.getInt(\"BALANCE\");\n } catch (SQLException ex) {\n return null;\n }\n\n return null;\n }", "public static BigDecimal getBalance(int accountId) throws SQLException {\n boolean cdt1 = Checker.checkValidUserAccountAccountId(accountId);\n // if it is a valid account id, establish a connection\n if (cdt1) {\n Connection connection = DatabaseDriverHelper.connectOrCreateDataBase();\n BigDecimal balance = DatabaseSelector.getBalance(accountId, connection);\n connection.close();\n return balance;\n }\n return null;\n }", "public double selectCurrentBalance(int choice, String getUser);", "public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}", "public float getBalance(String SavngsAcct) {\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next()) {\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}", "@Override\n public BigDecimal getBalance(String customerId, EMCUserData userData) {\n BigDecimal outstandingDebit = null;\n\n //Get total outstanding credits for customer, which existed at atDate\n EMCQuery query = new EMCQuery(enumQueryTypes.SELECT, DebtorsOpenTransactions.class);\n query.addFieldAggregateFunction(\"debit\", \"SUM\");\n query.addFieldAggregateFunction(\"debitAmountSettled\", \"SUM\");\n query.addFieldAggregateFunction(\"credit\", \"SUM\");\n query.addFieldAggregateFunction(\"creditAmountSettled\", \"SUM\");\n\n //Customer is optional.\n if (customerId != null) {\n query.addAnd(\"customerId\", customerId);\n }\n\n query.addAnd(\"transactionDate\", Functions.nowDate(), EMCQueryConditions.LESS_THAN_EQ);\n\n Object[] debitTotals = (Object[]) util.executeSingleResultQuery(query, userData);\n\n if (debitTotals != null) {\n BigDecimal totalDebit = debitTotals[0] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[0];\n BigDecimal totalDebitSettled = debitTotals[1] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[1];\n BigDecimal totalCredit = debitTotals[2] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[2];\n BigDecimal totalCreditSettled = debitTotals[3] == null ? BigDecimal.ZERO : (BigDecimal) debitTotals[3];\n outstandingDebit = totalDebit.subtract(totalDebitSettled);\n totalCredit = totalCredit.subtract(totalCreditSettled);\n outstandingDebit = outstandingDebit.subtract(totalCredit);\n }\n return outstandingDebit;\n }", "@RequestMapping(value = \"/balance\", method = RequestMethod.GET)\r\n public List<BigDecimal> getBalances(Principal principal) {\r\n try {\r\n return accountDAO.getCurrentBalance(principal.getName());\r\n } catch (Exception ex) {\r\n System.out.println(ex);\r\n }\r\n return null;\r\n }", "public Money getTotalBalance();", "@GetMapping(\"/accountBalance/{accountId}\")\n public ResponseEntity<String> getAccountBalanceAndTransactions(@PathVariable int accountId) {\n try {\n return new ResponseEntity<>(bankingService.getAccountBalanceAndTransactions(accountId), HttpStatus.OK);\n } catch (AccountNonExistentException e) {\n return new ResponseEntity<>(e.getLocalizedMessage(), HttpStatus.BAD_REQUEST);\n } catch (Exception e) {\n return new ResponseEntity<>(\"Error! \" + e.getLocalizedMessage(), HttpStatus.INTERNAL_SERVER_ERROR);\n }\n\n }", "public static void extract_money(){\n TOTALCMONEY = TOTALCMONEY - BALANCERETRIEVE; //the total cashier money equals the total cashier money minus the retrieve request\r\n BALANCE = BALANCE - BALANCERETRIEVE; //the user balance equals the account minus the retrieve request\r\n }", "AccountDetail getAccount(String number) throws Exception;", "com.google.ads.googleads.v6.resources.AccountBudget getAccountBudget();", "Balance[] findAllByBankAccount_Id(Long id);", "public Coin getBalance(BalanceType balanceType) {\n try {\n if (balanceType == BalanceType.AVAILABLE || balanceType == BalanceType.AVAILABLE_SPENDABLE) {\n List<TransactionOutput> candidates = calculateAllSpendCandidates(true, balanceType == BalanceType.AVAILABLE_SPENDABLE);\n CoinSelection selection = coinSelector.select(NetworkParameters.MAX_MONEY, candidates);\n return selection.valueGathered;\n } else if (balanceType == BalanceType.ESTIMATED || balanceType == BalanceType.ESTIMATED_SPENDABLE) {\n List<TransactionOutput> all = calculateAllSpendCandidates(false, balanceType == BalanceType.ESTIMATED_SPENDABLE);\n Coin value = Coin.ZERO;\n for (TransactionOutput out : all) value = value.add(out.getValue());\n return value;\n } else {\n throw new AssertionError(\"Unknown balance type\"); // Unreachable.\n }\n } finally {\n }\n }", "public BankAccount getBalance (IDRecord idRecord) {\n\n BankAccount currentBankAccount;\n // extract the bank account number\n int theAcctNum = idRecord.getNumericalID();\n\n // find BankAccount from account -> BankAccount HashMap\n currentBankAccount = hashMapOfAllAccts.get(theAcctNum);\n\n if ( currentBankAccount == null) {\n // if no account was found, generate a generic empty account\n currentBankAccount = new BankAccount();\n\n }\n\n return currentBankAccount;\n }", "private void DetermineBalance() {\n\t\t\n\t\tString query = \"SELECT Ticket_Class FROM Customer_Flight_Information WHERE Customer_Name = \"+name;\n\t\tCursor cursor = deltaDB.rawQuery(query, null);\n\t\t\n\t\ttry{\n\t\t\tif(cursor.moveToFirst()){\n\t\t\t String ticketClass = cursor.getString(cursor.getColumnIndex(\"Ticket_Class\"));\n\t\t\t \n\t\t\t switch(ticketClass){\n\t\t\t \t\n\t\t\t \t\tcase \"Economy Class\":\n\t\t\t \t\t\tprice_txt.setText(\"$315\");\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \t\tcase \"Business Class\":\n\t\t\t \t\t\tprice_txt.setText(\"$365\");\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \t\tcase \"First Class\":\n\t\t\t \t\t\tprice_txt.setText(\"$420\");\n\t\t\t \t\tbreak;\t\n\t\t\t }\n\t\t\t}\n\t\t}finally{\n\t\t\tcursor.close();\n\t\t}\n\t}", "public static Account getAccountDetails(int accountId) throws SQLException {\n boolean cdt1 = Checker.checkValidUserAccountAccountId(accountId);\n // if it is a account id, establish a connection\n if (cdt1) {\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n Connection connection = DatabaseDriverHelper.connectOrCreateDataBase();\n ResultSet results = DatabaseSelector.getAccountDetails(accountId, connection);\n while (results.next()) {\n // get the account details\n String name = results.getString(\"NAME\");\n BigDecimal balance = new BigDecimal(results.getString(\"BALANCE\"));\n // make an account class (either chequing, savings, or tfsa) based on the type\n if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.CHEQUING)) {\n ChequingAccount chequing = new ChequingAccountImpl(accountId, name, balance);\n connection.close();\n return chequing;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.SAVINGS)) {\n SavingsAccount savings = new SavingsAccountImpl(accountId, name, balance);\n connection.close();\n return savings;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.TFSA)) {\n TFSA tfsa = new TFSAImpl(accountId, name, balance);\n connection.close();\n return tfsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.RESTRICTEDSAVING)) {\n RestrictedSavingsAccount rsa = new RestrictedSavingsAccountImpl(accountId, name, balance);\n connection.close();\n return rsa;\n } else if (DatabaseSelectHelper.getAccountType(accountId) == map.accountTypes.get(AccountTypes.BALANCEOWING)) {\n BalanceOwingAccount boa = new BalanceOwingAccountImpl(accountId, name, balance);\n connection.close();\n return boa;\n }\n }\n }\n return null;\n }", "CusBankAccount selectByPrimaryKey(Integer id);", "public String getbal(String cname) {\nString countQuery = \"SELECT Balance FROM \" + DATABASE_TABLE1+\" WHERE Name='\"+cname+\"'\";\n\t \n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int d=cursor.getColumnIndex(\"Balance\");\n\t\tString cbal=null;\n\t\tfor(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()){\n\t\t\tcbal=cursor.getString(d);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cbal;\n\t}", "public ResponseEntity<DepositAccountBalanceResponse> getDepositAccountBalanceResponseEntity(String customerId, String accountId,\n String accessToken) {\n DepositAccountBalanceResponse response = new DepositAccountBalanceResponse();\n try {\n HttpResponse<String> apiResponse = Unirest.get(propertyUtil\n .getAPIUrl(com.activeai.integration.banking.api.constants.PropertyConstants.DEPOSIT_ACCOUNT_BALANCE_API_END_POINT, customerId,\n accountId)).header(APIConstants.CACHE_CONTROL, APIConstants.NO_CACHE).asString();\n ApplicationLogger.logInfo(\n MessageConstants.API_RESPONSE_STATUS + apiResponse.getStatus() + MessageConstants.AND_RESPONSE_STATUS_TEXT + apiResponse.getStatusText(),\n this.getClass());\n if (StringUtils.isNotEmpty(apiResponse.getBody())) {\n ApplicationLogger.logInfo(\"Deposit Account Balance Response Body Before Transformation :\" + apiResponse.getBody(), this.getClass());\n response = accountsResponseMapper.getManipulatedDepositAccountsBalanceResponse(apiResponse.getBody());\n ApplicationLogger.logInfo(\"Deposit Account Balance Response Body After Transformation :\" + response, this.getClass());\n }\n return ResponseEntity.ok(response);\n } catch (UnirestException e) {\n ApplicationLogger.logError(MessageFormat\n .format(ERROR_MESSAGE_FORMAT, com.activeai.integration.banking.api.constants.MessageConstants.API_FAILURE_MESSAGE,\n this.getClass().getName(), ExceptionUtils.getStackTrace(e)));\n } catch (Exception e) {\n ApplicationLogger.logError(MessageFormat\n .format(ERROR_MESSAGE_FORMAT, com.activeai.integration.banking.api.constants.MessageConstants.EXCEPTION_MESSAGE,\n this.getClass().getName(), ExceptionUtils.getStackTrace(e)));\n }\n response.setResult(propertyUtil\n .frameErrorResponse(com.activeai.integration.banking.api.constants.MessageConstants.INTERNAL_SERVER_ERROR,\n APIConstants.INTERNAL_SERVER_ERROR, 500));\n return ResponseEntity.ok(response);\n }", "public RemoteCall<BigInteger> balanceOf(String account) {\n final Function function = new Function(FUNC_BALANCEOF,\n Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(account)),\n Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));\n return executeRemoteCallSingleValueReturn(function, BigInteger.class);\n }", "public void showAccountBalance(){\n balance();\n\n }", "public double getBankAccountBalance() {\r\n\t\t\r\n\t\tdouble balance = 0.0;\r\n\t\t\r\n\t\t\t\tif( customerBankAccountList.contains(this.getCustomer() ) ) \r\n\t\t\t\t{\t\r\n\t\t\t\t\tbalance = this.getCustomer().getBalance();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn balance;\r\n\t\t}", "public abstract int getBalancesSelected();", "public List<Account> getBalanceByPassbook(String passbook_id) throws Exception{\n Session session= sessionFactory.getCurrentSession();\n List<Account> accountList= session.createQuery(\"select a.balance from Account a, Passbook p where p.passbook_id='\"+passbook_id+\"'\").list();\n return AccountDto.getBalanceByPassbook(accountList);\n }", "@GET\n @Path(\"bank/account/{account_id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBankAccountDetails(@PathParam(\"account_id\") \n String accountId) {\n \n int id = Integer.parseInt(accountId);\n Account a1 = new Account(1234, 12345678, 123.47, \"Current\", id, 1);\n return Response.status(200).entity(gson.toJson(a1)).build();\n \n }", "public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}", "public abstract GDataAccount getAccount(String account) throws ServiceException;", "public Account getAccountByID(int id)//This function is for getting account for transfering amount\r\n {\r\n return this.ac.stream().filter(ac1 -> ac1.getAccId()==id).findFirst().orElse(null);\r\n }", "public Coin getBalance(CoinSelector selector) {\n try {\n checkNotNull(selector);\n List<TransactionOutput> candidates = calculateAllSpendCandidates(true, false);\n CoinSelection selection = selector.select(params.getMaxMoney(), candidates);\n return selection.valueGathered;\n } finally {\n }\n }", "@Override\n public BigDecimal getCurrentBalance(Account account) {\n return null;\n }", "public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}", "@Override\n public AccountDto getBalance(AccountNumberDto accountNumber) {\n AccountEntity accountEntity = new AccountDaoImpl(new StatementsRunnerImpl()).readBalance(accountNumber);\n return new AccountDto(accountEntity.getId(), accountNumber.getAccountNumber(), accountEntity.getCurrency());\n }", "public int getBankAccount() {\n return bankAccount;\n }", "public BigDecimal getBalance() {\n return balance;\n }", "public BigDecimal getBalance() {\n return balance;\n }", "public void transferMoney(int customerAccountId, int accountId) throws SQLException {\n // check if the customer has this account\n boolean customerOwnsAccount = false;\n for (int i = 0; i < this.currentCustomer.getAccounts().size(); i++) {\n if (customerAccountId == this.currentCustomer.getAccounts().get(i).getId()) {\n customerOwnsAccount = true;\n break;\n }\n }\n // it is safe to proceed since the customer accounts have been authenticated\n if (customerOwnsAccount) {\n Account customerAccount = DatabaseSelectHelper.getAccountDetails(customerAccountId);\n // try and catch for valid input (int) expected\n try {\n System.out.println(\"Enter amount you wish to transfer:\");\n // take user input as a big decimal\n BigDecimal bigAmount = new BigDecimal(br.readLine());\n if (bigAmount.compareTo(customerAccount.getBalance()) <= 0) {\n // try to update accounts\n try {\n // update the account which received money in database\n DatabaseUpdateHelper.updateAccountBalance(\n bigAmount.add(DatabaseSelectHelper.getBalance(accountId)), accountId);\n // update account which transfered money in database\n DatabaseUpdateHelper.updateAccountBalance(\n customerAccount.getBalance().subtract(bigAmount), customerAccountId);\n // update the customer object for printing reasons for other options\n this.currentCustomer.updateAccounts();\n // Explicitly tell user money is transfered\n System.out.println(\"you have successfully transfered money to account \" + accountId);\n \n } catch (Exception e) {\n System.out.println(\"The account ID you wish to transfer money to does not exist\");\n }\n // error printing\n } else {\n System.out.println(\"This account does not have enough money to send this amount\");\n }\n \n } catch (Exception e) {\n System.out.println(\"Invalid amount\");\n }\n // error printing\n } else {\n System.out.println(\"You do not have access to this account\");\n }\n \n }", "Account getAccount(Integer accountNumber);", "public AmountOfMoney getCashRegisterBalance(){\n return cashRegister.getBalance();\n }", "public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }", "BigDecimal getClosingCreditBalance();", "public double getBalance()\n \n {\n \n return balance;\n \n }", "double getBalance();", "double getBalance();", "BigDecimal getOpeningCreditBalance();", "BigDecimal getOpeningCreditBalance();", "public static BigDecimal getBillingAccountNetBalance(Delegator delegator, String billingAccountId) throws GenericEntityException {\n BigDecimal balance = ZERO;\n\n // search through all PaymentApplications and add the amount that was applied to invoice and subtract the amount applied from payments\n List<GenericValue> paymentAppls = EntityQuery.use(delegator).from(\"PaymentApplication\").where(\"billingAccountId\",\n billingAccountId).queryList();\n for (GenericValue paymentAppl : paymentAppls) {\n BigDecimal amountApplied = paymentAppl.getBigDecimal(\"amountApplied\");\n GenericValue invoice = paymentAppl.getRelatedOne(\"Invoice\", false);\n if (invoice != null) {\n // make sure the invoice has not been canceled and it is not a \"Customer return invoice\"\n if (!\"CUST_RTN_INVOICE\".equals(invoice.getString(\"invoiceTypeId\")) && !\"INVOICE_CANCELLED\".equals(invoice.getString(\"statusId\"))) {\n balance = balance.add(amountApplied);\n }\n } else {\n balance = balance.subtract(amountApplied);\n }\n }\n\n balance = balance.setScale(DECIMALS, ROUNDING);\n return balance;\n }", "@Query(\"select acc.availableBalance from Account acc where acc.customer.customerId = :custId and acc.accountStatus = :accountStatus and acc.accountType = :accountType\")\n\tOptional<Double> findByAccountBalance(@Param(\"custId\") Long custId, @Param(\"accountStatus\") String accountStatus,\n\t\t\t@Param(\"accountType\") String accountType);", "public int getBalance() {\n return total_bal;\n }", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "public BalanceDto getBalance(String customerId) {\n\t\tlogger.info(\"balance service implementation class\");\n\t\t\n\t\tBalanceDto balanceDto = new BalanceDto();\n\t\t\n\t\tAccount accountDetails = accountRepository.findBycustomerId(customerId);\n\t\t\n\t\tMortagage mortagagae = mortagageRepository.findBycustomerId(customerId);\n\t\t\n\t\tif(accountDetails.getAccountNumber() != null && mortagagae.getCustomerId() != null)\n\t\t{\n\t\t\t\n\t\t\tlogger.info(\"balance service implementation class with customerId\");\n\t\t\tbalanceDto.setTransactionAccountNumber(accountDetails.getAccountNumber());\n\t\t\tbalanceDto.setTransactionBalance(accountDetails.getBalance());\n\t\t\tbalanceDto.setMortagageBalance(mortagagae.getMortagageBalance());\n\t\t\tbalanceDto.setMortagageAccNumber(mortagagae.getMortagageId());\n\t\t\tbalanceDto.setMessage(\"Balance Data\");\n\t\t\tbalanceDto.setStatus(\"SUCCESS\");\n\t\t\tbalanceDto.setStatusCode(200);\n\t\t\treturn balanceDto;\n\t\t}else\n\t\t{\n\t\t\tlogger.info(\"balance service implementation class with customerId does not exists\");\n\t\t\tthrow new MortagageManagementException(\"Customer Id does not exists or transactions not done\");\n\t\t}\n\t}", "public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }", "public Cursor getCashMovements(long accountId) {\n\n SQLiteQueryBuilder qb = new SQLiteQueryBuilder();\n qb.setTables(TABLE_ACCOUNTS + JOIN + TABLE_MOVEMENTS + \" ON \" +\n MovementsTable.ID_ACCOUNT + \" = \" + AccountTable.FULL_ID);\n\n String orderBy = MovementsTable.FULL_MOVEMENTS_DATE + \" DESC\";\n\n // Get the database.\n SQLiteDatabase db = mOpenHelper.getReadableDatabase();\n if (db != null) {\n return qb.query(db, new String[]{ MovementsTable.FULL_ID,\n MovementsTable.FULL_MOVEMENTS_AMOUNT,\n MovementsTable.FULL_MOVEMENTS_DESCRIPTION,\n MovementsTable.FULL_MOVEMENTS_DATE,\n MovementsTable.FULL_MOVEMENTS_SING,\n MovementsTable.FULL_ID_ACCOUNT },\n AccountTable.FULL_ID + \" = ?\" ,\n new String[]{ Double.valueOf(accountId).toString()}, null, null,\n orderBy);\n } else {\n throw new IllegalStateException(\"Can't get the movements for the given account.\");\n }\n }", "public Account getAccount(int accound_index){\n return accounts[accound_index];\n }", "public Promise<Result> getAccount(final int accountId) throws APIException\n\t{\n\t\treturn accountAction(accountId, new PromiseCallback() {\n\t\t\t@Override\n\t\t\tpublic Promise<Result> execute() throws APIException\n\t\t\t{\n\t\t\t\tAccount a = Account.findById(accountId, true);\n\n\t\t\t\t//TODO hacer un serializer como la gente\n\t\t\t\tJSONSerializer serializer = new JSONSerializer()\n\t\t\t\t\t\t.include(\"tags\", \"invites\", \"gateways.name\", \"gateways.gatewayId\", \"users.firstName\", \"users.id\", \"users.lastName\", \"users.emailAddress\", \"users.phone\", \"users.permissions.*\", \"oem.*\", \"owner.accounts.id\", \"owner.accounts.owner.firstName\", \"owner.accounts.owner.lastName\",\n\t\t\t\t\t\t\t\t\"owner.accounts.companyName\")\n\t\t\t\t\t\t.exclude(\"*.class\", \"tags.possibleAlertMetadatas\", \"gateways.*\", \"users.*\", \"owner.accounts.kabaPassword\", \"kabaPassword\").prettyPrint(true);\n\n\t\t\t\treturn json(serializer.serialize(a));\n\t\t\t}\n\t\t});\n\t}", "public saccoAccount (int account_num, double initial_balance) \r\n {\r\n\r\n account = account_num;\r\n balance = initial_balance;\r\n\r\n }", "ArrayList<Bet> selectBetsWithResult(Account account, int result) throws DAOException;", "@Override\npublic Currency getCurrency() {\n\treturn balance.getCurrency();\n}", "public BankAccount findAccountById(int currentBankID) throws SQLException;", "public long balanceForAccount(int acctnum) {\n if (acctnum != -1) {\n return mAccounts.get(acctnum).balance();\n } else {\n long sum = 0;\n for (HDAccount hda : mAccounts)\n sum += hda.balance();\n return sum;\n }\n }", "BigDecimal getClosingDebitBalance();", "public BankAccount getBankAccount(int accountNumber) {\n\t\tString sql = \"SELECT id, name, balance, balance_saving FROM accounts WHERE id = ?\";\n\n\t\ttry (PreparedStatement pstmt = dbConnection.prepareStatement(sql)) {\n\t\t\tpstmt.setInt(1, accountNumber);\n\t\t\tResultSet rs = pstmt.executeQuery();\n\n\t\t\t// loop through the result set\n\t\t\tif (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString name = rs.getString(\"name\");\n\t\t\t\tint checking_balance = rs.getInt(\"balance\");\n\t\t\t\tint saving_balance = rs.getInt(\"balance_saving\");\n\t\t\t\treturn new BankAccount(id, name, checking_balance, saving_balance);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t\treturn null;\n\t}", "public synchronized double getBalanceForAccId(int AccId) {\n\t\tConnection dbAccess = DataAccess.getDbAccess();\n\t\tPreparedStatement psttmnt;\n\t\tResultSet rs;\n\t\tString querySting;\n\t\tdouble balance = -1.0;\n\t\ttry {\n\t\t\tquerySting = \"SELECT acc_balance FROM accounts where acc_id = \" + AccId;\n\t\t\tpsttmnt = dbAccess.prepareStatement(querySting);\n\t\t\trs = psttmnt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbalance = rs.getDouble(\"acc_balance\");\n\t\t\t}\n\t\t\tdbAccess.close();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\treturn balance;\n\t}", "public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }", "public BigDecimal getBalance(String accountNumber) throws TransferServiceException {\n\n\t\tAccount acc = repository.findByAccountNumber(accountNumber);\n\t\tisAccountValid(acc);\n\t\treturn acc.getBalance();\n\t}", "public int getBalance()\n {\n return balance;\n }", "public double getBalance(){\n return balance.getBalance();\n }", "public float getBalance() {\n return balance;\n }", "public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }", "BankAccountDTO getCustomerBankAccountDetails(Long slNo);", "FinanceAccount selectByPrimaryKey(Integer id);", "public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}", "public Integer getBalance() {\n return balance;\n }", "public Integer getBalance() {\n return balance;\n }", "public List<Balance> getAddBalanceList() {\r\n\t\tList<Balance> balanceList = new ArrayList<Balance>();\r\n\t\tif (selectedItem != null) {\r\n\t\t\tList<Book> bookList = new ArrayList<Book>();\r\n\t\t\tfor (BalanceData b : GlobalBalance.instance().list()) {\r\n\t\t\t\t// Flag no se ha encontrado\r\n\t\t\t\tboolean founded = false;\r\n\t\t\t\t// Recuperar la lista de books a las que pertenece el balance\r\n\t\t\t\tbookList = bookService.getBooksByIdBalance(b.getId());\r\n\t\t\t\tfor (Book book : bookList) {\r\n\t\t\t\t\t// Si el book seleccionado ya pertenece al balance\r\n\t\t\t\t\tif (selectedItem.getId().compareTo(book.getId()) == 0) {\r\n\t\t\t\t\t\t// Flag se ha encontrado\r\n\t\t\t\t\t\tfounded = true;\r\n\t\t\t\t\t\t// Detener el bucle\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Si el balance no ha sido agregado ya al book\r\n\t\t\t\tif (!founded) {\r\n\t\t\t\t\t// Agregarlo a la lista\r\n\t\t\t\t\tbalanceList.add(b.getEntity());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn balanceList;\r\n\t}", "BigDecimal getOpeningDebitBalance();", "BigDecimal getOpeningDebitBalance();", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic BigDecimal getFCAmountfromFxDealDetails(BigDecimal bankId, BigDecimal currencyId, String accountNumberId) {\n\n\t\tBigDecimal accumulatedFcAmount = new BigDecimal(0);\n\n\t\tDetachedCriteria dCriteria = DetachedCriteria.forClass(TreasuryDealDetail.class, \"treasuryDealDetail\");\n\n\t\tdCriteria.setFetchMode(\"treasuryDealDetail.treasuryDealBankMaster\", FetchMode.JOIN);\n\t\tdCriteria.createAlias(\"treasuryDealDetail.treasuryDealBankMaster\", \"treasuryDealBankMaster\", JoinType.INNER_JOIN);\n\t\tdCriteria.add(Restrictions.eq(\"treasuryDealBankMaster.bankId\", bankId));\n\n\t\tdCriteria.setFetchMode(\"treasuryDealDetail.treasuryDealDetailCurrencyMaster\", FetchMode.JOIN);\n\t\tdCriteria.createAlias(\"treasuryDealDetail.treasuryDealDetailCurrencyMaster\", \"treasuryDealDetailCurrencyMaster\", JoinType.INNER_JOIN);\n\t\tdCriteria.add(Restrictions.eq(\"treasuryDealDetailCurrencyMaster.currencyId\", currencyId));\n\n\t\t/*\n\t\t * dCriteria.setFetchMode(\n\t\t * \"treasuryDealDetail.treasuryDealDetailBankAccountDetails\",\n\t\t * FetchMode.JOIN); dCriteria.createAlias(\n\t\t * \"treasuryDealDetail.treasuryDealDetailBankAccountDetails\",\n\t\t * \"treasuryDealDetailBankAccountDetails\", JoinType.INNER_JOIN);\n\t\t * dCriteria\n\t\t * .add(Restrictions.eq(\"treasuryDealDetailBankAccountDetails.bankAcctDetId\"\n\t\t * , accountNumberId));\n\t\t */\n\n\t\tdCriteria.add(Restrictions.eq(\"treasuryDealDetail.faAccountNo\", accountNumberId));\n\n\t\tdCriteria.add(Restrictions.eq(\"treasuryDealDetail.lineType\", \"SD\"));\n\t\tdCriteria.setResultTransformer(DetachedCriteria.DISTINCT_ROOT_ENTITY);\n\t\tList<TreasuryDealDetail> data = (List<TreasuryDealDetail>) findAll(dCriteria);\n\n\t\tif (data.size() != 0) {\n\t\t\tfor (TreasuryDealDetail treasuryDealDetail : data) {\n\t\t\t\taccumulatedFcAmount = accumulatedFcAmount.add(treasuryDealDetail.getFcAmount());\n\t\t\t}\n\t\t}\n\t\treturn accumulatedFcAmount;\n\t}", "@Override\n public long getTotalBalances() {\n return accounts.values().stream().map(Account::getBalance).mapToLong(Long::longValue).sum();\n }", "@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}", "public String getBalance() {\n return this.balance;\n }", "public double getBalance(){\n return balance;\n }", "public void updateBalance(int account_id, int final_amount){\n dbUpdate(\"update ACCOUNTS set BALANCE = \"+ final_amount + \" where ACCOUNT_ID = \" + account_id);\n cache.add(new Account(account_id, final_amount));\n }", "public static String getFullCurrentBill(String account){\n return \"select * from current_bills where cb_account = '\"+account+\"'\";\n }", "public Map<String, Integer> getAccountBalances() throws LedgerException {\n Block lastBlock;\n\n try {\n // Retrieve most recent completed block\n lastBlock = getBlock(blockMap.size());\n } catch (LedgerException e) {\n // Catch exception that 'Block does not exist' and throw a more specific error\n throw new LedgerException(\"get account balances\", \"No blocks have been committed yet.\");\n }\n\n // Get accountBalanceMap from the last committed block\n Map<String, Account> accountMap = lastBlock.getBalanceMap();\n\n // Create new map to store values\n Map<String, Integer> accountBalancesMap = new HashMap<String, Integer>();\n\n // Iterate through accounts to retrieve their current balances.\n for (Map.Entry<String, Account> entry : accountMap.entrySet() ) {\n accountBalancesMap.put(entry.getKey(), entry.getValue().getBalance());\n }\n\n return accountBalancesMap;\n }", "int deposit(int id, int amount, int accountType) {\n int idCompare; // will contain the ID needed\n double accountBalance = 0;\n String account; // 0 = chequing, 1 = savings\n\n // If the accountType is 0, then it's a Chequing account the user wants to deposit to, if it's 1 then\n // it's savings\n account = accountType == 0 ? \"UserBalanceC\" : \"UserBalanceS\";\n\n // Look into the account number and user balance for the deposit\n String sql = \"SELECT AccountNum, \" + account + \" FROM CashiiDB2\";\n\n try {\n rs = st.executeQuery(sql);\n while (rs.next()) {\n idCompare = rs.getInt(\"AccountNum\"); // grab the id to compare with after\n\n // If the ID turns about to be the one that's needed, get the balance and add the amount needed\n if (idCompare == id) {\n accountBalance = rs.getDouble(account);\n accountBalance += amount;\n break;\n } else\n return -1;\n }\n // Run the operation to update the balance only for the user's account\n updateAccount(id, accountBalance, account);\n } catch (java.sql.SQLException e) {\n e.printStackTrace();\n }\n System.out.println(\"AMOUNT: \" + accountBalance);\n return 1;\n }", "public List<Double> getAvgBalance(String account_type) {\n Session session = sessionFactory.getCurrentSession();\n List<Double> accountList = session.createQuery(\"select avg(balance) from Account where account_type='\"+account_type+\"'\", Double.class).list();\n return AccountDto.getAvgBalance(accountList);\n }", "public String getBalanceInfo(String request,String user);", "public int getBalance() {\n return balance;\n }", "public int getBalance() {\n return balance;\n }", "@Override\n\tpublic Account getBalance(String username) {\n\t\treturn account.findByUsername(username);\n\t}", "public void getBalance() {\n\t\tSystem.out.println(\"Balance in Savings account is\" + balance);\n\t\t//return balance;\n\t}", "@Override\n\tpublic BigDecimal getBackAccMoney(String bidId, String period) {\n\t\treturn dao.getBackAccMoney(bidId,period);\n\t}", "@Override\r\n\tpublic Account loadAccount(String accountNumber) {\n\t\tAccount account1=null;\r\n\t\ttry {\r\n\t\t\taccount1 = account.getclone(account);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tString sql = \"SELECT a.accountNumber, a.balance, a.accountType, b.name, b.email, c.street, c.city, c.zip, c.state \"+\r\n \"FROM customer b \"+\r\n \"INNER JOIN address c \"+\r\n \"ON b.addressID = c.ID \"+\r\n \"INNER JOIN account a \"+\r\n \"ON b.ID = a.CustomerID \"+\r\n\t\t\"WHERE a.accountNumber = \"+accountNumber+\";\" ;\r\n\t\tPreparedStatement preparedStatement;\r\n\r\n\r\n\r\ntry {\r\n\r\n\tpreparedStatement = con.prepareStatement(sql);\r\n\t\r\n\t\r\n ResultSet rs=preparedStatement.executeQuery();\r\n\r\n\r\n while ( rs.next() ) {\r\n \taccount1.setAccountNumber(Integer.toString(rs.getInt(1)));\r\n \taccount1.setBalance((double) rs.getInt(2));\r\n \tAccountType accty=BankAccountType.CHECKING;\r\n \tif(\"SAVING\".equalsIgnoreCase(rs.getString(3))){\r\n \t\taccty=BankAccountType.SAVING;\r\n \t}\r\n \taccount1.setAccountType(accty);\r\n \taccount1.getCustomer().setName(rs.getString(4));\r\n \taccount1.getCustomer().setEmail(rs.getString(5));\r\n \taccount1.getCustomer().getAddress().setStreet(rs.getString(6));\r\n \taccount1.getCustomer().getAddress().setCity(rs.getString(7));\r\n \taccount1.getCustomer().getAddress().setZip(rs.getString(8));\r\n \taccount1.getCustomer().getAddress().setState(rs.getString(9));\r\n \taccount1.setAccountEntries(getAccountEntry(accountNumber));\r\n \t\r\n System.out.println(account1);\r\n \r\n }\r\n} catch (SQLException e) {\r\n\t// TODO Auto-generated catch block\r\n\tSystem.out.println(\"Connection Failed! Check output console\");\r\n\te.printStackTrace();\r\n}\r\nlog();\r\n\r\n \r\nreturn account1;\r\n\t}" ]
[ "0.67511374", "0.6346115", "0.6343031", "0.6323225", "0.6318233", "0.6215347", "0.60355234", "0.5963258", "0.5940399", "0.5905262", "0.59017044", "0.5885767", "0.58442324", "0.58260447", "0.57835853", "0.5783265", "0.5724897", "0.5711395", "0.5702397", "0.56418085", "0.5633305", "0.56242716", "0.5607374", "0.55951494", "0.55844235", "0.5540505", "0.55323946", "0.5531088", "0.55244035", "0.552187", "0.5511555", "0.54950005", "0.5492907", "0.5489969", "0.54889226", "0.54853314", "0.5479448", "0.5459514", "0.54459447", "0.54433066", "0.54369324", "0.54369324", "0.5424186", "0.542132", "0.5414058", "0.54095787", "0.53978896", "0.5394172", "0.53881955", "0.53881955", "0.5375764", "0.5375764", "0.53756547", "0.5368851", "0.53685844", "0.53677446", "0.53609467", "0.5348396", "0.53450686", "0.5337385", "0.533404", "0.53322434", "0.53265244", "0.5315623", "0.53083646", "0.5288014", "0.5286076", "0.5285413", "0.5285045", "0.5284653", "0.5274516", "0.5273865", "0.52681416", "0.5256554", "0.5253414", "0.52526677", "0.5252499", "0.5243211", "0.5240417", "0.5240417", "0.5239999", "0.52389354", "0.52389354", "0.5232232", "0.52241075", "0.52227616", "0.5214427", "0.5214186", "0.5213746", "0.52032465", "0.5197668", "0.51973456", "0.51960707", "0.5194559", "0.5191491", "0.5191491", "0.5191172", "0.5171246", "0.51689297", "0.5168493" ]
0.6125383
6